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>
This commit is contained in:

committed by
David S. Miller

parent
e7246e122a
commit
a5135bcfba
@@ -409,10 +409,18 @@ bool tcf_destroy(struct tcf_proto *tp, bool force);
|
||||
void tcf_destroy_chain(struct tcf_proto __rcu **fl);
|
||||
int skb_do_redirect(struct sk_buff *);
|
||||
|
||||
static inline void skb_reset_tc(struct sk_buff *skb)
|
||||
{
|
||||
#ifdef CONFIG_NET_CLS_ACT
|
||||
skb->tc_at = 0;
|
||||
skb->tc_from = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool skb_at_tc_ingress(const struct sk_buff *skb)
|
||||
{
|
||||
#ifdef CONFIG_NET_CLS_ACT
|
||||
return G_TC_AT(skb->tc_verd) & AT_INGRESS;
|
||||
return skb->tc_at & AT_INGRESS;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user