diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sch_generic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 8a67f24cbe02..4ebd615bd013 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -302,4 +302,16 @@ drop: | |||
302 | return NET_XMIT_DROP; | 302 | return NET_XMIT_DROP; |
303 | } | 303 | } |
304 | 304 | ||
305 | /* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how | ||
306 | long it will take to send a packet given its size. | ||
307 | */ | ||
308 | static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen) | ||
309 | { | ||
310 | int slot = pktlen; | ||
311 | slot >>= rtab->rate.cell_log; | ||
312 | if (slot > 255) | ||
313 | return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]); | ||
314 | return rtab->data[slot]; | ||
315 | } | ||
316 | |||
305 | #endif | 317 | #endif |