DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix link state update
@ 2020-03-27 17:24 Benoît Ganne
  2020-03-29  7:00 ` Matan Azrad
  2020-11-19 14:20 ` [dpdk-dev] [PATCH v2] " Raslan Darawsheh
  0 siblings, 2 replies; 23+ messages in thread
From: Benoît Ganne @ 2020-03-27 17:24 UTC (permalink / raw)
  To: dev

mlx5 PMD refuses to update link state if link speed is defined but
status is down or if link speed is undefined but status is up, even if
the ioctl() succeeded.
This prevents application to detect link up/down event, especially when
the link speed is not correctly detected.
As link speed is nice to have whereas link status is mandatory for
operations, always update link state regardless of link speed. The
application can then check link speed if needs be.

Signed-off-by: Benoît Ganne <bganne@cisco.com>
---

Following the discussion on dpdk-users [1], I am submitting a tentative
patch.
[1] http://mails.dpdk.org/archives/users/2020-March/thread.html#4744

 drivers/net/mlx5/mlx5_ethdev.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d7d3bc73c..c15f4d62b 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -896,11 +896,6 @@ mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev,
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
 	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
 			ETH_LINK_SPEED_FIXED);
-	if (((dev_link.link_speed && !dev_link.link_status) ||
-	     (!dev_link.link_speed && dev_link.link_status))) {
-		rte_errno = EAGAIN;
-		return -rte_errno;
-	}
 	*link = dev_link;
 	return 0;
 }
@@ -1032,11 +1027,6 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
 	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
 				  ETH_LINK_SPEED_FIXED);
-	if (((dev_link.link_speed && !dev_link.link_status) ||
-	     (!dev_link.link_speed && dev_link.link_status))) {
-		rte_errno = EAGAIN;
-		return -rte_errno;
-	}
 	*link = dev_link;
 	return 0;
 }
-- 
2.17.1


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

end of thread, other threads:[~2020-11-22 12:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 17:24 [dpdk-dev] [PATCH] net/mlx5: fix link state update Benoît Ganne
2020-03-29  7:00 ` Matan Azrad
2020-03-30  9:55   ` Benoit Ganne (bganne)
2020-03-30 10:12     ` Matan Azrad
2020-03-30 12:03       ` Benoit Ganne (bganne)
2020-03-30 13:44         ` Matan Azrad
2020-03-30 13:53           ` Benoit Ganne (bganne)
2020-03-30 16:13             ` Matan Azrad
2020-04-01 10:17               ` Benoit Ganne (bganne)
2020-04-01 12:46                 ` Matan Azrad
2020-04-07 12:54               ` Thomas Monjalon
2020-04-07 13:41                 ` Benoit Ganne (bganne)
2020-11-19  8:30                   ` Matan Azrad
2020-11-19 14:20 ` [dpdk-dev] [PATCH v2] " Raslan Darawsheh
2020-11-19 16:27   ` Raslan Darawsheh
2020-11-19 17:48   ` Ferruh Yigit
2020-11-19 18:42     ` Thomas Monjalon
2020-11-20 10:51       ` Ferruh Yigit
2020-11-20 13:50         ` Thomas Monjalon
2020-11-20 14:21           ` Ferruh Yigit
2020-11-22 10:03             ` Raslan Darawsheh
2020-11-22 10:04   ` [dpdk-dev] [PATCH v3] net/mlx5: allow unknown link speed Raslan Darawsheh
2020-11-22 12:58     ` Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git