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 092AEA04F5; Thu, 12 Dec 2019 23:30:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BB501BF8E; Thu, 12 Dec 2019 23:30:42 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 8FDB01BF8D for ; Thu, 12 Dec 2019 23:30:41 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0245922923; Thu, 12 Dec 2019 17:30:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 12 Dec 2019 17:30:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=1+ip6ZHxeqHsb6xk0crcUqwoWnssfybkDZyneHydprM=; b=dns/mc7R5f6Z yZXt+8B21q77PfCuKXCPeWk54Nalj3vlKkuHhYgEW/FTY9CMABrtDUZp5WKonHiI 1LjHA4CKmgwvkocXChMZ3FFx/2HPxV3SkVRgMeFVipX7ZFsmNc/cqT5uhOJO9KuH QWTcUOOuExPXj6W/gg+JcYLANwL1ksE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=1+ip6ZHxeqHsb6xk0crcUqwoWnssfybkDZyneHydp rM=; b=bx7IYmJc1WXH0taha/EeAYvvCn+JINvMCQYjkztGR6rwcmvHvDves4AwM kisLLpZGdX3dMU/u+fGURf1RM4KnxLJuS3+zHhHN7OYAWByrjuRrlAMNtbsUVS5O J0iu8KDaPFaaSFTp/XJVIAs5N7ErTvs6UMX3cjFy/dX4ackgg67/rcqgQEnsMKeK T6SqM2iyYQLOXWOxDMRg6trh3s+8/cvSeXm06nTWUJMDAW7Vb3GTZ8qEY7bmSlo7 LYqMUZvNajhBy+PsAAND5L0/sXNz4Bp2M6ABDJhXMXrV/b4Jh+Z4G3HuSCQuumKn 5k+hM7aEI4NxgOGyU/0yzPGXlLjjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeljedgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc fkphepjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpeht hhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 755EA306030A; Thu, 12 Dec 2019 17:30:39 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Mike Manning , =?ISO-8859-1?Q?N=E9lio?= Laranjeiro , matan@mellanox.com, viacheslavo@mellanox.com, shahafs@mellanox.com, rasland@mellanox.com Date: Thu, 12 Dec 2019 23:30:38 +0100 Message-ID: <1868349.qFeMPqzfeV@xps> In-Reply-To: <20191209182314.4698-1-mmanning@vyatta.att-mail.com> References: <20191209182314.4698-1-mmanning@vyatta.att-mail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix eagain on admin down 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" +Cc maintainers 09/12/2019 19:23, Mike Manning: > The check in mlx5_link_update_unlocked_gs() returns -EAGAIN if link > status does not correspond to link speed. If status is DOWN, the speed > is expected to be ETH_SPEED_NUM_NONE (0). But as the link speed is -1 > on admin down, modify the check to account for this. >=20 > Fixes: cfee94752b8f ("net/mlx5: fix link status to use wait to complete") > Cc: N=E9lio Laranjeiro >=20 > Signed-off-by: Mike Manning > --- > drivers/net/mlx5/mlx5_ethdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethde= v.c > index d80ae458b..6ef2dfd74 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1031,8 +1031,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *de= v, > 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))) { > + if ((((int)dev_link.link_speed > 0 && !dev_link.link_status) || > + ((int)dev_link.link_speed <=3D 0 && dev_link.link_status))) { > rte_errno =3D EAGAIN; > return -rte_errno; > } >=20