diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2016-07-26 02:09:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-26 07:49:19 +0300 |
commit | a85a970af265f156740977168b542234511b28a8 (patch) | |
tree | 19866c37883917b1ec6964fcbae76335f9de0139 /include/net/tc_act/tc_gact.h | |
parent | b93dd49c1a35884864027abd707889b795637f7a (diff) | |
download | linux-a85a970af265f156740977168b542234511b28a8.tar.xz |
net_sched: move tc_action into tcf_common
struct tc_action is confusing, currently we use it for two purposes:
1) Pass in arguments and carry out results from helper functions
2) A generic representation for tc actions
The first one is error-prone, since we need to make sure we don't
miss anything. This patch aims to get rid of this use, by moving
tc_action into tcf_common, so that they are allocated together
in hashtable and can be cast'ed easily.
And together with the following patch, we could really make
tc_action a generic representation for all tc actions and each
type of action can inherit from it.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tc_act/tc_gact.h')
-rw-r--r-- | include/net/tc_act/tc_gact.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/tc_act/tc_gact.h b/include/net/tc_act/tc_gact.h index 93c520b83d10..119cdb418c23 100644 --- a/include/net/tc_act/tc_gact.h +++ b/include/net/tc_act/tc_gact.h @@ -13,8 +13,7 @@ struct tcf_gact { atomic_t packets; #endif }; -#define to_gact(a) \ - container_of(a->priv, struct tcf_gact, common) +#define to_gact(a) ((struct tcf_gact *)a) static inline bool is_tcf_gact_shot(const struct tc_action *a) { @@ -24,7 +23,7 @@ static inline bool is_tcf_gact_shot(const struct tc_action *a) if (a->ops && a->ops->type != TCA_ACT_GACT) return false; - gact = a->priv; + gact = to_gact(a); if (gact->tcf_action == TC_ACT_SHOT) return true; |