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 4655EA04F1; Fri, 13 Dec 2019 16:12:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58DF41BFD0; Fri, 13 Dec 2019 16:12:17 +0100 (CET) Received: from mx0a-00191d01.pphosted.com (mx0b-00191d01.pphosted.com [67.231.157.136]) by dpdk.org (Postfix) with ESMTP id EA2AB1BFCB for ; Fri, 13 Dec 2019 16:12:15 +0100 (CET) Received: from pps.filterd (m0049462.ppops.net [127.0.0.1]) by m0049462.ppops.net-00191d01. (8.16.0.42/8.16.0.42) with SMTP id xBDF6GRv014379; Fri, 13 Dec 2019 10:12:14 -0500 Received: from tlpd255.enaf.dadc.sbc.com (sbcsmtp3.sbc.com [144.160.112.28]) by m0049462.ppops.net-00191d01. with ESMTP id 2wvcdx8xqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2019 10:12:13 -0500 Received: from enaf.dadc.sbc.com (localhost [127.0.0.1]) by tlpd255.enaf.dadc.sbc.com (8.14.5/8.14.5) with ESMTP id xBDFCAm9129761; Fri, 13 Dec 2019 09:12:12 -0600 Received: from zlp30497.vci.att.com (zlp30497.vci.att.com [135.46.181.156]) by tlpd255.enaf.dadc.sbc.com (8.14.5/8.14.5) with ESMTP id xBDFC53Z129575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 13 Dec 2019 09:12:06 -0600 Received: from zlp30497.vci.att.com (zlp30497.vci.att.com [127.0.0.1]) by zlp30497.vci.att.com (Service) with ESMTP id D2DC14009E81; Fri, 13 Dec 2019 15:12:05 +0000 (GMT) Received: from clpi183.sldc.sbc.com (unknown [135.41.1.46]) by zlp30497.vci.att.com (Service) with ESMTP id A04A24009E80; Fri, 13 Dec 2019 15:12:05 +0000 (GMT) Received: from sldc.sbc.com (localhost [127.0.0.1]) by clpi183.sldc.sbc.com (8.14.5/8.14.5) with ESMTP id xBDFC54J027247; Fri, 13 Dec 2019 09:12:05 -0600 Received: from mail.eng.vyatta.net (mail.eng.vyatta.net [10.156.50.82]) by clpi183.sldc.sbc.com (8.14.5/8.14.5) with ESMTP id xBDFBvJm026518; Fri, 13 Dec 2019 09:11:58 -0600 Received: from [10.156.47.168] (unknown [10.156.47.168]) by mail.eng.vyatta.net (Postfix) with ESMTPA id E761F36008E; Fri, 13 Dec 2019 07:11:55 -0800 (PST) To: Slava Ovsiienko , Thomas Monjalon , "dev@dpdk.org" Cc: =?UTF-8?Q?N=c3=a9lio_Laranjeiro?= , Matan Azrad , Shahaf Shuler , Raslan Darawsheh References: <20191209182314.4698-1-mmanning@vyatta.att-mail.com> <1868349.qFeMPqzfeV@xps> From: Mike Manning Message-ID: <5d69fcde-a7a1-d531-174d-0cb6c17dbdc7@vyatta.att-mail.com> Date: Fri, 13 Dec 2019 15:11:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-13_03:2019-12-13,2019-12-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=0 impostorscore=0 lowpriorityscore=0 clxscore=1011 adultscore=0 bulkscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912130123 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 Reply-To: mmanning@vyatta.att-mail.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Slava, Thanks, you are right - I retract my patch, as this was fixed in v19.08 by 6fd05da9efbd ("net/mlx5: fix link speed info when link is down") as per the line you indicate. I should explain that we are using Debian 10 which uses v18.11, here we had a painful issue with the combination of this -EAGAIN and use of netlink to obtain the ifindex resulting in concurrent use of the netlink socket causing the calling thread to block indefinitely. Regards Mike On 13/12/2019 14:43, Slava Ovsiienko wrote: > Hi, Mike > > In the mlx5_link_update_unlocked_gs() the dev_link.link_speed is set like this: > > dev_link.link_speed = (ecmd->speed == UINT32_MAX) ? ETH_SPEED_NUM_NONE : ecmd->speed; > > So, dev_link.link_speed can't be assigned with -1. Do I misunderstand you commit message? > > With best regards, Slava > >> -----Original Message----- >> From: Thomas Monjalon >> Sent: Friday, December 13, 2019 0:31 >> To: dev@dpdk.org >> Cc: Mike Manning ; Nélio Laranjeiro >> ; Matan Azrad ; Slava >> Ovsiienko ; Shahaf Shuler >> ; Raslan Darawsheh >> Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix eagain on admin down >> >> +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. >>> >>> 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; >>> } >>> >> >> >>