Re: [PATCH] ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets
flat view
From: Neil Horman <nhorman@tuxdriver.com>
Date: 2011-04-06 18:39:17
On Wed, Apr 06, 2011 at 08:07:33PM +0200, Eric Dumazet wrote:
Le mercredi 06 avril 2011 à 13:54 -0400, Neil Horman a écrit :quoted
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index d7037c0..aa3e327 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c@@ -505,6 +505,8 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) int rc; int is_udplite = IS_UDPLITE(sk); + sock_rps_save_rxhash(sk, skb->rxhash); + if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) goto drop;Problem is every packet received might have a different rxhash if multiple senders are active. This can hurt performance (cache misses on RFS table) on a DNS server workload for example. This is why we used on ipv4 : if (inet_sk(sk)->inet_daddr) sock_rps_save_rxhash(sk, skb->rxhash);
Ok, I can absolutely do that, I'll respin shortly. Just to make sure I understand how to do this, the ipv6 equivalant of inet_daddr is inet6_sk(sk)->daddr, correct? I ask because the above v4 equivalent is stored in the sk_common struct, and I want to make sure I'm testing the right data. Also, do we have a macro already to see if an ipv6 address is all zeros? I'm not finding one, but I'd hate to re-invent the wheel if I'm just missing it.
Only arm RFS on UDP if socket is bound to a given remote peer. BTW you forgot Tom Herbert. (I added him in CC)
Thanks, sorry Tom, Just took the output of get_maintainers.pl without checking all the results. Neil