Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2819166rwl; Sun, 9 Apr 2023 01:55:10 -0700 (PDT) X-Google-Smtp-Source: AKy350YwCH8spq6Y7JMomTXTBqHQPEEjAwaZhRRIfDSYZFuQLlzmLHvn53XRpOzKriFEWwknaL08 X-Received: by 2002:a05:6a20:78a9:b0:dd:2577:4018 with SMTP id d41-20020a056a2078a900b000dd25774018mr4026599pzg.49.1681030510614; Sun, 09 Apr 2023 01:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681030510; cv=none; d=google.com; s=arc-20160816; b=ZAlhiKc1VrIxX7us/t1C4sxl/OhjcxgUIqP6qSlxMBCHkVSTNSGLMVu3ihTbrwnMgU GnDzlvHq7C3wrJKzA77WHRYO3ZuFFXfzfqaFDPA9VZdzy2BBg5fdZWu/TxpeNUdytwFk pa9GRwd7emTXsHHYai41r5ca14Jle452EqMHeuFHCBKctbeEyNEbxVtRKcvw/y7W9dHL 1KgSrmvYOl+0qYKjwrN1d76ooa+fNEaUi7sahoozsltzdu4erSnzN14Tftk8r+/D7KV8 vnS+01RCdy/+PFecUIWRuEMrsS+2Y8Teebt9l15GgXEcASaFBgxM3YvEPRpwvfJ0igbG uHXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nFpyrd7LeUomRGQQ6qiB/EPQz+nu7r/fVQcyVqPuYqE=; b=P4UBw5727RAK5a1ZCdIss6BOA/rBv8zVF4R77/DBPvatAfHHJln3dkMms5TgtWvjyh Nv6U6RRTmpwrvW9WQqJtSrzBjZH2IJ+8hL4VqM4ggJdPK0iDd7BqPJQaTmBTPr3yUDnP X0nSIwsRSL0ZNGVGKTAAZ5vpwPk853+1eRdC9VP5do4QkEYdlg3SC94PzgZaP/ZLsu3J b00ZiGBU1MlA2CBGXT1CU2OV5hPV+GFLFQ46fZwPRblJR7g/XRmh5ElCh4koSiO+H4Zx nD4L6YXqbw+MF4YvIU0zjBXRdNHHdFfnu42apP1ycEuP+bCRch6dQozNFtPEUcnHwMUm 4ulQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=onzUumLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a634517000000b004cc67cfc92bsi8199684pga.97.2023.04.09.01.54.57; Sun, 09 Apr 2023 01:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=onzUumLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229485AbjDIIyc (ORCPT + 99 others); Sun, 9 Apr 2023 04:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjDIIyb (ORCPT ); Sun, 9 Apr 2023 04:54:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A925146B3; Sun, 9 Apr 2023 01:54:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50F616118C; Sun, 9 Apr 2023 08:54:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E597DC433D2; Sun, 9 Apr 2023 08:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681030469; bh=Oko4BOsX0p2Y6o6EhAvfUlbM6+JFTmdsQOEDiHoM358=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=onzUumLUUOzSBwTMu2NEH3LHQRTNf1rT8aDOAraILt6dgOUsDMeeMz7qsgZdVSiL5 hOrJZR8LC4NFuKEtZbl5tfAWla+ASf9Tu4RWpQSrltlVH5p2Nvl9YlzgnM55XMe1nx FXRMKmAgztU3A6XfqvfB4iJNYFOqUOtNaYCJE5A66hZAmfqSGzosHPbiqgQfYr3IoW z28AkEihjDRfNC44CWDfZC7gGjdgrtNLhfQQ46TCIO5glcb5VHj+9kirDUEZOCMBbA AyJ9swfEsnhLgCMkbqV/opKBCBkWydMbNcQQ6E9BlOiYulnloBcTIXcrzWXLCV+448 dE8kadILXq5AQ== Date: Sun, 9 Apr 2023 11:54:25 +0300 From: Leon Romanovsky To: Bjorn Helgaas Cc: Niklas Schnelle , Saeed Mahameed , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Gerd Bayer , Alexander Schmidt , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/mlx5: stop waiting for PCI link if reset is required Message-ID: <20230409085425.GC14869@unreal> References: <20230405210613.GA3638573@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405210613.GA3638573@bhelgaas> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 04:06:13PM -0500, Bjorn Helgaas wrote: > On Tue, Apr 04, 2023 at 05:27:35PM +0200, Niklas Schnelle wrote: > > On Mon, 2023-04-03 at 21:21 +0300, Leon Romanovsky wrote: > > > On Mon, Apr 03, 2023 at 09:56:56AM +0200, Niklas Schnelle wrote: > > > > after an error on the PCI link, the driver does not need to wait > > > > for the link to become functional again as a reset is required. Stop > > > > the wait loop in this case to accelerate the recovery flow. > > > > > > > > Co-developed-by: Alexander Schmidt > > > > Signed-off-by: Alexander Schmidt > > > > Signed-off-by: Niklas Schnelle > > > > --- > > > > drivers/net/ethernet/mellanox/mlx5/core/health.c | 12 ++++++++++-- > > > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c > > > > index f9438d4e43ca..81ca44e0705a 100644 > > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c > > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c > > > > @@ -325,6 +325,8 @@ int mlx5_health_wait_pci_up(struct mlx5_core_dev *dev) > > > > while (sensor_pci_not_working(dev)) { > > > > > > According to the comment in sensor_pci_not_working(), this loop is > > > supposed to wait till PCI will be ready again. Otherwise, already in > > > first iteration, we will bail out with pci_channel_offline() error. > > > > Well yes. The problem is that this works for intermittent errors > > including when the card resets itself which seems to be the use case in > > mlx5_fw_reset_complete_reload() and mlx5_devlink_reload_fw_activate(). > > If there is a PCI error that requires a link reset though we see some > > problems though it does work after running into the timeout. > > > > As I understand it and as implemented at least on s390, > > pci_channel_io_frozen is only set for fatal errors that require a reset > > while non fatal errors will have pci_channel_io_normal (see also > > Documentation/PCI/pcieaer-howto.rst) > > Yes, I think that's true, see handle_error_source(). > > > thus I think pci_channel_offline() > > should only be true if a reset is required or there is a permanent > > error. > > Yes, I think pci_channel_offline() will only be true when a fatal > error has been reported via AER or DPC (or a hotplug driver says the > device has been removed). The driver resetting the device should not > cause such a fatal error. Thank you for an explanation and confirmation.