Re: [PATCH net-next v22 04/13] netdev: netdevice devmem allocator

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-08-28 02:15:22
Also in
bpf, dri-devel, linux-alpha, linux-arch, linux-doc, linux-kselftest, linux-media, linux-mips, lkml, netdev, sparclinux
Reply to
Mina Almasry, 2024-08-25
On Sun, 25 Aug 2024 04:15:02 +0000 Mina Almasry wrote:
quoted hunk ↗ jump to hunk
+void net_devmem_free_dmabuf(struct net_iov *niov)
+{
+	struct net_devmem_dmabuf_binding *binding = net_iov_binding(niov);
+	unsigned long dma_addr = net_devmem_get_dma_addr(niov);
+
+	if (gen_pool_has_addr(binding->chunk_pool, dma_addr, PAGE_SIZE))
+		gen_pool_free(binding->chunk_pool, dma_addr, PAGE_SIZE);
Is the check necessary for correctness? Should it perhaps be a WARN
under DEBUG_NET instead? The rest LGTM:

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Thread (19 messages) 19 messages, 2 authors, last reply 2024-08-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help