Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Dec 2019 15:21:13 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355422 - in head/sys/dev/mlx5: . mlx5_core mlx5_en
Message-ID:  <201912051521.xB5FLDVK046099@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Dec  5 15:21:13 2019
New Revision: 355422
URL: https://svnweb.freebsd.org/changeset/base/355422

Log:
  mlx5: Do not poke hardware for statistic after teardown is started.
  
  Sponsored by:	Mellanox Technologies
  MFC after:	1 week

Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/driver.h
==============================================================================
--- head/sys/dev/mlx5/driver.h	Thu Dec  5 15:16:19 2019	(r355421)
+++ head/sys/dev/mlx5/driver.h	Thu Dec  5 15:21:13 2019	(r355422)
@@ -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: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec  5 15:16:19 2019	(r355421)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Thu Dec  5 15:21:13 2019	(r355422)
@@ -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: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec  5 15:16:19 2019	(r355421)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu Dec  5 15:21:13 2019	(r355422)
@@ -1038,9 +1038,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?201912051521.xB5FLDVK046099>