vsock: enable setting SO_ZEROCOPY
authorArseniy Krasnov <avkrasnov@salutedevices.com>
Tue, 10 Oct 2023 19:15:20 +0000 (22:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2023 12:19:42 +0000 (13:19 +0100)
commite0718bd82e27d85086ada18e7f04847ee84b710a
tree5462edbaf0a6e52199bfe069302649e6620086d7
parentcfdca3904687d851436076080779c271bc31eb20
vsock: enable setting SO_ZEROCOPY

For AF_VSOCK, zerocopy tx mode depends on transport, so this option must
be set in AF_VSOCK implementation where transport is accessible (if
transport is not set during setting SO_ZEROCOPY: for example socket is
not connected, then SO_ZEROCOPY will be enabled, but once transport will
be assigned, support of this type of transmission will be checked).

To handle SO_ZEROCOPY, AF_VSOCK implementation uses SOCK_CUSTOM_SOCKOPT
bit, thus handling SOL_SOCKET option operations, but all of them except
SO_ZEROCOPY will be forwarded to the generic handler by calling
'sock_setsockopt()'.

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