netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC net-next 0/4] Adjust page pool netlink filling to non common case
@ 2024-06-25 12:08 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
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Amit Cohen @ 2024-06-25 12:08 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, hawk, idosch, petrm, mlxsw, netdev,
	Amit Cohen

Most network drivers has 1:1 mapping between netdevice and event queues,
so then each page pool is used by only one netdevice. This is not the case
in mlxsw driver.

Currently, the netlink message is filled with 'pool->slow.netdev->ifindex',
which should be NULL in case that several netdevices use the same pool.
Adjust page pool netlink filling to use the netdevice which the pool is
stored in its list. See more info in commit messages.

Without this set, mlxsw driver cannot dump all page pools:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
	--dump page-pool-stats-get --output-json | jq
[]

With this set, "dump" command prints all the page pools for all the
netdevices:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
	--dump page-pool-get --output-json | \
	jq -e ".[] | select(.ifindex == 64)" | grep "napi-id" | wc -l
56

From driver POV, such queries are supported by associating the pools with
an unregistered netdevice (dummy netdevice). The following limitations
are caused by such implementation:
1. The get command output specifies the 'ifindex' as 0, which is
meaningless. `iproute2` will print this as "*", but there might be other
tools which fail in such case.
2. get command does not work when devlink instance is reloaded to namespace
which is not the initial one, as the dummy device associated with the pools
belongs to the initial namespace.
See examples in commit messages.

We would like to expose page pool stats and info via the standard
interface, but such implementation is not perfect. An additional option
is to use debugfs, but we prefer to avoid it, if it is possible. Any
suggestions for better implementation in case of pool for several
netdevices will be welcomed.

Patch set overview:
Patch #1 makes netlink filling code more flex
Patch #2 changes the 'ifindex' which is used for dump
Patch #3 sets netdevice for page pools in mlxsw driver, to allow "do"
commands
Patch #4 sets page pools list for netdevices in mlxsw driver, to allow
"dump" commands

Amit Cohen (4):
  net: core: page_pool_user: Allow flexibility of 'ifindex' value
  net: core: page_pool_user: Change 'ifindex' for page pool dump
  mlxsw: pci: Allow get page pool info/stats via netlink
  mlxsw: Set page pools list for netdevices

 drivers/net/ethernet/mellanox/mlxsw/core.c    |  6 +++++
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  2 ++
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |  9 ++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  2 ++
 net/core/page_pool_user.c                     | 22 +++++++++----------
 5 files changed, 29 insertions(+), 12 deletions(-)

-- 
2.45.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-25 15:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH RFC net-next 2/4] net: core: page_pool_user: Change 'ifindex' for page pool dump Amit Cohen
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

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).