Lines Matching refs:vsk
15 #define PKT_FIELD(vsk, field_name) \ argument
16 (vmci_trans(vsk)->notify.pkt_q_state.field_name)
18 static bool vmci_transport_notify_waiting_write(struct vsock_sock *vsk) in vmci_transport_notify_waiting_write() argument
23 if (!PKT_FIELD(vsk, peer_waiting_write)) in vmci_transport_notify_waiting_write()
33 if (!PKT_FIELD(vsk, peer_waiting_write_detected)) { in vmci_transport_notify_waiting_write()
34 PKT_FIELD(vsk, peer_waiting_write_detected) = true; in vmci_transport_notify_waiting_write()
35 if (PKT_FIELD(vsk, write_notify_window) < PAGE_SIZE) { in vmci_transport_notify_waiting_write()
36 PKT_FIELD(vsk, write_notify_window) = in vmci_transport_notify_waiting_write()
37 PKT_FIELD(vsk, write_notify_min_window); in vmci_transport_notify_waiting_write()
39 PKT_FIELD(vsk, write_notify_window) -= PAGE_SIZE; in vmci_transport_notify_waiting_write()
40 if (PKT_FIELD(vsk, write_notify_window) < in vmci_transport_notify_waiting_write()
41 PKT_FIELD(vsk, write_notify_min_window)) in vmci_transport_notify_waiting_write()
42 PKT_FIELD(vsk, write_notify_window) = in vmci_transport_notify_waiting_write()
43 PKT_FIELD(vsk, write_notify_min_window); in vmci_transport_notify_waiting_write()
47 notify_limit = vmci_trans(vsk)->consume_size - in vmci_transport_notify_waiting_write()
48 PKT_FIELD(vsk, write_notify_window); in vmci_transport_notify_waiting_write()
59 retval = vmci_qpair_consume_free_space(vmci_trans(vsk)->qpair) > in vmci_transport_notify_waiting_write()
67 PKT_FIELD(vsk, peer_waiting_write_detected) = false; in vmci_transport_notify_waiting_write()
92 struct vsock_sock *vsk = vsock_sk(sk); in vsock_block_update_write_window() local
94 if (PKT_FIELD(vsk, write_notify_window) < vmci_trans(vsk)->consume_size) in vsock_block_update_write_window()
95 PKT_FIELD(vsk, write_notify_window) = in vsock_block_update_write_window()
96 min(PKT_FIELD(vsk, write_notify_window) + PAGE_SIZE, in vsock_block_update_write_window()
97 vmci_trans(vsk)->consume_size); in vsock_block_update_write_window()
102 struct vsock_sock *vsk; in vmci_transport_send_read_notification() local
107 vsk = vsock_sk(sk); in vmci_transport_send_read_notification()
112 if (vmci_transport_notify_waiting_write(vsk)) { in vmci_transport_send_read_notification()
120 while (!(vsk->peer_shutdown & RCV_SHUTDOWN) && in vmci_transport_send_read_notification()
134 PKT_FIELD(vsk, peer_waiting_write) = false; in vmci_transport_send_read_notification()
142 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_socket_init() local
144 PKT_FIELD(vsk, write_notify_window) = PAGE_SIZE; in vmci_transport_notify_pkt_socket_init()
145 PKT_FIELD(vsk, write_notify_min_window) = PAGE_SIZE; in vmci_transport_notify_pkt_socket_init()
146 PKT_FIELD(vsk, peer_waiting_write) = false; in vmci_transport_notify_pkt_socket_init()
147 PKT_FIELD(vsk, peer_waiting_write_detected) = false; in vmci_transport_notify_pkt_socket_init()
150 static void vmci_transport_notify_pkt_socket_destruct(struct vsock_sock *vsk) in vmci_transport_notify_pkt_socket_destruct() argument
152 PKT_FIELD(vsk, write_notify_window) = PAGE_SIZE; in vmci_transport_notify_pkt_socket_destruct()
153 PKT_FIELD(vsk, write_notify_min_window) = PAGE_SIZE; in vmci_transport_notify_pkt_socket_destruct()
154 PKT_FIELD(vsk, peer_waiting_write) = false; in vmci_transport_notify_pkt_socket_destruct()
155 PKT_FIELD(vsk, peer_waiting_write_detected) = false; in vmci_transport_notify_pkt_socket_destruct()
162 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_poll_in() local
164 if (vsock_stream_has_data(vsk)) { in vmci_transport_notify_pkt_poll_in()
184 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_poll_out() local
186 produce_q_free_space = vsock_stream_has_space(vsk); in vmci_transport_notify_pkt_poll_out()
206 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_recv_init() local
212 if (PKT_FIELD(vsk, write_notify_min_window) < target + 1) { in vmci_transport_notify_pkt_recv_init()
213 PKT_FIELD(vsk, write_notify_min_window) = target + 1; in vmci_transport_notify_pkt_recv_init()
214 if (PKT_FIELD(vsk, write_notify_window) < in vmci_transport_notify_pkt_recv_init()
215 PKT_FIELD(vsk, write_notify_min_window)) { in vmci_transport_notify_pkt_recv_init()
223 PKT_FIELD(vsk, write_notify_window) = in vmci_transport_notify_pkt_recv_init()
224 PKT_FIELD(vsk, write_notify_min_window); in vmci_transport_notify_pkt_recv_init()
260 struct vsock_sock *vsk; in vmci_transport_notify_pkt_recv_post_dequeue() local
265 vsk = vsock_sk(sk); in vmci_transport_notify_pkt_recv_post_dequeue()
272 vmci_qpair_consume_free_space(vmci_trans(vsk)->qpair); in vmci_transport_notify_pkt_recv_post_dequeue()
276 PKT_FIELD(vsk, peer_waiting_write) = true; in vmci_transport_notify_pkt_recv_post_dequeue()
309 struct vsock_sock *vsk; in vmci_transport_notify_pkt_send_post_enqueue() local
314 vsk = vsock_sk(sk); in vmci_transport_notify_pkt_send_post_enqueue()
319 vmci_qpair_produce_buf_ready(vmci_trans(vsk)->qpair) == written; in vmci_transport_notify_pkt_send_post_enqueue()
321 while (!(vsk->peer_shutdown & RCV_SHUTDOWN) && in vmci_transport_notify_pkt_send_post_enqueue()
368 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_process_request() local
370 PKT_FIELD(vsk, write_notify_window) = vmci_trans(vsk)->consume_size; in vmci_transport_notify_pkt_process_request()
371 if (vmci_trans(vsk)->consume_size < in vmci_transport_notify_pkt_process_request()
372 PKT_FIELD(vsk, write_notify_min_window)) in vmci_transport_notify_pkt_process_request()
373 PKT_FIELD(vsk, write_notify_min_window) = in vmci_transport_notify_pkt_process_request()
374 vmci_trans(vsk)->consume_size; in vmci_transport_notify_pkt_process_request()
379 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_notify_pkt_process_negotiate() local
381 PKT_FIELD(vsk, write_notify_window) = vmci_trans(vsk)->consume_size; in vmci_transport_notify_pkt_process_negotiate()
382 if (vmci_trans(vsk)->consume_size < in vmci_transport_notify_pkt_process_negotiate()
383 PKT_FIELD(vsk, write_notify_min_window)) in vmci_transport_notify_pkt_process_negotiate()
384 PKT_FIELD(vsk, write_notify_min_window) = in vmci_transport_notify_pkt_process_negotiate()
385 vmci_trans(vsk)->consume_size; in vmci_transport_notify_pkt_process_negotiate()