numam-dpdk/lib/librte_ether
Lee Daly 8c49d5f1c2 ethdev: rework xstats retrieve by id
Fix xstats functions, rte_eth_xstats_get_names_by_id()
and rte_eth_xstats_get_by_id(), in current implementation
ethdev level reads all xstat values and filters out
the ones requested by the application. This behavior doesn't
benefit from PMD ops and doesn't provide the benefit the
API was created in the first place for. APIs are also unnecessarily
complicated. Both APIs have different returns for the same params.

In this fix, instead of reading all the stats and finding the
requested value, drivers can provide ops to get selected xstats.
API no longer crashes with certain params,

rte_eth_get_by_id returned seg fault with
"ids = NULL && values != NULL && n<max”
rte_eth_get_names_by_id returned seg fault with
"ids = NULL && values != NULL && n=0”
These now return max number of stats available, matching the other API.

rte_eth_get_by_id returned seg fault with
"ids != NULL && values = NULL && n<max”
This now returns -22,(EINVAL).

Standardized variable/parameter names between the 2 APIs.

Overall code complexity reduced.

Fixes: 79c913a42f ("ethdev: retrieve xstats by ID")

Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-13 01:29:53 +01:00
..
ethdev_profile.c ethdev: fix port id type 2017-10-13 01:17:49 +01:00
ethdev_profile.h ethdev: fix port id type 2017-10-13 01:17:49 +01:00
Makefile ethdev: increase port id range 2017-10-06 18:23:25 +02:00
rte_dev_info.h lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
rte_eth_ctrl.h ethdev: introduce generic flow API 2016-12-23 10:11:07 +01:00
rte_ethdev_pci.h ethdev: fix doxygen comment for PCI info copy 2017-07-31 23:39:43 +02:00
rte_ethdev_vdev.h ethdev: remove driver name from device private data 2017-06-12 16:27:44 +01:00
rte_ethdev_version.map ethdev: expose flow API error helper 2017-10-13 01:18:47 +01:00
rte_ethdev.c ethdev: rework xstats retrieve by id 2017-10-13 01:29:53 +01:00
rte_ethdev.h ethdev: rework xstats retrieve by id 2017-10-13 01:29:53 +01:00
rte_flow_driver.h ethdev: expose flow API error helper 2017-10-13 01:18:47 +01:00
rte_flow.c ethdev: expose flow API error helper 2017-10-13 01:18:47 +01:00
rte_flow.h ethdev: expose flow API error helper 2017-10-13 01:18:47 +01:00
rte_tm_driver.h ethdev: increase port id range 2017-10-06 18:23:25 +02:00
rte_tm.c ethdev: increase port id range 2017-10-06 18:23:25 +02:00
rte_tm.h ethdev: increase port id range 2017-10-06 18:23:25 +02:00