aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2022-10-27 22:33:14 +0200
committerRafał Miłecki <rafal@milecki.pl>2022-11-03 09:40:06 +0100
commit1d12cfdce28101ca60fc7afed1e4cf0812814992 (patch)
treed8c2d9275de192ccc0503845f6ed7d264daa774d /target
parent973c18fb8c1d3e7db42bb4aa51b17e23b92bb0e6 (diff)
downloadupstream-1d12cfdce28101ca60fc7afed1e4cf0812814992.tar.gz
upstream-1d12cfdce28101ca60fc7afed1e4cf0812814992.tar.bz2
upstream-1d12cfdce28101ca60fc7afed1e4cf0812814992.zip
bcm4908: backport upstream BQL support for bcm4908_enet
Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit ae57770c956888337249688b9a16c25dd4fd63fb) (cherry picked from commit 6198eb3e6448e9a43a32d3f46b7d0543424f455b)
Diffstat (limited to 'target')
-rw-r--r--target/linux/bcm4908/patches-5.4/079-v6.2-0002-net-broadcom-bcm4908_enet-report-queued-and-transmit.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/bcm4908/patches-5.4/079-v6.2-0002-net-broadcom-bcm4908_enet-report-queued-and-transmit.patch b/target/linux/bcm4908/patches-5.4/079-v6.2-0002-net-broadcom-bcm4908_enet-report-queued-and-transmit.patch
new file mode 100644
index 0000000000..9f85a77b76
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.4/079-v6.2-0002-net-broadcom-bcm4908_enet-report-queued-and-transmit.patch
@@ -0,0 +1,45 @@
+From 471ef777ec79baadc5cd9773d08f95f49cf5e2b1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Mon, 31 Oct 2022 11:48:56 +0100
+Subject: [PATCH] net: broadcom: bcm4908_enet: report queued and transmitted
+ bytes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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>
+---
+ drivers/net/ethernet/broadcom/bcm4908_enet.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
+@@ -504,6 +504,7 @@ static int bcm4908_enet_stop(struct net_
+ 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);
+@@ -563,6 +564,8 @@ static int bcm4908_enet_start_xmit(struc
+ 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);
+
+@@ -670,6 +673,7 @@ static int bcm4908_enet_poll_tx(struct n
+ tx_ring->read_idx = 0;
+ }
+
++ netdev_completed_queue(enet->netdev, handled, bytes);
+ enet->netdev->stats.tx_packets += handled;
+ enet->netdev->stats.tx_bytes += bytes;
+