Skip to contentSkip to conversation

devlink: fix port dump cmd type

PATCH Applied Jiri Pirko 3 participants 3 messages Feb 20, 2024 – Feb 22, 2024

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 devlink: fix port dump cmd type

From: Jiri Pirko <[email protected]>

Unlike other commands, due to a c&p error, port dump fills-up cmd with wrong value, different from port-get request cmd, port-get doit reply and port notification.

Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

Skimmed through devlink userspace implementations, none of them cares about this cmd value. Only ynl, for which, this is actually a fix, as it expects doit and dumpit ops rsp_value to be the same.

Omit the fixes tag, even thought this is fix, better to target this for next release.

Fixes bfcd3a466172 ("Introduce devlink infrastructure")

---
v1->v2:
- target net and add fixes tag

---
 net/devlink/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/devlink/port.c +1 -1
index 78592912f657..4b2d46ccfe48 100644
@@ -583,7 +583,7 @@ devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
 
 	xa_for_each_start(&devlink->ports, port_index, devlink_port, state->idx) {
 		err = devlink_nl_port_fill(msg, devlink_port,
-					   DEVLINK_CMD_NEW,
+					   DEVLINK_CMD_PORT_NEW,
 					   NETLINK_CB(cb->skb).portid,
 					   cb->nlh->nlmsg_seq, flags,
 					   cb->extack);
Signature · 1 line
2.43.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Tue, 20 Feb 2024 08:52:45 +0100 Jiri Pirko wrote:

Unlike other commands, due to a c&p error, port dump fills-up cmd with wrong value, different from port-get request cmd, port-get doit reply and port notification.

Quoted 8 lines

Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

Skimmed through devlink userspace implementations, none of them cares about this cmd value. Only ynl, for which, this is actually a fix, as it expects doit and dumpit ops rsp_value to be the same.

Omit the fixes tag, even thought this is fix, better to target this for next release.

#2 lore raw
In reply to Jiri Pirko
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 20 Feb 2024 08:52:45 +0100 you wrote:

From: Jiri Pirko <[email protected]>

Unlike other commands, due to a c&p error, port dump fills-up cmd with wrong value, different from port-get request cmd, port-get doit reply and port notification.

Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

[...]

Here is the summary with links:
- [net] devlink: fix port dump cmd type

    https://git.kernel.org/netdev/net/c/61c43780e944

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html