Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e08b09983fe9cf379faf1aefdf9164268d4610e7
Commit:     e08b09983fe9cf379faf1aefdf9164268d4610e7
Parent:     e9bef55d3d062ee7a78fde2913ec87ca9305a1e0
Author:     Jesper Dangaard Brouer <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 12 16:36:28 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:49:20 2007 -0700

    [NET_SCHED]: Making rate table lookups more flexible.
    
    This is done in order to, add support to changing the rate table to
    use the upper-boundry L2T (length to time) value. Currently we use the
    lower-boundry, which result in under-estimating the actual bandwidth
    usage.
    
    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 <[EMAIL PROTECTED]>
    Acked-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/pkt_sched.h |    4 ++--
 include/net/sch_generic.h |    4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 268c515..919af93 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -77,8 +77,8 @@ struct tc_ratespec
 {
        unsigned char   cell_log;
        unsigned char   __reserved;
-       unsigned short  feature;
-       short           addend;
+       unsigned short  overhead;
+       short           cell_align;
        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]);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to