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 8B0EEA00E6 for ; Mon, 5 Aug 2019 15:39:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A6CB5680; Mon, 5 Aug 2019 15:39:38 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20087.outbound.protection.outlook.com [40.107.2.87]) by dpdk.org (Postfix) with ESMTP id E53E65587; Mon, 5 Aug 2019 15:39:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKDiuhnGq9i9n3Xd96mtBBNaWJg4hSMYJodYWhL9ciVXeLkydfK2WW5K4tHCAOZhUAHvRDLLSk0247mtiRNzkoCJ1d1cN8BETVA10CCZoubQc2psWQ6o67XNJweLW3+wvLimnMBYM72pa8oHRWmeJdbfzgiIMN2ac4YzZ/TVWgOL+arGDYa+qxV7tvNZiUgVGRzaklf3Ss2YnWabfKwTo5Ey+bCpz+koCS+/C7RW4cOc4Bgz9Dtb6BKYqWfJcAOfP0S/AkhSNC5vi+kDVLv2YSl1A3of93deJWw4oYcexO1LyyogHkTe+dJxRoq2ho5T7WAemDctKjlNeFmmF0apTQ== 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=4xKaNW99nC3Qc994C+JmFS8cT7E9w37Ly158mGtMKkM=; b=gecd17/bMXaqZZ/PTf6DeCIidsmDT8Wvix2DT+kTwJlXvMfyP1TUC6Cs+zXqDH1yEIiZwZvh5D76zvBx6Blcm/iOsRYS/zHOfQFVM1Z6EkSL0yrY6g9LSNT74pXwcI5XY3op45Xt7UApdG6vVveChT9MB2c1z8djl+0dBZIo2McrIXme486g2y1PVny/TfY7n3ECXktdE/OB6/MpxtfcEy+L+HDUNyYxlGHBBugRxq9yR9Z5Lnd4WA160Z0/ItDNjw+n827PQ5m3MshISmrXqQO68dPlzg2X00D2aqQfCoVWmiLVnixBLqWe1Er7Ti923m45u5WaYCGL1qqQqXuI7g== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4xKaNW99nC3Qc994C+JmFS8cT7E9w37Ly158mGtMKkM=; b=E/nNzrm5bqVZK0yqBerwL1zPhwS341xHx40kIYvzQ+99hakEMPOACj8Flf5tshAJ8/LVlLwxqCLg2Gp2a8ukxMsQsVv0JP/EVl2yyfBIKgT89I9LVvDwrBGUOG/wLpIKuiCjOGDxGS/xo+vMJHjGeGFmSbOWXbwHTFSSiBeCGcY= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3155.eurprd05.prod.outlook.com (10.170.126.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16; Mon, 5 Aug 2019 13:39:35 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::ec83:c573:8eda:b6a]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::ec83:c573:8eda:b6a%4]) with mapi id 15.20.2136.018; Mon, 5 Aug 2019 13:39:35 +0000 From: Slava Ovsiienko To: Jack Min , Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix link speed info when link is down Thread-Index: AQHVS2QWB551sfn0R0KobJhhIU2aX6bsj5Lg Date: Mon, 5 Aug 2019 13:39:35 +0000 Message-ID: References: <4b0167f58ced8ae76262b0accbf14a4653b29283.1564991888.git.jackmin@mellanox.com> In-Reply-To: <4b0167f58ced8ae76262b0accbf14a4653b29283.1564991888.git.jackmin@mellanox.com> 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: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 48a2af9f-1085-4027-fdd0-08d719aa5aff x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM4PR05MB3155; x-ms-traffictypediagnostic: AM4PR05MB3155: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 01208B1E18 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(39860400002)(376002)(366004)(189003)(199004)(13464003)(102836004)(26005)(66066001)(68736007)(81166006)(450100002)(54906003)(14454004)(110136005)(6246003)(2906002)(81156014)(33656002)(8676002)(4326008)(316002)(25786009)(66946007)(229853002)(64756008)(8936002)(99286004)(305945005)(7736002)(486006)(6116002)(11346002)(476003)(446003)(66476007)(478600001)(66556008)(14444005)(3846002)(76176011)(256004)(66446008)(71190400001)(71200400001)(186003)(52536014)(76116006)(74316002)(5660300002)(6636002)(53936002)(6436002)(55016002)(9686003)(86362001)(7696005)(53546011)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3155; 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-message-info: wqxs6WrZnVkVVCcs4wPABoGlyAoKmbwVWNI1uYYvsFqY9/cxT+z+B933kd6yWkfSaVxzHcqyEc+Sx6hxZfZc6dQdmd35Tu2auCO3usOBYF/4Fl6O/Y0jBXs7YHDimvBPnpScvqyuwLlAprPaLB5HoTxW8GYm9BxX9iSEJaiAsIacz/6wxjAGX9PtzT+6J7h6EQe9fCrAav7/58dgjXPR0B0UqkaNTh6AlbkXz9+nx0dnXdwYd1oziel39Twcs3LLPlkroG2f7PwwX2M0crbS7anG34sWgg+uJssy0THnnZIHNQ004FKo2cWT/LtdGOBBNftE7Eg6pSifOOyLUd/A9ODTPL8dufAJYR/iOijTxAoySnOYspGC/aVu2NRoPBl1/94qIMVvl7VRlCssFSVMEBwdvGa+yi7tJHwkGh3KVS0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48a2af9f-1085-4027-fdd0-08d719aa5aff X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2019 13:39:35.6706 (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: viacheslavo@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3155 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is 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" > -----Original Message----- > From: Xiaoyu Min > Sent: Monday, August 5, 2019 11:02 > To: Shahaf Shuler ; Yongseok Koh > ; Slava Ovsiienko > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix link speed info when link is down >=20 > When the link is down, the link speed returned by ethtool is UINT32_MAX > and the link status is 0. >=20 > In this case, the DPDK ethdev link speed should be set to > ETH_SPEED_NUM_NONE. > Otherwise since link speed is non-zero but link status is zero, this is a= n > inconsistent situation and -EAGAIN is returned, which is not right. >=20 > Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiaoyu Min Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_ethdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > b/drivers/net/mlx5/mlx5_ethdev.c index 9629cfb333..33a32fc2fa 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -908,7 +908,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev > *dev, > dev->data->port_id, strerror(rte_errno)); > return ret; > } > - dev_link.link_speed =3D ecmd->speed; > + dev_link.link_speed =3D (ecmd->speed =3D=3D UINT32_MAX) ? > ETH_SPEED_NUM_NONE : > + ecmd->speed; > sc =3D ecmd->link_mode_masks[0] | > ((uint64_t)ecmd->link_mode_masks[1] << 32); > priv->link_speed_capa =3D 0; > -- > 2.21.0