Skip to content

Commit ca24fca

Browse files
LorenzoBianconigregkh
authored andcommitted
net: airoha: Implement BQL support
[ Upstream commit 1d30417 ] Introduce BQL support in the airoha_eth driver reporting to the kernel info about tx hw DMA queues in order to avoid bufferbloat and keep the latency small. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20241012-en7581-bql-v2-1-4deb4efdb60b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 656121b ("net: airoha: Add missing RX_CPU_IDX() configuration in airoha_qdma_cleanup_rx_queue()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8b95b1d commit ca24fca

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/net/ethernet/mediatek/airoha_eth.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,9 +1729,11 @@ static int airoha_qdma_tx_napi_poll(struct napi_struct *napi, int budget)
17291729
WRITE_ONCE(desc->msg1, 0);
17301730

17311731
if (skb) {
1732+
u16 queue = skb_get_queue_mapping(skb);
17321733
struct netdev_queue *txq;
17331734

1734-
txq = netdev_get_tx_queue(skb->dev, qid);
1735+
txq = netdev_get_tx_queue(skb->dev, queue);
1736+
netdev_tx_completed_queue(txq, 1, skb->len);
17351737
if (netif_tx_queue_stopped(txq) &&
17361738
q->ndesc - q->queued >= q->free_thr)
17371739
netif_tx_wake_queue(txq);
@@ -2510,7 +2512,9 @@ static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,
25102512
q->queued += i;
25112513

25122514
skb_tx_timestamp(skb);
2513-
if (!netdev_xmit_more())
2515+
netdev_tx_sent_queue(txq, skb->len);
2516+
2517+
if (netif_xmit_stopped(txq) || !netdev_xmit_more())
25142518
airoha_qdma_rmw(qdma, REG_TX_CPU_IDX(qid),
25152519
TX_RING_CPU_IDX_MASK,
25162520
FIELD_PREP(TX_RING_CPU_IDX_MASK, q->head));

0 commit comments

Comments
 (0)