net/bnxt: add missing ids in xstats
authorDavid Marchand <david.marchand@6wind.com>
Thu, 7 Jun 2018 05:36:05 +0000 (07:36 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 14 Jun 2018 17:27:50 +0000 (19:27 +0200)
The xstats API expects that the driver fills both values and ids for
each filled entries.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_stats.c

index bbd4e78..a5d3c86 100644 (file)
@@ -278,6 +278,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
        count = 0;
        for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) {
                uint64_t *rx_stats = (uint64_t *)bp->hw_rx_port_stats;
+               xstats[count].id = count;
                xstats[count].value = rte_le_to_cpu_64(
                                *(uint64_t *)((char *)rx_stats +
                                bnxt_rx_stats_strings[i].offset));
@@ -286,6 +287,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 
        for (i = 0; i < RTE_DIM(bnxt_tx_stats_strings); i++) {
                uint64_t *tx_stats = (uint64_t *)bp->hw_tx_port_stats;
+               xstats[count].id = count;
                xstats[count].value = rte_le_to_cpu_64(
                                 *(uint64_t *)((char *)tx_stats +
                                bnxt_tx_stats_strings[i].offset));
@@ -293,6 +295,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
        }
 
        /* The Tx drop pkts aka the Anti spoof coounter */
+       xstats[count].id = count;
        xstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);
        count++;