mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
net: sched: don't expose action qstats to skb_tc_reinsert()
[ Upstream commit ef816f3c49c1c404ababc50e10d4cbe5109da678 ]
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>
[ skulkarni: Adjusted patch for file 'sch_generic.h' wrt the mainline commit ]
Stable-dep-of: ca22da2fbd69 ("act_mirred: use the backlog for nested calls to mirred ingress")
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b7b56a5f5c
commit
4d6f20bf0f
2 changed files with 4 additions and 12 deletions
|
|
@ -1320,17 +1320,9 @@ void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp,
|
|||
void mini_qdisc_pair_init(struct mini_Qdisc_pair *miniqp, struct Qdisc *qdisc,
|
||||
struct mini_Qdisc __rcu **p_miniq);
|
||||
|
||||
static inline void skb_tc_reinsert(struct sk_buff *skb, struct tcf_result *res)
|
||||
static inline int skb_tc_reinsert(struct sk_buff *skb, struct tcf_result *res)
|
||||
{
|
||||
struct gnet_stats_queue *stats = res->qstats;
|
||||
int ret;
|
||||
|
||||
if (res->ingress)
|
||||
ret = netif_receive_skb(skb);
|
||||
else
|
||||
ret = dev_queue_xmit(skb);
|
||||
if (ret && stats)
|
||||
qstats_overlimit_inc(res->qstats);
|
||||
return res->ingress ? netif_receive_skb(skb) : dev_queue_xmit(skb);
|
||||
}
|
||||
|
||||
/* Make sure qdisc is no longer in SCHED state. */
|
||||
|
|
|
|||
|
|
@ -295,8 +295,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue