svn commit: r358014 - in stable/12/sys/dev/mlx5: . mlx5_core
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Feb 17 09:53:24 UTC 2020
Author: hselasky
Date: Mon Feb 17 09:53:23 2020
New Revision: 358014
URL: https://svnweb.freebsd.org/changeset/base/358014
Log:
MFC r357801:
Add support for disabling and polling MSIX interrupts in mlx5core.
Sponsored by: Mellanox Technologies
Modified:
stable/12/sys/dev/mlx5/driver.h
stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c
stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/mlx5/driver.h
==============================================================================
--- stable/12/sys/dev/mlx5/driver.h Mon Feb 17 09:46:32 2020 (r358013)
+++ stable/12/sys/dev/mlx5/driver.h Mon Feb 17 09:53:23 2020 (r358014)
@@ -1184,4 +1184,7 @@ static inline bool mlx5_rl_is_supported(struct mlx5_co
}
#endif
+void mlx5_disable_interrupts(struct mlx5_core_dev *);
+void mlx5_poll_interrupts(struct mlx5_core_dev *);
+
#endif /* MLX5_DRIVER_H */
Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Feb 17 09:46:32 2020 (r358013)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Feb 17 09:53:23 2020 (r358014)
@@ -739,3 +739,28 @@ static void mlx5_port_general_notification_event(struc
}
}
+void
+mlx5_disable_interrupts(struct mlx5_core_dev *dev)
+{
+ int nvec = dev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
+ int x;
+
+ for (x = 0; x != nvec; x++)
+ disable_irq(dev->priv.msix_arr[x].vector);
+}
+
+void
+mlx5_poll_interrupts(struct mlx5_core_dev *dev)
+{
+ struct mlx5_eq *eq;
+
+ if (unlikely(dev->priv.disable_irqs != 0))
+ return;
+
+ mlx5_eq_int(dev, &dev->priv.eq_table.cmd_eq);
+ mlx5_eq_int(dev, &dev->priv.eq_table.async_eq);
+ mlx5_eq_int(dev, &dev->priv.eq_table.pages_eq);
+
+ list_for_each_entry(eq, &dev->priv.eq_table.comp_eqs_list, list)
+ mlx5_eq_int(dev, eq);
+}
Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Feb 17 09:46:32 2020 (r358013)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Feb 17 09:53:23 2020 (r358014)
@@ -1585,7 +1585,7 @@ done:
return 0;
}
-static void mlx5_disable_interrupts(struct mlx5_core_dev *mdev)
+static void mlx5_shutdown_disable_interrupts(struct mlx5_core_dev *mdev)
{
int nvec = mdev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
int x;
@@ -1609,7 +1609,7 @@ static void shutdown_one(struct pci_dev *pdev)
set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state);
/* disable all interrupts */
- mlx5_disable_interrupts(dev);
+ mlx5_shutdown_disable_interrupts(dev);
err = mlx5_try_fast_unload(dev);
if (err)
More information about the svn-src-stable-12
mailing list