Commit e8cb5bcf authored by Baowen Zheng's avatar Baowen Zheng Committed by David S. Miller

net: sched: save full flags for tc action

Save full action flags and return user flags when return flags to
user space.

Save full action flags to distinguish if the action is created
independent from classifier.

We made this change mainly for further patch to reoffload tc actions.
Signed-off-by: default avatarBaowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7a66f8d
...@@ -669,7 +669,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, ...@@ -669,7 +669,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
p->tcfa_tm.install = jiffies; p->tcfa_tm.install = jiffies;
p->tcfa_tm.lastuse = jiffies; p->tcfa_tm.lastuse = jiffies;
p->tcfa_tm.firstuse = 0; p->tcfa_tm.firstuse = 0;
p->tcfa_flags = flags & TCA_ACT_FLAGS_USER_MASK; p->tcfa_flags = flags;
if (est) { if (est) {
err = gen_new_estimator(&p->tcfa_bstats, p->cpu_bstats, err = gen_new_estimator(&p->tcfa_bstats, p->cpu_bstats,
&p->tcfa_rate_est, &p->tcfa_rate_est,
...@@ -996,6 +996,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) ...@@ -996,6 +996,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
int err = -EINVAL; int err = -EINVAL;
unsigned char *b = skb_tail_pointer(skb); unsigned char *b = skb_tail_pointer(skb);
struct nlattr *nest; struct nlattr *nest;
u32 flags;
if (tcf_action_dump_terse(skb, a, false)) if (tcf_action_dump_terse(skb, a, false))
goto nla_put_failure; goto nla_put_failure;
...@@ -1010,9 +1011,10 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) ...@@ -1010,9 +1011,10 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
a->used_hw_stats, TCA_ACT_HW_STATS_ANY)) a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
goto nla_put_failure; goto nla_put_failure;
if (a->tcfa_flags && flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
if (flags &&
nla_put_bitfield32(skb, TCA_ACT_FLAGS, nla_put_bitfield32(skb, TCA_ACT_FLAGS,
a->tcfa_flags, a->tcfa_flags)) flags, flags))
goto nla_put_failure; goto nla_put_failure;
if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count)) if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment