brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0220-net-sched-add-skb_at_tc_ingress-helper.patch
1 From 645e1a7bb2e9ab5d3a12fd8eac7b553ee8122ba9 Mon Sep 17 00:00:00 2001
2 From: Daniel Borkmann <daniel@iogearbox.net>
3 Date: Thu, 7 Jan 2016 15:50:22 +0100
4 Subject: [PATCH 220/304] net, sched: add skb_at_tc_ingress helper
5
6 Add a skb_at_tc_ingress() as this will be needed elsewhere as well and
7 can hide the ugly ifdef.
8
9 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
10 Acked-by: Alexei Starovoitov <ast@kernel.org>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13 include/net/sch_generic.h | 9 +++++++++
14 net/sched/cls_bpf.c | 6 +-----
15 2 files changed, 10 insertions(+), 5 deletions(-)
16
17 --- a/include/net/sch_generic.h
18 +++ b/include/net/sch_generic.h
19 @@ -408,6 +408,15 @@ bool tcf_destroy(struct tcf_proto *tp, b
20 void tcf_destroy_chain(struct tcf_proto __rcu **fl);
21 int skb_do_redirect(struct sk_buff *);
22
23 +static inline bool skb_at_tc_ingress(const struct sk_buff *skb)
24 +{
25 +#ifdef CONFIG_NET_CLS_ACT
26 + return G_TC_AT(skb->tc_verd) & AT_INGRESS;
27 +#else
28 + return false;
29 +#endif
30 +}
31 +
32 /* Reset all TX qdiscs greater then index of a device. */
33 static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
34 {
35 --- a/net/sched/cls_bpf.c
36 +++ b/net/sched/cls_bpf.c
37 @@ -79,12 +79,8 @@ static int cls_bpf_classify(struct sk_bu
38 struct tcf_result *res)
39 {
40 struct cls_bpf_head *head = rcu_dereference_bh(tp->root);
41 + bool at_ingress = skb_at_tc_ingress(skb);
42 struct cls_bpf_prog *prog;
43 -#ifdef CONFIG_NET_CLS_ACT
44 - bool at_ingress = G_TC_AT(skb->tc_verd) & AT_INGRESS;
45 -#else
46 - bool at_ingress = false;
47 -#endif
48 int ret = -1;
49
50 if (unlikely(!skb_mac_header_was_set(skb)))