diff mbox series

[net-next] devlink: fix port dump cmd type

Message ID 20240216113147.50797-1-jiri@resnulli.us (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] devlink: fix port dump cmd type | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 942 this patch: 942
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 958 this patch: 958
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 959 this patch: 959
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-19--18-00 (tests: 1449)

Commit Message

Jiri Pirko Feb. 16, 2024, 11:31 a.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

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.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 net/devlink/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Feb. 19, 2024, 3:13 p.m. UTC | #1
On Fri, Feb 16, 2024 at 12:31:47PM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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.

I guess that in theory unknown implementations could exist.
But, ok :)

> 
> Omit the fixes tag, even thought this is fix, better to target this for
> next release.
> 
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>

Reviewed-by: Simon Horman <horms@kernel.org>
Jakub Kicinski Feb. 19, 2024, 8:20 p.m. UTC | #2
On Mon, 19 Feb 2024 15:13:43 +0000 Simon Horman wrote:
> > 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.  
> 
> I guess that in theory unknown implementations could exist.
> But, ok :)

I'd also prefer Fixes tag + net. YNL is user space, even if current YNL
specs don't trigger it (I'm speculating that that's why you feel it's
not a fix) someone may end up using YNL + YAML from 6.9 and expect it
to work on 6.6 LTS.
Jiri Pirko Feb. 20, 2024, 7:42 a.m. UTC | #3
Mon, Feb 19, 2024 at 09:20:38PM CET, kuba@kernel.org wrote:
>On Mon, 19 Feb 2024 15:13:43 +0000 Simon Horman wrote:
>> > 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.  
>> 
>> I guess that in theory unknown implementations could exist.
>> But, ok :)
>
>I'd also prefer Fixes tag + net. YNL is user space, even if current YNL
>specs don't trigger it (I'm speculating that that's why you feel it's
>not a fix) someone may end up using YNL + YAML from 6.9 and expect it
>to work on 6.6 LTS.

As you wish.

>-- 
>pw-bot: cr
diff mbox series

Patch

diff --git a/net/devlink/port.c b/net/devlink/port.c
index 78592912f657..4b2d46ccfe48 100644
--- a/net/devlink/port.c
+++ b/net/devlink/port.c
@@ -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);