summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorMina Almasry <almasrymina@google.com>2025-05-08 03:48:21 +0300
committerPaolo Abeni <pabeni@redhat.com>2025-05-13 12:12:48 +0300
commit03e96b8c11d140fb4ead0b30c2d6e1a294b501ef (patch)
treed37c129b0423e0e6987e9d98c84c8abb99f8b1a2 /include/net
parente39d14a760c039af0653e3df967e7525413924a0 (diff)
downloadlinux-03e96b8c11d140fb4ead0b30c2d6e1a294b501ef.tar.xz
netmem: add niov->type attribute to distinguish different net_iov types
Later patches in the series adds TX net_iovs where there is no pp associated, so we can't rely on niov->pp->mp_ops to tell what is the type of the net_iov. Add a type enum to the net_iov which tells us the net_iov type. Signed-off-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20250508004830.4100853-2-almasrymina@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netmem.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/net/netmem.h b/include/net/netmem.h
index c61d5b21e7b4..973fdbcfef38 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -20,8 +20,17 @@ DECLARE_STATIC_KEY_FALSE(page_pool_mem_providers);
*/
#define NET_IOV 0x01UL
+enum net_iov_type {
+ NET_IOV_DMABUF,
+ NET_IOV_IOURING,
+
+ /* Force size to unsigned long to make the NET_IOV_ASSERTS below pass.
+ */
+ NET_IOV_MAX = ULONG_MAX
+};
+
struct net_iov {
- unsigned long __unused_padding;
+ enum net_iov_type type;
unsigned long pp_magic;
struct page_pool *pp;
struct net_iov_area *owner;