aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2017-01-07 17:06:35 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-08 20:58:52 -0500
commite7246e122aaa99ebbb8ad7da80f35a20577bd8af (patch)
treee1da3b73bd34b4e85b7b781276aa3ab65acb15d4 /net/core/dev.c
parentd6264071ce7d100a2b7c1f295167796ab5178caf (diff)
net-tc: extract skip classify bit from tc_verd
Packets sent by the IFB device skip subsequent tc classification. A single bit governs this state. Move it out of tc_verd in anticipation of removing that __u16 completely. The new bitfield tc_skip_classify temporarily uses one bit of a hole, until tc_verd is removed completely in a follow-up patch. Remove the bit hole comment. It could be 2, 3, 4 or 5 bits long. With that many options, little value in documenting it. Introduce a helper function to deduplicate the logic in the two sites that check this bit. The field tc_skip_classify is set only in IFB on skbs cloned in act_mirred, so original packet sources do not have to clear the bit when reusing packets (notably, pktgen and octeon). Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 56818f7eab2b..e39e35d2e082 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4093,12 +4093,8 @@ another_round:
4093 goto out; 4093 goto out;
4094 } 4094 }
4095 4095
4096#ifdef CONFIG_NET_CLS_ACT 4096 if (skb_skip_tc_classify(skb))
4097 if (skb->tc_verd & TC_NCLS) { 4097 goto skip_classify;
4098 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
4099 goto ncls;
4100 }
4101#endif
4102 4098
4103 if (pfmemalloc) 4099 if (pfmemalloc)
4104 goto skip_taps; 4100 goto skip_taps;
@@ -4128,8 +4124,8 @@ skip_taps:
4128#endif 4124#endif
4129#ifdef CONFIG_NET_CLS_ACT 4125#ifdef CONFIG_NET_CLS_ACT
4130 skb->tc_verd = 0; 4126 skb->tc_verd = 0;
4131ncls:
4132#endif 4127#endif
4128skip_classify:
4133 if (pfmemalloc && !skb_pfmemalloc_protocol(skb)) 4129 if (pfmemalloc && !skb_pfmemalloc_protocol(skb))
4134 goto drop; 4130 goto drop;
4135 4131