net: sched: update action implementations to support flags
Extend struct tc_action with new "tcfa_flags" field. Set the field in tcf_idr_create() function and provide new helper tcf_idr_create_from_flags() that derives 'cpustats' boolean from flags value. Update individual hardware-offloaded actions init() to pass their "flags" argument to new helper in order to skip percpu stats allocation when user requested it through flags. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
abbb0d3363
commit
e382267860
@@ -148,8 +148,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
|
||||
NL_SET_ERR_MSG_MOD(extack, "Specified device does not exist");
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = tcf_idr_create(tn, index, est, a,
|
||||
&act_mirred_ops, bind, true);
|
||||
ret = tcf_idr_create_from_flags(tn, index, est, a,
|
||||
&act_mirred_ops, bind, flags);
|
||||
if (ret) {
|
||||
tcf_idr_cleanup(tn, index);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user