Skip to content

Commit

Permalink
net: sched: check for frozen queue before skb_bad_txq check
Browse files Browse the repository at this point in the history
I can not think of any reason to pull the bad txq skb off the qdisc if
the txq we plan to send this on is still frozen. So check for frozen
queue first and abort before dequeuing either skb_bad_txq skb or
normal qdisc dequeue() skb.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John Fastabend authored and David S. Miller committed Dec 8, 2017
1 parent 70e57d5 commit fd8e8d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
int *packets)
{
const struct netdev_queue *txq = q->dev_queue;
struct sk_buff *skb;
struct sk_buff *skb = NULL;

*packets = 1;
if (unlikely(!skb_queue_empty(&q->gso_skb))) {
Expand Down Expand Up @@ -248,12 +248,15 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
}
validate:
*validate = true;

if ((q->flags & TCQ_F_ONETXQUEUE) &&
netif_xmit_frozen_or_stopped(txq))
return skb;

skb = qdisc_dequeue_skb_bad_txq(q);
if (unlikely(skb))
goto bulk;
if (!(q->flags & TCQ_F_ONETXQUEUE) ||
!netif_xmit_frozen_or_stopped(txq))
skb = q->dequeue(q);
skb = q->dequeue(q);
if (skb) {
bulk:
if (qdisc_may_bulk(q))
Expand Down

0 comments on commit fd8e8d1

Please sign in to comment.