Lines Matching refs:sock
28 #include <net/sock.h>
104 static void tx_poll_start(struct vhost_net *net, struct socket *sock)
108 vhost_poll_start(net->poll + VHOST_NET_VQ_TX, sock->file);
130 struct socket *sock = rcu_dereference(vq->private_data);
131 if (!sock)
134 wmem = atomic_read(&sock->sk->sk_wmem_alloc);
135 if (wmem >= sock->sk->sk_sndbuf) {
137 tx_poll_start(net, sock);
146 if (wmem < sock->sk->sk_sndbuf / 2)
160 wmem = atomic_read(&sock->sk->sk_wmem_alloc);
161 if (wmem >= sock->sk->sk_sndbuf * 3 / 4) {
162 tx_poll_start(net, sock);
163 set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
189 err = sock->ops->sendmsg(NULL, sock, &msg, len);
192 tx_poll_start(net, sock);
210 static int peek_head_len(struct sock *sk)
308 struct socket *sock = rcu_dereference(vq->private_data);
309 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue))
358 err = sock->ops->recvmsg(NULL, sock, &msg,
419 struct socket *sock = rcu_dereference(vq->private_data);
420 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue))
432 while ((sock_len = peek_head_len(sock->sk))) {
461 err = sock->ops->recvmsg(NULL, sock, &msg,
585 struct socket *sock = vq->private_data;
586 if (!sock)
590 tx_poll_start(n, sock);
592 vhost_poll_start(n->poll + VHOST_NET_VQ_RX, sock->file);
598 struct socket *sock;
601 sock = vq->private_data;
605 return sock;
654 struct socket *sock = sockfd_lookup(fd, &r);
655 if (!sock)
659 if (sock->sk->sk_type != SOCK_RAW) {
664 r = sock->ops->getname(sock, (struct sockaddr *)&uaddr.sa,
673 return sock;
675 fput(sock->file);
682 struct socket *sock;
685 sock = tun_get_socket(file);
686 if (!IS_ERR(sock))
687 return sock;
688 sock = macvtap_get_socket(file);
689 if (IS_ERR(sock))
691 return sock;
696 struct socket *sock;
700 sock = get_raw_socket(fd);
701 if (!IS_ERR(sock))
702 return sock;
703 sock = get_tap_socket(fd);
704 if (!IS_ERR(sock))
705 return sock;
711 struct socket *sock, *oldsock;
732 sock = get_socket(fd);
733 if (IS_ERR(sock)) {
734 r = PTR_ERR(sock);
740 if (sock != oldsock) {
742 rcu_assign_pointer(vq->private_data, sock);