Re: [PATCH net-next v14 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

From
Nikolay Aleksandrov <razor@blackwall.org>
Date
2024-06-26 11:14:35
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-06-25
On 25/06/2024 22:53, Mina Almasry wrote:
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 <redacted>
Signed-off-by: Mina Almasry <redacted>

---

v10:
- Fix leak of tokens (Nikolay).

v7:
- Updated SO_DEVMEM_* uapi to use the next available entry (Arnd).

v6:
- Squash in locking optimizations from edumazet@google.com. With his
   changes we lock the xarray once per sock_devmem_dontneed operation
   rather than once per frag.

Changes in v1:
- devmemtoken -> dmabuf_token (David).
- Use napi_pp_put_page() for refcounting (Yunsheng).
- Fix build error with missing socket options on other asms.

---
  arch/alpha/include/uapi/asm/socket.h  |  1 +
  arch/mips/include/uapi/asm/socket.h   |  1 +
  arch/parisc/include/uapi/asm/socket.h |  1 +
  arch/sparc/include/uapi/asm/socket.h  |  1 +
  include/uapi/asm-generic/socket.h     |  1 +
  include/uapi/linux/uio.h              |  4 ++
  net/core/sock.c                       | 61 +++++++++++++++++++++++++++
  7 files changed, 70 insertions(+)
FWIW,
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>

Thread (22 messages) 22 messages, 4 authors, last reply 2024-06-27
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