[v3,01/10] ethdev: define retval when xstats is null of get xstats
Checks
Commit Message
Currently the value returned when xstats is NULL of rte_eth_xstats_get()
is not specified, some PMDs (eg. hns3/ipn3ke/mvpp2/axgbe) return zero
while others return the required number of elements.
This patch defines that the return value should be the required number of
elements when xstats is NULL of rte_eth_xstats_get().
Fixes: ce757f5c9a4d ("ethdev: new method to retrieve extended statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/ethdev/rte_ethdev.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -3174,7 +3174,8 @@ int rte_eth_xstats_get_names(uint16_t port_id,
* @param xstats
* A pointer to a table of structure of type *rte_eth_xstat*
* to be filled with device statistics ids and values.
- * This parameter can be set to NULL if n is 0.
+ * This parameter can be set to NULL if n is 0; If set to NULL, the
+ * function returns the required number of elements.
* @param n
* The size of the xstats array (number of elements).
* @return