Skip to contentSkip to conversation

flow_dissector: support L2 GRE

PATCH Applied Eric Dumazet 2 participants 2 messages Mar 11, 2013 – Mar 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flow_dissector: support L2 GRE

From: Michael Dalton <[email protected]>

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

---
 net/core/flow_dissector.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
net/core/flow_dissector.c +11 -0
index 9d4c720..f8d9e03 100644
@@ -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;