Patchwork [net-next] flow_dissector: support L2 GRE

login
register
mail settings
Submitter Eric Dumazet
Date March 11, 2013, 4:52 p.m.
Message ID <1363020748.13690.3.camel@edumazet-glaptop>
Download mbox | patch
Permalink /patch/226611/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - March 11, 2013, 4:52 p.m.
From: Michael Dalton <mwdalton@google.com>

Add support for L2 GRE tunnels, so that RPS can be more effective.

Signed-off-by: Michael Dalton <mwdalton@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/flow_dissector.c |   11 +++++++++++
 1 file changed, 11 insertions(+)



--
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
David Miller - March 12, 2013, 9:15 a.m.
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 11 Mar 2013 17:52:28 +0100

> From: Michael Dalton <mwdalton@google.com>
> 
> Add support for L2 GRE tunnels, so that RPS can be more effective.
> 
> Signed-off-by: Michael Dalton <mwdalton@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.
--
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

Patch

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 9d4c720..f8d9e03 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -119,6 +119,17 @@  ipv6:
 				nhoff += 4;
 			if (hdr->flags & GRE_SEQ)
 				nhoff += 4;
+			if (proto == htons(ETH_P_TEB)) {
+				const struct ethhdr *eth;
+				struct ethhdr _eth;
+
+				eth = skb_header_pointer(skb, nhoff,
+							 sizeof(_eth), &_eth);
+				if (!eth)
+					return false;
+				proto = eth->h_proto;
+				nhoff += sizeof(*eth);
+			}
 			goto again;
 		}
 		break;