From owner-svn-src-all@freebsd.org Thu Sep 6 12:41:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9880AFFA280; Thu, 6 Sep 2018 12:41:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6D275295; Thu, 6 Sep 2018 12:41:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F7ED51CB; Thu, 6 Sep 2018 12:41:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86CfA8h056755; Thu, 6 Sep 2018 12:41:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86Cf9Ej056754; Thu, 6 Sep 2018 12:41:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061241.w86Cf9Ej056754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 12:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338493 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 338493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2018 12:41:10 -0000 Author: hselasky Date: Thu Sep 6 12:41:09 2018 New Revision: 338493 URL: https://svnweb.freebsd.org/changeset/base/338493 Log: Make the MSIX module parameter limit per device, in mlx5en(4). MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Sep 6 12:28:06 2018 (r338492) +++ head/sys/dev/mlx5/driver.h Thu Sep 6 12:41:09 2018 (r338493) @@ -682,6 +682,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: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Sep 6 12:28:06 2018 (r338492) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Sep 6 12:41:09 2018 (r338493) @@ -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; @@ -1206,6 +1202,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); @@ -1221,6 +1218,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); @@ -1256,6 +1259,7 @@ clean_health: close_pci: mlx5_pci_close(dev, priv); clean_dev: + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); return err; } @@ -1276,6 +1280,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); }