fe85aefa7c07972a7f9be91272c8d63b523917c8
[openwrt/staging/blogic.git] /
1 From 471ef777ec79baadc5cd9773d08f95f49cf5e2b1 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Mon, 31 Oct 2022 11:48:56 +0100
4 Subject: [PATCH] net: broadcom: bcm4908_enet: report queued and transmitted
5 bytes
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 This allows BQL to operate avoiding buffer bloat and reducing latency.
11
12 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
13 Link: https://lore.kernel.org/r/20221031104856.32388-1-zajec5@gmail.com
14 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
15 ---
16 drivers/net/ethernet/broadcom/bcm4908_enet.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
20 +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
21 @@ -505,6 +505,7 @@ static int bcm4908_enet_stop(struct net_
22 netif_carrier_off(netdev);
23 napi_disable(&rx_ring->napi);
24 napi_disable(&tx_ring->napi);
25 + netdev_reset_queue(netdev);
26
27 bcm4908_enet_dma_rx_ring_disable(enet, &enet->rx_ring);
28 bcm4908_enet_dma_tx_ring_disable(enet, &enet->tx_ring);
29 @@ -564,6 +565,8 @@ static int bcm4908_enet_start_xmit(struc
30 if (ring->write_idx + 1 == ring->length - 1)
31 tmp |= DMA_CTL_STATUS_WRAP;
32
33 + netdev_sent_queue(enet->netdev, skb->len);
34 +
35 buf_desc->addr = cpu_to_le32((uint32_t)slot->dma_addr);
36 buf_desc->ctl = cpu_to_le32(tmp);
37
38 @@ -671,6 +674,7 @@ static int bcm4908_enet_poll_tx(struct n
39 tx_ring->read_idx = 0;
40 }
41
42 + netdev_completed_queue(enet->netdev, handled, bytes);
43 enet->netdev->stats.tx_packets += handled;
44 enet->netdev->stats.tx_bytes += bytes;
45