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 1B6C3A04F1; Mon, 9 Dec 2019 19:23:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 291DE23D; Mon, 9 Dec 2019 19:23:42 +0100 (CET) Received: from mx0a-00191d01.pphosted.com (mx0b-00191d01.pphosted.com [67.231.157.136]) by dpdk.org (Postfix) with ESMTP id CB2861F5 for ; Mon, 9 Dec 2019 19:23:40 +0100 (CET) Received: from pps.filterd (m0049458.ppops.net [127.0.0.1]) by m0049458.ppops.net-00191d01. (8.16.0.42/8.16.0.42) with SMTP id xB9IFRsu040826; Mon, 9 Dec 2019 13:23:39 -0500 Received: from alpi155.enaf.aldc.att.com (sbcsmtp7.sbc.com [144.160.229.24]) by m0049458.ppops.net-00191d01. with ESMTP id 2wsa8sa6nr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2019 13:23:39 -0500 Received: from enaf.aldc.att.com (localhost [127.0.0.1]) by alpi155.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id xB9INcdN003146; Mon, 9 Dec 2019 13:23:38 -0500 Received: from zlp27128.vci.att.com (zlp27128.vci.att.com [135.66.87.50]) by alpi155.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id xB9INYU0003069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Dec 2019 13:23:35 -0500 Received: from zlp27128.vci.att.com (zlp27128.vci.att.com [127.0.0.1]) by zlp27128.vci.att.com (Service) with ESMTP id D9BC84039341; Mon, 9 Dec 2019 18:23:34 +0000 (GMT) Received: from mlpi432.sfdc.sbc.com (unknown [144.151.223.11]) by zlp27128.vci.att.com (Service) with ESMTP id C61954039340; Mon, 9 Dec 2019 18:23:34 +0000 (GMT) Received: from sfdc.sbc.com (localhost [127.0.0.1]) by mlpi432.sfdc.sbc.com (8.14.5/8.14.5) with ESMTP id xB9INXET013464; Mon, 9 Dec 2019 13:23:34 -0500 Received: from mail.eng.vyatta.net (mail.eng.vyatta.net [10.156.50.82]) by mlpi432.sfdc.sbc.com (8.14.5/8.14.5) with ESMTP id xB9INRMY011632; Mon, 9 Dec 2019 13:23:28 -0500 Received: from MM-7520.vyatta.net (unknown [10.156.47.168]) by mail.eng.vyatta.net (Postfix) with ESMTPA id AF3DB36008E; Mon, 9 Dec 2019 10:23:26 -0800 (PST) From: Mike Manning To: dev@dpdk.org Cc: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Date: Mon, 9 Dec 2019 18:23:14 +0000 Message-Id: <20191209182314.4698-1-mmanning@vyatta.att-mail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-09_04:2019-12-09,2019-12-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=897 adultscore=0 spamscore=0 clxscore=1011 impostorscore=0 malwarescore=0 suspectscore=1 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912090146 Subject: [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" 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. Fixes: cfee94752b8f ("net/mlx5: fix link status to use wait to complete") Cc: NĂ©lio Laranjeiro Signed-off-by: Mike Manning --- drivers/net/mlx5/mlx5_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.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 *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))) { + if ((((int)dev_link.link_speed > 0 && !dev_link.link_status) || + ((int)dev_link.link_speed <= 0 && dev_link.link_status))) { rte_errno = EAGAIN; return -rte_errno; } -- 2.11.0