aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch')
-rw-r--r--target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch b/target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch
new file mode 100644
index 0000000000..ab1a4a91e1
--- /dev/null
+++ b/target/linux/bcm63xx/patches-5.4/040-v5.12-bcm63xx_enet-batch-process-rx-path.patch
@@ -0,0 +1,55 @@
+From 9cbfea02c1dbee0afb9128f065e6e793672b9ff7 Mon Sep 17 00:00:00 2001
+From: Sieng Piaw Liew <liew.s.piaw@gmail.com>
+Date: Wed, 6 Jan 2021 22:42:02 +0800
+Subject: [PATCH 1/7] bcm63xx_enet: batch process rx path
+
+Use netif_receive_skb_list to batch process rx skb.
+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>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ 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
+@@ -298,10 +298,12 @@ static void bcm_enet_refill_rx_timer(str
+ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
+ {
+ struct bcm_enet_priv *priv;
++ struct list_head rx_list;
+ struct device *kdev;
+ int processed;
+
+ priv = netdev_priv(dev);
++ INIT_LIST_HEAD(&rx_list);
+ kdev = &priv->pdev->dev;
+ processed = 0;
+
+@@ -392,10 +394,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);
+