Hi Jakub,

On 19/03/2026 04:56, Jakub Kicinski wrote:
> NIPA tries to make sure that HW tests don't modify system state.
> It saves the state of page pools, too. Now that I write this commit
> message I realize that this is impractical since page pool IDs and
> state will get legitimately changed by the tests. But I already
> spent a couple of hours implementing the filtering, so..
> 
> Signed-off-by: Jakub Kicinski <[email protected]>

[...]

> diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
> index ee5060d8eec0..01509d1b3cba 100644
> --- a/net/core/page_pool_user.c
> +++ b/net/core/page_pool_user.c
> @@ -79,7 +79,7 @@ struct page_pool_dump_cb {
>  
>  static int
>  netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback 
> *cb,
> -                          pp_nl_fill_cb fill)
> +                          pp_nl_fill_cb fill, struct nlattr *ifindex_attr)
>  {
>       struct page_pool_dump_cb *state = (void *)cb->ctx;
>       const struct genl_info *info = genl_info_dump(cb);
> @@ -88,9 +88,17 @@ netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct 
> netlink_callback *cb,
>       struct page_pool *pool;
>       int err = 0;
>  
> +     if (ifindex_attr)
> +             state->ifindex = nla_get_u32(ifindex_attr);
> +
>       rtnl_lock();
>       mutex_lock(&page_pools_lock);
>       for_each_netdev_dump(net, netdev, state->ifindex) {
> +             /* Either the provided ifindex doesn't exist or done dumping */
> +             if (ifindex_attr &&
> +                 netdev->ifindex != nla_get_u32(ifindex_attr))
> +                     break;

If the passed ifindex doesn't exist, isn't netdev NULL here ?

Maxime

Reply via email to