From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH] net/mlx5: fix invalid count in xstats Date: Sun, 20 May 2018 10:13:58 +0200 Message-ID: <1526804038-27137-1-git-send-email-david.marchand@6wind.com> Cc: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com To: dev@dpdk.org Return-path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 7AB162F4F for ; Sun, 20 May 2018 10:14:02 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id o78-v6so21774423wmg.0 for ; Sun, 20 May 2018 01:14:02 -0700 (PDT) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" With the commit af4f09f28294 ("net/mlx5: prefix all functions with mlx5"), mlx5_xstats_get() is not compliant any longer with the api. It always returns the caller max entries count while it should return how many entries it wrote/wanted to write. Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5") Signed-off-by: David Marchand --- drivers/net/mlx5/mlx5_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 8e427e7..875dd10 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -325,7 +325,7 @@ mlx5_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats, stats[i].value = (counters[i] - xstats_ctrl->base[i]); } } - return n; + return xstats_n; } /** -- 2.7.4