Skip to content

Commit

Permalink
page_pool: fix netlink dump stop/resume
Browse files Browse the repository at this point in the history
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: 950ab53 ("net: page_pool: implement GET in the netlink API")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Mar 4, 2024
1 parent 1ca1ba4 commit 429679d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/page_pool_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 429679d

Please sign in to comment.