[PATCH v4 4/9] net/ipn3ke: adjust return value of xstats-get ops
Chengwen Feng
fengchengwen at huawei.com
Fri May 13 04:53:52 CEST 2022
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 at dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
drivers/net/ipn3ke/ipn3ke_representor.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index c9dde1d82e..abbecfdf2e 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -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;
--
2.33.0
More information about the dev
mailing list