mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sieng Piaw Liew <liew.s.piaw@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com,
	Sieng Piaw Liew <liew.s.piaw@gmail.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next v3 1/7] bcm63xx_enet: batch process rx path
Date: Wed,  6 Jan 2021 22:42:02 +0800	[thread overview]
Message-ID: <20210106144208.1935-2-liew.s.piaw@gmail.com> (raw)
In-Reply-To: <20210106144208.1935-1-liew.s.piaw@gmail.com>

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>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 916824cca3fd..b82b7805c36a 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -297,10 +297,12 @@ static void bcm_enet_refill_rx_timer(struct timer_list *t)
 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;
 
@@ -391,10 +393,12 @@ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
 		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);
 
-- 
2.17.1


  reply	other threads:[~2021-01-06 14:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 14:42 [PATCH net-next v3 0/7] bcm63xx_enet: major makeover of driver Sieng Piaw Liew
2021-01-06 14:42 ` Sieng Piaw Liew [this message]
2021-01-06 17:04   ` [PATCH net-next v3 1/7] bcm63xx_enet: batch process rx path Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 2/7] bcm63xx_enet: add BQL support Sieng Piaw Liew
2021-01-06 17:05   ` Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 3/7] bcm63xx_enet: add xmit_more support Sieng Piaw Liew
2021-01-06 17:05   ` Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 4/7] bcm63xx_enet: alloc rx skb with NET_IP_ALIGN Sieng Piaw Liew
2021-01-06 17:06   ` Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 5/7] bcm63xx_enet: consolidate rx SKB ring cleanup code Sieng Piaw Liew
2021-01-06 17:07   ` Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 6/7] bcm63xx_enet: convert to build_skb Sieng Piaw Liew
2021-01-06 17:08   ` Florian Fainelli
2021-01-06 14:42 ` [PATCH net-next v3 7/7] bcm63xx_enet: improve rx loop Sieng Piaw Liew
2021-01-06 17:08   ` Florian Fainelli
2021-01-06 17:03 ` [PATCH net-next v3 0/7] bcm63xx_enet: major makeover of driver Florian Fainelli
2021-01-07 20:41 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210106144208.1935-2-liew.s.piaw@gmail.com \
    --to=liew.s.piaw@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®