SOURCES (LINUX_2_6): kernel-wrr.patch - updated to http://www.zz9.dk/patche...

mguevara mguevara at pld-linux.org
Thu Oct 23 02:19:56 CEST 2008


Author: mguevara                     Date: Thu Oct 23 00:19:56 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- updated to http://www.zz9.dk/patches/wrr-linux-080820-2.6.26.patch.gz
- fixed Makefile for PLD patched kernel (esfq stuff added)
- fixed qdisc_create_dflt args for 2.6.27 interface

---- Files affected:
SOURCES:
   kernel-wrr.patch (1.1 -> 1.1.4.1) 

---- Diffs:

================================================================
Index: SOURCES/kernel-wrr.patch
diff -u SOURCES/kernel-wrr.patch:1.1 SOURCES/kernel-wrr.patch:1.1.4.1
--- SOURCES/kernel-wrr.patch:1.1	Sun May 18 02:09:06 2008
+++ SOURCES/kernel-wrr.patch	Thu Oct 23 02:19:50 2008
@@ -1,6 +1,6 @@
-diff -urN linux-2.6.25.orig/include/linux/pkt_sched.h linux-2.6.25/include/linux/pkt_sched.h
---- linux-2.6.25.orig/include/linux/pkt_sched.h	2008-04-17 04:49:44.000000000 +0200
-+++ linux-2.6.25/include/linux/pkt_sched.h	2008-04-24 16:19:03.000000000 +0200
+diff -urN linux-2.6.26.2.org/include/linux/pkt_sched.h linux-2.6.26.2/include/linux/pkt_sched.h
+--- linux-2.6.26.2.org/include/linux/pkt_sched.h	2008-07-13 23:51:29.000000000 +0200
++++ linux-2.6.26.2/include/linux/pkt_sched.h	2008-08-19 11:20:27.000000000 +0200
 @@ -23,6 +23,8 @@
  
  #define TC_PRIO_MAX			15
@@ -108,9 +108,9 @@
 +};
 +
  #endif
-diff -urN linux-2.6.25.orig/include/linux/wrr.h linux-2.6.25/include/linux/wrr.h
---- linux-2.6.25.orig/include/linux/wrr.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.25/include/linux/wrr.h	2008-04-24 16:19:05.000000000 +0200
+diff -urN linux-2.6.26.2.org/include/linux/wrr.h linux-2.6.26.2/include/linux/wrr.h
+--- linux-2.6.26.2.org/include/linux/wrr.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.26.2/include/linux/wrr.h	2008-08-19 11:20:27.000000000 +0200
 @@ -0,0 +1,67 @@
 +#ifndef WRR_H
 +#define WRR_H
@@ -179,12 +179,12 @@
 +int proxyGetMaxConn(void *data);
 +
 +#endif
-diff -urN linux-2.6.25.orig/MAINTAINERS linux-2.6.25/MAINTAINERS
---- linux-2.6.25.orig/MAINTAINERS	2008-04-17 04:49:44.000000000 +0200
-+++ linux-2.6.25/MAINTAINERS	2008-04-24 16:19:05.000000000 +0200
-@@ -4351,6 +4351,12 @@
- W:	http://oops.ghostprotocols.net:81/blog
- S:	Maintained
+diff -urN linux-2.6.26.2.org/MAINTAINERS linux-2.6.26.2/MAINTAINERS
+--- linux-2.6.26.2.org/MAINTAINERS	2008-07-13 23:51:29.000000000 +0200
++++ linux-2.6.26.2/MAINTAINERS	2008-08-19 11:20:27.000000000 +0200
+@@ -4500,6 +4500,12 @@
+ W:	http://opensource.wolfsonmicro.com/node/7
+ S:	Supported
  
 +WRR NETWORK SCHEDULER
 +P:	Rasmus Bøg Hansen
@@ -195,12 +195,12 @@
  X.25 NETWORK LAYER
  P:	Henner Eisen
  M:	eis at baty.hanse.de
-diff -urN linux-2.6.25.orig/net/sched/Kconfig linux-2.6.25/net/sched/Kconfig
---- linux-2.6.25.orig/net/sched/Kconfig	2008-04-17 04:49:44.000000000 +0200
-+++ linux-2.6.25/net/sched/Kconfig	2008-04-24 16:19:05.000000000 +0200
-@@ -117,6 +117,25 @@
- 	  sch_rr, so it will load sch_prio, although it is referred
- 	  to using sch_rr.
+diff -urN linux-2.6.26.2.org/net/sched/Kconfig linux-2.6.26.2/net/sched/Kconfig
+--- linux-2.6.26.2.org/net/sched/Kconfig	2008-07-13 23:51:29.000000000 +0200
++++ linux-2.6.26.2/net/sched/Kconfig	2008-08-19 11:20:27.000000000 +0200
+@@ -106,6 +106,25 @@
+ 	  To compile this code as a module, choose M here: the
+ 	  module will be called sch_prio.
  
 +config NET_SCH_WRR
 +	tristate "WRR packet scheduler"
@@ -224,16 +224,29 @@
  config NET_SCH_RED
  	tristate "Random Early Detection (RED)"
  	---help---
-diff -urN linux-2.6.25.orig/net/sched/Makefile linux-2.6.25/net/sched/Makefile
---- linux-2.6.25.orig/net/sched/Makefile	2008-04-17 04:49:44.000000000 +0200
-+++ linux-2.6.25/net/sched/Makefile	2008-04-24 16:19:06.000000000 +0200
-@@ -0,0 +0,2 @@
+diff -urN linux-2.6.26.2.org/net/sched/Makefile linux-2.6.26.2/net/sched/Makefile
+--- linux-2.6.26.2.org/net/sched/Makefile	2008-07-13 23:51:29.000000000 +0200
++++ linux-2.6.26.2/net/sched/Makefile	2008-08-19 11:20:27.000000000 +0200
+@@ -3,6 +3,7 @@
+ #
+ 
+ obj-y	:= sch_generic.o
 +sch_wrr-objs = wrr.o wrr_proxydict.o
+ 
+ obj-$(CONFIG_NET_SCHED)		+= sch_api.o sch_blackhole.o
+ obj-$(CONFIG_NET_CLS)		+= cls_api.o
+@@ -23,6 +24,7 @@
+ obj-$(CONFIG_NET_SCH_DSMARK)	+= sch_dsmark.o
+ obj-$(CONFIG_NET_SCH_SFQ)	+= sch_sfq.o
+ obj-$(CONFIG_NET_SCH_ESFQ)	+= sch_esfq.o
 +obj-$(CONFIG_NET_SCH_WRR)	+= sch_wrr.o
-diff -urN linux-2.6.25.orig/net/sched/wrr.c linux-2.6.25/net/sched/wrr.c
---- linux-2.6.25.orig/net/sched/wrr.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.25/net/sched/wrr.c	2008-04-24 16:19:07.000000000 +0200
-@@ -0,0 +1,1385 @@
+ obj-$(CONFIG_NET_SCH_TBF)	+= sch_tbf.o
+ obj-$(CONFIG_NET_SCH_TEQL)	+= sch_teql.o
+ obj-$(CONFIG_NET_SCH_PRIO)	+= sch_prio.o
+diff -urN linux-2.6.26.2.org/net/sched/wrr.c linux-2.6.26.2/net/sched/wrr.c
+--- linux-2.6.26.2.org/net/sched/wrr.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.26.2/net/sched/wrr.c	2008-08-20 16:40:09.000000000 +0200
+@@ -0,0 +1,1386 @@
 +/*-----------------------------------------------------------------------------
 +Weighted Round Robin scheduler.
 +  
@@ -348,7 +361,7 @@
 +#include <linux/version.h>
 +#include <linux/wrr.h>
 +
-+#define WRR_VER "051111"
++#define WRR_VER "080820"
 +
 +#define my_malloc(size) kmalloc(size,GFP_KERNEL)
 +#define my_free(ptr)    kfree(ptr)
@@ -994,7 +1007,7 @@
 +		my_free(q->proxydict);
 +}
 +
-+static int wrr_init(struct Qdisc *sch, struct rtattr *opt)
++static int wrr_init(struct Qdisc *sch, struct nlattr *opt)
 +{
 +	struct wrr_sched_data *q = qdisc_priv(sch);
 +	int i, maciniterr;
@@ -1004,9 +1017,9 @@
 +	/* Parse options */
 +	if (!opt)
 +		return -EINVAL;	/* Options must be specified */
-+	if (opt->rta_len < RTA_LENGTH(sizeof(*qopt)))
++	if (nla_len(opt) < sizeof(*qopt))
 +		return -EINVAL;
-+	qopt = RTA_DATA(opt);
++	qopt = nla_data(opt);
 +
 +	if (qopt->bands_max > 8192 || qopt->bands_max < 2) {
 +		/* More than 8192 queues or less than 2? That cannot be true - it must be 
@@ -1074,7 +1087,7 @@
 +		weight_setdefault(&q->bands[i].class_modf.weight2);
 +		if (!crterr) {
 +			struct Qdisc *child =
-+			    qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, sch->handle);
++			    qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, &pfifo_qdisc_ops, sch->handle);
 +			if (child)
 +				q->bands[i].que = child;
 +			else {
@@ -1326,20 +1339,20 @@
 +		opt.proxy_curconn = 0;
 +	}
 +
-+	RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
++	NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
 +	return skb->len;
 +
-+      rtattr_failure:		/* seems like RTA_PUT jump to this label */
++      nla_put_failure:		/* NLA_PUT may jump to this label */
 +	skb_trim(skb, b - skb->data);
 +	return -1;
 +}
 +
-+static int wrr_tune_std(struct Qdisc *sch, struct rtattr *opt)
++static int wrr_tune_std(struct Qdisc *sch, struct nlattr *opt)
 +{
 +	struct wrr_sched_data *q = qdisc_priv(sch);
-+	struct tc_wrr_qdisc_modf_std *qopt = RTA_DATA(opt);
++	struct tc_wrr_qdisc_modf_std *qopt = nla_data(opt);
 +
-+	if (opt->rta_len < RTA_LENGTH(sizeof(*qopt)))
++	if (nla_len(opt) < sizeof(*qopt))
 +		return -EINVAL;
 +
 +	LOCK_START;
@@ -1364,10 +1377,10 @@
 +	return 0;
 +}
 +
-+static int wrr_tune_proxy(struct Qdisc *sch, struct rtattr *opt)
++static int wrr_tune_proxy(struct Qdisc *sch, struct nlattr *opt)
 +{
 +	struct wrr_sched_data *q = qdisc_priv(sch);
-+	struct tc_wrr_qdisc_modf_proxy *qopt = RTA_DATA(opt);
++	struct tc_wrr_qdisc_modf_proxy *qopt = nla_data(opt);
 +	int i;
 +
 +	/* Return if we are not configured with proxy support */
@@ -1375,9 +1388,10 @@
 +		return -ENOSYS;
 +
 +	/* Return if not enough data given */
-+	if (opt->rta_len < RTA_LENGTH(sizeof(*qopt)) ||
-+	    opt->rta_len <
-+	    RTA_LENGTH(sizeof(*qopt) + sizeof(ProxyRemapBlock) * qopt->changec))
++	if (nla_len(opt) < sizeof(*qopt))
++
++	if (nla_len(opt) < sizeof(*qopt) ||
++	    nla_len(opt) < sizeof(*qopt) + sizeof(ProxyRemapBlock) * qopt->changec)
 +		return -EINVAL;
 +
 +	LOCK_START;
@@ -1396,9 +1410,9 @@
 +	return 0;
 +}
 +
-+static int wrr_tune(struct Qdisc *sch, struct rtattr *opt)
++static int wrr_tune(struct Qdisc *sch, struct nlattr *opt)
 +{
-+	if (((struct tc_wrr_qdisc_modf_std *)RTA_DATA(opt))->proxy) {
++	if (((struct tc_wrr_qdisc_modf_std *)nla_data(opt))->proxy) {
 +		return wrr_tune_proxy(sch, opt);
 +	} else {
 +		return wrr_tune_std(sch, opt);
@@ -1472,7 +1486,7 @@
 +	tcm->tcm_handle = sch->handle | cl;
 +
 +	if (cl == 0 || cl > q->bandc)
-+		goto rtattr_failure;
++		goto nla_put_failure;
 +	cl--;
 +
 +	if ((cl < q->bandc) && q->bands[cl].que)
@@ -1504,27 +1518,27 @@
 +	}
 +
 +	/* Put quing information */
-+	RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
++	NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
 +	return skb->len;
 +
-+      rtattr_failure:
++      nla_put_failure:		/* NLA_PUT may jump here */
 +	skb_trim(skb, b - skb->data);
 +	return -1;
 +}
 +
 +static int wrr_change(struct Qdisc *sch, u32 handle, u32 parent,
-+		      struct rtattr **tca, unsigned long *arg)
++		      struct nlattr **tca, unsigned long *arg)
 +{
 +	unsigned long cl = *arg;
 +	struct wrr_sched_data *q = qdisc_priv(sch);
-+	struct rtattr *opt = tca[TCA_OPTIONS - 1];
-+	struct tc_wrr_class_modf *copt = RTA_DATA(opt);
++	struct nlattr *opt = tca[TCA_OPTIONS];
++	struct tc_wrr_class_modf *copt = nla_data(opt);
 +
 +	if (cl == 0 || cl > q->bandc)
 +		return -EINVAL;
 +	cl--;
 +
-+	if (opt->rta_len < RTA_LENGTH(sizeof(*copt)))
++	if (nla_len(opt) < sizeof(*copt))
 +		return -EINVAL;
 +
 +	LOCK_START;
@@ -1619,9 +1633,9 @@
 +
 +MODULE_LICENSE("GPL");
 +MODULE_AUTHOR("Christian Worm Mortensen");
-diff -urN linux-2.6.25.orig/net/sched/wrr_proxydict.c linux-2.6.25/net/sched/wrr_proxydict.c
---- linux-2.6.25.orig/net/sched/wrr_proxydict.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.25/net/sched/wrr_proxydict.c	2008-04-24 16:19:07.000000000 +0200
+diff -urN linux-2.6.26.2.org/net/sched/wrr_proxydict.c linux-2.6.26.2/net/sched/wrr_proxydict.c
+--- linux-2.6.26.2.org/net/sched/wrr_proxydict.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.26.2/net/sched/wrr_proxydict.c	2008-08-19 11:20:27.000000000 +0200
 @@ -0,0 +1,156 @@
 +#ifndef __KERNEL__
 +#include <string.h>
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-wrr.patch?r1=1.1&r2=1.1.4.1&f=u



More information about the pld-cvs-commit mailing list