From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id D15201B781 for ; Mon, 9 Apr 2018 10:27:22 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id r82so14903222wme.0 for ; Mon, 09 Apr 2018 01:27:22 -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=FBhmqzuyx+Gm3oimv5q2gL+UOsw/N7Y9hkhgDGKaiqQ=; b=y96fPXT/k9rlb4j2OcTSvTcX07xjDk+9yzrfe0778aqCyJDkbDEwMA2i6g+YW1GEjD XZ5xFwtmqdVZsOLupNMzIq1LtWNej5fej820Z9Ug2RJjxEKkZZJcZvyZnmC+TlsfyqkG MXMJw8nysDKjGqAlcLv44Jc3vcNPWBMH/fjyfhvcOzpaXuw0slu2j3eesLq7VJtPFDQD s7E06T+rzjvuD/a16kR/QCYOh9XF2w3Y2oSXX0QayXovldJvFg8lqO5itbzY5qMrkvbJ P+Y+j7sDl4a5Oma8sz54EsygiMvBca4IDXBFGIJozDX8+RXDxOaQARU9ncT/wEYEU6oS 5UPA== 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=FBhmqzuyx+Gm3oimv5q2gL+UOsw/N7Y9hkhgDGKaiqQ=; b=Krt6wEBsG9oEoe1cuS7H7eXITX4pA3QdZWeJq2NpCpz5nilYpVYtsNc7YRSLs9LWzv bPLzulZxQ4f3Wh7tTJxuSXr9ZVyYSGM6hxBjeaYymQa6XzYE62ar3fMw/klvK1PPGhKL hvvXSGtNkwUmQGwXrO9KKscTlm6MUVXCsnZwNAQlfcVdF/eCiTacnvB/OAfQlEypnNvj XBmgTRnL2r6H0f++iWMZ+UN52C2dEr828Dmzm9bkz+wK0NmStalrOVGdefHcEjxNPrjP SX3DyK8VOdHQ1kKDeINQtGXobbZg6HXx1Ric7ahziZG++CZuuJyEdfT7FKsDIiZSQQfW ipXw== X-Gm-Message-State: AElRT7FgLpymiCqEAYUa4jlaq74f9jSnsdG8ddeLvj+8ReOiM4T7lJh5 WrTcpbDZcp8mI739RDZaV3dp X-Google-Smtp-Source: AIpwx4+sF/yKXs8MRf+Z4YKRtTHcAaelsaTAjtaziPYYGWxP57cM97LC7PWBCw1bpIa+qmjagd00ng== X-Received: by 10.28.88.195 with SMTP id m186mr18926751wmb.113.1523262442568; Mon, 09 Apr 2018 01:27:22 -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 l73sm208158wma.10.2018.04.09.01.27.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 01:27:21 -0700 (PDT) Date: Mon, 9 Apr 2018 10:27:36 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: Adrien Mazarguil , Yongseok Koh , "dev@dpdk.org" Message-ID: <20180409082736.spzxnp3bbcllakui@laranjeiro-vm.dev.6wind.com> References: <20180403044817.27457-1-shahafs@mellanox.com> <20180404073009.zgqu3yrj26trwdfr@laranjeiro-vm.dev.6wind.com> <20180404121051.ersiyf75gykwfon5@laranjeiro-vm.dev.6wind.com> <20180405065120.jqttkvlhjflpfdbj@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: Mon, 09 Apr 2018 08:27:23 -0000 On Sun, Apr 08, 2018 at 01:09:27PM +0000, Shahaf Shuler wrote: > Thursday, April 5, 2018 9:51 AM, Nélio Laranjeiro: > > Subject: Re: [PATCH] net/mlx5: fix link status initialization > > > > On Thu, Apr 05, 2018 at 05:35:57AM +0000, Shahaf Shuler wrote: > > > Wednesday, April 4, 2018 3:11 PM, Nélio Laranjeiro: > > > > Subject: Re: [PATCH] net/mlx5: fix link status initialization > > > > > > > > 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: > > [..] > > > > > > > > > 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. > > > > > > I think it is good practice whether or not LSC is set. > > > The link status should be initialized to the correct value after the probe. > > > > There is no guarantee the link will be accurate, at probe time the link may be > > up so internal information has a status up with a speed with this patch. > > The application probes a second port, in the mean time the link of the first > > port goes down, the interrupt is still not installed and the internal status > > becomes wrong (still up whereas the port is down). > > > > Finally at start, the device installs the handler, but the link is still down > > whereas internally it is up, the application will call > > rte_eth_link_get_nowait() which will directly copy the wrong internal status > > to the application. > > This is not correct. > Using Verbs, the async_fd on which link status interrupts are reported is created on probe. > Even if the interrupt handler is not installed, interrupts still > trigger on this fd. They will be processed when the interrupt handler > will be installed as part of the port start. > So in fact you have the whole trace on the link status changes waiting > to be processed upon port start. Right, but in such case, this patch still does not solves the issue. Until the dev_start() is called, the link may be inconsistent with the real status. example: pci_probe --> link is up. leaving pci probe, the link goes downs --> internally the PMD has a link up. Until the dev_start() is called any call to rte_eth_link_get_nowait() will copy the internal PMD status which is not accurate. >>From this point, the issue seems to fully come from rte_eth_link_get_nowait() which should not make any copy until the port is not started, until then the link may be inconsistent between the driver and the device. Regards, -- Nélio Laranjeiro 6WIND