All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Shay Drory <shayd@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next v0 01/14] devlink: Add new "io_eq_size" generic device param
Date: Tue, 21 Dec 2021 19:15:51 -0800	[thread overview]
Message-ID: <20211222031604.14540-2-saeed@kernel.org> (raw)
In-Reply-To: <20211222031604.14540-1-saeed@kernel.org>

From: Shay Drory <shayd@nvidia.com>

Add new device generic parameter to determine the size of the
I/O completion EQs.

For example, to reduce I/O EQ size to 64, execute:
$ devlink dev param set pci/0000:06:00.0 \
              name io_eq_size value 64 cmode driverinit
$ devlink dev reload pci/0000:06:00.0

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 Documentation/networking/devlink/devlink-params.rst | 3 +++
 include/net/devlink.h                               | 4 ++++
 net/core/devlink.c                                  | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index b7dfe693a332..547c0b430c9e 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -129,3 +129,6 @@ own name.
        will NACK any attempt of other host to reset the device. This parameter
        is useful for setups where a device is shared by different hosts, such
        as multi-host setup.
+   * - ``io_eq_size``
+     - u32
+     - Control the size of I/O completion EQs.
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 3276a29f2b81..b5f4acd0e0cd 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -459,6 +459,7 @@ enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA,
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET,
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_IWARP,
+	DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -511,6 +512,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_ENABLE_IWARP_NAME "enable_iwarp"
 #define DEVLINK_PARAM_GENERIC_ENABLE_IWARP_TYPE DEVLINK_PARAM_TYPE_BOOL
 
+#define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME "io_eq_size"
+#define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
 {									\
 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 0a9349a02cad..e2e38b8872c8 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4466,6 +4466,11 @@ static const struct devlink_param devlink_param_generic[] = {
 		.name = DEVLINK_PARAM_GENERIC_ENABLE_IWARP_NAME,
 		.type = DEVLINK_PARAM_GENERIC_ENABLE_IWARP_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE,
+		.name = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME,
+		.type = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)
-- 
2.33.1


  reply	other threads:[~2021-12-22  3:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  3:15 [pull request][net-next v0 00/14] mlx5 updates 2021-12-21 Saeed Mahameed
2021-12-22  3:15 ` Saeed Mahameed [this message]
2021-12-23  1:30   ` [net-next v0 01/14] devlink: Add new "io_eq_size" generic device param patchwork-bot+netdevbpf
2021-12-22  3:15 ` [net-next v0 02/14] net/mlx5: Let user configure io_eq_size param Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 03/14] devlink: Add new "event_eq_size" generic device param Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 04/14] net/mlx5: Let user configure event_eq_size param Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 05/14] devlink: Clarifies max_macs generic devlink param Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 06/14] net/mlx5: Let user configure max_macs generic param Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 07/14] net/mlx5: Remove the repeated declaration Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 08/14] net/mlx5e: Use bitmap field for profile features Saeed Mahameed
2021-12-22  3:15 ` [net-next v0 09/14] net/mlx5e: Add profile indications for PTP and QOS HTB features Saeed Mahameed
2021-12-22  3:16 ` [net-next v0 10/14] net/mlx5e: Save memory by using dynamic allocation in netdev priv Saeed Mahameed
2021-12-22  3:16 ` [net-next v0 11/14] net/mlx5e: Allow profile-specific limitation on max num of channels Saeed Mahameed
2021-12-22  3:16 ` [net-next v0 12/14] net/mlx5e: Use dynamic per-channel allocations in stats Saeed Mahameed
2021-12-22  3:16 ` [net-next v0 13/14] net/mlx5e: Allocate per-channel stats dynamically at first usage Saeed Mahameed
2021-12-22  3:16 ` [net-next v0 14/14] net/mlx5e: Take packet_merge params directly from the RX res struct Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211222031604.14540-2-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.