Re: [PATCH net-next v4 5/9] net: add devmem TCP TX documentation

From
Bagas Sanjaya <hidden>
Date
2025-02-20 08:13:40
Also in
kvm, linux-doc, linux-kselftest, lkml, virtualization
Reply to
Mina Almasry, 2025-02-20
On Thu, Feb 20, 2025 at 02:09:10AM +0000, Mina Almasry wrote:
quoted hunk ↗ jump to hunk
+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).
quoted hunk ↗ jump to hunk
+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

Attachments

Thread (24 messages) 24 messages, 3 authors, last reply 2025-02-22
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