aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorSieng Piaw Liew <liew.s.piaw@gmail.com>2020-11-13 02:20:30 +0800
committerÁlvaro Fernández Rojas <noltari@gmail.com>2020-12-05 09:55:16 +0100
commit342524895c1636734f79f4901ac8a4c3f5f9849a (patch)
treebd24512110eb430752cd5ca992b0f98312c0e4cf /target
parent33c27ccf4aef677d28246d30e815050ead68b434 (diff)
downloadupstream-342524895c1636734f79f4901ac8a4c3f5f9849a.tar.gz
upstream-342524895c1636734f79f4901ac8a4c3f5f9849a.tar.bz2
upstream-342524895c1636734f79f4901ac8a4c3f5f9849a.zip
bcm63xx: add BQL support
Add Byte Queue Limits support to reduce/remove bufferbloat in bcm63xx target. Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com> [Amend commit description] Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch
new file mode 100644
index 0000000000..7955b7134f
--- /dev/null
+++ b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch
@@ -0,0 +1,67 @@
+From 3c0e8e1259d223a1493c47f7e277d05b93909b6b Mon Sep 17 00:00:00 2001
+From: Sieng Piaw Liew <liew.s.piaw@gmail.com>
+Date: Mon, 2 Nov 2020 11:34:06 +0800
+Subject: [PATCH 1/2] bcm63xx: add BQL support
+
+Add Byte Queue Limits support to reduce/remove bufferbloat in bcm63xx target.
+
+Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
+---
+ bcm63xx_enet.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -423,9 +423,11 @@ static int bcm_enet_tx_reclaim(struct ne
+ {
+ struct bcm_enet_priv *priv;
+ int released;
++ unsigned int bytes;
+
+ priv = netdev_priv(dev);
+ released = 0;
++ bytes = 0;
+
+ while (priv->tx_desc_count < priv->tx_ring_size) {
+ struct bcm_enet_desc *desc;
+@@ -461,10 +463,13 @@ static int bcm_enet_tx_reclaim(struct ne
+ if (desc->len_stat & DMADESC_UNDER_MASK)
+ dev->stats.tx_errors++;
+
++ bytes += skb->len;
+ dev_kfree_skb(skb);
+ released++;
+ }
+
++ netdev_completed_queue(dev, released, bytes);
++
+ if (netif_queue_stopped(dev) && released)
+ netif_wake_queue(dev);
+
+@@ -631,6 +636,8 @@ bcm_enet_start_xmit(struct sk_buff *skb,
+ desc->len_stat = len_stat;
+ wmb();
+
++ netdev_sent_queue(dev, skb->len);
++
+ /* kick tx dma */
+ enet_dmac_writel(priv, priv->dma_chan_en_mask,
+ ENETDMAC_CHANCFG, priv->tx_chan);
+@@ -1051,6 +1058,8 @@ static int bcm_enet_open(struct net_devi
+ else
+ bcm_enet_adjust_link(dev);
+
++ netdev_reset_queue(dev);
++
+ netif_start_queue(dev);
+ return 0;
+
+@@ -2281,6 +2290,8 @@ static int bcm_enetsw_open(struct net_de
+ enet_dmac_writel(priv, ENETDMAC_IR_PKTDONE_MASK,
+ ENETDMAC_IRMASK, priv->tx_chan);
+
++ netdev_reset_queue(dev);
++
+ netif_carrier_on(dev);
+ netif_start_queue(dev);
+