Lines Matching refs:zc

1201 	bool zc = false;  in tcp_sendmsg_locked()  local
1215 zc = sk->sk_route_caps & NETIF_F_SG; in tcp_sendmsg_locked()
1216 if (!zc) in tcp_sendmsg_locked()
1323 if (skb_availroom(skb) > 0 && !zc) { in tcp_sendmsg_locked()
1329 } else if (!zc) { in tcp_sendmsg_locked()
1780 static int tcp_copy_straggler_data(struct tcp_zerocopy_receive *zc, in tcp_copy_straggler_data() argument
1784 unsigned long copy_address = (unsigned long)zc->copybuf_address; in tcp_copy_straggler_data()
1789 if (copy_address != zc->copybuf_address) in tcp_copy_straggler_data()
1799 zc->recv_skip_hint -= copylen; in tcp_copy_straggler_data()
1805 static int tcp_zerocopy_handle_leftover_data(struct tcp_zerocopy_receive *zc, in tcp_zerocopy_handle_leftover_data() argument
1811 u32 offset, copylen = min_t(u32, copybuf_len, zc->recv_skip_hint); in tcp_zerocopy_handle_leftover_data()
1821 zc->copybuf_len = tcp_copy_straggler_data(zc, skb, copylen, &offset, in tcp_zerocopy_handle_leftover_data()
1823 return zc->copybuf_len < 0 ? 0 : copylen; in tcp_zerocopy_handle_leftover_data()
1832 struct tcp_zerocopy_receive *zc) in tcp_zerocopy_vm_insert_batch() argument
1851 zc->recv_skip_hint += bytes_not_mapped; in tcp_zerocopy_vm_insert_batch()
1857 struct tcp_zerocopy_receive *zc) in tcp_zerocopy_receive() argument
1860 unsigned long address = (unsigned long)zc->address; in tcp_zerocopy_receive()
1861 s32 copybuf_len = zc->copybuf_len; in tcp_zerocopy_receive()
1874 zc->copybuf_len = 0; in tcp_zerocopy_receive()
1876 if (address & (PAGE_SIZE - 1) || address != zc->address) in tcp_zerocopy_receive()
1891 vma_len = min_t(unsigned long, zc->length, vma->vm_end - address); in tcp_zerocopy_receive()
1896 zc->length = aligned_len; in tcp_zerocopy_receive()
1897 zc->recv_skip_hint = 0; in tcp_zerocopy_receive()
1899 zc->length = avail_len; in tcp_zerocopy_receive()
1900 zc->recv_skip_hint = avail_len; in tcp_zerocopy_receive()
1904 while (length + PAGE_SIZE <= zc->length) { in tcp_zerocopy_receive()
1905 if (zc->recv_skip_hint < PAGE_SIZE) { in tcp_zerocopy_receive()
1914 &seq, zc); in tcp_zerocopy_receive()
1920 if (zc->recv_skip_hint > 0) in tcp_zerocopy_receive()
1927 zc->recv_skip_hint = skb->len - offset; in tcp_zerocopy_receive()
1933 int remaining = zc->recv_skip_hint; in tcp_zerocopy_receive()
1940 zc->recv_skip_hint -= remaining; in tcp_zerocopy_receive()
1946 zc->recv_skip_hint -= PAGE_SIZE; in tcp_zerocopy_receive()
1951 &seq, zc); in tcp_zerocopy_receive()
1960 zc); in tcp_zerocopy_receive()
1966 copylen = tcp_zerocopy_handle_leftover_data(zc, sk, skb, &seq, in tcp_zerocopy_receive()
1977 if (length == zc->length) in tcp_zerocopy_receive()
1978 zc->recv_skip_hint = 0; in tcp_zerocopy_receive()
1980 if (!zc->recv_skip_hint && sock_flag(sk, SOCK_DONE)) in tcp_zerocopy_receive()
1983 zc->length = length; in tcp_zerocopy_receive()
3919 struct tcp_zerocopy_receive zc = {}; in do_tcp_getsockopt() local
3927 if (len > sizeof(zc)) { in do_tcp_getsockopt()
3928 len = sizeof(zc); in do_tcp_getsockopt()
3932 if (copy_from_user(&zc, optval, len)) in do_tcp_getsockopt()
3935 err = tcp_zerocopy_receive(sk, &zc); in do_tcp_getsockopt()
3950 zc.err = sock_error(sk); in do_tcp_getsockopt()
3952 zc.inq = tcp_inq_hint(sk); in do_tcp_getsockopt()
3954 if (!err && copy_to_user(optval, &zc, len)) in do_tcp_getsockopt()