diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 268c51599eb8dc9343ffcdc6ef76e161858f6772..919af93b70596e70a06bdd10363c1d57a1aa50f4 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 4ebd615bd013e4cd8331cb6e7e89b39e05ab5e0c..a02ec9e5fea51934666d4b18085b0bcbd682f86a 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -307,7 +307,9 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch) */ 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]);