netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps
@ 2023-11-26 22:58 Jakub Kicinski
  2023-11-28 17:48 ` Simon Horman
  2023-11-29 16:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-11-26 22:58 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, f.fainelli, mkubecek

The default dump handler needs to clear ret before returning.
Otherwise if the last interface returns an inconsequential
error this error will propagate to user space.

This may confuse user space (ethtool CLI seems to ignore it,
but YNL doesn't). It will also terminate the dump early
for mutli-skb dump, because netlink core treats EOPNOTSUPP
as a real error.

Fixes: 728480f12442 ("ethtool: default handlers for GET requests")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: f.fainelli@gmail.com
CC: mkubecek@suse.cz
---
 net/ethtool/netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index 3bbd5afb7b31..fe3553f60bf3 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -505,6 +505,7 @@ static int ethnl_default_dumpit(struct sk_buff *skb,
 				ret = skb->len;
 			break;
 		}
+		ret = 0;
 	}
 	rtnl_unlock();
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps
  2023-11-26 22:58 [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps Jakub Kicinski
@ 2023-11-28 17:48 ` Simon Horman
  2023-11-29 16:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-11-28 17:48 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, f.fainelli, mkubecek

On Sun, Nov 26, 2023 at 02:58:06PM -0800, Jakub Kicinski wrote:
> The default dump handler needs to clear ret before returning.
> Otherwise if the last interface returns an inconsequential
> error this error will propagate to user space.
> 
> This may confuse user space (ethtool CLI seems to ignore it,
> but YNL doesn't). It will also terminate the dump early
> for mutli-skb dump, because netlink core treats EOPNOTSUPP
> as a real error.
> 
> Fixes: 728480f12442 ("ethtool: default handlers for GET requests")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps
  2023-11-26 22:58 [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps Jakub Kicinski
  2023-11-28 17:48 ` Simon Horman
@ 2023-11-29 16:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-11-29 16:50 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, f.fainelli, mkubecek

Hello:

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

On Sun, 26 Nov 2023 14:58:06 -0800 you wrote:
> The default dump handler needs to clear ret before returning.
> Otherwise if the last interface returns an inconsequential
> error this error will propagate to user space.
> 
> This may confuse user space (ethtool CLI seems to ignore it,
> but YNL doesn't). It will also terminate the dump early
> for mutli-skb dump, because netlink core treats EOPNOTSUPP
> as a real error.
> 
> [...]

Here is the summary with links:
  - [net] ethtool: don't propagate EOPNOTSUPP from dumps
    https://git.kernel.org/netdev/net/c/cbeb989e41f4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-29 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-26 22:58 [PATCH net] ethtool: don't propagate EOPNOTSUPP from dumps Jakub Kicinski
2023-11-28 17:48 ` Simon Horman
2023-11-29 16:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).