From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20076.outbound.protection.outlook.com [40.107.2.76]) by dpdk.org (Postfix) with ESMTP id 074BD1BD8C for ; Wed, 4 Apr 2018 11:58:35 +0200 (CEST) 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; bh=+gN21rDnYFoHHrM//OdG7Wv46Zkbd33+uevTErNQt1Y=; b=sizGOzIUrvq+KtCHNNMu2iRCkDcovhZ21q3BMFwQws6/oKnNMvzbyJP0P5CDk+I0PgQpj44tMI+OPsd0ZWdM6vDLi7M7NcCJLun1Z2FVJF4GILHdWc6hjsL1MuzFLOQZyWHrxyrUNwhJMiLzZpqZc1l8U75Z25pYwKAnUyHDMIU= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4313.eurprd05.prod.outlook.com (52.134.108.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Wed, 4 Apr 2018 09:58:33 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::808d:386e:26f3:859f]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::808d:386e:26f3:859f%13]) with mapi id 15.20.0631.013; Wed, 4 Apr 2018 09:58:33 +0000 From: Shahaf Shuler To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: Adrien Mazarguil , Yongseok Koh , "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix link status initialization Thread-Index: AQHTy+bChNPXB2fkBUSu8VuSnLilOaPwRWOw Date: Wed, 4 Apr 2018 09:58:33 +0000 Message-ID: References: <20180403044817.27457-1-shahafs@mellanox.com> <20180404073009.zgqu3yrj26trwdfr@laranjeiro-vm.dev.6wind.com> In-Reply-To: <20180404073009.zgqu3yrj26trwdfr@laranjeiro-vm.dev.6wind.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=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4313; 7:LBZ+gcx+h4aa8N/vyr8JVR6TmNPQJsVe8slKyq/d0d6+HcQ63dvqYLDlJAR3FCgu1SptD6aRO/wqfeXTS4wtEzqNBikrupNlXW3l8q/I8gKNYMk28fNA/Yx+UILWj4YYIntpni2aRusnBUdOis+ZHTTtypgN+aATePJsPqR1Zv9i9SWe2Vy4tnkCVmHqrG87Mh8KW+8nrBEbWbgKYjpiXHRf3H2w5k4ssVWoMRe9+6xv/FSdJzHtT8483G791XZU x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 15f05277-18bb-4f90-cdeb-08d59a12a094 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4313; x-ms-traffictypediagnostic: DB7PR05MB4313: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DB7PR05MB4313; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4313; x-forefront-prvs: 0632519F33 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(366004)(376002)(346002)(199004)(189003)(6506007)(55016002)(446003)(9686003)(99286004)(6436002)(305945005)(26005)(59450400001)(74316002)(7736002)(76176011)(7696005)(11346002)(229853002)(476003)(5660300001)(8676002)(486006)(102836004)(105586002)(6246003)(186003)(5250100002)(6916009)(106356001)(33656002)(53936002)(8936002)(2906002)(3660700001)(14454004)(3280700002)(68736007)(3846002)(2900100001)(25786009)(4326008)(54906003)(6116002)(81166006)(316002)(81156014)(478600001)(86362001)(66066001)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4313; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: y4WsPMsV8IRRx5kss43IAhT/L9mhkTgZRJ2jqnuZ5p3rwRTvRgK4KsC59sU6y3Qh/HqWEuvULAg3ujqFzgb84HIEob0PvusrQUmrm1CmrSBMPLadu13noNxqVekmqmRzChd5PuhATsUUh5Hm754+I21ESNilsGD3XVyL8ulXrQZuSUpNGOUfDQ++lYtIFCVsRlMBFM1nsHS+LU/p+NI9lAhlWdS/SyYSCG/ztWp/VaKzCrns3kO9IF+6tWz8EYTetDAJlbeFamRGsj7f4BL8NtfAkB2+K4NKVo3utaNQStQpmIY9KPt+hmszD1nVIMDKPQUc7H5oD6WiYb5U0vsDN25NLwhX3vWhgfxF7niZNYbAvgDbRghlecgeXdfHLZ6s/oT7Y2lBHgHsbn8CXe/8jdvZZQVCGsOb9NoCrx+uGu4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: 15f05277-18bb-4f90-cdeb-08d59a12a094 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2018 09:58:33.5269 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4313 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix link status initialization 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: , X-List-Received-Date: Wed, 04 Apr 2018 09:58:35 -0000 Wednesday, April 4, 2018 10:30 AM, N=E9lio Laranjeiro: > Subject: Re: [PATCH] net/mlx5: fix link status initialization >=20 > On Tue, Apr 03, 2018 at 07:48:17AM +0300, Shahaf Shuler wrote: > > Following commit 7ba5320baa32 ("net/mlx5: fix link status behavior") > > > > The initial link status is no longer set as part of the port start. > > This may cause application to query the link as down while in fact it > > was already up before the DPDK application start. >=20 > There is something wrong in this explanation, the application should quer= y > the link using this same callback, why the PMD should call it? It is how ethdev is implemented. The application is doing nothing wrong, it= queries the link status using rte_eth_link_get_nowait When the application works with LSC interrupts the ethdev layer skips the P= MD callback and just update according to the link status exists on device d= ata. It is because it assumes the link status on the device data is the correct = one since any link change is processed by the application. The issue is with the initial state of the link. If the link is already up = when the PMD starts there will be no callback for the application.=20 I think this logic is OK, and it is also a good practice to initialize the = link status to the actual state of the link as part of the port probing.=20 >=20 > > Fixes: 7ba5320baa32 ("net/mlx5: fix link status behavior") > > Cc: nelio.laranjeiro@6wind.com > > > > Signed-off-by: Shahaf Shuler > > Acked-by: Yongseok Koh > > --- > > drivers/net/mlx5/mlx5.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > > 7d58d66bb9..f954ea2862 100644 > > --- a/drivers/net/mlx5/mlx5.c > > +++ b/drivers/net/mlx5/mlx5.c > > @@ -961,6 +961,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv > __rte_unused, > > DRV_LOG(DEBUG, "port %u forcing Ethernet interface up", > > eth_dev->data->port_id); > > mlx5_set_link_up(eth_dev); > > + mlx5_link_update(eth_dev, 1); > > /* Store device configuration on private structure. */ > > priv->config =3D config; > > continue; > > -- > > 2.12.0 >=20 >=20 > -- > N=E9lio Laranjeiro > 6WIND