]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/sch_generic.h
[S390] Use new style spinlock initializer in __RWSEM_INITIALIZER.
[linux-2.6-omap-h63xx.git] / include / net / sch_generic.h
index 1b8e35197ebeee5667f79175da1f8464e716a8cd..4c3b35153c3722b2a5871cf78ed11023f7fa9e17 100644 (file)
@@ -290,7 +290,7 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
 {
        sch->qstats.drops++;
 
-#ifdef CONFIG_NET_CLS_POLICE
+#ifdef CONFIG_NET_CLS_ACT
        if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
                goto drop;
 
@@ -302,4 +302,32 @@ drop:
        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 + 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]);
+       return rtab->data[slot];
+}
+
+#ifdef CONFIG_NET_CLS_ACT
+static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
+{
+       struct sk_buff *n = skb_clone(skb, gfp_mask);
+
+       if (n) {
+               n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
+               n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
+               n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
+       }
+       return n;
+}
+#endif
+
 #endif