Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[deliverable/linux.git] / net / sched / sch_plug.c
index 5abfe44678d4a1ecda495bf9e00879c649c63cdb..1c6cbab3e7b993fba3c836cb24ab664afeb6db66 100644 (file)
@@ -64,6 +64,8 @@ struct plug_sched_data {
         */
        bool unplug_indefinite;
 
+       bool throttled;
+
        /* Queue Limit in bytes */
        u32 limit;
 
@@ -86,7 +88,8 @@ struct plug_sched_data {
        u32 pkts_to_release;
 };
 
-static int plug_enqueue(struct sk_buff *skb, struct Qdisc *sch)
+static int plug_enqueue(struct sk_buff *skb, struct Qdisc *sch,
+                       struct sk_buff **to_free)
 {
        struct plug_sched_data *q = qdisc_priv(sch);
 
@@ -96,14 +99,14 @@ static int plug_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                return qdisc_enqueue_tail(skb, sch);
        }
 
-       return qdisc_reshape_fail(skb, sch);
+       return qdisc_drop(skb, sch, to_free);
 }
 
 static struct sk_buff *plug_dequeue(struct Qdisc *sch)
 {
        struct plug_sched_data *q = qdisc_priv(sch);
 
-       if (qdisc_is_throttled(sch))
+       if (q->throttled)
                return NULL;
 
        if (!q->unplug_indefinite) {
@@ -111,7 +114,7 @@ static struct sk_buff *plug_dequeue(struct Qdisc *sch)
                        /* No more packets to dequeue. Block the queue
                         * and wait for the next release command.
                         */
-                       qdisc_throttled(sch);
+                       q->throttled = true;
                        return NULL;
                }
                q->pkts_to_release--;
@@ -141,7 +144,7 @@ static int plug_init(struct Qdisc *sch, struct nlattr *opt)
                q->limit = ctl->limit;
        }
 
-       qdisc_throttled(sch);
+       q->throttled = true;
        return 0;
 }
 
@@ -173,7 +176,7 @@ static int plug_change(struct Qdisc *sch, struct nlattr *opt)
                q->pkts_last_epoch = q->pkts_current_epoch;
                q->pkts_current_epoch = 0;
                if (q->unplug_indefinite)
-                       qdisc_throttled(sch);
+                       q->throttled = true;
                q->unplug_indefinite = false;
                break;
        case TCQ_PLUG_RELEASE_ONE:
@@ -182,7 +185,7 @@ static int plug_change(struct Qdisc *sch, struct nlattr *opt)
                 */
                q->pkts_to_release += q->pkts_last_epoch;
                q->pkts_last_epoch = 0;
-               qdisc_unthrottled(sch);
+               q->throttled = false;
                netif_schedule_queue(sch->dev_queue);
                break;
        case TCQ_PLUG_RELEASE_INDEFINITE:
@@ -190,7 +193,7 @@ static int plug_change(struct Qdisc *sch, struct nlattr *opt)
                q->pkts_to_release = 0;
                q->pkts_last_epoch = 0;
                q->pkts_current_epoch = 0;
-               qdisc_unthrottled(sch);
+               q->throttled = false;
                netif_schedule_queue(sch->dev_queue);
                break;
        case TCQ_PLUG_LIMIT:
This page took 0.025293 seconds and 5 git commands to generate.