• Home
  • Raw
  • Download

Lines Matching refs:vsk

285 	struct vsock_sock *vsk;  in vmci_transport_send_control_pkt()  local
288 vsk = vsock_sk(sk); in vmci_transport_send_control_pkt()
290 if (!vsock_addr_bound(&vsk->local_addr)) in vmci_transport_send_control_pkt()
293 if (!vsock_addr_bound(&vsk->remote_addr)) in vmci_transport_send_control_pkt()
300 err = __vmci_transport_send_control_pkt(pkt, &vsk->local_addr, in vmci_transport_send_control_pkt()
301 &vsk->remote_addr, type, size, in vmci_transport_send_control_pkt()
440 static int vmci_transport_shutdown(struct vsock_sock *vsk, int mode) in vmci_transport_shutdown() argument
443 &vsk->sk, in vmci_transport_shutdown()
607 struct vsock_sock *vsk; in vmci_transport_recv_dgram_cb() local
620 vsk = vsock_sk(sk); in vmci_transport_recv_dgram_cb()
621 if (!vmci_transport_allow_dgram(vsk, dg->src.context)) in vmci_transport_recv_dgram_cb()
668 struct vsock_sock *vsk; in vmci_transport_recv_stream_cb() local
737 vsk = vsock_sk(sk); in vmci_transport_recv_stream_cb()
738 if (!vmci_transport_allow_dgram(vsk, pkt->dg.src.context)) { in vmci_transport_recv_stream_cb()
752 vsk->local_addr.svm_cid = dst.svm_cid; in vmci_transport_recv_stream_cb()
755 vmci_trans(vsk)->notify_ops->handle_notify_pkt( in vmci_transport_recv_stream_cb()
800 struct vsock_sock *vsk; in vmci_transport_peer_attach_cb() local
804 vsk = vsock_sk(sk); in vmci_transport_peer_attach_cb()
818 if (vmci_handle_is_equal(vmci_trans(vsk)->qp_handle, in vmci_transport_peer_attach_cb()
834 struct vsock_sock *vsk; in vmci_transport_handle_detach() local
836 vsk = vsock_sk(sk); in vmci_transport_handle_detach()
837 if (!vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle)) { in vmci_transport_handle_detach()
843 vsk->peer_shutdown = SHUTDOWN_MASK; in vmci_transport_handle_detach()
849 if (vsock_stream_has_data(vsk) <= 0) { in vmci_transport_handle_detach()
876 struct vsock_sock *vsk; in vmci_transport_peer_detach_cb() local
879 vsk = vsock_sk(sk); in vmci_transport_peer_detach_cb()
890 if (vmci_handle_is_equal(vmci_trans(vsk)->qp_handle, in vmci_transport_peer_detach_cb()
1288 struct vsock_sock *vsk; in vmci_transport_recv_connecting_client() local
1292 vsk = vsock_sk(sk); in vmci_transport_recv_connecting_client()
1298 vmci_trans(vsk)->qp_handle)) { in vmci_transport_recv_connecting_client()
1311 vsock_insert_connected(vsk); in vmci_transport_recv_connecting_client()
1318 || pkt->dg.src.context != vsk->remote_addr.svm_cid in vmci_transport_recv_connecting_client()
1319 || pkt->src_port != vsk->remote_addr.svm_port in vmci_transport_recv_connecting_client()
1320 || !vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle) in vmci_transport_recv_connecting_client()
1321 || vmci_trans(vsk)->qpair in vmci_transport_recv_connecting_client()
1322 || vmci_trans(vsk)->produce_size != 0 in vmci_transport_recv_connecting_client()
1323 || vmci_trans(vsk)->consume_size != 0 in vmci_transport_recv_connecting_client()
1324 || vmci_trans(vsk)->attach_sub_id != VMCI_INVALID_ID in vmci_transport_recv_connecting_client()
1325 || vmci_trans(vsk)->detach_sub_id != VMCI_INVALID_ID) { in vmci_transport_recv_connecting_client()
1357 if (vsk->ignore_connecting_rst) { in vmci_transport_recv_connecting_client()
1358 vsk->ignore_connecting_rst = false; in vmci_transport_recv_connecting_client()
1389 struct vsock_sock *vsk; in vmci_transport_recv_connecting_client_negotiate() local
1400 vsk = vsock_sk(sk); in vmci_transport_recv_connecting_client_negotiate()
1408 vsk->sent_request = false; in vmci_transport_recv_connecting_client_negotiate()
1409 vsk->ignore_connecting_rst = false; in vmci_transport_recv_connecting_client_negotiate()
1412 if (pkt->u.size < vmci_trans(vsk)->queue_pair_min_size || in vmci_transport_recv_connecting_client_negotiate()
1413 pkt->u.size > vmci_trans(vsk)->queue_pair_max_size) { in vmci_transport_recv_connecting_client_negotiate()
1420 if (vsk->local_addr.svm_cid == VMADDR_CID_ANY) in vmci_transport_recv_connecting_client_negotiate()
1421 vsk->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_connecting_client_negotiate()
1471 is_local = vsk->remote_addr.svm_cid == vsk->local_addr.svm_cid; in vmci_transport_recv_connecting_client_negotiate()
1478 vsk->remote_addr.svm_cid, in vmci_transport_recv_connecting_client_negotiate()
1481 vsk, in vmci_transport_recv_connecting_client_negotiate()
1482 vsk-> in vmci_transport_recv_connecting_client_negotiate()
1493 vmci_trans(vsk)->qp_handle = handle; in vmci_transport_recv_connecting_client_negotiate()
1494 vmci_trans(vsk)->qpair = qpair; in vmci_transport_recv_connecting_client_negotiate()
1496 vmci_trans(vsk)->produce_size = vmci_trans(vsk)->consume_size = in vmci_transport_recv_connecting_client_negotiate()
1499 vmci_trans(vsk)->attach_sub_id = attach_sub_id; in vmci_transport_recv_connecting_client_negotiate()
1500 vmci_trans(vsk)->detach_sub_id = detach_sub_id; in vmci_transport_recv_connecting_client_negotiate()
1502 vmci_trans(vsk)->notify_ops->process_negotiate(sk); in vmci_transport_recv_connecting_client_negotiate()
1524 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_recv_connecting_client_invalid() local
1526 if (vsk->sent_request) { in vmci_transport_recv_connecting_client_invalid()
1527 vsk->sent_request = false; in vmci_transport_recv_connecting_client_invalid()
1528 vsk->ignore_connecting_rst = true; in vmci_transport_recv_connecting_client_invalid()
1531 sk, vmci_trans(vsk)->queue_pair_size); in vmci_transport_recv_connecting_client_invalid()
1545 struct vsock_sock *vsk; in vmci_transport_recv_connected() local
1559 vsk = vsock_sk(sk); in vmci_transport_recv_connected()
1561 vsk->peer_shutdown |= pkt->u.mode; in vmci_transport_recv_connected()
1567 vsk = vsock_sk(sk); in vmci_transport_recv_connected()
1578 vsk->peer_shutdown = SHUTDOWN_MASK; in vmci_transport_recv_connected()
1579 if (vsock_stream_has_data(vsk) <= 0) in vmci_transport_recv_connected()
1586 vsk = vsock_sk(sk); in vmci_transport_recv_connected()
1587 vmci_trans(vsk)->notify_ops->handle_notify_pkt( in vmci_transport_recv_connected()
1599 static int vmci_transport_socket_init(struct vsock_sock *vsk, in vmci_transport_socket_init() argument
1602 vsk->trans = kmalloc(sizeof(struct vmci_transport), GFP_KERNEL); in vmci_transport_socket_init()
1603 if (!vsk->trans) in vmci_transport_socket_init()
1606 vmci_trans(vsk)->dg_handle = VMCI_INVALID_HANDLE; in vmci_transport_socket_init()
1607 vmci_trans(vsk)->qp_handle = VMCI_INVALID_HANDLE; in vmci_transport_socket_init()
1608 vmci_trans(vsk)->qpair = NULL; in vmci_transport_socket_init()
1609 vmci_trans(vsk)->produce_size = vmci_trans(vsk)->consume_size = 0; in vmci_transport_socket_init()
1610 vmci_trans(vsk)->attach_sub_id = vmci_trans(vsk)->detach_sub_id = in vmci_transport_socket_init()
1612 vmci_trans(vsk)->notify_ops = NULL; in vmci_transport_socket_init()
1614 vmci_trans(vsk)->queue_pair_size = in vmci_transport_socket_init()
1616 vmci_trans(vsk)->queue_pair_min_size = in vmci_transport_socket_init()
1618 vmci_trans(vsk)->queue_pair_max_size = in vmci_transport_socket_init()
1621 vmci_trans(vsk)->queue_pair_size = in vmci_transport_socket_init()
1623 vmci_trans(vsk)->queue_pair_min_size = in vmci_transport_socket_init()
1625 vmci_trans(vsk)->queue_pair_max_size = in vmci_transport_socket_init()
1632 static void vmci_transport_destruct(struct vsock_sock *vsk) in vmci_transport_destruct() argument
1634 if (vmci_trans(vsk)->attach_sub_id != VMCI_INVALID_ID) { in vmci_transport_destruct()
1635 vmci_event_unsubscribe(vmci_trans(vsk)->attach_sub_id); in vmci_transport_destruct()
1636 vmci_trans(vsk)->attach_sub_id = VMCI_INVALID_ID; in vmci_transport_destruct()
1639 if (vmci_trans(vsk)->detach_sub_id != VMCI_INVALID_ID) { in vmci_transport_destruct()
1640 vmci_event_unsubscribe(vmci_trans(vsk)->detach_sub_id); in vmci_transport_destruct()
1641 vmci_trans(vsk)->detach_sub_id = VMCI_INVALID_ID; in vmci_transport_destruct()
1644 if (!vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle)) { in vmci_transport_destruct()
1645 vmci_qpair_detach(&vmci_trans(vsk)->qpair); in vmci_transport_destruct()
1646 vmci_trans(vsk)->qp_handle = VMCI_INVALID_HANDLE; in vmci_transport_destruct()
1647 vmci_trans(vsk)->produce_size = 0; in vmci_transport_destruct()
1648 vmci_trans(vsk)->consume_size = 0; in vmci_transport_destruct()
1651 if (vmci_trans(vsk)->notify_ops) in vmci_transport_destruct()
1652 vmci_trans(vsk)->notify_ops->socket_destruct(vsk); in vmci_transport_destruct()
1654 kfree(vsk->trans); in vmci_transport_destruct()
1655 vsk->trans = NULL; in vmci_transport_destruct()
1658 static void vmci_transport_release(struct vsock_sock *vsk) in vmci_transport_release() argument
1660 if (!vmci_handle_is_invalid(vmci_trans(vsk)->dg_handle)) { in vmci_transport_release()
1661 vmci_datagram_destroy_handle(vmci_trans(vsk)->dg_handle); in vmci_transport_release()
1662 vmci_trans(vsk)->dg_handle = VMCI_INVALID_HANDLE; in vmci_transport_release()
1666 static int vmci_transport_dgram_bind(struct vsock_sock *vsk, in vmci_transport_dgram_bind() argument
1687 &vsk->sk, in vmci_transport_dgram_bind()
1688 &vmci_trans(vsk)->dg_handle); in vmci_transport_dgram_bind()
1691 vsock_addr_init(&vsk->local_addr, addr->svm_cid, in vmci_transport_dgram_bind()
1692 vmci_trans(vsk)->dg_handle.resource); in vmci_transport_dgram_bind()
1698 struct vsock_sock *vsk, in vmci_transport_dgram_enqueue() argument
1709 if (!vmci_transport_allow_dgram(vsk, remote_addr->svm_cid)) in vmci_transport_dgram_enqueue()
1721 dg->src = vmci_make_handle(vsk->local_addr.svm_cid, in vmci_transport_dgram_enqueue()
1722 vsk->local_addr.svm_port); in vmci_transport_dgram_enqueue()
1734 struct vsock_sock *vsk, in vmci_transport_dgram_dequeue() argument
1751 skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err); in vmci_transport_dgram_dequeue()
1790 skb_free_datagram(&vsk->sk, skb); in vmci_transport_dgram_dequeue()
1806 static int vmci_transport_connect(struct vsock_sock *vsk) in vmci_transport_connect() argument
1810 struct sock *sk = &vsk->sk; in vmci_transport_connect()
1815 sk, vmci_trans(vsk)->queue_pair_size); in vmci_transport_connect()
1824 sk, vmci_trans(vsk)->queue_pair_size, in vmci_transport_connect()
1831 vsk->sent_request = true; in vmci_transport_connect()
1838 struct vsock_sock *vsk, in vmci_transport_stream_dequeue() argument
1844 return vmci_qpair_peekv(vmci_trans(vsk)->qpair, iov, len, 0); in vmci_transport_stream_dequeue()
1846 return vmci_qpair_dequev(vmci_trans(vsk)->qpair, iov, len, 0); in vmci_transport_stream_dequeue()
1850 struct vsock_sock *vsk, in vmci_transport_stream_enqueue() argument
1854 return vmci_qpair_enquev(vmci_trans(vsk)->qpair, iov, len, 0); in vmci_transport_stream_enqueue()
1857 static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk) in vmci_transport_stream_has_data() argument
1859 return vmci_qpair_consume_buf_ready(vmci_trans(vsk)->qpair); in vmci_transport_stream_has_data()
1862 static s64 vmci_transport_stream_has_space(struct vsock_sock *vsk) in vmci_transport_stream_has_space() argument
1864 return vmci_qpair_produce_free_space(vmci_trans(vsk)->qpair); in vmci_transport_stream_has_space()
1867 static u64 vmci_transport_stream_rcvhiwat(struct vsock_sock *vsk) in vmci_transport_stream_rcvhiwat() argument
1869 return vmci_trans(vsk)->consume_size; in vmci_transport_stream_rcvhiwat()
1872 static bool vmci_transport_stream_is_active(struct vsock_sock *vsk) in vmci_transport_stream_is_active() argument
1874 return !vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle); in vmci_transport_stream_is_active()
1877 static u64 vmci_transport_get_buffer_size(struct vsock_sock *vsk) in vmci_transport_get_buffer_size() argument
1879 return vmci_trans(vsk)->queue_pair_size; in vmci_transport_get_buffer_size()
1882 static u64 vmci_transport_get_min_buffer_size(struct vsock_sock *vsk) in vmci_transport_get_min_buffer_size() argument
1884 return vmci_trans(vsk)->queue_pair_min_size; in vmci_transport_get_min_buffer_size()
1887 static u64 vmci_transport_get_max_buffer_size(struct vsock_sock *vsk) in vmci_transport_get_max_buffer_size() argument
1889 return vmci_trans(vsk)->queue_pair_max_size; in vmci_transport_get_max_buffer_size()
1892 static void vmci_transport_set_buffer_size(struct vsock_sock *vsk, u64 val) in vmci_transport_set_buffer_size() argument
1894 if (val < vmci_trans(vsk)->queue_pair_min_size) in vmci_transport_set_buffer_size()
1895 vmci_trans(vsk)->queue_pair_min_size = val; in vmci_transport_set_buffer_size()
1896 if (val > vmci_trans(vsk)->queue_pair_max_size) in vmci_transport_set_buffer_size()
1897 vmci_trans(vsk)->queue_pair_max_size = val; in vmci_transport_set_buffer_size()
1898 vmci_trans(vsk)->queue_pair_size = val; in vmci_transport_set_buffer_size()
1901 static void vmci_transport_set_min_buffer_size(struct vsock_sock *vsk, in vmci_transport_set_min_buffer_size() argument
1904 if (val > vmci_trans(vsk)->queue_pair_size) in vmci_transport_set_min_buffer_size()
1905 vmci_trans(vsk)->queue_pair_size = val; in vmci_transport_set_min_buffer_size()
1906 vmci_trans(vsk)->queue_pair_min_size = val; in vmci_transport_set_min_buffer_size()
1909 static void vmci_transport_set_max_buffer_size(struct vsock_sock *vsk, in vmci_transport_set_max_buffer_size() argument
1912 if (val < vmci_trans(vsk)->queue_pair_size) in vmci_transport_set_max_buffer_size()
1913 vmci_trans(vsk)->queue_pair_size = val; in vmci_transport_set_max_buffer_size()
1914 vmci_trans(vsk)->queue_pair_max_size = val; in vmci_transport_set_max_buffer_size()
1918 struct vsock_sock *vsk, in vmci_transport_notify_poll_in() argument
1922 return vmci_trans(vsk)->notify_ops->poll_in( in vmci_transport_notify_poll_in()
1923 &vsk->sk, target, data_ready_now); in vmci_transport_notify_poll_in()
1927 struct vsock_sock *vsk, in vmci_transport_notify_poll_out() argument
1931 return vmci_trans(vsk)->notify_ops->poll_out( in vmci_transport_notify_poll_out()
1932 &vsk->sk, target, space_available_now); in vmci_transport_notify_poll_out()
1936 struct vsock_sock *vsk, in vmci_transport_notify_recv_init() argument
1940 return vmci_trans(vsk)->notify_ops->recv_init( in vmci_transport_notify_recv_init()
1941 &vsk->sk, target, in vmci_transport_notify_recv_init()
1946 struct vsock_sock *vsk, in vmci_transport_notify_recv_pre_block() argument
1950 return vmci_trans(vsk)->notify_ops->recv_pre_block( in vmci_transport_notify_recv_pre_block()
1951 &vsk->sk, target, in vmci_transport_notify_recv_pre_block()
1956 struct vsock_sock *vsk, in vmci_transport_notify_recv_pre_dequeue() argument
1960 return vmci_trans(vsk)->notify_ops->recv_pre_dequeue( in vmci_transport_notify_recv_pre_dequeue()
1961 &vsk->sk, target, in vmci_transport_notify_recv_pre_dequeue()
1966 struct vsock_sock *vsk, in vmci_transport_notify_recv_post_dequeue() argument
1972 return vmci_trans(vsk)->notify_ops->recv_post_dequeue( in vmci_transport_notify_recv_post_dequeue()
1973 &vsk->sk, target, copied, data_read, in vmci_transport_notify_recv_post_dequeue()
1978 struct vsock_sock *vsk, in vmci_transport_notify_send_init() argument
1981 return vmci_trans(vsk)->notify_ops->send_init( in vmci_transport_notify_send_init()
1982 &vsk->sk, in vmci_transport_notify_send_init()
1987 struct vsock_sock *vsk, in vmci_transport_notify_send_pre_block() argument
1990 return vmci_trans(vsk)->notify_ops->send_pre_block( in vmci_transport_notify_send_pre_block()
1991 &vsk->sk, in vmci_transport_notify_send_pre_block()
1996 struct vsock_sock *vsk, in vmci_transport_notify_send_pre_enqueue() argument
1999 return vmci_trans(vsk)->notify_ops->send_pre_enqueue( in vmci_transport_notify_send_pre_enqueue()
2000 &vsk->sk, in vmci_transport_notify_send_pre_enqueue()
2005 struct vsock_sock *vsk, in vmci_transport_notify_send_post_enqueue() argument
2009 return vmci_trans(vsk)->notify_ops->send_post_enqueue( in vmci_transport_notify_send_post_enqueue()
2010 &vsk->sk, written, in vmci_transport_notify_send_post_enqueue()
2033 struct vsock_sock *vsk = vsock_sk(sk); in vmci_transport_proto_to_notify_struct() local
2040 vmci_trans(vsk)->notify_ops = &vmci_transport_notify_pkt_ops; in vmci_transport_proto_to_notify_struct()
2046 vmci_trans(vsk)->notify_ops = in vmci_transport_proto_to_notify_struct()
2055 vmci_trans(vsk)->notify_ops->socket_init(sk); in vmci_transport_proto_to_notify_struct()