Re: [PATCH net-next V3 00/10] devlink: add per-port resource support
From: Or Har-Toov <hidden>
Date: 2026-03-11 18:24:21
Also in:
linux-doc, linux-kselftest, linux-rdma, lkml
On 09/03/2026 22:33, Jakub Kicinski wrote:
On Sun, 8 Mar 2026 18:03:11 +0200 Or Har-Toov wrote:quoted
Do you mean that we will register resources per port, but not show with new devlink port resource show. Instead, the current devlink resource show dev command will also display the ports of that device? For example: $ devlink resource show pci/0000:03:00.0 pci/0000:03:00.0: name local_max_SFs size 40 unit entry pci/0000:03:00.0/196608: name max_SFs size 20 unit entry pci/0000:03:00.0/196609: name max_SFs size 20 unit entry Or should we keep the current behavior where devlink resource show dev displays only device-level resources, and only the full dump shows both devices and their ports? For example: $ devlink resource show pci/0000:03:00.0: name local_max_SFs size 40 unit entry pci/0000:03:00.0/196608: name max_SFs size 20 unit entry pci/0000:03:00.0/196609: name max_SFs size 20 unit entry pci/0000:03:00.1: name local_max_SFs size 40 unit entry pci/0000:03:00.1/196608: name max_SFs size 20 unit entry pci/0000:03:00.1/196609: name max_SFs size 20 unit entry Want to confirm which behavior you meant.No strong preference on the CLI. For the kernel I think specifying the device should not exclude the port resources. Whether port resources are shown or not should be entirely up to the mask attribute. Thinking about this some more after my last reply to Jiri I think we should add that mask attribute to let user decide whether they want only the device resources, port resources or both. This will retain the exact functionality of the series. On the CLI "devlink resource show" should show all resources in the system IMO. How we define the CLI arguments to scope things down I don't have a strong opinion on.
So for the dump of all resources it is clear. But I want to make sure I understood the scope/mask part: For the dump-it command: devlink resource show pci/0000:03:00.0: <resource> pci/0000:03:00.0/196608: <port-resource> pci/0000:03:00.0/196609: <port-resource> pci/0000:03:00.1: <resource> pci/0000:03:00.1/262144: <port-resource> devlink resource show scope port pci/0000:03:00.0/196608: <port-resource> pci/0000:03:00.0/196609: <port-resource> pci/0000:03:00.1/262144: <port-resource> devlink resource show scope dev pci/0000:03:00.0: <resource> pci/0000:03:00.1: <resource> For the do-it command: devlink resource show pci/0000:03:00.0 pci/0000:03:00.0: <resource> pci/0000:03:00.0/196608: <port-resource> pci/0000:03:00.0/196609: <port-resource> devlink resource show pci/0000:03:00.0 scope port pci/0000:03:00.0/196608: <port-resource> pci/0000:03:00.0/196609: <port-resource> devlink resource show pci/0000:03:00.0 scope dev pci/0000:03:00.0: <resource> The way to get the dev or port scope will be by bitmask in the netlink message of the dump/doit command. Thank you