From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F651A057C; Fri, 27 Mar 2020 18:25:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB7831C24F; Fri, 27 Mar 2020 18:25:00 +0100 (CET) Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) by dpdk.org (Postfix) with ESMTP id C137D1C24B for ; Fri, 27 Mar 2020 18:24:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1825; q=dns/txt; s=iport; t=1585329898; x=1586539498; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=1Kf4qvl2FAaEMFhyHT3fVoy99L6LKNlGsBVuUd83qsk=; b=OHTZu5l17u1AywCdRE3ToiYCaXCUT0sU8tS1Ln2piyFNHDpk5+8rid03 KjsT3tXrnwXVxUrbIh0zzakR/J6RInzHD/Jub1CAed1RzQAj+nAb7TnHu 21A6c/B2ZwaIvmvwVIZRWzaYD848qMnjkJ4AqPeyor/7wyUGA8WSPFt6m 8=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DRBADWNX5e/xbLJq1mHgELHIFwC4F?= =?us-ascii?q?9gRhVIBIqhBqJApdmi3AKAQEBDAEBIwwEAQGHGzcGDgIDAQELAQEFAQEBAgE?= =?us-ascii?q?FBG2FVgyGGgQLAXsCJgJygltLAYJ8D6xHdX8zhDUBgRWEHoEEgQ4qh02EfoF?= =?us-ascii?q?BP4RjglwLBIIwgkWCXgSNfaJggkaHX48hDB2CTIECmBoBkGSHQpJoAgQLAhW?= =?us-ascii?q?BaCOBWE0jFUgQgk8JRxgNlySFQkADMAKPGwEB?= X-IronPort-AV: E=Sophos;i="5.72,313,1580774400"; d="scan'208";a="24824286" Received: from aer-iport-nat.cisco.com (HELO aer-core-4.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 27 Mar 2020 17:24:58 +0000 Received: from BGANNE-3D5NJ.cisco.com ([10.61.245.75]) (authenticated bits=0) by aer-core-4.cisco.com (8.15.2/8.15.2) with ESMTPSA id 02RHOrNC016111 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 27 Mar 2020 17:24:57 GMT From: =?UTF-8?q?Beno=C3=AEt=20Ganne?= To: dev@dpdk.org Date: Fri, 27 Mar 2020 18:24:49 +0100 Message-Id: <20200327172449.6514-1-bganne@cisco.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authenticated-User: bganne X-Outbound-SMTP-Client: 10.61.245.75, [10.61.245.75] X-Outbound-Node: aer-core-4.cisco.com Subject: [dpdk-dev] [PATCH] net/mlx5: fix link state update 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: , Errors-To: dev-bounces@dpdk.org Sender: "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 --- 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