Skip to content

Commit c900e49

Browse files
Sean Andersonkuba-moo
authored andcommitted
net: xilinx: axienet: Implement BQL
Implement byte queue limits to allow queueing disciplines to account for packets enqueued in the ring buffers but not yet transmitted. Signed-off-by: Sean Anderson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8af2136 commit c900e49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,7 @@ static int axienet_tx_poll(struct napi_struct *napi, int budget)
10021002
&size, budget);
10031003

10041004
if (packets) {
1005+
netdev_completed_queue(ndev, packets, size);
10051006
u64_stats_update_begin(&lp->tx_stat_sync);
10061007
u64_stats_add(&lp->tx_packets, packets);
10071008
u64_stats_add(&lp->tx_bytes, size);
@@ -1125,6 +1126,7 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
11251126
if (++new_tail_ptr >= lp->tx_bd_num)
11261127
new_tail_ptr = 0;
11271128
WRITE_ONCE(lp->tx_bd_tail, new_tail_ptr);
1129+
netdev_sent_queue(ndev, skb->len);
11281130

11291131
/* Start the transfer */
11301132
axienet_dma_out_addr(lp, XAXIDMA_TX_TDESC_OFFSET, tail_p);
@@ -1751,6 +1753,7 @@ static int axienet_stop(struct net_device *ndev)
17511753
dma_release_channel(lp->tx_chan);
17521754
}
17531755

1756+
netdev_reset_queue(ndev);
17541757
axienet_iow(lp, XAE_IE_OFFSET, 0);
17551758

17561759
if (lp->eth_irq > 0)
@@ -2676,6 +2679,7 @@ static void axienet_dma_err_handler(struct work_struct *work)
26762679
~(XAE_OPTION_TXEN | XAE_OPTION_RXEN));
26772680

26782681
axienet_dma_stop(lp);
2682+
netdev_reset_queue(ndev);
26792683

26802684
for (i = 0; i < lp->tx_bd_num; i++) {
26812685
cur_p = &lp->tx_bd_v[i];

0 commit comments

Comments
 (0)