* [PATCH net-next] net: devmem: remove net_iov_area base_virtual
@ 2026-10-05 20:18 Stanislav Fomichev
2026-10-06 7:10 ` Mina Almasry
2026-10-07 2:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2026-10-05 20:18 UTC (permalink / raw)
To: netdev
Cc: davem, edumazet, kuba, pabeni, edumazet, horms, sdf,
bobbyeshleman, almasrymina, linux-kernel
Since commit 083e64a3af77 ("net: devmem: replace gen_pool with
freelist"), a binding has a single net_iov_area covering the whole
dma-buf, and base_virtual is always 0. Its only reader is
net_iov_virtual_addr(), where it adds nothing. io_uring zcrx never
uses it.
Drop the field and the store, and compute the dma-buf offset from the
net_iov index alone.
No functional change. From review feedback on:
https://lore.kernel.org/netdev/asPUZ8DPllHd6Yu9@devvm7509.cco0.facebook.com/
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
include/net/netmem.h | 3 ---
net/core/devmem.c | 1 -
net/core/devmem.h | 3 +--
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/net/netmem.h b/include/net/netmem.h
index cc97611632dc..0cc8572f62ca 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -102,9 +102,6 @@ struct net_iov_area {
/* Array of net_iovs for this area. */
struct net_iov *niovs;
size_t num_niovs;
-
- /* Offset into the dma-buf where this chunk starts. */
- unsigned long base_virtual;
};
static inline struct net_iov_area *net_iov_owner(const struct net_iov *niov)
diff --git a/net/core/devmem.c b/net/core/devmem.c
index 71c83730d73d..07c62e2e3088 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -252,7 +252,6 @@ net_devmem_bind_dmabuf(struct net_device *dev, void *vdev,
goto err_unmap;
}
- binding->area.base_virtual = 0;
binding->area.num_niovs = dmabuf->size >> niov_shift;
if (direction == DMA_TO_DEVICE) {
binding->tx_vec = kvmalloc_objs(struct net_iov *,
diff --git a/net/core/devmem.h b/net/core/devmem.h
index 28d6fa7bcb57..1cec10f0257c 100644
--- a/net/core/devmem.h
+++ b/net/core/devmem.h
@@ -112,8 +112,7 @@ static inline unsigned long net_iov_virtual_addr(const struct net_iov *niov)
struct net_devmem_dmabuf_binding *binding =
net_devmem_iov_binding(niov);
- return net_iov_owner(niov)->base_virtual +
- ((unsigned long)net_iov_idx(niov) << binding->niov_shift);
+ return (unsigned long)net_iov_idx(niov) << binding->niov_shift;
}
static inline bool
--
2.53.0-Meta
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: devmem: remove net_iov_area base_virtual
2026-10-05 20:18 [PATCH net-next] net: devmem: remove net_iov_area base_virtual Stanislav Fomichev
@ 2026-10-06 7:10 ` Mina Almasry
2026-10-07 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Mina Almasry @ 2026-10-06 7:10 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: netdev, davem, edumazet, kuba, pabeni, edumazet, horms, sdf,
bobbyeshleman, linux-kernel
On Mon, Oct 5, 2026 at 1:18 PM Stanislav Fomichev <sdf.kernel@gmail.com> wrote:
>
> Since commit 083e64a3af77 ("net: devmem: replace gen_pool with
> freelist"), a binding has a single net_iov_area covering the whole
> dma-buf, and base_virtual is always 0. Its only reader is
> net_iov_virtual_addr(), where it adds nothing. io_uring zcrx never
> uses it.
>
> Drop the field and the store, and compute the dma-buf offset from the
> net_iov index alone.
>
> No functional change. From review feedback on:
> https://lore.kernel.org/netdev/asPUZ8DPllHd6Yu9@devvm7509.cco0.facebook.com/
>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Acked-by: Mina Almasry <almasrymina@google.com>
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: devmem: remove net_iov_area base_virtual
2026-10-05 20:18 [PATCH net-next] net: devmem: remove net_iov_area base_virtual Stanislav Fomichev
2026-10-06 7:10 ` Mina Almasry
@ 2026-10-07 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-07 2:00 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: netdev, davem, edumazet, kuba, pabeni, edumazet, horms, sdf,
bobbyeshleman, almasrymina, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 5 Oct 2026 13:18:22 -0700 you wrote:
> Since commit 083e64a3af77 ("net: devmem: replace gen_pool with
> freelist"), a binding has a single net_iov_area covering the whole
> dma-buf, and base_virtual is always 0. Its only reader is
> net_iov_virtual_addr(), where it adds nothing. io_uring zcrx never
> uses it.
>
> Drop the field and the store, and compute the dma-buf offset from the
> net_iov index alone.
>
> [...]
Here is the summary with links:
- [net-next] net: devmem: remove net_iov_area base_virtual
https://git.kernel.org/netdev/net-next/c/7d3e5984d0fc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-07 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 20:18 [PATCH net-next] net: devmem: remove net_iov_area base_virtual Stanislav Fomichev
2026-10-06 7:10 ` Mina Almasry
2026-10-07 2:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®