Merge tag 'armsoc-arm64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[deliverable/linux.git] / net / sched / sch_choke.c
index 789b69ee9e519bfd45603e08af24aa5e154a01d8..3b6d5bd691015f0dbfa285218e2453a8587b8043 100644 (file)
@@ -115,7 +115,8 @@ static void choke_zap_tail_holes(struct choke_sched_data *q)
 }
 
 /* Drop packet from queue array by creating a "hole" */
-static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx)
+static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx,
+                             struct sk_buff **to_free)
 {
        struct choke_sched_data *q = qdisc_priv(sch);
        struct sk_buff *skb = q->tab[idx];
@@ -129,7 +130,7 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx)
 
        qdisc_qstats_backlog_dec(sch, skb);
        qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
-       qdisc_drop(skb, sch);
+       qdisc_drop(skb, sch, to_free);
        --sch->q.qlen;
 }
 
@@ -261,7 +262,8 @@ static bool choke_match_random(const struct choke_sched_data *q,
        return choke_match_flow(oskb, nskb);
 }
 
-static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
+static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch,
+                        struct sk_buff **to_free)
 {
        int ret = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
        struct choke_sched_data *q = qdisc_priv(sch);
@@ -288,7 +290,7 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                /* Draw a packet at random from queue and compare flow */
                if (choke_match_random(q, skb, &idx)) {
                        q->stats.matched++;
-                       choke_drop_by_idx(sch, idx);
+                       choke_drop_by_idx(sch, idx, to_free);
                        goto congestion_drop;
                }
 
@@ -331,16 +333,16 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
        }
 
        q->stats.pdrop++;
-       return qdisc_drop(skb, sch);
+       return qdisc_drop(skb, sch, to_free);
 
 congestion_drop:
-       qdisc_drop(skb, sch);
+       qdisc_drop(skb, sch, to_free);
        return NET_XMIT_CN;
 
 other_drop:
        if (ret & __NET_XMIT_BYPASS)
                qdisc_qstats_drop(sch);
-       kfree_skb(skb);
+       __qdisc_drop(skb, to_free);
        return ret;
 }
 
This page took 0.032259 seconds and 5 git commands to generate.