netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5] [IPROUTE2] For CBQ, implement overhead parameter parsing.
       [not found] <1206312248.15884.26.camel@localhost.localdomain>
@ 2008-03-23 22:50 ` Jesper Dangaard Brouer
  2008-03-23 22:52 ` [PATCH 4/5] [IPROUTE2] CBQ remember to doc usage of overhead parameter Jesper Dangaard Brouer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2008-03-23 22:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev@vger.kernel.org


For CBQ, implement overhead parameter parsing.

The change is ABI (Application Binary Interface) backward compatible
with older kernels, but will first have effect from kernel 2.6.24.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---
 tc/q_cbq.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index 8e6bd40..c891ac5 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -53,6 +53,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 	struct tc_cbq_lssopt lss;
 	__u32 rtab[256];
 	unsigned mpu=0, avpkt=0, allot=0;
+	unsigned short overhead=0;
 	int cell_log=-1;
 	int ewma_log=-1;
 	struct rtattr *tail;
@@ -113,6 +114,11 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 				explain1("allot");
 				return -1;
 			}
+		} else if (matches(*argv, "overhead") == 0) {
+			NEXT_ARG();
+			if (get_u16(&overhead, *argv, 10)) {
+				explain1("overhead"); return -1;
+			}
 		} else if (matches(*argv, "help") == 0) {
 			explain();
 			return -1;
@@ -138,6 +144,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 		allot = (avpkt*3)/2;
 
 	r.mpu = mpu;
+	r.overhead = overhead;
 	if (tc_calc_rtable(&r, rtab, cell_log, allot) < 0) {
 		fprintf(stderr, "CBQ: failed to calculate rate table.\n");
 		return -1;
@@ -179,6 +186,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
 	int ewma_log=-1;
 	unsigned bndw = 0;
 	unsigned minburst=0, maxburst=0;
+	unsigned short overhead=0;
 	struct rtattr *tail;
 
 	memset(&r, 0, sizeof(r));
@@ -317,6 +325,11 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
 			if (err == 1)
 				fopt.defchange = ~0;
 			fopt_ok++;
+		} else if (matches(*argv, "overhead") == 0) {
+			NEXT_ARG();
+			if (get_u16(&overhead, *argv, 10)) {
+				explain1("overhead"); return -1;
+			}
 		} else if (matches(*argv, "help") == 0) {
 			explain_class();
 			return -1;
@@ -336,6 +349,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
 		if (wrr.allot < (lss.avpkt*3)/2)
 			wrr.allot = (lss.avpkt*3)/2;
 		r.mpu = mpu;
+		r.overhead = overhead;
 		if (tc_calc_rtable(&r, rtab, cell_log, pktsize) < 0) {
 			fprintf(stderr, "CBQ: failed to calculate rate table.\n");
 			return -1;
@@ -464,6 +478,8 @@ static int cbq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 			fprintf(f, "cell %ub ", 1<<r->cell_log);
 			if (r->mpu)
 				fprintf(f, "mpu %ub ", r->mpu);
+			if (r->overhead)
+				fprintf(f, "overhead %ub ", r->overhead);
 		}
 	}
 	if (lss && lss->flags) {
-- 
1.5.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] [IPROUTE2] CBQ remember to doc usage of overhead parameter.
       [not found] <1206312248.15884.26.camel@localhost.localdomain>
  2008-03-23 22:50 ` [PATCH 3/5] [IPROUTE2] For CBQ, implement overhead parameter parsing Jesper Dangaard Brouer
@ 2008-03-23 22:52 ` Jesper Dangaard Brouer
  2008-03-23 22:53 ` [PATCH 5/5] [IPROUTE2] For police, implement overhead parameter parsing Jesper Dangaard Brouer
  2008-04-01 19:23 ` [PATCH 0/5] [IPROUTE2] Add overhead parameter for CBQ, TBF and police Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2008-03-23 22:52 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev@vger.kernel.org


CBQ remember to doc usage of overhead parameter.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---
 tc/q_cbq.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index c891ac5..e53d167 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -32,6 +32,7 @@ static void explain_class(void)
 	fprintf(stderr, "               [ prio NUMBER ] [ cell BYTES ] [ ewma LOG ]\n");
 	fprintf(stderr, "               [ estimator INTERVAL TIME_CONSTANT ]\n");
 	fprintf(stderr, "               [ split CLASSID ] [ defmap MASK/CHANGE ]\n");
+	fprintf(stderr, "               [ overhead BYTES ]\n");
 }
 
 static void explain(void)
-- 
1.5.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] [IPROUTE2] For police, implement overhead parameter parsing.
       [not found] <1206312248.15884.26.camel@localhost.localdomain>
  2008-03-23 22:50 ` [PATCH 3/5] [IPROUTE2] For CBQ, implement overhead parameter parsing Jesper Dangaard Brouer
  2008-03-23 22:52 ` [PATCH 4/5] [IPROUTE2] CBQ remember to doc usage of overhead parameter Jesper Dangaard Brouer
@ 2008-03-23 22:53 ` Jesper Dangaard Brouer
  2008-04-01 19:23 ` [PATCH 0/5] [IPROUTE2] Add overhead parameter for CBQ, TBF and police Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2008-03-23 22:53 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev@vger.kernel.org


For police, implement overhead parameter parsing.

The change is ABI (Application Binary Interface) backward compatible
with older kernels, but will first have effect from kernel 2.6.24.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---
 tc/m_police.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tc/m_police.c b/tc/m_police.c
index 46c785b..8fa63ad 100644
--- a/tc/m_police.c
+++ b/tc/m_police.c
@@ -35,7 +35,7 @@ struct action_util police_action_util = {
 static void usage(void)
 {
 	fprintf(stderr, "Usage: ... police rate BPS burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ]\n");
-	fprintf(stderr, "                [ peakrate BPS ] [ avrate BPS ]\n");
+	fprintf(stderr, "                [ peakrate BPS ] [ avrate BPS ] [ overhead BYTES ]\n");
 	fprintf(stderr, "                [ ACTIONTERM ]\n");
 	fprintf(stderr, "Old Syntax ACTIONTERM := action <EXCEEDACT>[/NOTEXCEEDACT] \n");
 	fprintf(stderr, "New Syntax ACTIONTERM := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT] \n");
@@ -133,6 +133,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
 	__u32 avrate = 0;
 	int presult = 0;
 	unsigned buffer=0, mtu=0, mpu=0;
+	unsigned short overhead;
 	int Rcell_log=-1, Pcell_log = -1;
 	struct rtattr *tail;
 
@@ -234,6 +235,11 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
 				fprintf(stderr, "Illegal \"action\"\n");
 				return -1;
 			}
+		} else if (matches(*argv, "overhead") == 0) {
+			NEXT_ARG();
+			if (get_u16(&overhead, *argv, 10)) {
+				explain1("overhead"); return -1;
+			}
 		} else if (strcmp(*argv, "help") == 0) {
 			usage();
 		} else {
@@ -263,6 +269,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
 
 	if (p.rate.rate) {
 		p.rate.mpu = mpu;
+		p.rate.overhead = overhead;
 		if (tc_calc_rtable(&p.rate, rtab, Rcell_log, mtu) < 0) {
 			fprintf(stderr, "TBF: failed to calculate rate table.\n");
 			return -1;
@@ -272,6 +279,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
 	p.mtu = mtu;
 	if (p.peakrate.rate) {
 		p.peakrate.mpu = mpu;
+		p.peakrate.overhead = overhead;
 		if (tc_calc_rtable(&p.peakrate, ptab, Pcell_log, mtu) < 0) {
 			fprintf(stderr, "POLICE: failed to calculate peak rate table.\n");
 			return -1;
@@ -344,6 +352,7 @@ print_police(struct action_util *a, FILE *f, struct rtattr *arg)
 		fprintf(f, "/%s ", police_action_n2a(*(int*)RTA_DATA(tb[TCA_POLICE_RESULT]), b1, sizeof(b1)));
 	} else
 		fprintf(f, " ");
+	fprintf(f, "overhead %ub ", p->rate.overhead);
 	fprintf(f, "\nref %d bind %d\n",p->refcnt, p->bindcnt);
 
 	return 0;
-- 
1.5.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/5] [IPROUTE2] Add overhead parameter for CBQ, TBF and police
@ 2008-03-23 23:46 Jesper Dangaard Brouer
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2008-03-23 23:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev@vger.kernel.org

Hi Stephen

This can be view as a maintanance patchset for iproute2.  The overhead
parameter, introduced in kernel 2.6.24, were only implemented for HTB
in iproute2/tc.

This patchset adds overhead parameter parsing for the last rate-table
based schedulers CBQ, TFB and police.

The changes are ABI (Application Binary Interface) backward compatible
with older kernels, but will first have effect from kernel 2.6.24.


See you soon :-)
-- 
Med venlig hilsen / Best regards
  Jesper Brouer
  ComX Networks A/S
  Linux Network developer
  Cand. Scient Datalog / MSc.
  Author of http://adsl-optimizer.dk
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/5] [IPROUTE2] Add overhead parameter for CBQ, TBF and police
       [not found] <1206312248.15884.26.camel@localhost.localdomain>
                   ` (2 preceding siblings ...)
  2008-03-23 22:53 ` [PATCH 5/5] [IPROUTE2] For police, implement overhead parameter parsing Jesper Dangaard Brouer
@ 2008-04-01 19:23 ` Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2008-04-01 19:23 UTC (permalink / raw)
  To: jdb; +Cc: netdev@vger.kernel.org

On Sun, 23 Mar 2008 23:44:08 +0100
Jesper Dangaard Brouer <jdb@comx.dk> wrote:

> Hi Stephen
> 
> This can be view as a maintanance patchset for iproute2.  The overhead
> parameter, introduced in kernel 2.6.24, were only implemented for HTB
> in iproute2/tc.
> 
> This patchset adds overhead parameter parsing for the last rate-table
> based schedulers CBQ, TFB and police.
> 
> The changes are ABI (Application Binary Interface) backward compatible
> with older kernels, but will first have effect from kernel 2.6.24.
> 
> 
> See you soon :-)

Appled for 2.6.25 version

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-01 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1206312248.15884.26.camel@localhost.localdomain>
2008-03-23 22:50 ` [PATCH 3/5] [IPROUTE2] For CBQ, implement overhead parameter parsing Jesper Dangaard Brouer
2008-03-23 22:52 ` [PATCH 4/5] [IPROUTE2] CBQ remember to doc usage of overhead parameter Jesper Dangaard Brouer
2008-03-23 22:53 ` [PATCH 5/5] [IPROUTE2] For police, implement overhead parameter parsing Jesper Dangaard Brouer
2008-04-01 19:23 ` [PATCH 0/5] [IPROUTE2] Add overhead parameter for CBQ, TBF and police Stephen Hemminger
2008-03-23 23:46 Jesper Dangaard Brouer

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).