aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/devmem.c
diff options
context:
space:
mode:
authorMina Almasry <[email protected]>2025-05-08 00:48:21 +0000
committerPaolo Abeni <[email protected]>2025-05-13 09:12:48 +0000
commit03e96b8c11d140fb4ead0b30c2d6e1a294b501ef (patch)
treed37c129b0423e0e6987e9d98c84c8abb99f8b1a2 /net/core/devmem.c
parentnet: dsa: b53: implement setting ageing time (diff)
downloadkernel-03e96b8c11d140fb4ead0b30c2d6e1a294b501ef.tar.gz
kernel-03e96b8c11d140fb4ead0b30c2d6e1a294b501ef.zip
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/devmem.c')
-rw-r--r--net/core/devmem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/devmem.c b/net/core/devmem.c
index 6e27a47d0493..f5c3a7e6dbb7 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -30,7 +30,7 @@ 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;
+ return niov->type == NET_IOV_DMABUF;
}
static void net_devmem_dmabuf_free_chunk_owner(struct gen_pool *genpool,
@@ -266,6 +266,7 @@ net_devmem_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd,
for (i = 0; i < owner->area.num_niovs; i++) {
niov = &owner->area.niovs[i];
+ niov->type = NET_IOV_DMABUF;
niov->owner = &owner->area;
page_pool_set_dma_addr_netmem(net_iov_to_netmem(niov),
net_devmem_get_dma_addr(niov));