* [dpdk-dev] [PATCH] net/mlx5: fix representor port xstats @ 2018-09-06 10:28 Xueming Li 2018-09-14 6:33 ` [dpdk-dev] [PATCH v2] " Xueming Li 0 siblings, 1 reply; 7+ messages in thread From: Xueming Li @ 2018-09-06 10:28 UTC (permalink / raw) To: Shahaf Shuler, Yongseok Koh; +Cc: Xueming Li, dev This patch fixes the issue that representor port shows xstats of PF. Fixes: 5a4b8e2612c5 ("net/mlx5: probe all port representors") Signed-off-by: Xueming Li <xuemingl@mellanox.com> --- drivers/net/mlx5/mlx5_stats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 91f3d47..e3a1c60 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -146,7 +146,7 @@ struct mlx5_counter_ctrl { et_stats->cmd = ETHTOOL_GSTATS; 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, "port %u unable to read statistic values from device", @@ -194,7 +194,7 @@ struct mlx5_counter_ctrl { 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", dev->data->port_id); @@ -244,7 +244,7 @@ struct mlx5_counter_ctrl { strings->string_set = ETH_SS_STATS; 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", dev->data->port_id); -- 1.8.3.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/mlx5: fix representor port xstats 2018-09-06 10:28 [dpdk-dev] [PATCH] net/mlx5: fix representor port xstats Xueming Li @ 2018-09-14 6:33 ` Xueming Li 2018-09-14 16:50 ` Yongseok Koh 2018-09-19 7:55 ` [dpdk-dev] [PATCH v3] " Xueming Li 0 siblings, 2 replies; 7+ messages in thread From: Xueming Li @ 2018-09-14 6:33 UTC (permalink / raw) To: Shahaf Shuler, Yongseok Koh; +Cc: Xueming Li, dev This patch fixes the issue that representor port shows xstats of PF. Fixes: 5a4b8e2612c5 ("net/mlx5: probe all port representors") Signed-off-by: Xueming Li <xuemingl@mellanox.com> --- 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 91f3d47..ed5b51b 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -146,7 +146,7 @@ struct mlx5_counter_ctrl { et_stats->cmd = ETHTOOL_GSTATS; 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, "port %u unable to read statistic values from device", @@ -194,7 +194,7 @@ struct mlx5_counter_ctrl { 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", dev->data->port_id); @@ -229,7 +229,6 @@ struct mlx5_counter_ctrl { return; } 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; strings = (struct ethtool_gstrings *) @@ -244,7 +243,7 @@ struct mlx5_counter_ctrl { strings->string_set = ETH_SS_STATS; 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", dev->data->port_id); @@ -275,6 +274,7 @@ struct mlx5_counter_ctrl { goto free; } } + xstats_ctrl->stats_n = dev_stats_n; /* Copy to base at first time. */ assert(xstats_n <= MLX5_MAX_XSTATS); ret = mlx5_read_dev_counters(dev, xstats_ctrl->base); @@ -307,6 +307,8 @@ struct mlx5_counter_ctrl { unsigned int i; 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; int stats_n; @@ -480,8 +482,11 @@ struct mlx5_counter_ctrl { 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) { strncpy(xstats_names[i].name, -- 1.8.3.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix representor port xstats 2018-09-14 6:33 ` [dpdk-dev] [PATCH v2] " Xueming Li @ 2018-09-14 16:50 ` Yongseok Koh 2018-09-15 5:20 ` Xueming(Steven) Li 2018-09-19 7:55 ` [dpdk-dev] [PATCH v3] " Xueming Li 1 sibling, 1 reply; 7+ messages in thread From: Yongseok Koh @ 2018-09-14 16:50 UTC (permalink / raw) To: Xueming(Steven) Li; +Cc: Shahaf Shuler, dev > On Sep 13, 2018, at 11:33 PM, Xueming Li <xuemingl@mellanox.com> wrote: > > This patch fixes the issue that representor port shows xstats of PF. > > Fixes: 5a4b8e2612c5 ("net/mlx5: probe all port representors") Wrong commit SHA. > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > --- > 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 91f3d47..ed5b51b 100644 > --- a/drivers/net/mlx5/mlx5_stats.c > +++ b/drivers/net/mlx5/mlx5_stats.c > @@ -146,7 +146,7 @@ struct mlx5_counter_ctrl { > et_stats->cmd = ETHTOOL_GSTATS; > 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, > "port %u unable to read statistic values from device", > @@ -194,7 +194,7 @@ struct mlx5_counter_ctrl { > > 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", > dev->data->port_id); > @@ -229,7 +229,6 @@ struct mlx5_counter_ctrl { > return; > } > 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; > strings = (struct ethtool_gstrings *) > @@ -244,7 +243,7 @@ struct mlx5_counter_ctrl { > strings->string_set = ETH_SS_STATS; > 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", > dev->data->port_id); > @@ -275,6 +274,7 @@ struct mlx5_counter_ctrl { > goto free; > } > } > + xstats_ctrl->stats_n = dev_stats_n; Any reason to move it? If it is done to group the code, I'm fine with that. Thanks, Yongseok > /* Copy to base at first time. */ > assert(xstats_n <= MLX5_MAX_XSTATS); > ret = mlx5_read_dev_counters(dev, xstats_ctrl->base); > @@ -307,6 +307,8 @@ struct mlx5_counter_ctrl { > unsigned int i; > 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; > int stats_n; > @@ -480,8 +482,11 @@ struct mlx5_counter_ctrl { > 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) { > strncpy(xstats_names[i].name, > -- > 1.8.3.1 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix representor port xstats 2018-09-14 16:50 ` Yongseok Koh @ 2018-09-15 5:20 ` Xueming(Steven) Li 0 siblings, 0 replies; 7+ messages in thread From: Xueming(Steven) Li @ 2018-09-15 5:20 UTC (permalink / raw) To: Yongseok Koh; +Cc: Shahaf Shuler, dev > -----Original Message----- > From: Yongseok Koh > Sent: Saturday, September 15, 2018 12:51 AM > To: Xueming(Steven) Li <xuemingl@mellanox.com> > Cc: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org > Subject: Re: [PATCH v2] net/mlx5: fix representor port xstats > > > > On Sep 13, 2018, at 11:33 PM, Xueming Li <xuemingl@mellanox.com> wrote: > > > > This patch fixes the issue that representor port shows xstats of PF. > > > > Fixes: 5a4b8e2612c5 ("net/mlx5: probe all port representors") > > Wrong commit SHA. > > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > > --- > > 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 91f3d47..ed5b51b 100644 > > --- a/drivers/net/mlx5/mlx5_stats.c > > +++ b/drivers/net/mlx5/mlx5_stats.c > > @@ -146,7 +146,7 @@ struct mlx5_counter_ctrl { > > et_stats->cmd = ETHTOOL_GSTATS; > > 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, > > "port %u unable to read statistic values from device", @@ -194,7 > > +194,7 @@ struct mlx5_counter_ctrl { > > > > 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", > > dev->data->port_id); > > @@ -229,7 +229,6 @@ struct mlx5_counter_ctrl { > > return; > > } > > 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; > > strings = (struct ethtool_gstrings *) @@ -244,7 +243,7 @@ struct > > mlx5_counter_ctrl { > > strings->string_set = ETH_SS_STATS; > > 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", > > dev->data->port_id); > > @@ -275,6 +274,7 @@ struct mlx5_counter_ctrl { > > goto free; > > } > > } > > + xstats_ctrl->stats_n = dev_stats_n; > > Any reason to move it? > If it is done to group the code, I'm fine with that. Don't set value until all code success. > > Thanks, > Yongseok > > > /* Copy to base at first time. */ > > assert(xstats_n <= MLX5_MAX_XSTATS); > > ret = mlx5_read_dev_counters(dev, xstats_ctrl->base); @@ -307,6 > > +307,8 @@ struct mlx5_counter_ctrl { > > unsigned int i; > > 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; > > int stats_n; > > @@ -480,8 +482,11 @@ struct mlx5_counter_ctrl { > > 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) { > > strncpy(xstats_names[i].name, > > -- > > 1.8.3.1 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v3] net/mlx5: fix representor port xstats 2018-09-14 6:33 ` [dpdk-dev] [PATCH v2] " Xueming Li 2018-09-14 16:50 ` Yongseok Koh @ 2018-09-19 7:55 ` Xueming Li 2018-09-28 0:11 ` Yongseok Koh 1 sibling, 1 reply; 7+ messages in thread From: Xueming Li @ 2018-09-19 7:55 UTC (permalink / raw) To: Shahaf Shuler, Yongseok Koh; +Cc: Xueming Li, dev, adrien.mazarguil This patch fixes the issue that representor port shows xstats of PF. Fixes: 2b7302638898 ("net/mlx5: probe all port representors") Cc: adrien.mazarguil@6wind.com Signed-off-by: Xueming Li <xuemingl@mellanox.com> --- 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 91f3d47..ed5b51b 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -146,7 +146,7 @@ struct mlx5_counter_ctrl { et_stats->cmd = ETHTOOL_GSTATS; 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, "port %u unable to read statistic values from device", @@ -194,7 +194,7 @@ struct mlx5_counter_ctrl { 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", dev->data->port_id); @@ -229,7 +229,6 @@ struct mlx5_counter_ctrl { return; } 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; strings = (struct ethtool_gstrings *) @@ -244,7 +243,7 @@ struct mlx5_counter_ctrl { strings->string_set = ETH_SS_STATS; 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", dev->data->port_id); @@ -275,6 +274,7 @@ struct mlx5_counter_ctrl { goto free; } } + xstats_ctrl->stats_n = dev_stats_n; /* Copy to base at first time. */ assert(xstats_n <= MLX5_MAX_XSTATS); ret = mlx5_read_dev_counters(dev, xstats_ctrl->base); @@ -307,6 +307,8 @@ struct mlx5_counter_ctrl { unsigned int i; 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; int stats_n; @@ -480,8 +482,11 @@ struct mlx5_counter_ctrl { 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) { strncpy(xstats_names[i].name, -- 1.8.3.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/mlx5: fix representor port xstats 2018-09-19 7:55 ` [dpdk-dev] [PATCH v3] " Xueming Li @ 2018-09-28 0:11 ` Yongseok Koh 2018-10-04 20:46 ` Thomas Monjalon 0 siblings, 1 reply; 7+ messages in thread From: Yongseok Koh @ 2018-09-28 0:11 UTC (permalink / raw) To: Xueming(Steven) Li; +Cc: Shahaf Shuler, dev, Adrien Mazarguil > On Sep 19, 2018, at 12:55 AM, Xueming Li <xuemingl@mellanox.com> wrote: > > This patch fixes the issue that representor port shows xstats of PF. > > Fixes: 2b7302638898 ("net/mlx5: probe all port representors") > Cc: adrien.mazarguil@6wind.com > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > --- Acked-by: Yongseok Koh <yskoh@mellanox.com> Thanks ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/mlx5: fix representor port xstats 2018-09-28 0:11 ` Yongseok Koh @ 2018-10-04 20:46 ` Thomas Monjalon 0 siblings, 0 replies; 7+ messages in thread From: Thomas Monjalon @ 2018-10-04 20:46 UTC (permalink / raw) To: Xueming(Steven) Li; +Cc: dev, Yongseok Koh, Shahaf Shuler, Adrien Mazarguil 28/09/2018 02:11, Yongseok Koh: > > > On Sep 19, 2018, at 12:55 AM, Xueming Li <xuemingl@mellanox.com> wrote: > > > > This patch fixes the issue that representor port shows xstats of PF. > > > > Fixes: 2b7302638898 ("net/mlx5: probe all port representors") > > Cc: adrien.mazarguil@6wind.com > > > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > > --- > Acked-by: Yongseok Koh <yskoh@mellanox.com> applied to dpdk-next-net-mlx ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-04 20:46 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-09-06 10:28 [dpdk-dev] [PATCH] net/mlx5: fix representor port xstats Xueming Li 2018-09-14 6:33 ` [dpdk-dev] [PATCH v2] " Xueming Li 2018-09-14 16:50 ` Yongseok Koh 2018-09-15 5:20 ` Xueming(Steven) Li 2018-09-19 7:55 ` [dpdk-dev] [PATCH v3] " Xueming Li 2018-09-28 0:11 ` Yongseok Koh 2018-10-04 20:46 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).