mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
net/sched: act_mirred: refactor the handle of xmit
[ Upstream commit fa6d639930ee5cd3f932cc314f3407f07a06582d ]
This one is prepare for the next patch.
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ 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
7192eb73a0
commit
02ca042304
2 changed files with 15 additions and 11 deletions
|
|
@ -1320,11 +1320,6 @@ 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 int skb_tc_reinsert(struct sk_buff *skb, struct tcf_result *res)
|
||||
{
|
||||
return res->ingress ? netif_receive_skb(skb) : dev_queue_xmit(skb);
|
||||
}
|
||||
|
||||
/* Make sure qdisc is no longer in SCHED state. */
|
||||
static inline void qdisc_synchronize(const struct Qdisc *q)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -206,6 +206,18 @@ release_idr:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int tcf_mirred_forward(bool want_ingress, struct sk_buff *skb)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (!want_ingress)
|
||||
err = dev_queue_xmit(skb);
|
||||
else
|
||||
err = netif_receive_skb(skb);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,
|
||||
struct tcf_result *res)
|
||||
{
|
||||
|
|
@ -295,18 +307,15 @@ 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;
|
||||
if (skb_tc_reinsert(skb, res))
|
||||
err = tcf_mirred_forward(res->ingress, skb);
|
||||
if (err)
|
||||
tcf_action_inc_overlimit_qstats(&m->common);
|
||||
__this_cpu_dec(mirred_rec_level);
|
||||
return TC_ACT_CONSUMED;
|
||||
}
|
||||
}
|
||||
|
||||
if (!want_ingress)
|
||||
err = dev_queue_xmit(skb2);
|
||||
else
|
||||
err = netif_receive_skb(skb2);
|
||||
|
||||
err = tcf_mirred_forward(want_ingress, skb2);
|
||||
if (err) {
|
||||
out:
|
||||
tcf_action_inc_overlimit_qstats(&m->common);
|
||||
|
|
|
|||
Loading…
Reference in a new issue