Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66405
b: refs/heads/master
c: e9bef55
h: refs/heads/master
i:
  66403: ad8891c
v: v3
  • Loading branch information
Jesper Dangaard Brouer authored and David S. Miller committed Oct 10, 2007
1 parent 8be1fda commit bf7a7eb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6fa1a4d746488a7de95ec16afcaf3247fedb003
refs/heads/master: e9bef55d3d062ee7a78fde2913ec87ca9305a1e0
12 changes: 12 additions & 0 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,16 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
return NET_XMIT_DROP;
}

/* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how
long it will take to send a packet given its size.
*/
static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
{
int slot = pktlen;
slot >>= rtab->rate.cell_log;
if (slot > 255)
return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]);
return rtab->data[slot];
}

#endif
4 changes: 2 additions & 2 deletions trunk/net/sched/act_police.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <net/act_api.h>
#include <net/netlink.h>

#define L2T(p,L) ((p)->tcfp_R_tab->data[(L)>>(p)->tcfp_R_tab->rate.cell_log])
#define L2T_P(p,L) ((p)->tcfp_P_tab->data[(L)>>(p)->tcfp_P_tab->rate.cell_log])
#define L2T(p,L) qdisc_l2t((p)->tcfp_R_tab, L)
#define L2T_P(p,L) qdisc_l2t((p)->tcfp_P_tab, L)

#define POL_TAB_MASK 15
static struct tcf_common *tcf_police_ht[POL_TAB_MASK + 1];
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ struct cbq_sched_data
};


#define L2T(cl,len) ((cl)->R_tab->data[(len)>>(cl)->R_tab->rate.cell_log])
#define L2T(cl,len) qdisc_l2t((cl)->R_tab,len)


static __inline__ unsigned cbq_hash(u32 h)
Expand Down
6 changes: 2 additions & 4 deletions trunk/net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ struct htb_class {
static inline long L2T(struct htb_class *cl, struct qdisc_rate_table *rate,
int size)
{
int slot = size >> rate->rate.cell_log;
if (slot > 255)
return (rate->data[255]*(slot >> 8) + rate->data[slot & 0xFF]);
return rate->data[slot];
long result = qdisc_l2t(rate, size);
return result;
}

struct htb_sched {
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sched/sch_tbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct tbf_sched_data
struct qdisc_watchdog watchdog; /* Watchdog timer */
};

#define L2T(q,L) ((q)->R_tab->data[(L)>>(q)->R_tab->rate.cell_log])
#define L2T_P(q,L) ((q)->P_tab->data[(L)>>(q)->P_tab->rate.cell_log])
#define L2T(q,L) qdisc_l2t((q)->R_tab,L)
#define L2T_P(q,L) qdisc_l2t((q)->P_tab,L)

static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch)
{
Expand Down

0 comments on commit bf7a7eb

Please sign in to comment.