Re: [PATCH net-next v4 5/9] net: add devmem TCP TX documentation
From: Bagas Sanjaya
Date: Thu Feb 20 2025 - 03:14:09 EST
On Thu, Feb 20, 2025 at 02:09:10AM +0000, Mina Almasry wrote:
> +The user application must use MSG_ZEROCOPY flag when sending devmem TCP. Devmem
> +cannot be copied by the kernel, so the semantics of the devmem TX are similar
> +to the semantics of MSG_ZEROCOPY.
> +
> + setsockopt(socket_fd, SOL_SOCKET, SO_ZEROCOPY, &opt, sizeof(opt));
> +
> +It is also recommended that the user binds the TX socket to the same interface
> +the dma-buf has been bound to via SO_BINDTODEVICE.
> +
> + setsockopt(socket_fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname) + 1);
> +
Wrap both setsockopts above in literal code-block (just like other snippets
for consistency).
> +The user should create a msghdr where,
> +
> +iov_base is set to the offset into the dmabuf to start sending from.
> +iov_len is set to the number of bytes to be sent from the dmabuf.
Should above be bullet list?
Thanks.
--
An old man doll... just what I always wanted! - Clara
Attachment:
signature.asc
Description: PGP signature