mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
net: devmem: replace gen_pool with freelist
devmem only needs fixed-size net_iov allocations for each dma-buf binding. The gen_pool tracks the same free set indirectly through DMA addresses, which makes devmem depend on the generic allocator even though the users are fixed-size net_iov chunks. Mirror the io_uring zcrx model more closely by keeping a binding-level freelist protected by spin_lock_bh(). Use a single net_iov_area owner for the binding, populate each net_iov's DMA address while walking the SG table, and check at teardown that all net_iovs have returned to the freelist. Validate the DMA-BUF size against the net_iov size up front and derive the RX and TX entry count from it, avoiding a separate SG-table pass. Drop the NET_DEVMEM select of GENERIC_ALLOCATOR now that devmem no longer calls gen_pool APIs. Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20260917181116.3319017-2-sdf@fomichev.me Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
cd7e4b1e47
commit
083e64a3af
3 changed files with 88 additions and 110 deletions
Loading…
Add table
Add a link
Reference in a new issue