svn commit: r353189 - stable/11/sys/dev/mlx5/mlx5_core

Hans Petter Selasky hselasky at FreeBSD.org
Mon Oct 7 08:40:34 UTC 2019


Author: hselasky
Date: Mon Oct  7 08:40:34 2019
New Revision: 353189
URL: https://svnweb.freebsd.org/changeset/base/353189

Log:
  MFC r352958:
  Make sure the number of IRQ vectors doesn't exceed 256 in mlx5core.
  The "intr" field in "struct mlx5_ifc_eqc_bits" is only 8 bits wide.
  
  Sponsored by:	Mellanox Technologies

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

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Mon Oct  7 08:39:55 2019	(r353188)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Mon Oct  7 08:40:34 2019	(r353189)
@@ -275,7 +275,10 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev)
 	else
 		nvec += MLX5_CAP_GEN(dev, num_ports) * num_online_cpus();
 
-	nvec = min_t(int, nvec, num_eqs);
+	if (nvec > num_eqs)
+		nvec = num_eqs;
+	if (nvec > 256)
+		nvec = 256;	/* limit of firmware API */
 	if (nvec <= MLX5_EQ_VEC_COMP_BASE)
 		return -ENOMEM;
 


More information about the svn-src-all mailing list