From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 819971B10D for ; Wed, 21 Nov 2018 17:50:42 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBFBA2D800; Wed, 21 Nov 2018 16:50:41 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3A745C221; Wed, 21 Nov 2018 16:50:40 +0000 (UTC) From: Kevin Traynor To: Xueming Li Cc: Yongseok Koh , dpdk stable Date: Wed, 21 Nov 2018 16:48:02 +0000 Message-Id: <20181121164828.32249-48-ktraynor@redhat.com> In-Reply-To: <20181121164828.32249-1-ktraynor@redhat.com> References: <20181121164828.32249-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 16:50:41 +0000 (UTC) Subject: [dpdk-stable] patch 'net/mlx5: fix representor port xstats' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:50:42 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/27/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From ae34e239b0290a4b504550124f7debdc7116181b Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Wed, 19 Sep 2018 15:55:26 +0800 Subject: [PATCH] net/mlx5: fix representor port xstats [ upstream commit 45b83b9b0434db1f190f7fa7d30e6fed75793ae6 ] This patch fixes the issue that representor port shows xstats of PF. Fixes: 2b7302638898 ("net/mlx5: probe all port representors") Signed-off-by: Xueming Li Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_stats.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 91f3d474a..ed5b51bb2 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -147,5 +147,5 @@ mlx5_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats) et_stats->n_stats = xstats_ctrl->stats_n; ifr.ifr_data = (caddr_t)et_stats; - ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 1); + ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 0); if (ret) { DRV_LOG(WARNING, @@ -195,5 +195,5 @@ mlx5_ethtool_get_stats_n(struct rte_eth_dev *dev) { drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (caddr_t)&drvinfo; - ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 1); + ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 0); if (ret) { DRV_LOG(WARNING, "port %u unable to query number of statistics", @@ -230,5 +230,4 @@ mlx5_xstats_init(struct rte_eth_dev *dev) } dev_stats_n = ret; - xstats_ctrl->stats_n = dev_stats_n; /* Allocate memory to grab stat names and values. */ str_sz = dev_stats_n * ETH_GSTRING_LEN; @@ -245,5 +244,5 @@ mlx5_xstats_init(struct rte_eth_dev *dev) strings->len = dev_stats_n; ifr.ifr_data = (caddr_t)strings; - ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 1); + ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 0); if (ret) { DRV_LOG(WARNING, "port %u unable to get statistic names", @@ -276,4 +275,5 @@ mlx5_xstats_init(struct rte_eth_dev *dev) } } + xstats_ctrl->stats_n = dev_stats_n; /* Copy to base at first time. */ assert(xstats_n <= MLX5_MAX_XSTATS); @@ -308,4 +308,6 @@ mlx5_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats, uint64_t counters[n]; + if (!priv->xstats_ctrl.stats_n) + return 0; if (n >= xstats_n && stats) { struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl; @@ -481,6 +483,9 @@ mlx5_xstats_get_names(struct rte_eth_dev *dev __rte_unused, struct rte_eth_xstat_name *xstats_names, unsigned int n) { + struct priv *priv = dev->data->dev_private; unsigned int i; + if (!priv->xstats_ctrl.stats_n) + return 0; if (n >= xstats_n && xstats_names) { for (i = 0; i != xstats_n; ++i) { -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-21 16:44:32.255862179 +0000 +++ 0048-net-mlx5-fix-representor-port-xstats.patch 2018-11-21 16:44:30.000000000 +0000 @@ -1,12 +1,13 @@ -From 45b83b9b0434db1f190f7fa7d30e6fed75793ae6 Mon Sep 17 00:00:00 2001 +From ae34e239b0290a4b504550124f7debdc7116181b Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Wed, 19 Sep 2018 15:55:26 +0800 Subject: [PATCH] net/mlx5: fix representor port xstats +[ upstream commit 45b83b9b0434db1f190f7fa7d30e6fed75793ae6 ] + This patch fixes the issue that representor port shows xstats of PF. Fixes: 2b7302638898 ("net/mlx5: probe all port representors") -Cc: stable@dpdk.org Signed-off-by: Xueming Li Acked-by: Yongseok Koh