Commit eea96a3e authored by Pavel Begunkov's avatar Pavel Begunkov Committed by David S. Miller
Browse files

net/tcp: don't peek at tail for io_uring zc



Move tcp_write_queue_tail() to SOCK_ZEROCOPY specific flag as zerocopy
setup for msghdr->ubuf_info doesn't need to peek into the last request.

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 833e24ae
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1229,13 +1229,12 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
	flags = msg->msg_flags;

	if ((flags & MSG_ZEROCOPY) && size) {
		skb = tcp_write_queue_tail(sk);

		if (msg->msg_ubuf) {
			uarg = msg->msg_ubuf;
			net_zcopy_get(uarg);
			zc = sk->sk_route_caps & NETIF_F_SG;
		} else if (sock_flag(sk, SOCK_ZEROCOPY)) {
			skb = tcp_write_queue_tail(sk);
			uarg = msg_zerocopy_realloc(sk, size, skb_zcopy(skb));
			if (!uarg) {
				err = -ENOBUFS;