summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-10-30 15:09:03 +0100
committerDavid S. Miller <davem@davemloft.net>2019-10-31 02:07:50 +0100
commitef816f3c49c1c404ababc50e10d4cbe5109da678 (patch)
treef9caa7727948d1b465e9e47041bfd2cb82586b40 /net/sched
parentnet: sched: extract qstats update code into functions (diff)
downloadlinux-ef816f3c49c1c404ababc50e10d4cbe5109da678.tar.xz
linux-ef816f3c49c1c404ababc50e10d4cbe5109da678.zip
net: sched: don't expose action qstats to skb_tc_reinsert()
Previous commit introduced helper function for updating qstats and refactored set of actions to use the helpers, instead of modifying qstats directly. However, one of the affected action exposes its qstats to skb_tc_reinsert(), which then modifies it. Refactor skb_tc_reinsert() to return integer error code and don't increment overlimit qstats in case of error, and use the returned error code in tcf_mirred_act() to manually increment the overlimit counter with new helper function. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_mirred.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 49a378a5b4fa..ae1129aaf3c0 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -289,8 +289,8 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,
/* let's the caller reinsert the packet, if possible */
if (use_reinsert) {
res->ingress = want_ingress;
- res->qstats = this_cpu_ptr(m->common.cpu_qstats);
- skb_tc_reinsert(skb, res);
+ if (skb_tc_reinsert(skb, res))
+ tcf_action_inc_overlimit_qstats(&m->common);
__this_cpu_dec(mirred_rec_level);
return TC_ACT_CONSUMED;
}