From: Amit Cohen <amcohen@nvidia.com>
To: <kuba@kernel.org>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<hawk@kernel.org>, <idosch@nvidia.com>, <petrm@nvidia.com>,
<mlxsw@nvidia.com>, <netdev@vger.kernel.org>,
Amit Cohen <amcohen@nvidia.com>
Subject: [PATCH RFC net-next 2/4] net: core: page_pool_user: Change 'ifindex' for page pool dump
Date: Tue, 25 Jun 2024 15:08:05 +0300 [thread overview]
Message-ID: <20240625120807.1165581-3-amcohen@nvidia.com> (raw)
In-Reply-To: <20240625120807.1165581-1-amcohen@nvidia.com>
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(-)
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;
}
--
2.45.1
next prev parent reply other threads:[~2024-06-25 12:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 12:08 [PATCH RFC net-next 0/4] Adjust page pool netlink filling to non common case Amit Cohen
2024-06-25 12:08 ` [PATCH RFC net-next 1/4] net: core: page_pool_user: Allow flexibility of 'ifindex' value Amit Cohen
2024-06-25 12:08 ` Amit Cohen [this message]
2024-06-25 12:08 ` [PATCH RFC net-next 3/4] mlxsw: pci: Allow get page pool info/stats via netlink Amit Cohen
2024-06-25 12:08 ` [PATCH RFC net-next 4/4] mlxsw: Set page pools list for netdevices Amit Cohen
2024-06-25 14:35 ` [PATCH RFC net-next 0/4] Adjust page pool netlink filling to non common case Jakub Kicinski
2024-06-25 15:37 ` Amit Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240625120807.1165581-3-amcohen@nvidia.com \
--to=amcohen@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).