Date: Mon, 10 Sep 2018 08:13:33 +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: r338554 - in stable/11/sys/dev/mlx5: . mlx5_core Message-ID: <201809100813.w8A8DXdx087204@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Sep 10 08:13:33 2018 New Revision: 338554 URL: https://svnweb.freebsd.org/changeset/base/338554 Log: MFC r338493: Make the MSIX module parameter limit per device, in mlx5en(4). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Sep 10 08:10:52 2018 (r338553) +++ stable/11/sys/dev/mlx5/driver.h Mon Sep 10 08:13:33 2018 (r338554) @@ -656,6 +656,9 @@ struct mlx5_core_dev { struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; struct mlx5_dump_data *dump_data; + + struct sysctl_ctx_list sysctl_ctx; + int msix_eqvec; }; enum { Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 10 08:10:52 2018 (r338553) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 10 08:13:33 2018 (r338554) @@ -61,10 +61,6 @@ 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); @@ -243,7 +239,7 @@ 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 limit = mlx5_core_msix_eqvec; + int limit = dev->msix_eqvec; int nvec = MLX5_EQ_VEC_COMP_BASE; int i; @@ -1188,6 +1184,7 @@ static int init_one(struct pci_dev *pdev, { struct mlx5_core_dev *dev; struct mlx5_priv *priv; + device_t bsddev = pdev->dev.bsddev; int err; dev = kzalloc(sizeof(*dev), GFP_KERNEL); @@ -1203,6 +1200,12 @@ static int init_one(struct pci_dev *pdev, dev->pdev = pdev; dev->event = mlx5_core_event; + sysctl_ctx_init(&dev->sysctl_ctx); + SYSCTL_ADD_INT(&dev->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), + OID_AUTO, "msix_eqvec", CTLFLAG_RDTUN, &dev->msix_eqvec, 0, + "Maximum number of MSIX event queue vectors, if set"); + INIT_LIST_HEAD(&priv->ctx_list); spin_lock_init(&priv->ctx_lock); mutex_init(&dev->pci_status_mutex); @@ -1238,6 +1241,7 @@ clean_health: close_pci: mlx5_pci_close(dev, priv); clean_dev: + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); return err; } @@ -1258,6 +1262,7 @@ static void remove_one(struct pci_dev *pdev) mlx5_health_cleanup(dev); mlx5_pci_close(dev, priv); pci_set_drvdata(pdev, NULL); + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809100813.w8A8DXdx087204>