mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
net: sched: extract qstats update code into functions
[ Upstream commit 26b537a88ca5b7399c7ab0656e06dbd9da9513c1 ]
Extract common code that increments cpu_qstats counters into standalone act
API functions. Change hardware offloaded actions that use percpu counter
allocation to use the new functions instead of accessing cpu_qstats
directly.
This commit doesn't change functionality.
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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
dc15bd5634
commit
b7b56a5f5c
6 changed files with 21 additions and 5 deletions
|
|
@ -193,6 +193,22 @@ static inline void tcf_action_update_bstats(struct tc_action *a,
|
|||
bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), skb);
|
||||
}
|
||||
|
||||
static inline struct gnet_stats_queue *
|
||||
tcf_action_get_qstats(struct tc_action *a)
|
||||
{
|
||||
return this_cpu_ptr(a->cpu_qstats);
|
||||
}
|
||||
|
||||
static inline void tcf_action_inc_drop_qstats(struct tc_action *a)
|
||||
{
|
||||
qstats_drop_inc(this_cpu_ptr(a->cpu_qstats));
|
||||
}
|
||||
|
||||
static inline void tcf_action_inc_overlimit_qstats(struct tc_action *a)
|
||||
{
|
||||
qstats_overlimit_inc(this_cpu_ptr(a->cpu_qstats));
|
||||
}
|
||||
|
||||
void tcf_action_update_stats(struct tc_action *a, u64 bytes, u32 packets,
|
||||
bool drop, bool hw);
|
||||
int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
|
||||
|
|
|
|||
|
|
@ -621,7 +621,7 @@ out:
|
|||
return action;
|
||||
|
||||
drop:
|
||||
qstats_drop_inc(this_cpu_ptr(p->common.cpu_qstats));
|
||||
tcf_action_inc_drop_qstats(&p->common);
|
||||
action = TC_ACT_SHOT;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ out:
|
|||
return retval;
|
||||
|
||||
drop:
|
||||
qstats_drop_inc(this_cpu_ptr(a->cpu_qstats));
|
||||
tcf_action_inc_drop_qstats(&c->common);
|
||||
return TC_ACT_SHOT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static int tcf_gact_act(struct sk_buff *skb, const struct tc_action *a,
|
|||
#endif
|
||||
tcf_action_update_bstats(&gact->common, skb);
|
||||
if (action == TC_ACT_SHOT)
|
||||
qstats_drop_inc(this_cpu_ptr(gact->common.cpu_qstats));
|
||||
tcf_action_inc_drop_qstats(&gact->common);
|
||||
|
||||
tcf_lastuse_update(&gact->tcf_tm);
|
||||
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,
|
|||
|
||||
if (err) {
|
||||
out:
|
||||
qstats_overlimit_inc(this_cpu_ptr(m->common.cpu_qstats));
|
||||
tcf_action_inc_overlimit_qstats(&m->common);
|
||||
if (tcf_mirred_is_act_redirect(m_eaction))
|
||||
retval = TC_ACT_SHOT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ out:
|
|||
return action;
|
||||
|
||||
drop:
|
||||
qstats_drop_inc(this_cpu_ptr(v->common.cpu_qstats));
|
||||
tcf_action_inc_drop_qstats(&v->common);
|
||||
return TC_ACT_SHOT;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue