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: 79c913a42f0e ("ethdev: retrieve xstats by ID") Signed-off-by: Lee Daly <lee.daly@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses the Open Source BSD license for the core libraries and drivers. The kernel components are GPLv2 licensed. Please check the doc directory for release notes, API documentation, and sample application information. For questions and usage discussions, subscribe to: users@dpdk.org Report bugs and issues to the development mailing list: dev@dpdk.org
Description
Languages
C
99.1%
Meson
0.5%
Python
0.2%
Shell
0.1%