summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bcm4908_enet.c
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2022-10-31 11:48:56 +0100
committerJakub Kicinski <kuba@kernel.org>2022-11-02 20:38:04 -0700
commit471ef777ec79baadc5cd9773d08f95f49cf5e2b1 (patch)
tree20061857c4b9f1e300e44df9aba7fea15490099f /drivers/net/ethernet/broadcom/bcm4908_enet.c
parent2cee6401c4eaa562abc1d437d5d03e80bbee79c1 (diff)
net: broadcom: bcm4908_enet: report queued and transmitted bytes
This allows BQL to operate avoiding buffer bloat and reducing latency. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Link: https://lore.kernel.org/r/20221031104856.32388-1-zajec5@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcm4908_enet.c')
-rw-r--r--drivers/net/ethernet/broadcom/bcm4908_enet.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c
index b0aac0bcb060..33d86683af50 100644
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
@@ -505,6 +505,7 @@ static int bcm4908_enet_stop(struct net_device *netdev)
netif_carrier_off(netdev);
napi_disable(&rx_ring->napi);
napi_disable(&tx_ring->napi);
+ netdev_reset_queue(netdev);
bcm4908_enet_dma_rx_ring_disable(enet, &enet->rx_ring);
bcm4908_enet_dma_tx_ring_disable(enet, &enet->tx_ring);
@@ -564,6 +565,8 @@ static netdev_tx_t bcm4908_enet_start_xmit(struct sk_buff *skb, struct net_devic
if (ring->write_idx + 1 == ring->length - 1)
tmp |= DMA_CTL_STATUS_WRAP;
+ netdev_sent_queue(enet->netdev, skb->len);
+
buf_desc->addr = cpu_to_le32((uint32_t)slot->dma_addr);
buf_desc->ctl = cpu_to_le32(tmp);
@@ -671,6 +674,7 @@ static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight)
tx_ring->read_idx = 0;
}
+ netdev_completed_queue(enet->netdev, handled, bytes);
enet->netdev->stats.tx_packets += handled;
enet->netdev->stats.tx_bytes += bytes;