numam-dpdk/drivers/net/bnx2x
Olivier Matz 513c78ae3f ethdev: fix extended statistics name index
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().

Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:

  rte_eth_xstats_get_name() returns:
    0: "rx0_stat"
    1: "rx1_stat"
    2: ...
    7: "rx7_stat"
    8: "tx0_stat"
    9: "tx1_stat"
    ...
    15: "tx7_stat"

  rte_eth_xstats_get() returns:
    0: id=0, val=<stat>    ("rx0_stat")
    1: id=1, val=<stat>    ("rx1_stat")
    2: id=8, val=<stat>    ("tx0_stat")
    3: id=9, val=<stat>    ("tx1_stat")

This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-01-04 19:04:30 +01:00
..
bnx2x_ethdev.c ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
bnx2x_ethdev.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
bnx2x_logs.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
bnx2x_rxtx.c net/bnx2x: remove unused Rx queue code 2016-10-13 15:30:59 +02:00
bnx2x_rxtx.h net/bnx2x: remove unused Rx queue code 2016-10-13 15:30:59 +02:00
bnx2x_stats.c bnx2x: add license file 2015-12-13 01:58:10 +01:00
bnx2x_stats.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
bnx2x_vfpf.c net/bnx2x: do not return structs 2016-10-13 15:30:59 +02:00
bnx2x_vfpf.h net/bnx2x: replace macro with static function 2016-10-13 15:30:59 +02:00
bnx2x.c net/bnx2x: restrict Rx mask flags sent to the PF 2016-10-13 15:30:59 +02:00
bnx2x.h net/bnx2x: merge debug register operations into headers 2016-10-13 15:30:59 +02:00
ecore_fw_defs.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_hsi.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_init_ops.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_init.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_mfw_req.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_reg.h bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_sp.c bnx2x: add license file 2015-12-13 01:58:10 +01:00
ecore_sp.h bnx2x: fix build on FreeBSD 2015-12-13 01:58:10 +01:00
elink.c net/bnx2x: fix build with icc 2016-10-26 19:38:17 +02:00
elink.h net/bnx2x: remove unused preprocessor code 2016-10-13 15:30:59 +02:00
LICENSE.bnx2x_pmd bnx2x: add license file 2015-12-13 01:58:10 +01:00
Makefile net/bnx2x: merge debug register operations into headers 2016-10-13 15:30:59 +02:00
rte_pmd_bnx2x_version.map bnx2x: driver support routines 2015-07-27 04:27:10 +02:00