sch_netem: Move private queue handler to generic location.
authorDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 23:33:28 +0000 (16:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Sep 2018 17:06:53 +0000 (10:06 -0700)
By hand copies of SKB list handlers do not belong in individual packet
schedulers.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
net/sched/sch_netem.c

index bc8f6b0b661034856d5ca3b019bbeddca95a55b9..fdaa5506e6f722fe69a797511e14c9ac85606bad 100644 (file)
@@ -851,6 +851,17 @@ static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch)
        return NET_XMIT_SUCCESS;
 }
 
+static inline void __qdisc_enqueue_head(struct sk_buff *skb,
+                                       struct qdisc_skb_head *qh)
+{
+       skb->next = qh->head;
+
+       if (!qh->head)
+               qh->tail = skb;
+       qh->head = skb;
+       qh->qlen++;
+}
+
 static inline struct sk_buff *__qdisc_dequeue_head(struct qdisc_skb_head *qh)
 {
        struct sk_buff *skb = qh->head;
index ad18a205241690070aff0f459c59c099ff8f3e2a..b9541ce4d67233839719e201f537a7b9b2254083 100644 (file)
@@ -412,16 +412,6 @@ static struct sk_buff *netem_segment(struct sk_buff *skb, struct Qdisc *sch,
        return segs;
 }
 
-static void netem_enqueue_skb_head(struct qdisc_skb_head *qh, struct sk_buff *skb)
-{
-       skb->next = qh->head;
-
-       if (!qh->head)
-               qh->tail = skb;
-       qh->head = skb;
-       qh->qlen++;
-}
-
 /*
  * Insert one skb into qdisc.
  * Note: parent depends on return value to account for queue length.
@@ -570,7 +560,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
                cb->time_to_send = ktime_get_ns();
                q->counter = 0;
 
-               netem_enqueue_skb_head(&sch->q, skb);
+               __qdisc_enqueue_head(skb, &sch->q);
                sch->qstats.requeues++;
        }