mediatek: update to latest kernel patchset from v4.13-rc
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.9 / 0039-net-next-dsa-add-flow_dissect-callback-to-struct-dsa.patch
1 From 22e8b65ea4bf8a1fa757137bdcbdefe505fa4044 Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Mon, 7 Aug 2017 16:35:43 +0200
4 Subject: [PATCH 39/57] net-next: dsa: add flow_dissect callback to struct
5 dsa_device_ops
6
7 When the flow dissector first sees packets coming in on a DSA devices the
8 802.3 header wont be located where the code expects it to be as the tag
9 is still present. Adding this new callback allows a DSA device to provide a
10 new function that the flow_disscetor can use to get the correct offsets
11 for the protocol field and network header offset.
12
13 Signed-off-by: John Crispin <john@phrozen.org>
14 ---
15 include/net/dsa.h | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18 --- a/include/net/dsa.h
19 +++ b/include/net/dsa.h
20 @@ -90,9 +90,11 @@ struct packet_type;
21
22 struct dsa_device_ops {
23 struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
24 - int sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
25 + int (*rcv)(struct sk_buff *skb, struct net_device *dev,
26 struct packet_type *pt,
27 struct net_device *orig_dev);
28 + int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
29 + int *offset);
30 };
31
32 struct dsa_switch_tree {