sched: Use __qdisc_drop instead of kfree_skb in sch_prio and sch_qfq
authorGao Feng <gfree.wind@vip.163.com>
Mon, 4 Sep 2017 06:21:12 +0000 (14:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Sep 2017 04:20:07 +0000 (21:20 -0700)
The commit 520ac30f4551 ("net_sched: drop packets after root qdisc lock
is released) made a big change of tc for performance. There are two points
left in sch_prio and sch_qfq which are not changed with that commit. Now
enhance them now with __qdisc_drop.

Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_prio.c
net/sched/sch_qfq.c

index f31b28f788c008c570a194501227f628bc15643d..2dd6c68ae91eefe2f4e61b40f833f136c7576871 100644 (file)
@@ -80,7 +80,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
 
                if (ret & __NET_XMIT_BYPASS)
                        qdisc_qstats_drop(sch);
-               kfree_skb(skb);
+               __qdisc_drop(skb, to_free);
                return ret;
        }
 #endif
index cd661a7f81e6db4252f1b3a9b4da4adae2728248..6ddfd4991108ad9de057a22175d87f667c24f370 100644 (file)
@@ -1215,7 +1215,7 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
        if (cl == NULL) {
                if (err & __NET_XMIT_BYPASS)
                        qdisc_qstats_drop(sch);
-               kfree_skb(skb);
+               __qdisc_drop(skb, to_free);
                return err;
        }
        pr_debug("qfq_enqueue: cl = %x\n", cl->common.classid);