Le vendredi 16 avril 2010 à 23:12 +0200, Eric Dumazet a écrit :
With attached patch, I reached
Throughput 4465.13 MB/sec 16 procs
RFS better than no RPS/RFS :)
So, the old idea to make rxhash consistent (same value in both
directions) is a win for some workloads (Consider connection tracking /
firewalling)
port1 = ...
port2 = ...
addr1 = ...
addr2 = ...
if (addr1 > addr2)
exchange(addr1, addr2)
if (port1 > port2)
exchange(port, port2)
hash = jhash(addr1, addr2, (port1<<16)+port2, ...)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7abf959..6b757ff 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2280,8 +2280,10 @@ static int get_rps_cpu(struct net_device *dev,
struct sk_buff *skb,
case IPPROTO_AH:
case IPPROTO_SCTP:
case IPPROTO_UDPLITE:
- if (pskb_may_pull(skb, (ihl * 4) + 4))
- ports = *((u32 *) (skb->data + (ihl * 4)));
+ if (pskb_may_pull(skb, (ihl * 4) + 4)) {
+ u16 *_ports = (u16 *)(skb->data + (ihl * 4));
+ ports = _ports[0] ^ _ports[1];
+ }
break;
default:
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html