Skip to content

Commit

Permalink
sch_netem: Move private queue handler to generic location.
Browse files Browse the repository at this point in the history
By hand copies of SKB list handlers do not belong in individual packet
schedulers.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Sep 10, 2018
1 parent aea890b commit 5969773
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 11 additions & 0 deletions include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 1 addition & 11 deletions net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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++;
}

Expand Down

0 comments on commit 5969773

Please sign in to comment.