netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: hadi@cyberus.ca
Cc: shemminger@osdl.org, util@deuroconsult.ro, netdev@oss.sgi.com,
	lartc@mailman.ds9a.nl
Subject: Re: [PATCH 2.6] update to network emulation QOS scheduler
Date: Tue, 6 Jul 2004 14:41:32 -0700	[thread overview]
Message-ID: <20040706144132.4a5fe83b.davem@redhat.com> (raw)
In-Reply-To: <1089119090.4260.2.camel@jzny.localdomain>

On 06 Jul 2004 09:04:50 -0400
jamal <hadi@cyberus.ca> wrote:

> On Mon, 2004-07-05 at 22:49, David S. Miller wrote:
> > I'm going to hold off on Stephen's patches until Jamal and he has
> > a chance to fight it out :-)
> 
> Actually i would be fine with it if Stephen gets rid of the new "rate"
> thing.

Ok, so for now I'm going to just put in this part of Stephen's
patch which just adds the rtnetlink.h include and the loss
optimization.

To be honest, the rate feature is such a tiny amount of code...
it's not the end of the world if we put it in :-)

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/07/06 14:35:36-07:00 shemminger@osdl.org 
#   [PKT_SCHED]: Two small netem fixes.
#   
#   - rtnetlink.h needs including
#   - optimize loss test so that net_random() call is not done
#     when no-loss is indicated
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_netem.c
#   2004/07/06 14:31:50-07:00 shemminger@osdl.org +2 -1
#   [PKT_SCHED]: Two small netem fixes.
#   
#   - rtnetlink.h needs including
#   - optimize loss test so that net_random() call is not done
#     when no-loss is indicated
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c	2004-07-06 14:36:05 -07:00
+++ b/net/sched/sch_netem.c	2004-07-06 14:36:05 -07:00
@@ -18,6 +18,7 @@
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
+#include <linux/rtnetlink.h>
 
 #include <net/pkt_sched.h>
 
@@ -54,7 +55,7 @@
 	pr_debug("netem_enqueue skb=%p @%lu\n", skb, jiffies);
 
 	/* Random packet drop 0 => none, ~0 => all */
-	if (q->loss >= net_random()) {
+	if (q->loss && q->loss >= net_random()) {
 		sch->stats.drops++;
 		return 0;	/* lie about loss so TCP doesn't know */
 	}

  reply	other threads:[~2004-07-06 21:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 18:33 [PATCH 2.6] update to network emulation QOS scheduler Stephen Hemminger
2004-07-01 20:11 ` [PATCH 2.4] " Stephen Hemminger
2004-07-06 21:06   ` David S. Miller
2004-07-02 20:44 ` [PATCH 2.6] " Stephen Hemminger
2004-07-03  3:13   ` jamal
2004-07-06  2:49     ` David S. Miller
2004-07-06 13:04       ` jamal
2004-07-06 21:41         ` David S. Miller [this message]
2004-07-07  6:39         ` Catalin BOIE
2004-07-06 16:09     ` Stephen Hemminger
2004-07-07  1:36       ` jamal
2004-07-07  1:51         ` David S. Miller
2004-07-07  7:01         ` Catalin BOIE
2004-07-07 18:44           ` jamal
2004-07-07 18:10     ` Stephen Hemminger
2004-07-07 18:57       ` jamal
2004-07-07 20:58         ` Stephen Hemminger
2004-07-07 21:11           ` jamal
2004-07-07 21:22             ` Stephen Hemminger
2004-07-08 13:36               ` jamal
2004-07-03 13:32   ` Ed Wildgoose
2004-07-06 21:02 ` 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=20040706144132.4a5fe83b.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=hadi@cyberus.ca \
    --cc=lartc@mailman.ds9a.nl \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    --cc=util@deuroconsult.ro \
    /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).