Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-19 Thread Patrick McHardy

David Miller wrote:

From: Brock Noland [EMAIL PROTECTED]
Date: Sat, 9 Feb 2008 20:30:58 -0600


Is this going to be merged anytime soon?


If it gets submitted to the proper mailing list, it might.
'linux-net' is for user questions, it is not where the networking
developers hang out, 'netdev' is.

And you have to post patches for review, not URL's point to
the patches.  It has to be int he email, in an applyable form
so people can review the thing properly.



Since SFQ is not exactly simple and I needed something like this
myself, I followed Paul's suggestion and added a new scheduler
(DRR) for this with more flexible limits.

I'll rediff against net-2.6.26 within the next days and send
a final version for review (anyone interested is welcome to
already review this version of course :).

commit 13d0cc64d0f7fed945c357cf4ca43330c8f95ad2
Author: Patrick McHardy [EMAIL PROTECTED]
Date:   Mon Feb 18 22:21:55 2008 +0100

[NET_SCHED]: Add DRR scheduler

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index dbb7ac3..2fca9c4 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -482,4 +482,20 @@ struct tc_netem_corrupt
 
 #define NETEM_DIST_SCALE   8192
 
+/* DRR */
+
+enum
+{
+   TCA_DRR_UNSPEC,
+   TCA_DRR_QUANTUM,
+   __TCA_DRR_MAX
+};
+
+#define TCA_DRR_MAX(__TCA_DRR_MAX - 1)
+
+struct tc_drr_stats
+{
+   s32 deficit;
+};
+
 #endif
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 82adfe6..7e1ab99 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -196,6 +196,9 @@ config NET_SCH_NETEM
 
  If unsure, say N.
 
+config NET_SCH_DRR
+   tristate DRR scheduler
+
 config NET_SCH_INGRESS
tristate Ingress Qdisc
depends on NET_CLS_ACT
diff --git a/net/sched/Makefile b/net/sched/Makefile
index 1d2b0f7..b055f74 100644
--- a/net/sched/Makefile
+++ b/net/sched/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_NET_SCH_TEQL)+= sch_teql.o
 obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
 obj-$(CONFIG_NET_SCH_ATM)  += sch_atm.o
 obj-$(CONFIG_NET_SCH_NETEM)+= sch_netem.o
+obj-$(CONFIG_NET_SCH_DRR)  += sch_drr.o
 obj-$(CONFIG_NET_CLS_U32)  += cls_u32.o
 obj-$(CONFIG_NET_CLS_ROUTE4)   += cls_route.o
 obj-$(CONFIG_NET_CLS_FW)   += cls_fw.o
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
new file mode 100644
index 000..aa241b5
--- /dev/null
+++ b/net/sched/sch_drr.c
@@ -0,0 +1,534 @@
+/*
+ * net/sched/sch_drr.c Deficit Round Robin scheduler
+ *
+ * Copyright (c) 2008 Patrick McHardy [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/netdevice.h
+#include linux/pkt_sched.h
+#include net/sch_generic.h
+#include net/pkt_sched.h
+#include net/pkt_cls.h
+
+struct drr_class {
+   struct hlist_node   hlist;
+   u32 classid;
+   unsigned intrefcnt;
+
+   struct gnet_stats_basic bstats;
+   struct gnet_stats_queue qstats;
+   struct gnet_stats_rate_est  rate_est;
+   struct list_headalist;
+   struct Qdisc *  qdisc;
+
+   u32 quantum;
+   s32 deficit;
+};
+
+#define DRR_HSIZE  16
+
+struct drr_sched {
+   struct list_headactive;
+   struct tcf_proto *  filter_list;
+   unsigned intfilter_cnt;
+   struct hlist_head   clhash[DRR_HSIZE];
+   struct sk_buff *requeue;
+};
+
+static unsigned int drr_hash(u32 h)
+{
+   h ^= h  8;
+   h ^= h  4;
+
+   return h  (DRR_HSIZE - 1);
+}
+
+static struct drr_class *drr_find_class(struct Qdisc *sch, u32 classid)
+{
+   struct drr_sched *q = qdisc_priv(sch);
+   struct drr_class *cl;
+   struct hlist_node *n;
+
+   hlist_for_each_entry(cl, n, q-clhash[drr_hash(classid)], hlist) {
+   if (cl-classid == classid)
+   return cl;
+   }
+   return NULL;
+}
+
+static void drr_purge_queue(struct drr_class *cl)
+{
+   unsigned int len = cl-qdisc-q.qlen;
+
+   qdisc_reset(cl-qdisc);
+   qdisc_tree_decrease_qlen(cl-qdisc, len);
+}
+
+static const struct nla_policy drr_policy[TCA_DRR_MAX + 1] = {
+   [TCA_DRR_QUANTUM]   = { .type = NLA_U32 },
+};
+
+static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
+   struct nlattr **tca, unsigned long *arg)
+{
+   struct drr_sched *q = qdisc_priv(sch);
+   struct drr_class *cl = (struct drr_class *)*arg;
+   struct nlattr 

Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-11 Thread xerces8
David Miller wrote:

 From: Brock Noland [EMAIL PROTECTED]
 Date: Sat, 9 Feb 2008 20:30:58 -0600
 
  Is this going to be merged anytime soon?
 
 If it gets submitted to the proper mailing list, it might.
 'linux-net' is for user questions, it is not where the networking
 developers hang out, 'netdev' is.

Then why do Alan and Jeff pass around patches on this (linux-net) list ? ;-)

Regards,
David


-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-09 Thread Corey Hickey
Corey Hickey wrote:
 The most recent ESFQ patches are getting stale, and I have received a
 few requests to update them to a current kernel release. Instead, I
 added hash type selection to my most recent round of SFQ patches and
 packaged them up.
 
 http://fatooh.org/esfq-2.6/
 http://fatooh.org/esfq-2.6/sfq-2.6.24.tar.bz2

This release has a silly typo that prevented the conntrack hash types
from being used. The annoying part is that I fixed the bug long ago,
tested the fix, and then forgot to apply it to my git tree. Oh well.
Grab a new one here:

http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2

...or just:

$ sed -i s/ESFQ/SFQ/ net/sched/sch_sfq.c

-Corey
-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-09 Thread Brock Noland
Is this going to be merged anytime soon?

Brock

On Feb 9, 2008 8:11 PM, Corey Hickey [EMAIL PROTECTED] wrote:
 Corey Hickey wrote:
  The most recent ESFQ patches are getting stale, and I have received a
  few requests to update them to a current kernel release. Instead, I
  added hash type selection to my most recent round of SFQ patches and
  packaged them up.
 
  http://fatooh.org/esfq-2.6/
  http://fatooh.org/esfq-2.6/sfq-2.6.24.tar.bz2

 This release has a silly typo that prevented the conntrack hash types
 from being used. The annoying part is that I fixed the bug long ago,
 tested the fix, and then forgot to apply it to my git tree. Oh well.
 Grab a new one here:

 http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2

 ...or just:

 $ sed -i s/ESFQ/SFQ/ net/sched/sch_sfq.c

 -Corey
 -
 To unsubscribe from this list: send the line unsubscribe linux-net in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-09 Thread Corey Hickey
Brock Noland wrote:
 Is this going to be merged anytime soon?

Part of it ought to be, but first I need to:
- update my patches to recent net-2.6 git (there were major changes)
- test thoroughly
- submit for review
- wait for review
- etc.

That'll happen when I get more time in the near future.

-Corey
-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-02-09 Thread David Miller
From: Brock Noland [EMAIL PROTECTED]
Date: Sat, 9 Feb 2008 20:30:58 -0600

 Is this going to be merged anytime soon?

If it gets submitted to the proper mailing list, it might.
'linux-net' is for user questions, it is not where the networking
developers hang out, 'netdev' is.

And you have to post patches for review, not URL's point to
the patches.  It has to be int he email, in an applyable form
so people can review the thing properly.
-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ANNOUNCE] ESFQ -- SFQ patches for Linux 2.6.24

2008-01-28 Thread Corey Hickey
The most recent ESFQ patches are getting stale, and I have received a
few requests to update them to a current kernel release. Instead, I
added hash type selection to my most recent round of SFQ patches and
packaged them up.

http://fatooh.org/esfq-2.6/
http://fatooh.org/esfq-2.6/sfq-2.6.24.tar.bz2

The ESFQ code was largely rewritten for inclusion in SFQ--not just a sed
job. The SFQ patches should be relatively clean and bug-free. If they're
not, please tell me! I have so far been unsuccessful in getting them
included in the main Linux kernel, and wider testing may help.

The SFQ patches aren't up to date with current net-2.6.25 git; I need to
forward-port them before I (once again) try to pester the net developers
into reviewing my work. Don't misunderstand me--I know patch review is
lots of work as well, and I appreciate the very helpful reviews my first
few rounds of patches received. Still, the recent silence has been
frustrating.

ESFQ, meanwhile, has a few bugs I know about, and it doesn't even
survive my new stress test for long without crashing my user-mode Linux.
I don't know why, and I'm not going to look. My intent is to let ESFQ
stagnate and only develop the SFQ patches further. If you really want
the original ESFQ, I have included that in the SFQ tarball. The only
modification I have made since the last release is a slight alteration
to make it compatible with my SFQ patches. You can run ESFQ and patched
SFQ in the same kernel, if that seems useful for testing.

Have fun!

-Corey
-
To unsubscribe from this list: send the line unsubscribe linux-net in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html