Allow filtering the resource dump to device-level or port-level resources using the 'scope' option. Example - dump only device-level resources: $ 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 Example - dump only port-level resources: $ devlink resource show scope port 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/196708: name max_SFs size 128 unit entry dpipe_tables none pci/0000:03:00.1/196709: name max_SFs size 128 unit entry dpipe_tables none
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -645,6 +645,7 @@ enum devlink_attr { · 644 unmodified lines | ||
| 645 | 645 | DEVLINK_ATTR_PARAM_RESET_DEFAULT, /* flag */ |
| 646 | 646 | |
| 647 | 647 | DEVLINK_ATTR_INDEX, /* uint */ |
| 648 | + DEVLINK_ATTR_RESOURCE_SCOPE_MASK, /* u32 */ | |
| 648 | 649 | |
| 649 | 650 | /* Add new attributes above here, update the spec in |
| 650 | 651 | * Documentation/netlink/specs/devlink.yaml and re-generate |
| @@ -704,6 +705,16 @@ enum devlink_resource_unit { · 53 unmodified lines | ||
| 704 | 705 | DEVLINK_RESOURCE_UNIT_ENTRY, |
| 705 | 706 | }; |
| 706 | 707 | |
| 708 | +enum devlink_resource_scope { | |
| 709 | + DEVLINK_RESOURCE_SCOPE_DEV_BIT, | |
| 710 | + DEVLINK_RESOURCE_SCOPE_PORT_BIT, | |
| 711 | +}; | |
| 712 | + | |
| 713 | +#define DEVLINK_RESOURCE_SCOPE_DEV \ | |
| 714 | + _BITUL(DEVLINK_RESOURCE_SCOPE_DEV_BIT) | |
| 715 | +#define DEVLINK_RESOURCE_SCOPE_PORT \ | |
| 716 | + _BITUL(DEVLINK_RESOURCE_SCOPE_PORT_BIT) | |
| 717 | + | |
| 707 | 718 | enum devlink_port_fn_attr_cap { |
| 708 | 719 | DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT, |
| 709 | 720 | DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT, |