public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Gerd Bayer <gbayer@linux.ibm.com>,
	Alexander Schmidt <alexs@linux.ibm.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] net/mlx5: stop waiting for PCI link if reset is required
Date: Thu, 13 Apr 2023 16:01:37 -0700	[thread overview]
Message-ID: <ZDiJ0f5kxgJ4Bpb7@x130> (raw)
In-Reply-To: <20230411105103.2835394-1-schnelle@linux.ibm.com>

On 11 Apr 12:51, 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 <alexs@linux.ibm.com>
>Signed-off-by: Alexander Schmidt <alexs@linux.ibm.com>
>Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
>Link: https://lore.kernel.org/r/20230403075657.168294-1-schnelle@linux.ibm.com
>Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
>---
> 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)) {
> 		if (time_after(jiffies, end))
> 			return -ETIMEDOUT;
>+		if (pci_channel_offline(dev->pdev))
>+			return -EIO;

We already sent a patch to net not too long a go to break this while loop
when there is a triggered reset:
  
net/mlx5: Stop waiting for PCI up if teardown was triggered
https://lore.kernel.org/netdev/20230314054234.267365-3-saeed@kernel.org/

Usually when the pci goes offline, either the PCI subsystem will detect
that and will trigger the mlx5 teardown or mlx5 health check will detect it
and will initiate the teardown, in both ways the MLX5_BREAK_FW_WAIT flag
will be raised and the loop will quit, please let me know if you think 
the extra check of pci_channel_offline(dev->pdev) is still required here
for your system.



      parent reply	other threads:[~2023-04-13 23:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 10:51 [PATCH net-next v2] net/mlx5: stop waiting for PCI link if reset is required Niklas Schnelle
2023-04-12 23:33 ` Jacob Keller
2023-04-13 23:01 ` Saeed Mahameed [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDiJ0f5kxgJ4Bpb7@x130 \
    --to=saeed@kernel.org \
    --cc=alexs@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gbayer@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=schnelle@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox