Skip to content

Commit 8f4cd89

Browse files
williamtukuba-moo
authored andcommitted
devlink: Fix length of eswitch inline-mode
Set eswitch inline-mode to be u8, not u16. Otherwise, errors below $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev \ inline-mode network Error: Attribute failed policy validation. kernel answers: Numerical result out of rang netlink: 'devlink': attribute type 26 has an invalid length. Fixes: f2f9dd1 ("netlink: specs: devlink: add the remaining command to generate complete split_ops") Signed-off-by: William Tu <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c8a5c73 commit 8f4cd89

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/netlink/specs/devlink.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ attribute-sets:
290290
enum: eswitch-mode
291291
-
292292
name: eswitch-inline-mode
293-
type: u16
293+
type: u8
294294
enum: eswitch-inline-mode
295295
-
296296
name: dpipe-tables

net/devlink/netlink_gen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITC
198198
[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
199199
[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
200200
[DEVLINK_ATTR_ESWITCH_MODE] = NLA_POLICY_MAX(NLA_U16, 1),
201-
[DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U16, 3),
201+
[DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U8, 3),
202202
[DEVLINK_ATTR_ESWITCH_ENCAP_MODE] = NLA_POLICY_MAX(NLA_U8, 1),
203203
};
204204

0 commit comments

Comments
 (0)