Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2019 13:47:02 +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-12@freebsd.org
Subject:   svn commit: r355652 - in stable/12/sys/dev/mlx5: . mlx5_core mlx5_en
Message-ID:  <201912121347.xBCDl2VD095339@repo.freebsd.org>

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

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

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

Modified: stable/12/sys/dev/mlx5/driver.h
==============================================================================
--- stable/12/sys/dev/mlx5/driver.h	Thu Dec 12 13:46:02 2019	(r355651)
+++ stable/12/sys/dev/mlx5/driver.h	Thu Dec 12 13:47:02 2019	(r355652)
@@ -640,7 +640,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/12/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec 12 13:46:02 2019	(r355651)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec 12 13:47:02 2019	(r355652)
@@ -1606,6 +1606,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/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec 12 13:46:02 2019	(r355651)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec 12 13:47:02 2019	(r355652)
@@ -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?201912121347.xBCDl2VD095339>