path: root/drivers/net/mlx5/mlx5_stats.c
diff options
authorMatan Azrad <>2017-10-10 20:20:18 +0000
committerFerruh Yigit <>2017-10-12 01:52:49 +0100
commitd5b0924ba6baae2cb6ac7c880db0977d4befedc6 (patch)
tree97b37855886bb8c3d11a2ef516fbadfaced4eb4a /drivers/net/mlx5/mlx5_stats.c
parent75cd6fb1d901e3f62fa9b5d9e1eba75777f99efa (diff)
ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot return an error in case of failure at stats getting process time. Since PCI devices can be removed and there is a time between the physical removal to the RMV interrupt, the user may get invalid stats without any indication. This patch changes the stats_get API return value to be int instead of void. All the net PMDs stats_get dev ops are adjusted by this patch. Signed-off-by: Matan Azrad <> Reviewed-by: Ferruh Yigit <>
Diffstat (limited to 'drivers/net/mlx5/mlx5_stats.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 6b4772c..5e225d3 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -318,7 +318,7 @@ priv_xstats_reset(struct priv *priv)
* @param[out] stats
* Stats structure output buffer.
mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
struct priv *priv = mlx5_get_priv(dev);
@@ -373,6 +373,7 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
*stats = tmp;
+ return 0;