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

virtio/vsock: check SO_RCVLOWAT before wake up reader

This adds extra condition to wake up data reader: do it only when number
of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick
user,because it will wait until SO_RCVLOWAT bytes will be dequeued. This
check is performed in vsock_data_ready().

Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Arseniy Krasnov and committed by
Paolo Abeni
39f1ed33 f2fdcf67

+1 -1
+1 -1
net/vmw_vsock/virtio_transport_common.c
··· 1081 1081 switch (le16_to_cpu(pkt->hdr.op)) { 1082 1082 case VIRTIO_VSOCK_OP_RW: 1083 1083 virtio_transport_recv_enqueue(vsk, pkt); 1084 - sk->sk_data_ready(sk); 1084 + vsock_data_ready(sk); 1085 1085 return err; 1086 1086 case VIRTIO_VSOCK_OP_CREDIT_REQUEST: 1087 1087 virtio_transport_send_credit_update(vsk);