aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm63xx/patches-5.4
diff options
context:
space:
mode:
authorSieng Piaw Liew <liew.s.piaw@gmail.com>2020-11-30 11:32:18 +0800
committerÁlvaro Fernández Rojas <noltari@gmail.com>2020-12-02 20:25:32 +0100
commiteefbcf2915243bdedca37ba3df6bc505ffbc2e58 (patch)
treedefcdd91181561ec94ece9299ae5a592c44fdfbc /target/linux/bcm63xx/patches-5.4
parentf330f991c1dcb483a1966d2d194afc2a40cd30fd (diff)
downloadupstream-eefbcf2915243bdedca37ba3df6bc505ffbc2e58.tar.gz
upstream-eefbcf2915243bdedca37ba3df6bc505ffbc2e58.tar.bz2
upstream-eefbcf2915243bdedca37ba3df6bc505ffbc2e58.zip
bcm63xx: batch process RX path
Use netif_receive_skb_list to batch process skb in RX. Tested on BCM6328 320 MHz using iperf3 -M 512, increasing performance by 12.5%. Before: [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-30.00 sec 120 MBytes 33.7 Mbits/sec 277 sender [ 4] 0.00-30.00 sec 120 MBytes 33.5 Mbits/sec receiver After: [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-30.00 sec 136 MBytes 37.9 Mbits/sec 203 sender [ 4] 0.00-30.00 sec 135 MBytes 37.7 Mbits/sec receiver 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/linux/bcm63xx/patches-5.4')
-rw-r--r--target/linux/bcm63xx/patches-5.4/440-bcm63xx_enet-batch_process_RX_path.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/target/linux/bcm63xx/patches-5.4/440-bcm63xx_enet-batch_process_RX_path.patch b/target/linux/bcm63xx/patches-5.4/440-bcm63xx_enet-batch_process_RX_path.patch
new file mode 100644
index 0000000000..0a22d8c651
--- /dev/null
+++ b/target/linux/bcm63xx/patches-5.4/440-bcm63xx_enet-batch_process_RX_path.patch
@@ -0,0 +1,53 @@
+From 1606f78dc82e4f311ca5844a0605a62cd141a072 Mon Sep 17 00:00:00 2001
+From: Sieng Piaw Liew <liew.s.piaw@gmail.com>
+Date: Mon, 30 Nov 2020 11:07:47 +0800
+Subject: [PATCH] bcm63xx: batch process RX path
+
+Use netif_receive_skb_list to batch process skb in RX.
+Tested on BCM6328 320 MHz using iperf3 -M 512, increasing performance
+by 12.5%.
+
+Before:
+[ ID] Interval Transfer Bandwidth Retr
+[ 4] 0.00-30.00 sec 120 MBytes 33.7 Mbits/sec 277 sender
+[ 4] 0.00-30.00 sec 120 MBytes 33.5 Mbits/sec receiver
+
+After:
+[ ID] Interval Transfer Bandwidth Retr
+[ 4] 0.00-30.00 sec 136 MBytes 37.9 Mbits/sec 203 sender
+[ 4] 0.00-30.00 sec 135 MBytes 37.7 Mbits/sec receiver
+
+Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
+---
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -301,10 +301,12 @@ static int bcm_enet_receive_queue(struct
+ struct bcm_enet_priv *priv;
+ struct device *kdev;
+ int processed;
++ struct list_head rx_list;
+
+ priv = netdev_priv(dev);
+ kdev = &priv->pdev->dev;
+ processed = 0;
++ INIT_LIST_HEAD(&rx_list);
+
+ /* don't scan ring further than number of refilled
+ * descriptor */
+@@ -393,10 +395,12 @@ static int bcm_enet_receive_queue(struct
+ skb->protocol = eth_type_trans(skb, dev);
+ dev->stats.rx_packets++;
+ dev->stats.rx_bytes += len;
+- netif_receive_skb(skb);
++ list_add_tail(&skb->list, &rx_list);
+
+ } while (--budget > 0);
+
++ netif_receive_skb_list(&rx_list);
++
+ if (processed || !priv->rx_desc_count) {
+ bcm_enet_refill_rx(dev);
+