diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-02-04 13:56:19 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-06 16:27:31 -0800 |
| commit | 69e39537b66232103633f685b208f293bf9a15b5 (patch) | |
| tree | ca848f5a85135fb942d389e8b1c0610327e74a6b /net/core/devmem.c | |
| parent | f8350a4358fc9c4801f2f4229cf9b6e678055d9a (diff) | |
| download | linux-next-69e39537b66232103633f685b208f293bf9a15b5.tar.gz linux-next-69e39537b66232103633f685b208f293bf9a15b5.zip | |
net: prepare for non devmem TCP memory providers
There is a good bunch of places in generic paths assuming that the only
page pool memory provider is devmem TCP. As we want to reuse the net_iov
and provider infrastructure, we need to patch it up and explicitly check
the provider type when we branch into devmem TCP code.
Reviewed-by: Mina Almasry <almasrymina@google.com>
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-9-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/devmem.c')
| -rw-r--r-- | net/core/devmem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/devmem.c b/net/core/devmem.c index cbac6419fcc4..7c6e0b5b6acb 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -30,6 +30,11 @@ static DEFINE_XARRAY_FLAGS(net_devmem_dmabuf_bindings, XA_FLAGS_ALLOC1); static const struct memory_provider_ops dmabuf_devmem_ops; +bool net_is_devmem_iov(struct net_iov *niov) +{ + return niov->pp->mp_ops == &dmabuf_devmem_ops; +} + static void net_devmem_dmabuf_free_chunk_owner(struct gen_pool *genpool, struct gen_pool_chunk *chunk, void *not_used) |
