On Tue, 2012-07-24 at 22:58 +0200, Eric Dumazet wrote:
> Its a single line change in net/core/flow_dissector.c
>
Well, its a bit more than one line ;)
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h
index 80461c1..b5bae21 100644
--- a/include/net/flow_keys.h
+++ b/include/net/flow_keys.h
@@ -10,6 +10,7 @@ struct flow_keys {
__be16 port16[2];
};
u8 ip_proto;
+ u8 tcpflags;
};
extern bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys
*flow);
diff --git a/net/core/dev.c b/net/core/dev.c
index 0ebaea1..0df90e7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -135,6 +135,7 @@
#include <linux/net_tstamp.h>
#include <linux/static_key.h>
#include <net/flow_keys.h>
+#include <net/tcp.h>
#include "net-sysfs.h"
@@ -2629,6 +2630,12 @@ void __skb_get_rxhash(struct sk_buff *skb)
return;
if (keys.ports) {
+ if ((keys.tcpflags & (TCPHDR_SYN | TCPHDR_ACK)) == TCPHDR_SYN) {
+ hash = jhash_2words((__force u32)keys.dst,
+ (__force u32)keys.port16[1],
+ hashrnd);
+ goto end;
+ }
if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0])
swap(keys.port16[0], keys.port16[1]);
skb->l4_rxhash = 1;
@@ -2641,6 +2648,7 @@ void __skb_get_rxhash(struct sk_buff *skb)
hash = jhash_3words((__force u32)keys.dst,
(__force u32)keys.src,
(__force u32)keys.ports, hashrnd);
+end:
if (!hash)
hash = 1;
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 466820b..4d5bae1 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -138,6 +138,15 @@ ipv6:
ports = skb_header_pointer(skb, nhoff, sizeof(_ports), &_ports);
if (ports)
flow->ports = *ports;
+ if (ip_proto == IPPROTO_TCP) {
+ __u8 *tcpflags, _tcpflags;
+
+ tcpflags = skb_header_pointer(skb, nhoff + 13,
+ sizeof(_tcpflags),
+ &_tcpflags);
+ if (tcpflags)
+ flow->tcpflags = *tcpflags;
+ }
}
return true;
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit
http://communities.intel.com/community/wired