[v4,4/9] net/ipn3ke: adjust return value of xstats-get ops
Checks
Commit Message
Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0)
to retrieve the required number of elements, but currently ipn3ke PMD
returns zero when xstats is NULL.
In the previous patch, the framework defines that the required number
of entries should be returned when xstats is NULL and n is zero. And
xstats is NULL if and only if n is zero.
Based on the preceding constraints, this patch removes the logic of
"return zero when xstats is NULL".
Fixes: 5a6d883878db ("net/ipn3ke: implement statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
drivers/net/ipn3ke/ipn3ke_representor.c | 3 ---
1 file changed, 3 deletions(-)
@@ -2218,9 +2218,6 @@ ipn3ke_rpst_xstats_get
struct ipn3ke_rpst_hw_port_stats hw_stats;
struct rte_eth_stats stats;
- if (!xstats)
- return 0;
-
if (!ethdev) {
IPN3KE_AFU_PMD_ERR("ethernet device to get statistics is NULL");
return -EINVAL;