Date: Thu, 2 Aug 2018 08:51:56 +0000 (UTC) From: Hans Petter Selasky <hselasky@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: r337112 - stable/11/sys/dev/mlx5/mlx5_core Message-ID: <201808020851.w728pusZ060855@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Aug 2 08:51:55 2018 New Revision: 337112 URL: https://svnweb.freebsd.org/changeset/base/337112 Log: MFC r336410: Add module parameter to limit number of MSIX EQ vectors in mlx5en(4). For setups having a large amount of PCI devices, it makes sense to limit the number of MSIX vectors per PCI device, in order to avoid running out of IRQ vectors. 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 Thu Aug 2 08:50:28 2018 (r337111) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Aug 2 08:51:55 2018 (r337112) @@ -61,6 +61,10 @@ static int prof_sel = MLX5_DEFAULT_PROF; module_param_named(prof_sel, prof_sel, int, 0444); MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); +static int mlx5_core_msix_eqvec; +module_param_named(msix_eqvec, mlx5_core_msix_eqvec, int, 0644); +MODULE_PARM_DESC(msix_eqvec, "Maximum number of MSIX event queue vectors"); + #define NUMA_NO_NODE -1 static LIST_HEAD(intf_list); @@ -239,11 +243,15 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev) struct mlx5_priv *priv = &dev->priv; struct mlx5_eq_table *table = &priv->eq_table; int num_eqs = 1 << MLX5_CAP_GEN(dev, log_max_eq); - int nvec; + int limit = mlx5_core_msix_eqvec; + int nvec = MLX5_EQ_VEC_COMP_BASE; int i; - nvec = MLX5_CAP_GEN(dev, num_ports) * num_online_cpus() + - MLX5_EQ_VEC_COMP_BASE; + if (limit > 0) + nvec += limit; + else + nvec += MLX5_CAP_GEN(dev, num_ports) * num_online_cpus(); + nvec = min_t(int, nvec, num_eqs); if (nvec <= MLX5_EQ_VEC_COMP_BASE) return -ENOMEM;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808020851.w728pusZ060855>