Skip to content

Commit fd8e8d1

Browse files
jrfastabdavem330
authored andcommitted
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: John Fastabend <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 70e57d5 commit fd8e8d1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net/sched/sch_generic.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
204204
int *packets)
205205
{
206206
const struct netdev_queue *txq = q->dev_queue;
207-
struct sk_buff *skb;
207+
struct sk_buff *skb = NULL;
208208

209209
*packets = 1;
210210
if (unlikely(!skb_queue_empty(&q->gso_skb))) {
@@ -248,12 +248,15 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,
248248
}
249249
validate:
250250
*validate = true;
251+
252+
if ((q->flags & TCQ_F_ONETXQUEUE) &&
253+
netif_xmit_frozen_or_stopped(txq))
254+
return skb;
255+
251256
skb = qdisc_dequeue_skb_bad_txq(q);
252257
if (unlikely(skb))
253258
goto bulk;
254-
if (!(q->flags & TCQ_F_ONETXQUEUE) ||
255-
!netif_xmit_frozen_or_stopped(txq))
256-
skb = q->dequeue(q);
259+
skb = q->dequeue(q);
257260
if (skb) {
258261
bulk:
259262
if (qdisc_may_bulk(q))

0 commit comments

Comments
 (0)