net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags
authorMina Almasry <almasrymina@google.com>
Tue, 10 Sep 2024 17:14:54 +0000 (17:14 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Sep 2024 03:44:32 +0000 (20:44 -0700)
commit678f6e28b5f6fc2316f2c0fed8f8903101f1e128
tree8916f815367dc4c2ac01ddf8f0c56aa136a5b760
parent8f0b3cc9a4c102c24808c87f1bc943659d7a7f9f
net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

Add an interface for the user to notify the kernel that it is done
reading the devmem dmabuf frags returned as cmsg. The kernel will
drop the reference on the frags to make them available for reuse.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Kaiyuan Zhang <kaiyuanz@google.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20240910171458.219195-11-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
arch/alpha/include/uapi/asm/socket.h
arch/mips/include/uapi/asm/socket.h
arch/parisc/include/uapi/asm/socket.h
arch/sparc/include/uapi/asm/socket.h
include/uapi/asm-generic/socket.h
include/uapi/linux/uio.h
net/core/sock.c