Merge tag 'io_uring-6.1-2022-10-22' of git://git.kernel.dk/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 23 Oct 2022 16:55:50 +0000 (09:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 23 Oct 2022 16:55:50 +0000 (09:55 -0700)
Pull io_uring follow-up from Jens Axboe:
 "Currently the zero-copy has automatic fallback to normal transmit, and
  it was decided that it'd be cleaner to return an error instead if the
  socket type doesn't support it.

  Zero-copy does work with UDP and TCP, it's more of a future proofing
  kind of thing (eg for samba)"

* tag 'io_uring-6.1-2022-10-22' of git://git.kernel.dk/linux:
  io_uring/net: fail zc sendmsg when unsupported by socket
  io_uring/net: fail zc send when unsupported by socket
  net: flag sockets supporting msghdr originated zerocopy

1  2 
net/ipv4/udp.c

diff --combined net/ipv4/udp.c
@@@ -448,7 -448,7 +448,7 @@@ static struct sock *udp4_lib_lookup2(st
                        result = lookup_reuseport(net, sk, skb,
                                                  saddr, sport, daddr, hnum);
                        /* Fall back to scoring if group has connections */
 -                      if (result && !reuseport_has_conns(sk, false))
 +                      if (result && !reuseport_has_conns(sk))
                                return result;
  
                        result = result ? : sk;
@@@ -1624,6 -1624,7 +1624,7 @@@ int udp_init_sock(struct sock *sk
  {
        skb_queue_head_init(&udp_sk(sk)->reader_queue);
        sk->sk_destruct = udp_destruct_sock;
+       set_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags);
        return 0;
  }