summaryrefslogtreecommitdiff
path: root/target/linux/mediatek/patches-4.9/0039-net-next-dsa-add-flow_dissect-callback-to-struct-dsa.patch
blob: ebc52c83fefd78a88444fec75c2a3e678e68fd18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 22e8b65ea4bf8a1fa757137bdcbdefe505fa4044 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Mon, 7 Aug 2017 16:35:43 +0200
Subject: [PATCH 39/57] net-next: dsa: add flow_dissect callback to struct
 dsa_device_ops

When the flow dissector first sees packets coming in on a DSA devices the
802.3 header wont be located where the code expects it to be as the tag
is still present. Adding this new callback allows a DSA device to provide a
new function that the flow_disscetor can use to get the correct offsets
for the protocol field and network header offset.

Signed-off-by: John Crispin <john@phrozen.org>
---
 include/net/dsa.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -90,9 +90,11 @@ struct packet_type;
 
 struct dsa_device_ops {
 	struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
-	int sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
+	int (*rcv)(struct sk_buff *skb, struct net_device *dev,
 			       struct packet_type *pt,
 			       struct net_device *orig_dev);
+	int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
+			    int *offset);
 };
 
 struct dsa_switch_tree {