]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
udp/v6: prefetch rmem_alloc in udp6_queue_rcv_skb()
authorPaolo Abeni <pabeni@redhat.com>
Thu, 22 Jun 2017 13:01:22 +0000 (15:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Jun 2017 17:44:04 +0000 (13:44 -0400)
very similar to commit dd99e425be23 ("udp: prefetch
rmem_alloc in udp_queue_rcv_skb()"), this allows saving a cache
miss when the BH is bottle-neck for UDP over ipv6 packet
processing, e.g. for small packets when a single RX NIC ingress
queue is in use.

Performances under flood when multiple NIC RX queues used are
unaffected, but when a single NIC rx queue is in use, this
gives ~8% performance improvement.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/udp.c

index 2b33847bf931100d8c8de96e662f5e96d73a7e20..d1d72880572938ad99a4779f4216ccb4f14a8f92 100644 (file)
@@ -630,6 +630,7 @@ static int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
                }
        }
 
+       prefetch(&sk->sk_rmem_alloc);
        if (rcu_access_pointer(sk->sk_filter) &&
            udp_lib_checksum_complete(skb))
                goto csum_error;