Commit fd8e8d1a authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

net: sched: check for frozen queue before skb_bad_txq check

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: default avatarJohn Fastabend <john.fastabend@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70e57d5e
...@@ -204,7 +204,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate, ...@@ -204,7 +204,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
int *packets) int *packets)
{ {
const struct netdev_queue *txq = q->dev_queue; const struct netdev_queue *txq = q->dev_queue;
struct sk_buff *skb; struct sk_buff *skb = NULL;
*packets = 1; *packets = 1;
if (unlikely(!skb_queue_empty(&q->gso_skb))) { if (unlikely(!skb_queue_empty(&q->gso_skb))) {
...@@ -248,11 +248,14 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate, ...@@ -248,11 +248,14 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
} }
validate: validate:
*validate = true; *validate = true;
if ((q->flags & TCQ_F_ONETXQUEUE) &&
netif_xmit_frozen_or_stopped(txq))
return skb;
skb = qdisc_dequeue_skb_bad_txq(q); skb = qdisc_dequeue_skb_bad_txq(q);
if (unlikely(skb)) if (unlikely(skb))
goto bulk; goto bulk;
if (!(q->flags & TCQ_F_ONETXQUEUE) ||
!netif_xmit_frozen_or_stopped(txq))
skb = q->dequeue(q); skb = q->dequeue(q);
if (skb) { if (skb) {
bulk: bulk:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment