Skip to contentSkip to conversation

page_pool: fix netlink dump stop/resume

PATCH Applied Jakub Kicinski 3 participants 3 messages Mar 1, 2024 – Mar 4, 2024

Subsystems (2)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 page_pool: fix netlink dump stop/resume

If message fills up we need to stop writing. 'break' will only get us out of the iteration over pools of a single netdev, we need to also stop walking netdevs.

This results in either infinite dump, or missing pools, depending on whether message full happens on the last netdev (infinite dump) or non-last (missing pools).

Fixes 950ab53b77ab ("net: page_pool: implement GET in the netlink API")

---
CC: [email protected]

---
 net/core/page_pool_user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/page_pool_user.c +2 -1
index ffe5244e5597..278294aca66a 100644
@@ -94,11 +94,12 @@ netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback *cb,
 			state->pp_id = pool->user.id;
 			err = fill(skb, pool, info);
 			if (err)
-				break;
+				goto out;
 		}
 
 		state->pp_id = 0;
 	}
+out:
 	mutex_unlock(&page_pools_lock);
 	rtnl_unlock();
 
Signature · 1 line
2.43.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jakub Kicinski

If message fills up we need to stop writing. 'break' will only get us out of the iteration over pools of a single netdev, we need to also stop walking netdevs.

This results in either infinite dump, or missing pools, depending on whether message full happens on the last netdev (infinite dump) or non-last (missing pools).

Fixes 950ab53b77ab ("net: page_pool: implement GET in the netlink API")
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

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

Quoted 9 lines · On Thu, 29 Feb 2024 17:13:31 -0800 you wrote:

If message fills up we need to stop writing. 'break' will only get us out of the iteration over pools of a single netdev, we need to also stop walking netdevs.

This results in either infinite dump, or missing pools, depending on whether message full happens on the last netdev (infinite dump) or non-last (missing pools).

[...]

Here is the summary with links:
- [net] page_pool: fix netlink dump stop/resume

    https://git.kernel.org/netdev/net/c/429679dcf7d9

You are awesome, thank you!

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