Skip to content

Commit 21c167a

Browse files
tammelakuba-moo
authored andcommitted
net/sched: act_ctinfo: use percpu stats
The tc action act_ctinfo was using shared stats, fix it to use percpu stats since bstats_update() must be called with locks or with a percpu pointer argument. tdc results: 1..12 ok 1 c826 - Add ctinfo action with default setting ok 2 0286 - Add ctinfo action with dscp ok 3 4938 - Add ctinfo action with valid cpmark and zone ok 4 7593 - Add ctinfo action with drop control ok 5 2961 - Replace ctinfo action zone and action control ok 6 e567 - Delete ctinfo action with valid index ok 7 6a91 - Delete ctinfo action with invalid index ok 8 5232 - List ctinfo actions ok 9 7702 - Flush ctinfo actions ok 10 3201 - Add ctinfo action with duplicate index ok 11 8295 - Add ctinfo action with invalid index ok 12 3964 - Replace ctinfo action with invalid goto_chain control Fixes: 24ec483 ("net: sched: Introduce act_ctinfo action") Reviewed-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Pedro Tammela <[email protected]> Reviewed-by: Larysa Zaremba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4562c65 commit 21c167a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/sched/act_ctinfo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ TC_INDIRECT_SCOPE int tcf_ctinfo_act(struct sk_buff *skb,
9393
cp = rcu_dereference_bh(ca->params);
9494

9595
tcf_lastuse_update(&ca->tcf_tm);
96-
bstats_update(&ca->tcf_bstats, skb);
96+
tcf_action_update_bstats(&ca->common, skb);
9797
action = READ_ONCE(ca->tcf_action);
9898

9999
wlen = skb_network_offset(skb);
@@ -212,8 +212,8 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla,
212212
index = actparm->index;
213213
err = tcf_idr_check_alloc(tn, &index, a, bind);
214214
if (!err) {
215-
ret = tcf_idr_create(tn, index, est, a,
216-
&act_ctinfo_ops, bind, false, flags);
215+
ret = tcf_idr_create_from_flags(tn, index, est, a,
216+
&act_ctinfo_ops, bind, flags);
217217
if (ret) {
218218
tcf_idr_cleanup(tn, index);
219219
return ret;

0 commit comments

Comments
 (0)