DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix wrong representor port link status
@ 2018-09-06  6:50 Xueming Li
  2018-09-14  6:27 ` [dpdk-dev] [PATCH v2] " Xueming Li
  0 siblings, 1 reply; 7+ messages in thread
From: Xueming Li @ 2018-09-06  6:50 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: Xueming Li, dev, adrien.mazarguil

Current code uses PF links status for representor port, not the representor
interface itself. This caused wrong representor port link status when
toggling linterface up or down.

Fixes: 5a4b8e2612c5 ("net/mlx5: probe all port representors")
Cc: adrien.mazarguil@6wind.com

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 34c5b95..08b22ce 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -627,7 +627,7 @@ struct ethtool_link_settings {
 	int link_speed = 0;
 	int ret;
 
-	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr, 1);
+	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr, 0);
 	if (ret) {
 		DRV_LOG(WARNING, "port %u ioctl(SIOCGIFFLAGS) failed: %s",
 			dev->data->port_id, strerror(rte_errno));
@@ -636,6 +636,7 @@ struct ethtool_link_settings {
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
+	memset(&ifr, 0, sizeof(ifr));
 	ifr.ifr_data = (void *)&edata;
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 1);
 	if (ret) {
@@ -698,7 +699,7 @@ struct ethtool_link_settings {
 	uint64_t sc;
 	int ret;
 
-	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr, 1);
+	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr, 0);
 	if (ret) {
 		DRV_LOG(WARNING, "port %u ioctl(SIOCGIFFLAGS) failed: %s",
 			dev->data->port_id, strerror(rte_errno));
@@ -707,6 +708,7 @@ struct ethtool_link_settings {
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
+	memset(&ifr, 0, sizeof(ifr));
 	ifr.ifr_data = (void *)&gcmd;
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr, 1);
 	if (ret) {
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-04 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  6:50 [dpdk-dev] [PATCH] net/mlx5: fix wrong representor port link status Xueming Li
2018-09-14  6:27 ` [dpdk-dev] [PATCH v2] " Xueming Li
2018-09-14 16:43   ` Yongseok Koh
2018-09-15  5:23     ` Xueming(Steven) Li
2018-09-19  8:27   ` [dpdk-dev] [PATCH v3] " Xueming Li
2018-09-28  0:13     ` Yongseok Koh
2018-10-04 20:42       ` 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).