Skip to content

Commit 6252352

Browse files
Jarek Poplawskidavem330
authored andcommitted
pkt_sched: Simplify dev_requeue_skb and dequeue_skb
qdisc->requeue was planned to universally replace all requeuing code, but at the top level we never requeue more than one skb, so qdisc-> gso_skb is enough for this. qdisc->requeue would be used on the lower levels only for one level deep requeuing (like in sch_hfsc) after finishing all the changes. Signed-off-by: Jarek Poplawski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 554794d commit 6252352

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

net/sched/sch_generic.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,26 @@ static inline int qdisc_qlen(struct Qdisc *q)
4444

4545
static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
4646
{
47-
if (unlikely(skb->next))
48-
q->gso_skb = skb;
49-
else
50-
__skb_queue_head(&q->requeue, skb);
51-
47+
q->gso_skb = skb;
5248
__netif_schedule(q);
49+
5350
return 0;
5451
}
5552

5653
static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
5754
{
5855
struct sk_buff *skb = q->gso_skb;
5956

60-
if (!skb)
61-
skb = skb_peek(&q->requeue);
62-
6357
if (unlikely(skb)) {
6458
struct net_device *dev = qdisc_dev(q);
6559
struct netdev_queue *txq;
6660

6761
/* check the reason of requeuing without tx lock first */
6862
txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
69-
if (!netif_tx_queue_stopped(txq) &&
70-
!netif_tx_queue_frozen(txq)) {
71-
if (q->gso_skb)
72-
q->gso_skb = NULL;
73-
else
74-
__skb_unlink(skb, &q->requeue);
75-
} else {
63+
if (!netif_tx_queue_stopped(txq) && !netif_tx_queue_frozen(txq))
64+
q->gso_skb = NULL;
65+
else
7666
skb = NULL;
77-
}
7867
} else {
7968
skb = q->dequeue(q);
8069
}

0 commit comments

Comments
 (0)