[dpdk-dev] [PATCH 1/4] net/bnxt: fix extended port counter statistics
David Marchand
david.marchand at redhat.com
Thu Jul 25 09:21:57 CEST 2019
On Thu, Jul 25, 2019 at 7:05 AM Somnath Kotur
<somnath.kotur at broadcom.com> wrote:
>
> From: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
>
> We were trying to fill in more rx extended stats than the size allocated
> for stats causing segfault. Fixed this by adding an explicit check.
> Rearranged the code to return statistic values in xstats_get as per the
> names returned in xstats_get_names.
>
> Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
>
> Signed-off-by: Rahul Gupta <rahul.gupta at broadcom.com>
> Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
> Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
> ---
> drivers/net/bnxt/bnxt_stats.c | 24 ++++++++++++++----------
> 1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
> index 4e74f8a..69ac2dd 100644
> --- a/drivers/net/bnxt/bnxt_stats.c
> +++ b/drivers/net/bnxt/bnxt_stats.c
[snip]
> @@ -463,22 +467,22 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
> xstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);
> count++;
>
> - for (i = 0; i < tx_port_stats_ext_cnt; i++) {
> - uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext;
> + for (i = 0; i < rx_port_stats_ext_cnt; i++) {
> + uint64_t *rx_stats_ext = (uint64_t *)bp->hw_rx_port_stats_ext;
>
> xstats[count].value = rte_le_to_cpu_64
> - (*(uint64_t *)((char *)tx_stats_ext +
> - bnxt_tx_ext_stats_strings[i].offset));
> + (*(uint64_t *)((char *)rx_stats_ext +
> + bnxt_rx_ext_stats_strings[i].offset));
>
> count++;
> }
>
> - for (i = 0; i < rx_port_stats_ext_cnt; i++) {
> - uint64_t *rx_stats_ext = (uint64_t *)bp->hw_rx_port_stats_ext;
> + for (i = 0; i < tx_port_stats_ext_cnt; i++) {
> + uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext;
>
> xstats[count].value = rte_le_to_cpu_64
> - (*(uint64_t *)((char *)rx_stats_ext +
> - bnxt_rx_ext_stats_strings[i].offset));
> + (*(uint64_t *)((char *)tx_stats_ext +
> + bnxt_tx_ext_stats_strings[i].offset));
>
> count++;
> }
> --
> 1.8.3.1
>
This whole hunk just adds some noise, right? or is there anything fixed in it?
--
David Marchand
More information about the dev
mailing list