Message ID | 20240625120807.1165581-3-amcohen@nvidia.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Adjust page pool netlink filling to non common case | expand |
diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c index 44948f7b9d68..ce4a34adad8a 100644 --- a/net/core/page_pool_user.c +++ b/net/core/page_pool_user.c @@ -92,7 +92,7 @@ netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback *cb, continue; state->pp_id = pool->user.id; - err = fill(skb, pool, info, pool->slow.netdev->ifindex); + err = fill(skb, pool, info, netdev->ifindex); if (err) goto out; }
Currently, to dump all page pools, there is a loop which iterates over all netdevices in the relevant net, then, for each netdevice, iterate over all page pools which are attached to this netdevice, and call the fill() function with the pool. With the exiting code, the netlink message is filled with 'pool->slow.netdev->ifindex', which means that if a pool is used by several netdevices, it will not be dumped with the real netdevice via page-pool-get/page-pool-stats-get, as this pointer should be NULL in such case. Change 'ifindex' which is passed to fill() function, pass the 'ifindex' of the netdevice which the pool is stored in its list. This should not change the behavior for drivers which has netdevice per page pool, as the same value is passed now. It will allow drivers which have page pool for several netdevices to dump all the pools. The drivers just need to make 'netdev->page_pools' list to hold all the pools which the netdevice consumes pages from. Note that 'ifindex' for get command is not changed. Signed-off-by: Amit Cohen <amcohen@nvidia.com> --- net/core/page_pool_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)