Skip to content

Commit 88fd650

Browse files
committed
net: macb: credit unsent frames to BQL in macb_tx_error_task()
The frames dropped on a TX error are never returned to BQL. Each error shrinks the BQL budget for good until the queue stops with an empty ring. netdev_tx_reset_queue() is not safe here as the task runs without tx_ptr_lock, so macb_start_xmit() may still be queueing. Fixes: e6a5321 ("net: cadence: macb: Implement BQL") Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent b04406d commit 88fd650

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/net/ethernet/cadence/macb_main.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,10 +1357,8 @@ static void macb_tx_error_task(struct work_struct *work)
13571357
skb->data);
13581358
bp->dev->stats.tx_packets++;
13591359
queue->stats.tx_packets++;
1360-
packets++;
13611360
bp->dev->stats.tx_bytes += skb->len;
13621361
queue->stats.tx_bytes += skb->len;
1363-
bytes += skb->len;
13641362
}
13651363
} else {
13661364
/* "Buffers exhausted mid-frame" errors may only happen
@@ -1374,6 +1372,12 @@ static void macb_tx_error_task(struct work_struct *work)
13741372
desc->ctrl = ctrl | MACB_BIT(TX_USED);
13751373
}
13761374

1375+
/* BQL has to see every frame leaving the ring, sent or not */
1376+
if (skb) {
1377+
packets++;
1378+
bytes += skb->len;
1379+
}
1380+
13771381
macb_tx_unmap(bp, tx_skb, 0);
13781382
}
13791383

0 commit comments

Comments
 (0)