[PATCH net-next V3 10/10] devlink: Document port-level resources

Tariq Toukan posted 10 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH net-next V3 10/10] devlink: Document port-level resources
Posted by Tariq Toukan 1 month, 1 week ago
From: Or Har-Toov <ohartoov@nvidia.com>

Add documentation for the port-level resource feature to
devlink-resource.rst. Port-level resources allow viewing resources
associated with specific devlink ports.

Currently, port-level resources only support the get command for
viewing resource information.

Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 .../networking/devlink/devlink-resource.rst   | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/Documentation/networking/devlink/devlink-resource.rst b/Documentation/networking/devlink/devlink-resource.rst
index b4203c498bf2..1d6d8bfa1692 100644
--- a/Documentation/networking/devlink/devlink-resource.rst
+++ b/Documentation/networking/devlink/devlink-resource.rst
@@ -94,3 +94,39 @@ attribute, which represents the pending change in size. For example:
 
 Note that changes in resource size may require a device reload to properly
 take effect.
+
+Port-level Resources
+====================
+
+In addition to device-level resources, ``devlink`` also supports port-level
+resources. These resources are associated with a specific devlink port rather
+than the device as a whole.
+
+Currently, port-level resources only support the ``GET`` command for viewing
+resource information.
+
+Port-level resources can be viewed for a specific port:
+
+.. code:: shell
+
+    $devlink port resource show pci/0000:03:00.0/196608
+    pci/0000:03:00.0/196608:
+      name max_SFs size 20 unit entry
+
+Or for ports of a specific device:
+
+.. code:: shell
+
+    $devlink port resource show pci/0000:03:00.0
+    pci/0000:03:00.0/196608:
+      name max_SFs size 20 unit entry
+
+Or for all ports across all devices:
+
+.. code:: shell
+
+    $devlink port resource show
+    pci/0000:03:00.0/196608:
+      name max_SFs size 20 unit entry
+    pci/0000:03:00.1/262144:
+      name max_SFs size 20 unit entry
-- 
2.44.0
Re: [PATCH net-next V3 10/10] devlink: Document port-level resources
Posted by Jakub Kicinski 1 month ago
On Fri, 27 Feb 2026 00:19:16 +0200 Tariq Toukan wrote:
> +Currently, port-level resources only support the ``GET`` command for viewing
> +resource information.

In case there is v4, AI says:

> +Currently, port-level resources only support the ``GET`` command for viewing
                                                         ^^^^^

This isn't a bug, but the terminology here appears inconsistent with the
rest of the documentation. The document uses user-facing command names
elsewhere (like "devlink port resource show"), but this line uses "GET
command" which seems to reference the internal DEVLINK_CMD_PORT_RESOURCE_GET
netlink command.

Should this be reworded to match the user-facing terminology used throughout
the rest of the document, perhaps "only support the show command" or
"only support viewing"?
Re: [PATCH net-next V3 10/10] devlink: Document port-level resources
Posted by Jiri Pirko 1 month ago
Tue, Mar 03, 2026 at 04:14:48AM +0100, kuba@kernel.org wrote:
>On Fri, 27 Feb 2026 00:19:16 +0200 Tariq Toukan wrote:
>> +Currently, port-level resources only support the ``GET`` command for viewing
>> +resource information.
>
>In case there is v4, AI says:
>
>> +Currently, port-level resources only support the ``GET`` command for viewing
>                                                         ^^^^^
>
>This isn't a bug, but the terminology here appears inconsistent with the
>rest of the documentation. The document uses user-facing command names
>elsewhere (like "devlink port resource show"), but this line uses "GET
>command" which seems to reference the internal DEVLINK_CMD_PORT_RESOURCE_GET
>netlink command.
>
>Should this be reworded to match the user-facing terminology used throughout
>the rest of the document, perhaps "only support the show command" or
>"only support viewing"?

AI does not see the context here. This is in-line with the rest of the
get commands.