* [PATCH net-next] nexthop: Simplify dump error handling
@ 2024-03-07 15:47 Ido Schimmel
2024-03-07 19:28 ` David Ahern
2024-03-08 21:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ido Schimmel @ 2024-03-07 15:47 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, petrm, Ido Schimmel
The only error that can happen during a nexthop dump is insufficient
space in the skb caring the netlink messages (EMSGSIZE). If this happens
and some messages were already filled in, the nexthop code returns the
skb length to signal the netlink core that more objects need to be
dumped.
After commit b5a899154aa9 ("netlink: handle EMSGSIZE errors in the
core") there is no need to handle this error in the nexthop code as it
is now handled in the core.
Simplify the code and simply return the error to the core.
No regressions in nexthop tests:
# ./fib_nexthops.sh
Tests passed: 234
Tests failed: 0
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
net/ipv4/nexthop.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 70509da4f080..b3a24b61f76b 100644
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -3241,10 +3241,6 @@ static int rtm_dump_nexthop(struct sk_buff *skb, struct netlink_callback *cb)
err = rtm_dump_walk_nexthops(skb, cb, root, ctx,
&rtm_dump_nexthop_cb, &filter);
- if (err < 0) {
- if (likely(skb->len))
- err = skb->len;
- }
cb->seq = net->nexthop.seq;
nl_dump_check_consistent(cb, nlmsg_hdr(skb));
@@ -3439,11 +3435,6 @@ static int rtm_dump_nexthop_bucket(struct sk_buff *skb,
&rtm_dump_nexthop_bucket_cb, &dd);
}
- if (err < 0) {
- if (likely(skb->len))
- err = skb->len;
- }
-
cb->seq = net->nexthop.seq;
nl_dump_check_consistent(cb, nlmsg_hdr(skb));
return err;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nexthop: Simplify dump error handling
2024-03-07 15:47 [PATCH net-next] nexthop: Simplify dump error handling Ido Schimmel
@ 2024-03-07 19:28 ` David Ahern
2024-03-08 21:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2024-03-07 19:28 UTC (permalink / raw)
To: Ido Schimmel, netdev; +Cc: davem, kuba, pabeni, edumazet, petrm
On 3/7/24 8:47 AM, Ido Schimmel wrote:
> The only error that can happen during a nexthop dump is insufficient
> space in the skb caring the netlink messages (EMSGSIZE). If this happens
> and some messages were already filled in, the nexthop code returns the
> skb length to signal the netlink core that more objects need to be
> dumped.
>
> After commit b5a899154aa9 ("netlink: handle EMSGSIZE errors in the
> core") there is no need to handle this error in the nexthop code as it
> is now handled in the core.
>
> Simplify the code and simply return the error to the core.
>
> No regressions in nexthop tests:
>
> # ./fib_nexthops.sh
> Tests passed: 234
> Tests failed: 0
>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> net/ipv4/nexthop.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nexthop: Simplify dump error handling
2024-03-07 15:47 [PATCH net-next] nexthop: Simplify dump error handling Ido Schimmel
2024-03-07 19:28 ` David Ahern
@ 2024-03-08 21:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-08 21:20 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, petrm
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 7 Mar 2024 17:47:27 +0200 you wrote:
> The only error that can happen during a nexthop dump is insufficient
> space in the skb caring the netlink messages (EMSGSIZE). If this happens
> and some messages were already filled in, the nexthop code returns the
> skb length to signal the netlink core that more objects need to be
> dumped.
>
> After commit b5a899154aa9 ("netlink: handle EMSGSIZE errors in the
> core") there is no need to handle this error in the nexthop code as it
> is now handled in the core.
>
> [...]
Here is the summary with links:
- [net-next] nexthop: Simplify dump error handling
https://git.kernel.org/netdev/net-next/c/5d9b7cb383bb
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:[~2024-03-08 21:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07 15:47 [PATCH net-next] nexthop: Simplify dump error handling Ido Schimmel
2024-03-07 19:28 ` David Ahern
2024-03-08 21:20 ` 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).