diff mbox

net_sched: dsmark: use qdisc_dequeue_peeked()

Message ID 1456953590.3297.58.camel@kyeongy-dl
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Kyeong Yoo March 2, 2016, 9:19 p.m. UTC
Author: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>

net_sched: dsmark: use qdisc_dequeue_peeked()

This fix is for dsmark similar to commit 3557619f0f6f7496ed453d4825e249
("net_sched: prio: use qdisc_dequeue_peeked")
and makes use of qdisc_dequeue_peeked() instead of direct dequeue() call.

First time, wrr peeks dsmark, which will then peek into sfq.
sfq dequeues an skb and it's stored in sch->gso_skb.
Next time, wrr tries to dequeue from dsmark, which will call sfq dequeue
directly. This results skipping the previously peeked skb.

So changed dsmark dequeue to call qdisc_dequeue_peeked() instead to use
peeked skb if exists.

Signed-off-by: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>


On Wed, 2016-03-02 at 10:26 -0800, Cong Wang wrote:
> On Tue, Mar 1, 2016 at 8:10 PM, Kyeong Yoo

> <Kyeong.Yoo@alliedtelesis.co.nz> wrote:

> > This fix is for dsmark similar to 3557619f0f6f7496ed453d4825e24958ab1884e0,

> > and makes use of qdisc_dequeue_peeked() instead of direct dequeue() call.

> >

> > First time, wrr peeks dsmark, which will then peek into sfq.

> > sfq dequeues an skb and it's stored in sch->gso_skb.

> > Next time, wrr tries to dequeue from dsmark, which will call sfq dequeue

> > directly. This results skipping the previously peeked skb.

> >

> > So changed dsmark dequeue to call qdisc_dequeue_peeked() instead to use

> > peeked skb if exists.

> 

> 

> This part looks reasonable to me.

> 

> >

> > Also replaced dsmark peek to use qdisc_peek_dequeued() which works correctly

> > if previously peeked skb still exists.

> 

> 

> But not this part, since sfq already calls qdisc_peek_dequeued()?

Comments

Cong Wang March 2, 2016, 10:01 p.m. UTC | #1
On Wed, Mar 2, 2016 at 1:19 PM, Kyeong Yoo
<Kyeong.Yoo@alliedtelesis.co.nz> wrote:
> Author: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>
>
> net_sched: dsmark: use qdisc_dequeue_peeked()
>
> This fix is for dsmark similar to commit 3557619f0f6f7496ed453d4825e249
> ("net_sched: prio: use qdisc_dequeue_peeked")
> and makes use of qdisc_dequeue_peeked() instead of direct dequeue() call.
>
> First time, wrr peeks dsmark, which will then peek into sfq.
> sfq dequeues an skb and it's stored in sch->gso_skb.
> Next time, wrr tries to dequeue from dsmark, which will call sfq dequeue
> directly. This results skipping the previously peeked skb.
>
> So changed dsmark dequeue to call qdisc_dequeue_peeked() instead to use
> peeked skb if exists.
>
> Signed-off-by: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>


Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks!

>
> diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
> index f357f34..b204472 100644
> --- a/net/sched/sch_dsmark.c
> +++ b/net/sched/sch_dsmark.c
> @@ -281,7 +281,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
>
>         pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
>
> -       skb = p->q->ops->dequeue(p->q);
> +       skb = qdisc_dequeue_peeked(p->q);
>         if (skb == NULL)
>                 return NULL;
>
David Miller March 3, 2016, 5:52 a.m. UTC | #2
From: Kyeong Yoo <Kyeong.Yoo@alliedtelesis.co.nz>
Date: Wed, 2 Mar 2016 21:19:51 +0000

> Author: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>
> 
> net_sched: dsmark: use qdisc_dequeue_peeked()
 ...
> On Wed, 2016-03-02 at 10:26 -0800, Cong Wang wrote:
>> On Tue, Mar 1, 2016 at 8:10 PM, Kyeong Yoo
>> <Kyeong.Yoo@alliedtelesis.co.nz> wrote:

Please do not submit patches like this.

Specifically, do not reply to feedback you are given in order
to submit a new version of a patch.

Instead, make a new, fresh, list posting for the new version of
your patch.  Indicate that this is a new version of the patch
by putting something like "[net-next v2] net_sched: dsmark: ..."
in your Subject line.
diff mbox

Patch

diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index f357f34..b204472 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -281,7 +281,7 @@  static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
 
 	pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
 
-	skb = p->q->ops->dequeue(p->q);
+	skb = qdisc_dequeue_peeked(p->q);
 	if (skb == NULL)
 		return NULL;