Netdev List
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: Carolina Jubran <cjubran@nvidia.com>, Chris Mi <cmi@nvidia.com>,
	"Cosmin Ratiu" <cratiu@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	Jiri Pirko <jiri@resnulli.us>, Jonathan Corbet <corbet@lwn.net>,
	Kees Cook <kees@kernel.org>, Leon Romanovsky <leon@kernel.org>,
	<linux-doc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, Mark Bloch <mbloch@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>,
	Or Har-Toov <ohartoov@nvidia.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Saeed Mahameed <saeedm@nvidia.com>, Shay Drori <shayd@nvidia.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Simon Horman <horms@kernel.org>, Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH net-next] net/mlx5: Remove max_external_SFs device resource
Date: Sun, 11 Oct 2026 12:38:28 +0300	[thread overview]
Message-ID: <20261011093828.784454-1-tariqt@nvidia.com> (raw)

From: Or Har-Toov <ohartoov@nvidia.com>

The device-level max_external_SFs resource is redundant now that
per-port max_SFs resources are registered on each PF port representor.
Users can look up SF limits per-port directly via 'devlink port show'
to correlate with controller number and pfnum.

Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 .../networking/devlink/devlink-resource.rst   |  4 ----
 .../net/ethernet/mellanox/mlx5/core/devlink.h |  1 -
 .../ethernet/mellanox/mlx5/core/sf/hw_table.c | 19 ++++++-------------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/Documentation/networking/devlink/devlink-resource.rst b/Documentation/networking/devlink/devlink-resource.rst
index 47eec8f875b4..b7172d94b2c6 100644
--- a/Documentation/networking/devlink/devlink-resource.rst
+++ b/Documentation/networking/devlink/devlink-resource.rst
@@ -89,14 +89,12 @@ To list resources for all devlink devices and ports:
     $ devlink resource show
     pci/0000:03:00.0:
       name max_local_SFs size 128 unit entry dpipe_tables none
-      name max_external_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.0/196608:
       name max_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.0/196609:
       name max_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.1:
       name max_local_SFs size 128 unit entry dpipe_tables none
-      name max_external_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.1/196708:
       name max_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.1/196709:
@@ -124,10 +122,8 @@ To dump only device-level resources across all devices:
     $ devlink resource show scope dev
     pci/0000:03:00.0:
       name max_local_SFs size 128 unit entry dpipe_tables none
-      name max_external_SFs size 128 unit entry dpipe_tables none
     pci/0000:03:00.1:
       name max_local_SFs size 128 unit entry dpipe_tables none
-      name max_external_SFs size 128 unit entry dpipe_tables none
 
 To dump only port-level resources across all devices:
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
index 4fbb3926a3e5..b4092eadfe53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
@@ -8,7 +8,6 @@
 
 enum mlx5_devlink_resource_id {
 	MLX5_DL_RES_MAX_LOCAL_SFS = 1,
-	MLX5_DL_RES_MAX_EXTERNAL_SFS,
 
 	__MLX5_ID_RES_MAX,
 	MLX5_ID_RES_MAX = __MLX5_ID_RES_MAX - 1,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c
index 1724bf7e0e7a..c36dbd7de877 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c
@@ -262,24 +262,17 @@ static void mlx5_sf_hw_table_res_unregister(struct mlx5_core_dev *dev)
 	devl_resources_unregister(priv_to_devlink(dev));
 }
 
-static int mlx5_sf_hw_table_res_register(struct mlx5_core_dev *dev, u16 max_fn,
-					 u16 max_ext_fn)
+static int mlx5_sf_hw_table_res_register(struct mlx5_core_dev *dev,
+					 u16 max_fn)
 {
 	struct devlink_resource_size_params size_params;
 	struct devlink *devlink = priv_to_devlink(dev);
-	int err;
 
 	devlink_resource_size_params_init(&size_params, max_fn, max_fn, 1,
 					  DEVLINK_RESOURCE_UNIT_ENTRY);
-	err = devl_resource_register(devlink, "max_local_SFs", max_fn, MLX5_DL_RES_MAX_LOCAL_SFS,
-				     DEVLINK_RESOURCE_ID_PARENT_TOP, &size_params);
-	if (err)
-		return err;
-
-	devlink_resource_size_params_init(&size_params, max_ext_fn, max_ext_fn, 1,
-					  DEVLINK_RESOURCE_UNIT_ENTRY);
-	return devl_resource_register(devlink, "max_external_SFs", max_ext_fn,
-				      MLX5_DL_RES_MAX_EXTERNAL_SFS, DEVLINK_RESOURCE_ID_PARENT_TOP,
+	return devl_resource_register(devlink, "max_local_SFs", max_fn,
+				      MLX5_DL_RES_MAX_LOCAL_SFS,
+				      DEVLINK_RESOURCE_ID_PARENT_TOP,
 				      &size_params);
 }
 
@@ -303,7 +296,7 @@ int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev)
 	if (err)
 		return err;
 
-	if (mlx5_sf_hw_table_res_register(dev, max_fn, max_ext_fn))
+	if (mlx5_sf_hw_table_res_register(dev, max_fn))
 		mlx5_core_dbg(dev, "failed to register max SFs resources");
 
 	if (!max_fn && !max_ext_fn && !mlx5_esw_has_spf_sfs(dev))

base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
-- 
2.44.0


             reply	other threads:[~2026-10-11  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11  9:38 Tariq Toukan [this message]
2026-10-12  9:40 ` [PATCH net-next] net/mlx5: Remove max_external_SFs device resource netdev-bot+sashiko

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=20261011093828.784454-1-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=cmi@nvidia.com \
    --cc=corbet@lwn.net \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=ohartoov@nvidia.com \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    --cc=skhan@linuxfoundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox