Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: net: description of MSG_ZEROCOPY for AF_VSOCK

This adds description of MSG_ZEROCOPY flag support for AF_VSOCK type of
socket.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arseniy Krasnov and committed by
David S. Miller
bac2cac1 e0718bd8

+11 -2
+11 -2
Documentation/networking/msg_zerocopy.rst
··· 7 7 ===== 8 8 9 9 The MSG_ZEROCOPY flag enables copy avoidance for socket send calls. 10 - The feature is currently implemented for TCP and UDP sockets. 10 + The feature is currently implemented for TCP, UDP and VSOCK (with 11 + virtio transport) sockets. 11 12 12 13 13 14 Opportunity and Caveats ··· 175 174 is encoded in the standard error format, sock_extended_err. 176 175 177 176 The level and type fields in the control data are protocol family 178 - specific, IP_RECVERR or IPV6_RECVERR. 177 + specific, IP_RECVERR or IPV6_RECVERR (for TCP or UDP socket). 178 + For VSOCK socket, cmsg_level will be SOL_VSOCK and cmsg_type will be 179 + VSOCK_RECVERR. 179 180 180 181 Error origin is the new type SO_EE_ORIGIN_ZEROCOPY. ee_errno is zero, 181 182 as explained before, to avoid blocking read and write system calls on ··· 238 235 Loopback 239 236 -------- 240 237 238 + For TCP and UDP: 241 239 Data sent to local sockets can be queued indefinitely if the receive 242 240 process does not read its socket. Unbound notification latency is not 243 241 acceptable. For this reason all packets generated with MSG_ZEROCOPY 244 242 that are looped to a local socket will incur a deferred copy. This 245 243 includes looping onto packet sockets (e.g., tcpdump) and tun devices. 246 244 245 + For VSOCK: 246 + Data path sent to local sockets is the same as for non-local sockets. 247 247 248 248 Testing 249 249 ======= ··· 260 254 namespaces, the test will not show any improvement. For testing, the 261 255 loopback restriction can be temporarily relaxed by making 262 256 skb_orphan_frags_rx identical to skb_orphan_frags. 257 + 258 + For VSOCK type of socket example can be found in 259 + tools/testing/vsock/vsock_test_zerocopy.c.