From: Jesper Dangaard Brouer <jdb@comx.dk>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Patrick McHardy <kaber@trash.net>,
Jesper Dangaard Brouer <jdb@comx.dk>
Subject: [PATCH 2/2]: [NET_SCHED]: Making rate table lookups more flexible.
Date: Fri, 31 Aug 2007 14:22:58 +0200 [thread overview]
Message-ID: <1188562978.18622.13.camel@localhost.localdomain> (raw)
commit ac093f5c2f1160ece72a6fef5c779c1892fc3152
Author: Jesper Dangaard Brouer <hawk@comx.dk>
Date: Fri Aug 31 11:53:35 2007 +0200
[NET_SCHED]: Making rate table lookups more flexible. Extend the
tc_ratespec struct, with two parameters: 1) "cell_align" that allow
adjusting the alignment of the rate table. 2) "overhead" that allow
adding a packet overhead before the lookup.
Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 268c515..a127d63 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -78,7 +78,8 @@ struct tc_ratespec
unsigned char cell_log;
unsigned char __reserved;
unsigned short feature;
- short addend;
+ char cell_align;
+ unsigned char overhead;
unsigned short mpu;
__u32 rate;
};
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4ebd615..a02ec9e 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -307,7 +307,9 @@ drop:
*/
static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
{
- int slot = pktlen;
+ int slot = pktlen + rtab->rate.cell_align + rtab->rate.overhead;
+ if (slot < 0)
+ slot = 0;
slot >>= rtab->rate.cell_log;
if (slot > 255)
return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]);
next reply other threads:[~2007-08-31 12:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-31 12:22 Jesper Dangaard Brouer [this message]
2007-09-01 7:10 ` [PATCH 2/2]: [NET_SCHED]: Making rate table lookups more flexible Patrick McHardy
2007-09-01 21:56 ` Jesper Dangaard Brouer
2007-09-02 14:35 ` Patrick McHardy
2007-09-02 18:56 ` Jesper Dangaard Brouer
2007-09-02 21:16 ` Patrick McHardy
2007-09-03 14:19 ` Jesper Dangaard Brouer
2007-09-04 16:25 ` Patrick McHardy
2007-09-05 13:58 ` Jesper Dangaard Brouer
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=1188562978.18622.13.camel@localhost.localdomain \
--to=jdb@comx.dk \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
/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