From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 67ADC1C18C for ; Wed, 4 Apr 2018 14:10:47 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id 80so22291385wrb.2 for ; Wed, 04 Apr 2018 05:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=dm62XtefiJ0/PDwaVEaYe08MZEzNrq46t3QRssx7ehU=; b=TlwlCMQHk75RhXfCeERSU0lcTEnZebh5rWSf/SwSexDrmDKIBjas1eeFS+xW07SvxD KFYbHW9x8M0/azRG1FRsYGV4xYxKhMQOq9CFEfXmfQat3uAR2MrbYdaC1LOmOk250UCv UzRNeCENAP0pfEFzQ8yy4DZjIA8xTN7R4tOUJ+Aiq515M/cVYhjQz3Kn9buimBrPMBTc /sj4hkOsZLJvGD1MxC+qtJksRaZbVxTl9WYIMaDg56RMhWfAUWCgW7MubMJfV04j3235 KwDLSm2TvBnMn/51cz1jLeUeMVt9Kwi8hFkz5p/vgPmpGPCzftED3TDHJmlvui9r9ACh jUxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=dm62XtefiJ0/PDwaVEaYe08MZEzNrq46t3QRssx7ehU=; b=bNPHe6uCWC72B/o8mi3/1u5HRNFPuU+bRgKVcyRBLJo/FM9mtXg5iS2WZPETPhrwDP cSbQ6+vhaTfnO52wjk42iKijs2OHVHdiHNU8kfXio1aJI9bOzufhhht9vdepvQ/7a4fu TNfi5FO4LicUkSNI9eMy4AjrxpY6gahcpj+meFBb8YSkQG7YHX+Kf2NcxKtkU4fKp6HW 2seD9Uu4PS2xc2kyG+19FDDQEOarQCmVE5wgYFMEOi1rXnIYQ0/DDqMZWSId1SIz5mOP uKjcIaLROQtqXEyoKM7mhUUTyPeGPBiTfBNh0tTB/KqtTihZIchhTdmCB7dH3MQ9ZSQm WujQ== X-Gm-Message-State: AElRT7GJxmp+0gYeohM6Df9CU6QpPiE4XWeedmOp0UNRym6kXbgCqSe8 49l2UEJvzup49JULB+xf04de X-Google-Smtp-Source: AIpwx4+Bj0+EPlaLJeGRifrPWd+TG20EQ6+Bp9pvkFxtplZJPhlf0RKKJ1VINaXEYMJ/qMPNzUkaTQ== X-Received: by 10.223.150.117 with SMTP id c50mr12779145wra.196.1522843847103; Wed, 04 Apr 2018 05:10:47 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id y191sm7029526wme.14.2018.04.04.05.10.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Apr 2018 05:10:46 -0700 (PDT) Date: Wed, 4 Apr 2018 14:10:51 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: Adrien Mazarguil , Yongseok Koh , "dev@dpdk.org" Message-ID: <20180404121051.ersiyf75gykwfon5@laranjeiro-vm.dev.6wind.com> References: <20180403044817.27457-1-shahafs@mellanox.com> <20180404073009.zgqu3yrj26trwdfr@laranjeiro-vm.dev.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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 12:10:47 -0000 On Wed, Apr 04, 2018 at 09:58:33AM +0000, Shahaf Shuler wrote: > Wednesday, April 4, 2018 10:30 AM, Nélio Laranjeiro: > > Subject: Re: [PATCH] net/mlx5: fix link status initialization > > > > 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. > > > > There is something wrong in this explanation, the application should query > > 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 PMD callback and just update according to the link status exists > on device data. > 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. > > 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. The commit log should be re-worded to include this explanation. > > > 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 = config; > > > continue; > > > -- > > > 2.12.0 According to your analysis, this is only necessary when the LCS is configured in the device. Why not adding this call to mlx5_dev_interrupt_handler_install() which is responsible to install the LCS callback. Another point, the wait to complete flag is useless, if the link is up, the status and speed will be accurate, if not, it will receive an LSC event later. Regards, -- Nélio Laranjeiro 6WIND