Commit e061aed9 authored by Arseniy Krasnov's avatar Arseniy Krasnov Committed by Paolo Abeni

vmci/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: default avatarArseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: default avatarVishnu Dasa <vdasa@vmware.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 39f1ed33
...@@ -307,7 +307,7 @@ vmci_transport_handle_wrote(struct sock *sk, ...@@ -307,7 +307,7 @@ vmci_transport_handle_wrote(struct sock *sk,
struct vsock_sock *vsk = vsock_sk(sk); struct vsock_sock *vsk = vsock_sk(sk);
PKT_FIELD(vsk, sent_waiting_read) = false; PKT_FIELD(vsk, sent_waiting_read) = false;
#endif #endif
sk->sk_data_ready(sk); vsock_data_ready(sk);
} }
static void vmci_transport_notify_pkt_socket_init(struct sock *sk) static void vmci_transport_notify_pkt_socket_init(struct sock *sk)
......
...@@ -84,7 +84,7 @@ vmci_transport_handle_wrote(struct sock *sk, ...@@ -84,7 +84,7 @@ vmci_transport_handle_wrote(struct sock *sk,
bool bottom_half, bool bottom_half,
struct sockaddr_vm *dst, struct sockaddr_vm *src) 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) static void vsock_block_update_write_window(struct sock *sk)
...@@ -282,7 +282,7 @@ vmci_transport_notify_pkt_recv_post_dequeue( ...@@ -282,7 +282,7 @@ vmci_transport_notify_pkt_recv_post_dequeue(
/* See the comment in /* See the comment in
* vmci_transport_notify_pkt_send_post_enqueue(). * vmci_transport_notify_pkt_send_post_enqueue().
*/ */
sk->sk_data_ready(sk); vsock_data_ready(sk);
} }
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment