From: Paolo Abeni Date: Thu, 22 Jun 2017 13:01:22 +0000 (+0200) Subject: udp/v6: prefetch rmem_alloc in udp6_queue_rcv_skb() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4b943faedfc29eda882851b772c06cecdf78d8e3;p=openwrt%2Fstaging%2Fblogic.git udp/v6: prefetch rmem_alloc in udp6_queue_rcv_skb() 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 2b33847bf931..d1d728805729 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -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;