Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2019 13:48:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r355653 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en
Message-ID:  <201912121348.xBCDmOwj097165@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Dec 12 13:48:23 2019
New Revision: 355653
URL: https://svnweb.freebsd.org/changeset/base/355653

Log:
  MFC r355422:
  mlx5: Do not poke hardware for statistic after teardown is started.

Modified:
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/driver.h
==============================================================================
--- stable/11/sys/dev/mlx5/driver.h	Thu Dec 12 13:47:02 2019	(r355652)
+++ stable/11/sys/dev/mlx5/driver.h	Thu Dec 12 13:48:23 2019	(r355653)
@@ -614,7 +614,8 @@ enum mlx5_device_state {
 };
 
 enum mlx5_interface_state {
-	MLX5_INTERFACE_STATE_UP,
+	MLX5_INTERFACE_STATE_UP = 0x1,
+	MLX5_INTERFACE_STATE_TEARDOWN = 0x2,
 };
 
 enum mlx5_pci_status {

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec 12 13:47:02 2019	(r355652)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec 12 13:48:23 2019	(r355653)
@@ -1588,6 +1588,8 @@ static void shutdown_one(struct pci_dev *pdev)
 	/* enter polling mode */
 	mlx5_cmd_use_polling(dev);
 
+	set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state);
+
 	/* disable all interrupts */
 	mlx5_disable_interrupts(dev);
 

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec 12 13:47:02 2019	(r355652)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec 12 13:48:23 2019	(r355653)
@@ -1037,9 +1037,10 @@ mlx5e_update_stats_work(struct work_struct *work)
 {
 	struct mlx5e_priv *priv;
 
-	priv  = container_of(work, struct mlx5e_priv, update_stats_work);
+	priv = container_of(work, struct mlx5e_priv, update_stats_work);
 	PRIV_LOCK(priv);
-	if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0)
+	if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 &&
+	    !test_bit(MLX5_INTERFACE_STATE_TEARDOWN, &priv->mdev->intf_state))
 		mlx5e_update_stats_locked(priv);
 	PRIV_UNLOCK(priv);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912121348.xBCDmOwj097165>