From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=jXZTt1FaJRrZBqyqd6do1pFYaiH2zaogAHGGkaCU8Vw=; b=PCL05KUN1KB7YyLDT7e8onZyaVsi6+zRNJDRaM2b497FPz704xNNp6i+flTANntmVT II0qDuGFYBFA/Wj4LBjQV+qz0aatoXffpAT2nfFw2iJvFcujB79e1NrhSaCiqqXaZkcS u3eO4ZGLh4qlqLU9pxOqLz6WtqJwvKGsFSnFPbqck3JkVZy3fIfk01gpPmKKtXM0t9nX qIoLRhc7S5WwHqnE+RqYPoJh9Q3fFjY7AhOJ9RRmLBJK7v2kQuoTWk5GDxzPrtu3Sd55 WqHFPRayTqqu7BeEIobx9KpPY40r0D7sLZJkl49KqHeTB+HecSD6VE2plBLHH88CgujZ hWsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jXZTt1FaJRrZBqyqd6do1pFYaiH2zaogAHGGkaCU8Vw=; b=XINFHQyw0wbdyGX0gPQ07i65QSrELZHYctxaaBBZ8A2D5AXDguH345oIgJRKqdPPgC QbJfLTJ21c4rpcV8LQtJRVrzBide1BTVW7Aun01Rr6OfWZwYEkl4TodRK511sRiIa+1B nod4GYlnAtOzYx9+Bvup59+ulOzUgdrUf6mMoYGxSi6GF3/QQaJ219505+HqURBDY8zz +ykvZA1oN8HDFN8pdpLdTV0ecBNoN51WSt627ydLopKV3MPjRqcLQWnzsFvvPALygi8v CBwns3M53SlsrsmcWrxwXbvG7LVLbZ6l30j/fFMcxogK1PTBZvbZZ9Dl1lgVNY6Xb/VO Olww== X-Gm-Message-State: ALKqPwe5gpsLVOVYZ4ssW6ze845iUIKK3SyVuwTaze5fKEj3l9nllwTP dOdk3MbeRaWPX5scAmN5nVvvz4FH0yg= X-Google-Smtp-Source: AB8JxZripUYg5pvw48iCZvWDZpprDYyEOp4sug9iUlDtnKqj01v/Zhvs4BdPL1YDtqwLvZWw/vwFnA== X-Received: by 2002:a1c:2806:: with SMTP id o6-v6mr8011268wmo.151.1526804041781; Sun, 20 May 2018 01:14:01 -0700 (PDT) Received: from 6wind.com ([2a01:cb19:142:1800:ed73:e6c1:ac8e:8c99]) by smtp.gmail.com with ESMTPSA id k130-v6sm16591176wmg.15.2018.05.20.01.14.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 May 2018 01:14:01 -0700 (PDT) From: David Marchand To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com Date: Sun, 20 May 2018 10:13:58 +0200 Message-Id: <1526804038-27137-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/mlx5: fix invalid count in xstats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 08:14:02 -0000 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