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 4ED4EA04F1; Fri, 13 Dec 2019 15:43:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D8BE1BFB6; Fri, 13 Dec 2019 15:43:18 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150087.outbound.protection.outlook.com [40.107.15.87]) by dpdk.org (Postfix) with ESMTP id 022E51BFB5 for ; Fri, 13 Dec 2019 15:43:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpyQLCJfkkz4/5GyLwtR3WH80Pbo7EzXnWGrx8W+EAr5XTJX0JqbMw4erLh7RHv35bz0IelYoYXBFmtv0tp9WPGM1lroVVj8tH/TbfOlWZSJ+pzwg7pcO1va+WWXd+GipC5Guzuk6rT+49UanGcQU28NrJv4wQqo1Q782VBD7mGDeZvzG0/ibCUrBbD46P+qAj3MosMIq3qCwUivGIXhYEdnkhI/Ym6jOJDIbXTJjBHJQCXTCucZecteOgPOluQtIrePfkQMVgI+p4N1BQpHmjdr85bPH3X8Ai2cfC6dUJxzfLfh2dReepR0QC4IObizAOvOeFtU4g/iGYI9tQl7XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KpkDpwHG1IS+uLlZclS1a3KFecEGX8SpQ4o/+axPi8Q=; b=IPJ5Ww1txFp/hJsCQHvoa2qhJIRCgkZd8Srz2+BORZWx2o0PTUpi/8Jy/4VwPWxvcGknuZFjxSZR+iQkS6sWR/0icEF9CpI6kfdrq1Jv6HUgamSOFIr4Tr/K6Ml1hbdrLFAdIyzV03PzhqoHY2iFMxN9n3MzsX2qCHCMVPMr7lmDrtZFDL41J0WQJvcZq5FMKyMKf0D8GjeB+FdicuISjZ078S3o59MSMeihtBPFRXeALBSEaP/02QmST3oUH30HEiavHcGT70niEZhk1ZCAWnkotUVMZ987M/u7sdjLHUBW3WZtLgo8/02muU3TbJmbB5j7mKM7LcR9wFCPF3mC0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KpkDpwHG1IS+uLlZclS1a3KFecEGX8SpQ4o/+axPi8Q=; b=Yk1baNvBeMwc/oDBoCw8k2fgngW2qeuJvDZULcFPzg0z0KcsXnZH5HegX9LkS8KN9tN3T4w5OURDCOcMnmvjR7AhLrJvqVRuQvRW6wO22inye1uxbSEaqjImQX9ePem5FglEpSneXb+VZQt1t++tVq9fdbod9+K7A2e+WIzQSjM= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3204.eurprd05.prod.outlook.com (10.171.186.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Fri, 13 Dec 2019 14:43:15 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f%3]) with mapi id 15.20.2516.020; Fri, 13 Dec 2019 14:43:15 +0000 From: Slava Ovsiienko To: Thomas Monjalon , "dev@dpdk.org" CC: Mike Manning , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , Matan Azrad , Shahaf Shuler , Raslan Darawsheh Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix eagain on admin down Thread-Index: AQHVrr3NQ3DJK6muUkKGtENpa5fDlKe3GhIAgAEO4eA= Date: Fri, 13 Dec 2019 14:43:14 +0000 Message-ID: References: <20191209182314.4698-1-mmanning@vyatta.att-mail.com> <1868349.qFeMPqzfeV@xps> In-Reply-To: <1868349.qFeMPqzfeV@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [77.75.144.194] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2c75ebb4-49bb-4c5d-691a-08d77fdac948 x-ms-traffictypediagnostic: AM4PR05MB3204:|AM4PR05MB3204: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:383; x-forefront-prvs: 0250B840C1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(396003)(136003)(366004)(13464003)(189003)(199004)(9686003)(8676002)(81166006)(81156014)(8936002)(7696005)(55016002)(5660300002)(4326008)(71200400001)(54906003)(76116006)(186003)(64756008)(53546011)(52536014)(66556008)(110136005)(33656002)(66574012)(107886003)(6506007)(86362001)(478600001)(66476007)(66946007)(2906002)(316002)(66446008)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3204; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IgNx7fOZiMXAJmijggcVQNjQcDu0yeHgkCjz+NZkpQgiZ67RU1/UF3AuAfY6enOoU95GCOR+KomyiH+I5PZFAxXW65iWFiLze6lHdeN0nb1iV3BoCo2yE9D3BP4E1snd/2mUb68M1Cf/KuwB5wTHkAThnUaoqWBPiD1fSKhw4uvua8Xx6aQ3RaqZl+j2bCiY7VFKCuKLNepTz90AgQ2KzvAX0ytFRGxuEltp2FZy8PNPtDDln5ICDuPzJUT06nURuqBFt/wxXvmfN6YqOexirNNyo20q/zeyW+1Lpx7R9C3Lq89MquQ9IsnuEDuZEs/TimvCsAs+FJpBsZEKvpFNFhOAsOeIE+xeWs/VpLdUdg24/xBvph0SKT/DwevVgiMp7kM3KHsF3rH6R/tNhwKePWfDQGqBu/bnNZkxJui2tXkRfcpoLjbvxj8pIW12QNfGj96fshhn8fr6foJSWpRVkwobdUf5qGZeLcko7w+0TY2YNWCgzJ8//TXnhB22Irtr Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c75ebb4-49bb-4c5d-691a-08d77fdac948 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2019 14:43:15.1159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FrKR3HfiF5p3WY7GUNvbcPlganCu+yqoplguaEIecNeEdLn6Q5/YfwD5K/gJ12zndY1iuysMdPkFo2Ock7qyAlBMAwCzFFl+GuxzY/Rshns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3204 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" Hi, Mike =20 In the mlx5_link_update_unlocked_gs() the dev_link.link_speed is set like t= his: dev_link.link_speed =3D (ecmd->speed =3D=3D UINT32_MAX) ? ETH_SPEED_NUM_NON= E : ecmd->speed; So, dev_link.link_speed can't be assigned with -1. Do I misunderstand you c= ommit message?=20 With best regards, Slava > -----Original Message----- > From: Thomas Monjalon > Sent: Friday, December 13, 2019 0:31 > To: dev@dpdk.org > Cc: Mike Manning ; N=E9lio Laranjeiro > ; Matan Azrad ; Slava > Ovsiienko ; Shahaf Shuler > ; Raslan Darawsheh > Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix eagain on admin down >=20 > +Cc maintainers >=20 > 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=E9lio 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 =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 >=20 >=20 >=20