From bef8442f5ffab8b6b846199850247fe5e2d383f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Fri, 25 Sep 2026 21:39:07 +0000 Subject: [PATCH] netlink: specs: devlink: fix resource-scope type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The correct type for resource-scope is flags, not enum: - DEVLINK_RESOURCE_SCOPE_DEV is _BITUL(0) aka. 1, not 0. - DEVLINK_RESOURCE_SCOPE_PORT is _BITUL(1) aka. 2, not 1. This patch also removes "enum-as-flags", as it is now redundant, these changes does not change the generated policy. Before this patch, this generated devlink-user.c function call: devlink_resource_scope_str(DEVLINK_RESOURCE_SCOPE_DEV) returned "port", not "dev", as it didn't use ffs() to convert the value. CC: Jiri Pirko CC: Tariq Toukan Reviewed-by: Moshe Shemesh Reviewed-by: Jakub Kicinski Signed-off-by: Asbjørn Sloth Tønnesen Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20260925213918.204767-5-ast@fiberby.net Signed-off-by: Paolo Abeni --- Documentation/netlink/specs/devlink.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml index 1de0daa0f921..4706de628392 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -158,7 +158,7 @@ definitions: - name: entry - - type: enum + type: flags name: resource-scope entries: - @@ -903,7 +903,6 @@ attribute-sets: name: resource-scope-mask type: u32 enum: resource-scope - enum-as-flags: true doc: | Bitmask selecting which resource classes to include in a resource-dump response. Bit 0 (dev) selects device-level