diff mbox series

[net] devlink: fix port new reply cmd type

Message ID 20240318091908.2736542-1-jiri@resnulli.us (mailing list archive)
State Accepted
Commit 78a2f5e6c15d8dcbd6495bb9635c7cb89235dfc5
Delegated to: Netdev Maintainers
Headers show
Series [net] devlink: fix port new reply 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
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 941 this patch: 941
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: saeedm@nvidia.com; 1 maintainers not CCed: saeedm@nvidia.com
netdev/build_clang success Errors and warnings before: 957 this patch: 957
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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 958 this patch: 958
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-03-19--18-00 (tests: 907)

Commit Message

Jiri Pirko March 18, 2024, 9:19 a.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

Due to a c&p error, port new reply fills-up cmd with wrong value,
any other existing port command replies and notifications.

Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

Skimmed through devlink userspace implementations, none of them cares
about this cmd value.

Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
Closes: https://lore.kernel.org/all/ZfZcDxGV3tSy4qsV@cy-server/
Fixes: cd76dcd68d96 ("devlink: Support add and delete devlink port")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 net/devlink/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Parav Pandit March 18, 2024, 1:57 p.m. UTC | #1
> From: Jiri Pirko <jiri@resnulli.us>
> Sent: Monday, March 18, 2024 2:49 PM
> To: netdev@vger.kernel.org
> Cc: kuba@kernel.org; pabeni@redhat.com; davem@davemloft.net;
> edumazet@google.com; Parav Pandit <parav@nvidia.com>
> 
> From: Jiri Pirko <jiri@nvidia.com>
> 
> Due to a c&p error, port new reply fills-up cmd with wrong value, any other
> existing port command replies and notifications.
> 
I didn't understand 'c&p' error. Did you mean command and port?

> Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.
> 
> Skimmed through devlink userspace implementations, none of them cares
> about this cmd value.
> 
> Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Closes: https://lore.kernel.org/all/ZfZcDxGV3tSy4qsV@cy-server/
> Fixes: cd76dcd68d96 ("devlink: Support add and delete devlink port")
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
> ---
>  net/devlink/port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/devlink/port.c b/net/devlink/port.c index
> 4b2d46ccfe48..118d130d2afd 100644
> --- a/net/devlink/port.c
> +++ b/net/devlink/port.c
> @@ -889,7 +889,7 @@ int devlink_nl_port_new_doit(struct sk_buff *skb,
> struct genl_info *info)
>  		err = -ENOMEM;
>  		goto err_out_port_del;
>  	}
> -	err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
> +	err = devlink_nl_port_fill(msg, devlink_port,
> DEVLINK_CMD_PORT_NEW,
>  				   info->snd_portid, info->snd_seq, 0, NULL);
>  	if (WARN_ON_ONCE(err))
>  		goto err_out_msg_free;
> --
> 2.44.0

Subject should start with upper case.. 

Thanks,
Reviewed-by: Parav Pandit <parav@nvidia.com>
Jiri Pirko March 18, 2024, 2:21 p.m. UTC | #2
Mon, Mar 18, 2024 at 02:57:21PM CET, parav@nvidia.com wrote:
>> From: Jiri Pirko <jiri@resnulli.us>
>> Sent: Monday, March 18, 2024 2:49 PM
>> To: netdev@vger.kernel.org
>> Cc: kuba@kernel.org; pabeni@redhat.com; davem@davemloft.net;
>> edumazet@google.com; Parav Pandit <parav@nvidia.com>
>> 
>> From: Jiri Pirko <jiri@nvidia.com>
>> 
>> Due to a c&p error, port new reply fills-up cmd with wrong value, any other
>> existing port command replies and notifications.
>> 
>I didn't understand 'c&p' error. Did you mean command and port?

copy&paste :)


>
>> Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.
>> 
>> Skimmed through devlink userspace implementations, none of them cares
>> about this cmd value.
>> 
>> Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
>> Closes: https://lore.kernel.org/all/ZfZcDxGV3tSy4qsV@cy-server/
>> Fixes: cd76dcd68d96 ("devlink: Support add and delete devlink port")
>> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
>> ---
>>  net/devlink/port.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/net/devlink/port.c b/net/devlink/port.c index
>> 4b2d46ccfe48..118d130d2afd 100644
>> --- a/net/devlink/port.c
>> +++ b/net/devlink/port.c
>> @@ -889,7 +889,7 @@ int devlink_nl_port_new_doit(struct sk_buff *skb,
>> struct genl_info *info)
>>  		err = -ENOMEM;
>>  		goto err_out_port_del;
>>  	}
>> -	err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
>> +	err = devlink_nl_port_fill(msg, devlink_port,
>> DEVLINK_CMD_PORT_NEW,
>>  				   info->snd_portid, info->snd_seq, 0, NULL);
>>  	if (WARN_ON_ONCE(err))
>>  		goto err_out_msg_free;
>> --
>> 2.44.0
>
>Subject should start with upper case.. 

I don't see why.


>
>Thanks,
>Reviewed-by: Parav Pandit <parav@nvidia.com>
>
Kalesh Anakkur Purayil March 18, 2024, 2:24 p.m. UTC | #3
On Mon, Mar 18, 2024 at 2:49 PM Jiri Pirko <jiri@resnulli.us> wrote:
>
> From: Jiri Pirko <jiri@nvidia.com>
>
> Due to a c&p error, port new reply fills-up cmd with wrong value,
> any other existing port command replies and notifications.
>
> Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.
>
> Skimmed through devlink userspace implementations, none of them cares
> about this cmd value.
>
> Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Closes: https://lore.kernel.org/all/ZfZcDxGV3tSy4qsV@cy-server/
> Fixes: cd76dcd68d96 ("devlink: Support add and delete devlink port")
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>

LGTM,
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> ---
>  net/devlink/port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/devlink/port.c b/net/devlink/port.c
> index 4b2d46ccfe48..118d130d2afd 100644
> --- a/net/devlink/port.c
> +++ b/net/devlink/port.c
> @@ -889,7 +889,7 @@ int devlink_nl_port_new_doit(struct sk_buff *skb, struct genl_info *info)
>                 err = -ENOMEM;
>                 goto err_out_port_del;
>         }
> -       err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
> +       err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW,
>                                    info->snd_portid, info->snd_seq, 0, NULL);
>         if (WARN_ON_ONCE(err))
>                 goto err_out_msg_free;
> --
> 2.44.0
>
>
patchwork-bot+netdevbpf@kernel.org March 20, 2024, 3:10 a.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 18 Mar 2024 10:19:08 +0100 you wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> Due to a c&p error, port new reply fills-up cmd with wrong value,
> any other existing port command replies and notifications.
> 
> Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.
> 
> [...]

Here is the summary with links:
  - [net] devlink: fix port new reply cmd type
    https://git.kernel.org/netdev/net/c/78a2f5e6c15d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/devlink/port.c b/net/devlink/port.c
index 4b2d46ccfe48..118d130d2afd 100644
--- a/net/devlink/port.c
+++ b/net/devlink/port.c
@@ -889,7 +889,7 @@  int devlink_nl_port_new_doit(struct sk_buff *skb, struct genl_info *info)
 		err = -ENOMEM;
 		goto err_out_port_del;
 	}
-	err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
+	err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW,
 				   info->snd_portid, info->snd_seq, 0, NULL);
 	if (WARN_ON_ONCE(err))
 		goto err_out_msg_free;