David Wei
6e18ed929d
net: add helpers for setting a memory provider on an rx queue
...
Add helpers that properly prep or remove a memory provider for an rx
queue then restart the queue.
Reviewed-by: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com >
Signed-off-by: David Wei <dw@davidwei.uk >
Link: https://patch.msgid.link/20250204215622.695511-11-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-02-06 16:27:31 -08:00
Pavel Begunkov
56102c013f
net: page_pool: add memory provider helpers
...
Add helpers for memory providers to interact with page pools.
net_mp_niov_{set,clear}_page_pool() serve to [dis]associate a net_iov
with a page pool. If used, the memory provider is responsible to match
"set" calls with "clear" once a net_iov is not going to be used by a page
pool anymore, changing a page pool, etc.
Acked-by: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com >
Signed-off-by: David Wei <dw@davidwei.uk >
Link: https://patch.msgid.link/20250204215622.695511-10-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-02-06 16:27:31 -08:00
Pavel Begunkov
f8350a4358
net: page_pool: add a mp hook to unregister_netdevice*
...
Devmem TCP needs a hook in unregister_netdevice_many_notify() to upkeep
the set tracking queues it's bound to, i.e. ->bound_rxqs. Instead of
devmem sticking directly out of the genetic path, add a mp function.
Reviewed-by: Jakub Kicinski <kuba@kernel.org >
Reviewed-by: Mina Almasry <almasrymina@google.com >
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com >
Signed-off-by: David Wei <dw@davidwei.uk >
Link: https://patch.msgid.link/20250204215622.695511-8-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-02-06 16:27:31 -08:00
Pavel Begunkov
2508a46f92
net: page_pool: add callback for mp info printing
...
Add a mandatory callback that prints information about the memory
provider to netlink.
Reviewed-by: Jakub Kicinski <kuba@kernel.org >
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com >
Signed-off-by: David Wei <dw@davidwei.uk >
Link: https://patch.msgid.link/20250204215622.695511-7-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-02-06 16:27:31 -08:00
Pavel Begunkov
57afb48301
net: page_pool: create hooks for custom memory providers
...
A spin off from the original page pool memory providers patch by Jakub,
which allows extending page pools with custom allocators. One of such
providers is devmem TCP, and the other is io_uring zerocopy added in
following patches.
Link: https://lore.kernel.org/netdev/20230707183935.997267-7-kuba@kernel.org/
Co-developed-by: Jakub Kicinski <kuba@kernel.org > # initial mp proposal
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com >
Signed-off-by: David Wei <dw@davidwei.uk >
Link: https://patch.msgid.link/20250204215622.695511-5-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-02-06 16:27:30 -08:00