diff options
author | Willem de Bruijn <willemb@google.com> | 2017-01-07 17:06:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-08 20:58:52 -0500 |
commit | a5135bcfba7345031df45e02cd150a45add47cf8 (patch) | |
tree | 11e201bd54742af84404e74007a9408f14b5aa0f /net/core/dev.c | |
parent | e7246e122aaa99ebbb8ad7da80f35a20577bd8af (diff) |
net-tc: convert tc_verd to integer bitfields
Extract the remaining two fields from tc_verd and remove the __u16
completely. TC_AT and TC_FROM are converted to equivalent two-bit
integer fields tc_at and tc_from. Where possible, use existing
helper skb_at_tc_ingress when reading tc_at. Introduce helper
skb_reset_tc to clear fields.
Not documenting tc_from and tc_at, because they will be replaced
with single bit fields in follow-on patches.
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.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index e39e35d2e082..8b5d6d033473 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3153,7 +3153,7 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) | |||
3153 | if (!cl) | 3153 | if (!cl) |
3154 | return skb; | 3154 | return skb; |
3155 | 3155 | ||
3156 | /* skb->tc_verd and qdisc_skb_cb(skb)->pkt_len were already set | 3156 | /* skb->tc_at and qdisc_skb_cb(skb)->pkt_len were already set |
3157 | * earlier by the caller. | 3157 | * earlier by the caller. |
3158 | */ | 3158 | */ |
3159 | qdisc_bstats_cpu_update(cl->q, skb); | 3159 | qdisc_bstats_cpu_update(cl->q, skb); |
@@ -3320,7 +3320,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) | |||
3320 | 3320 | ||
3321 | qdisc_pkt_len_init(skb); | 3321 | qdisc_pkt_len_init(skb); |
3322 | #ifdef CONFIG_NET_CLS_ACT | 3322 | #ifdef CONFIG_NET_CLS_ACT |
3323 | skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); | 3323 | skb->tc_at = AT_EGRESS; |
3324 | # ifdef CONFIG_NET_EGRESS | 3324 | # ifdef CONFIG_NET_EGRESS |
3325 | if (static_key_false(&egress_needed)) { | 3325 | if (static_key_false(&egress_needed)) { |
3326 | skb = sch_handle_egress(skb, &rc, dev); | 3326 | skb = sch_handle_egress(skb, &rc, dev); |
@@ -3920,7 +3920,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, | |||
3920 | } | 3920 | } |
3921 | 3921 | ||
3922 | qdisc_skb_cb(skb)->pkt_len = skb->len; | 3922 | qdisc_skb_cb(skb)->pkt_len = skb->len; |
3923 | skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_INGRESS); | 3923 | skb->tc_at = AT_INGRESS; |
3924 | qdisc_bstats_cpu_update(cl->q, skb); | 3924 | qdisc_bstats_cpu_update(cl->q, skb); |
3925 | 3925 | ||
3926 | switch (tc_classify(skb, cl, &cl_res, false)) { | 3926 | switch (tc_classify(skb, cl, &cl_res, false)) { |
@@ -4122,9 +4122,7 @@ skip_taps: | |||
4122 | goto out; | 4122 | goto out; |
4123 | } | 4123 | } |
4124 | #endif | 4124 | #endif |
4125 | #ifdef CONFIG_NET_CLS_ACT | 4125 | skb_reset_tc(skb); |
4126 | skb->tc_verd = 0; | ||
4127 | #endif | ||
4128 | skip_classify: | 4126 | skip_classify: |
4129 | if (pfmemalloc && !skb_pfmemalloc_protocol(skb)) | 4127 | if (pfmemalloc && !skb_pfmemalloc_protocol(skb)) |
4130 | goto drop; | 4128 | goto drop; |