virtio/vsock: send credit update during setting SO_RCVLOWAT
authorArseniy Krasnov <avkrasnov@salutedevices.com>
Thu, 14 Dec 2023 12:52:29 +0000 (15:52 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Dec 2023 10:37:35 +0000 (10:37 +0000)
commit0fe1798968115488c0c02f4633032a015b1faf97
tree93c1841ec7259c8be1b0ef2636440c4858f8ff10
parent93b80887668226180ea5f5349cc728ca6dc700ab
virtio/vsock: send credit update during setting SO_RCVLOWAT

Send credit update message when SO_RCVLOWAT is updated and it is bigger
than number of bytes in rx queue. It is needed, because 'poll()' will
wait until number of bytes in rx queue will be not smaller than
O_RCVLOWAT, so kick sender to send more data. Otherwise mutual hungup
for tx/rx is possible: sender waits for free space and receiver is
waiting data in 'poll()'.

Rename 'set_rcvlowat' callback to 'notify_set_rcvlowat' and set
'sk->sk_rcvlowat' only in one place (i.e. 'vsock_set_rcvlowat'), so the
transport doesn't need to do it.

Fixes: b89d882dc9fc ("vsock/virtio: reduce credit update messages")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vsock.c
include/linux/virtio_vsock.h
include/net/af_vsock.h
net/vmw_vsock/af_vsock.c
net/vmw_vsock/hyperv_transport.c
net/vmw_vsock/virtio_transport.c
net/vmw_vsock/virtio_transport_common.c
net/vmw_vsock/vsock_loopback.c