summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_stats.c
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2017-10-10 20:20:18 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-12 01:52:49 +0100
commitd5b0924ba6baae2cb6ac7c880db0977d4befedc6 (patch)
tree97b37855886bb8c3d11a2ef516fbadfaced4eb4a /drivers/net/mlx5/mlx5_stats.c
parent75cd6fb1d901e3f62fa9b5d9e1eba75777f99efa (diff)
downloaddpdk-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.zip
dpdk-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.tar.gz
dpdk-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.tar.xz
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 <matan@mellanox.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_stats.c')
-rw-r--r--drivers/net/mlx5/mlx5_stats.c3
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.
*/
-void
+int
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)
#endif
*stats = tmp;
priv_unlock(priv);
+ return 0;
}
/**