numam-dpdk/drivers/net
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
..
af_packet drivers: remove useless reset of PCI device pointer 2016-12-24 18:47:19 +01:00
bnx2x ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
bnxt ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
bonding ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
cxgbe ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
e1000 ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
ena ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
enic ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
fm10k ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
i40e ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
ixgbe ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
mlx4 ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
mlx5 ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
mpipe ethdev: clear data when allocating device 2016-12-21 17:30:27 +01:00
nfp ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
null drivers: remove useless reset of PCI device pointer 2016-12-24 18:47:19 +01:00
pcap drivers: remove useless reset of PCI device pointer 2016-12-24 18:47:19 +01:00
qede ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
ring drivers: remove useless reset of PCI device pointer 2016-12-24 18:47:19 +01:00
szedata2 ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
thunderx ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
vhost ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
virtio ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
vmxnet3 ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
xenvirt drivers: remove useless reset of PCI device pointer 2016-12-24 18:47:19 +01:00
Makefile net/thunderx: add PMD skeleton 2016-06-20 17:21:54 +02:00