numam-dpdk/drivers/net/virtio
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
..
virtio_user net/virtio_user: fix wrong sequence of messages 2016-09-28 02:18:39 +02:00
Makefile net/virtio: add NEON based Rx handler 2016-09-28 02:18:39 +02:00
rte_pmd_virtio_version.map virtio: move to drivers/net/ 2015-05-22 16:06:23 +02:00
virtio_ethdev.c ethdev: fix extended statistics name index 2017-01-04 19:04:30 +01:00
virtio_ethdev.h net/virtio: move queue configure code to proper place 2016-11-07 15:40:13 +01:00
virtio_logs.h virtio: fix newline under debug mode 2016-05-10 10:52:01 -07:00
virtio_pci.c pci: create device list and fallback on its members 2016-10-03 16:34:03 +02:00
virtio_pci.h net/virtio: add helper to get interrrupt handle 2016-12-25 23:11:22 +01:00
virtio_ring.h net/virtio: fix used index retrieved only once 2016-06-22 09:47:12 +02:00
virtio_rxtx_simple_neon.c net/virtio: add NEON based Rx handler 2016-09-28 02:18:39 +02:00
virtio_rxtx_simple_sse.c net/virtio: move SSE based Rx code to separate file 2016-09-28 02:18:39 +02:00
virtio_rxtx_simple.c net/virtio: move SSE based Rx code to separate file 2016-09-28 02:18:39 +02:00
virtio_rxtx_simple.h net/virtio: move SSE based Rx code to separate file 2016-09-28 02:18:39 +02:00
virtio_rxtx.c net/virtio: move queue configure code to proper place 2016-11-07 15:40:13 +01:00
virtio_rxtx.h net/virtio: cleanup conditional compilation 2016-09-28 02:18:39 +02:00
virtio_user_ethdev.c ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
virtqueue.c virtio: check virtqueue parameter when detaching 2015-07-19 22:24:42 +02:00
virtqueue.h net/virtio: allocate queue at init stage 2016-11-07 15:40:03 +01:00