Lines Matching refs:zc

1209 	bool zc = false;  in tcp_sendmsg_locked()  local
1222 zc = sk->sk_route_caps & NETIF_F_SG; in tcp_sendmsg_locked()
1223 if (!zc) in tcp_sendmsg_locked()
1330 if (skb_availroom(skb) > 0 && !zc) { in tcp_sendmsg_locked()
1336 } else if (!zc) { in tcp_sendmsg_locked()
1817 struct tcp_zerocopy_receive *zc, in tcp_zerocopy_set_hint_for_skb() argument
1825 zc->recv_skip_hint = skb->len - offset; in tcp_zerocopy_set_hint_for_skb()
1841 zc->recv_skip_hint -= partial_frag_remainder; in tcp_zerocopy_set_hint_for_skb()
1849 mappable_offset = find_next_mappable_frag(frag, zc->recv_skip_hint); in tcp_zerocopy_set_hint_for_skb()
1850 zc->recv_skip_hint = mappable_offset + partial_frag_remainder; in tcp_zerocopy_set_hint_for_skb()
1858 struct tcp_zerocopy_receive *zc, int inq, in receive_fallback_to_copy() argument
1861 unsigned long copy_address = (unsigned long)zc->copybuf_address; in receive_fallback_to_copy()
1866 zc->length = 0; in receive_fallback_to_copy()
1867 zc->recv_skip_hint = 0; in receive_fallback_to_copy()
1869 if (copy_address != zc->copybuf_address) in receive_fallback_to_copy()
1878 tss, &zc->msg_flags); in receive_fallback_to_copy()
1882 zc->copybuf_len = err; in receive_fallback_to_copy()
1883 if (likely(zc->copybuf_len)) { in receive_fallback_to_copy()
1889 tcp_zerocopy_set_hint_for_skb(sk, zc, skb, offset); in receive_fallback_to_copy()
1894 static int tcp_copy_straggler_data(struct tcp_zerocopy_receive *zc, in tcp_copy_straggler_data() argument
1898 unsigned long copy_address = (unsigned long)zc->copybuf_address; in tcp_copy_straggler_data()
1903 if (copy_address != zc->copybuf_address) in tcp_copy_straggler_data()
1913 zc->recv_skip_hint -= copylen; in tcp_copy_straggler_data()
1919 static int tcp_zc_handle_leftover(struct tcp_zerocopy_receive *zc, in tcp_zc_handle_leftover() argument
1926 u32 offset, copylen = min_t(u32, copybuf_len, zc->recv_skip_hint); in tcp_zc_handle_leftover()
1937 zc->msg_flags |= TCP_CMSG_TS; in tcp_zc_handle_leftover()
1941 zc->copybuf_len = tcp_copy_straggler_data(zc, skb, copylen, &offset, in tcp_zc_handle_leftover()
1943 return zc->copybuf_len < 0 ? 0 : copylen; in tcp_zc_handle_leftover()
1952 struct tcp_zerocopy_receive *zc, in tcp_zerocopy_vm_insert_batch_error() argument
1958 zc->flags & TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT) { in tcp_zerocopy_vm_insert_batch_error()
1989 zc->recv_skip_hint += bytes_not_mapped; in tcp_zerocopy_vm_insert_batch_error()
2000 struct tcp_zerocopy_receive *zc, in tcp_zerocopy_vm_insert_batch() argument
2022 pages_remaining, address, length, seq, zc, total_bytes_to_map, in tcp_zerocopy_vm_insert_batch()
2028 struct tcp_zerocopy_receive *zc, in tcp_zc_finalize_rx_tstamp() argument
2034 msg_control_addr = (unsigned long)zc->msg_control; in tcp_zc_finalize_rx_tstamp()
2037 (__kernel_size_t)zc->msg_controllen; in tcp_zc_finalize_rx_tstamp()
2041 zc->msg_flags = 0; in tcp_zc_finalize_rx_tstamp()
2042 if (zc->msg_control == msg_control_addr && in tcp_zc_finalize_rx_tstamp()
2043 zc->msg_controllen == cmsg_dummy.msg_controllen) { in tcp_zc_finalize_rx_tstamp()
2045 zc->msg_control = (__u64) in tcp_zc_finalize_rx_tstamp()
2047 zc->msg_controllen = in tcp_zc_finalize_rx_tstamp()
2049 zc->msg_flags = (__u32)cmsg_dummy.msg_flags; in tcp_zc_finalize_rx_tstamp()
2055 struct tcp_zerocopy_receive *zc, in tcp_zerocopy_receive() argument
2059 unsigned long address = (unsigned long)zc->address; in tcp_zerocopy_receive()
2061 s32 copybuf_len = zc->copybuf_len; in tcp_zerocopy_receive()
2072 zc->copybuf_len = 0; in tcp_zerocopy_receive()
2073 zc->msg_flags = 0; in tcp_zerocopy_receive()
2075 if (address & (PAGE_SIZE - 1) || address != zc->address) in tcp_zerocopy_receive()
2084 return receive_fallback_to_copy(sk, zc, inq, tss); in tcp_zerocopy_receive()
2087 zc->length = 0; in tcp_zerocopy_receive()
2088 zc->recv_skip_hint = inq; in tcp_zerocopy_receive()
2101 vma_len = min_t(unsigned long, zc->length, vma->vm_end - address); in tcp_zerocopy_receive()
2105 if (!(zc->flags & TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT)) in tcp_zerocopy_receive()
2107 zc->length = total_bytes_to_map; in tcp_zerocopy_receive()
2108 zc->recv_skip_hint = 0; in tcp_zerocopy_receive()
2110 zc->length = avail_len; in tcp_zerocopy_receive()
2111 zc->recv_skip_hint = avail_len; in tcp_zerocopy_receive()
2114 while (length + PAGE_SIZE <= zc->length) { in tcp_zerocopy_receive()
2118 if (zc->recv_skip_hint < PAGE_SIZE) { in tcp_zerocopy_receive()
2122 if (zc->recv_skip_hint > 0) in tcp_zerocopy_receive()
2132 zc->msg_flags |= TCP_CMSG_TS; in tcp_zerocopy_receive()
2134 zc->recv_skip_hint = skb->len - offset; in tcp_zerocopy_receive()
2141 zc->recv_skip_hint); in tcp_zerocopy_receive()
2143 zc->recv_skip_hint = mappable_offset; in tcp_zerocopy_receive()
2150 zc->recv_skip_hint -= PAGE_SIZE; in tcp_zerocopy_receive()
2153 zc->recv_skip_hint < PAGE_SIZE) { in tcp_zerocopy_receive()
2160 &seq, zc, in tcp_zerocopy_receive()
2170 zc, total_bytes_to_map); in tcp_zerocopy_receive()
2176 copylen = tcp_zc_handle_leftover(zc, sk, skb, &seq, copybuf_len, tss); in tcp_zerocopy_receive()
2186 if (length == zc->length) in tcp_zerocopy_receive()
2187 zc->recv_skip_hint = 0; in tcp_zerocopy_receive()
2189 if (!zc->recv_skip_hint && sock_flag(sk, SOCK_DONE)) in tcp_zerocopy_receive()
2192 zc->length = length; in tcp_zerocopy_receive()
4160 struct tcp_zerocopy_receive zc = {}; in do_tcp_getsockopt() local
4168 if (unlikely(len > sizeof(zc))) { in do_tcp_getsockopt()
4169 err = check_zeroed_user(optval + sizeof(zc), in do_tcp_getsockopt()
4170 len - sizeof(zc)); in do_tcp_getsockopt()
4173 len = sizeof(zc); in do_tcp_getsockopt()
4177 if (copy_from_user(&zc, optval, len)) in do_tcp_getsockopt()
4179 if (zc.reserved) in do_tcp_getsockopt()
4181 if (zc.msg_flags & ~(TCP_VALID_ZC_MSG_FLAGS)) in do_tcp_getsockopt()
4184 err = tcp_zerocopy_receive(sk, &zc, &tss); in do_tcp_getsockopt()
4186 &zc, &len, err); in do_tcp_getsockopt()
4207 if (zc.msg_flags & TCP_CMSG_TS) in do_tcp_getsockopt()
4208 tcp_zc_finalize_rx_tstamp(sk, &zc, &tss); in do_tcp_getsockopt()
4210 zc.msg_flags = 0; in do_tcp_getsockopt()
4213 zc.err = sock_error(sk); in do_tcp_getsockopt()
4215 zc.inq = tcp_inq_hint(sk); in do_tcp_getsockopt()
4217 if (!err && copy_to_user(optval, &zc, len)) in do_tcp_getsockopt()