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 0A1D5A04DD; Thu, 19 Nov 2020 15:20:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 04B553B5; Thu, 19 Nov 2020 15:20:41 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id B749D160 for ; Thu, 19 Nov 2020 15:20:38 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 19 Nov 2020 06:20:47 -0800 Received: from nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 19 Nov 2020 14:20:31 +0000 From: Raslan Darawsheh To: CC: , , , =?UTF-8?q?Beno=C3=AEt=20Ganne?= Date: Thu, 19 Nov 2020 16:20:18 +0200 Message-ID: <20201119142018.25277-1-rasland@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327172449.6514-1-bganne@cisco.com> References: <20200327172449.6514-1-bganne@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1605795647; bh=TN0iURI/fPTRfSiX9PXtMkwPjDAkWvN8bEH4Ux8v5W4=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding: X-Originating-IP:X-ClientProxiedBy; b=IphcwMkNFGB5fsRR8xmOSSIkTW9ngBfEcQkbuKsA9+7LfVMxyNRelA2rtIFDgManj xGrJCIOo/jVwaNOl6kbbfKLSUBSFw4G3eHdc/oEdLGldzxi5V8PPgzCB2LdXfzYnWX TOizD5ik+WyOwft9QF2gxGM0ExoAS3XnyoYWE9YG4BUbkUMpQ2ivAcKUBRMlXLHNB0 ojVxqX5iLiSzCjaURJh8awQfp7hUzfFuUVjf3oq6ly0baqLCjkOHIwX5GUU5fdEI5T P6Uxeq9ILZKkthh41rsJm11ROaDnDCmDJ9dleC+ZJBlDjG+g2NfFqHKJqGk0Q/tAS2 lkCjWRcSlVFUg== Subject: [dpdk-dev] [PATCH v2] 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" From: Beno=C3=AEt Ganne 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=C3=AEt Ganne Signed-off-by: Raslan Darawsheh --- doc/guides/rel_notes/release_20_11.rst | 1 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/= release_20_11.rst index 1c262d39a5..75b4ebc84b 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -207,6 +207,7 @@ New Features by rte_flow API. * Added support of Age action query. * Added support of multi-ports hairpin. + * Allow unknown link speed. =20 Updated Mellanox mlx5 vDPA driver: =20 diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/lin= ux/mlx5_ethdev_os.c index 19b281925f..f7ef1492b1 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -425,11 +425,6 @@ mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev= , ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX); dev_link.link_autoneg =3D !(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 =3D EAGAIN; - return -rte_errno; - } *link =3D dev_link; return 0; } @@ -571,11 +566,6 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX); dev_link.link_autoneg =3D !(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 =3D EAGAIN; - return -rte_errno; - } *link =3D dev_link; return 0; } --=20 2.17.1