Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Stanislav Fomichev
Wed, 11 Nov 2026 22:47
[PATCH net-next v4 3/5] net: devmem: use niov_shift in net_devmem_get_niov_at()
Author: Stanislav Fomichev
Date: Wed, 11 Nov 2026 22:47
Date: Wed, 11 Nov 2026 22:47
38 lines
12269 bytes
12269 bytes
TX bindings use PAGE_SIZE net_iovs, and the TX lookup hard-codes it.
Derive the index and offset from binding->niov_shift instead, so TX
bindings can use larger net_iovs. No functional change, TX bindings are
still created with PAGE_SHIFT.
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
---
net/core/devmem.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/core/devmem.c b/net/core/devmem.c
index 5c7d9640e9d1..c6868f39261a 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -581,13 +581,15 @@ struct net_iov *
net_devmem_get_niov_at(struct net_devmem_dmabuf_binding *binding,
size_t virt_addr, size_t *off, size_t *size)
{
+ size_t niov_size = 1UL << binding->niov_shift;
+
if (virt_addr >= binding->dmabuf->size)
return NULL;
- *off = virt_addr % PAGE_SIZE;
- *size = PAGE_SIZE - *off;
+ *off = virt_addr & (niov_size - 1);
+ *size = niov_size - *off;
- return binding->tx_vec[virt_addr / PAGE_SIZE];
+ return binding->tx_vec[virt_addr >> binding->niov_shift];
}
/*** "Dmabuf devmem memory provider" ***/
--
2.53.0-Meta
Re: [PATCH net-next v4 3/5] net: devmem: use niov_shift in net_devmem_get_niov_at()
Author: Breno Leitao
Date: Fri, 13 Nov 2026 12:05
Date: Fri, 13 Nov 2026 12:05
12 lines
9273 bytes
9273 bytes
On Wed, Nov 11, 2026 at 02:47:38PM -0800, Stanislav Fomichev wrote: > TX bindings use PAGE_SIZE net_iovs, and the TX lookup hard-codes it. > Derive the index and offset from binding->niov_shift instead, so TX > bindings can use larger net_iovs. No functional change, TX bindings are > still created with PAGE_SHIFT. > > Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> > Reviewed-by: Mina Almasry <almasrymina@google.com> > Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Breno Leitao <leitao@debian.org>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads