vmci/vsock: check SO_RCVLOWAT before wake up reader
authorArseniy Krasnov <AVKrasnov@sberdevices.ru>
Fri, 19 Aug 2022 05:41:35 +0000 (05:41 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Aug 2022 08:43:12 +0000 (10:43 +0200)
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: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/vmw_vsock/vmci_transport_notify.c
net/vmw_vsock/vmci_transport_notify_qstate.c

index 852097e2b9e6d38d3453c7702c49d181656af72a..7c3a7db134b2820033c5d475731b0ab2b84382e5 100644 (file)
@@ -307,7 +307,7 @@ vmci_transport_handle_wrote(struct sock *sk,
        struct vsock_sock *vsk = vsock_sk(sk);
        PKT_FIELD(vsk, sent_waiting_read) = false;
 #endif
-       sk->sk_data_ready(sk);
+       vsock_data_ready(sk);
 }
 
 static void vmci_transport_notify_pkt_socket_init(struct sock *sk)
index 12f0cb8fe99886430a0855d59e3eaadd44ab1b6b..e96a88d850a86a9ffbd422674b080ef324dc4799 100644 (file)
@@ -84,7 +84,7 @@ vmci_transport_handle_wrote(struct sock *sk,
                            bool bottom_half,
                            struct sockaddr_vm *dst, struct sockaddr_vm *src)
 {
-       sk->sk_data_ready(sk);
+       vsock_data_ready(sk);
 }
 
 static void vsock_block_update_write_window(struct sock *sk)
@@ -282,7 +282,7 @@ vmci_transport_notify_pkt_recv_post_dequeue(
                /* See the comment in
                 * vmci_transport_notify_pkt_send_post_enqueue().
                 */
-               sk->sk_data_ready(sk);
+               vsock_data_ready(sk);
        }
 
        return err;