# 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 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2024/06/2654014
- Thread: https://ratatoskr.run/netdev/2024/06/2653048/t.md

```text
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>


```
