Subject: Re: [PATCH 2/2] net: netem: always adjust now/delay when not reordering

From: Sergei Shtylyov <[email-masked]>
Date: Tue, 20 Aug 2013 22:31:56 +0400

Hello.

On 08/20/2013 07:11 PM, Ferry Huberts wrote:

> From: Ferry Huberts <[email-masked]>

> Not doing this (current behaviour) introduces reordering.

> The packet_len_2_sched_time call is the only thing that logically
> depends on q->rate, so move the now/delay adjustment out of the if.

> Signed-off-by: Ferry Huberts <[email-masked]>
> ---
>   net/sched/sch_netem.c | 34 +++++++++++++++++-----------------
>   1 file changed, 17 insertions(+), 17 deletions(-)

> diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
> index abe5fa6..86c73d2 100644
> --- a/net/sched/sch_netem.c
> +++ b/net/sched/sch_netem.c
[...]
> @@ -465,24 +467,22 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
[...]
>
> +		if (q->rate) {
>   			delay += packet_len_2_sched_time(skb->len, q);
>   		}

    Single statements shouldn't be enclosed in {} (and scripts/checkpatch.pl 
should complain about it).

WBR, Sergei