netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julio Kriger <juliokriger@gmail.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@oss.sgi.com, netem@osdl.org
Subject: Re: [PATCH] netem: fix logic bug in reorder conditional
Date: Mon, 23 May 2005 17:55:35 -0300	[thread overview]
Message-ID: <682bc30a050523135534b38b8b@mail.gmail.com> (raw)
In-Reply-To: <20050523104342.78b1032d@dxpl.pdx.osdl.net>

Hi!

1) Supouse I don't want reordering, so in 'tc' I don't add reorder
option. Will this code work? The previous (on this subject) patch has
a the following:

+       /* for compatiablity with earlier versions.
+        * if gap is set, need to assume 100% probablity
+        */
+       q->reorder = ~0;
+

Should it be set to 100% or 101%? 
This "q->reorder = ~0;" mean 100%?

2) If I set latency = 50ms and a jitter = 300ms, tabledist can give me
a negative number. This value is addes to cb->time_to_send, so it
could change it to a negative value. Should we only accept positives
number before add it to cb->time_to_send? or will
q->qdisc->enqueue(skb, q->qdisc) put the package on the queue in a
special way so it will be handled "before" other packages alrealy on
the queue but with gretaer time_to_send?

Regards,
Julio

On 5/23/05, Stephen Hemminger <shemminger@osdl.org> wrote:
> Thanks, Julio you spotted the problem with the logic.  This should fix it:
> 
> Index: netem-2.6.12-rc4/net/sched/sch_netem.c
> ===================================================================
> --- netem-2.6.12-rc4.orig/net/sched/sch_netem.c
> +++ netem-2.6.12-rc4/net/sched/sch_netem.c
> @@ -181,13 +181,9 @@ static int netem_enqueue(struct sk_buff
>                 q->duplicate = dupsave;
>         }
> 
> -       /*
> -        * Do re-ordering by putting one out of N packets at the front
> -        * of the queue.
> -        * gap == 0 is special case for no-reordering.
> -        */
> -       if (q->gap == 0 && q->counter < q->gap &&
> -           q->reorder < get_crandom(&q->reorder_cor)) {
> +       if (q->gap == 0                 /* not doing reordering */
> +           || q->counter < q->gap      /* inside last reordering gap */
> +           || q->reorder < get_crandom(&q->reorder_cor)) {
>                 psched_time_t now;
>                 PSCHED_GET_TIME(now);
>                 PSCHED_TADD2(now, tabledist(q->latency, q->jitter,
> @@ -196,6 +192,10 @@ static int netem_enqueue(struct sk_buff
>                 ++q->counter;
>                 ret = q->qdisc->enqueue(skb, q->qdisc);
>         } else {
> +               /*
> +                * Do re-ordering by putting one out of N packets at the front
> +                * of the queue.
> +                */
>                 PSCHED_GET_TIME(cb->time_to_send);
>                 q->counter = 0;
>                 ret = q->qdisc->ops->requeue(skb, q->qdisc);
> 


-- 
----------------------------
Julio Kriger
mailto:juliokriger@gmail.com

  reply	other threads:[~2005-05-23 20:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19 22:12 [PATCH] (3/3) netem: allow random reordering Stephen Hemminger
2005-05-20 20:28 ` [Netem] " Julio Kriger
2005-05-23 17:25   ` Stephen Hemminger
2005-05-21 15:05 ` Julio Kriger
2005-05-21 23:00 ` Julio Kriger
2005-05-23 17:43   ` [PATCH] netem: fix logic bug in reorder conditional Stephen Hemminger
2005-05-23 20:55     ` Julio Kriger [this message]
2005-05-23 21:00       ` Stephen Hemminger
2005-05-24 15:41         ` Julio Kriger
2005-05-24 16:57           ` Stephen Hemminger
2005-05-24 17:27             ` Julio Kriger
2005-05-24 22:26 ` [PATCH] (3/3) netem: allow random reordering (with fix) Stephen Hemminger
2005-05-25 22:08   ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=682bc30a050523135534b38b8b@mail.gmail.com \
    --to=juliokriger@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    --cc=netem@osdl.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).