netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
	jacob.e.keller@intel.com, horms@kernel.org, sd@queasysnail.net,
	chunkeey@gmail.com
Subject: [PATCH net-next v3 01/17] net: ibm: emac: use netif_receive_skb_list
Date: Wed,  2 Oct 2024 19:11:19 -0700	[thread overview]
Message-ID: <20241003021135.1952928-2-rosenp@gmail.com> (raw)
In-Reply-To: <20241003021135.1952928-1-rosenp@gmail.com>

Small rx improvement. Would use napi_gro_receive instead but that's a
lot more involved than netif_receive_skb_list because of how the
function is implemented.

Before:

> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 51556 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.04 sec   559 MBytes   467 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 48228 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.03 sec   558 MBytes   467 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 47600 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.04 sec   557 MBytes   466 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 37252 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.05 sec   559 MBytes   467 Mbits/sec

After:

> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 40786 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.05 sec   572 MBytes   478 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 52482 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.04 sec   571 MBytes   477 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 48370 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.04 sec   572 MBytes   478 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 46086 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.05 sec   571 MBytes   476 Mbits/sec
> iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.1.101 port 46062 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.04 sec   572 MBytes   478 Mbits/sec

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/ibm/emac/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index dac570f3c110..d476844bae3e 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -1727,6 +1727,7 @@ static inline int emac_rx_sg_append(struct emac_instance *dev, int slot)
 /* NAPI poll context */
 static int emac_poll_rx(void *param, int budget)
 {
+	LIST_HEAD(rx_list);
 	struct emac_instance *dev = param;
 	int slot = dev->rx_slot, received = 0;
 
@@ -1783,8 +1784,7 @@ static int emac_poll_rx(void *param, int budget)
 		skb->protocol = eth_type_trans(skb, dev->ndev);
 		emac_rx_csum(dev, skb, ctrl);
 
-		if (unlikely(netif_receive_skb(skb) == NET_RX_DROP))
-			++dev->estats.rx_dropped_stack;
+		list_add_tail(&skb->list, &rx_list);
 	next:
 		++dev->stats.rx_packets;
 	skip:
@@ -1828,6 +1828,8 @@ static int emac_poll_rx(void *param, int budget)
 		goto next;
 	}
 
+	netif_receive_skb_list(&rx_list);
+
 	if (received) {
 		DBG2(dev, "rx %d BDs" NL, received);
 		dev->rx_slot = slot;
-- 
2.46.2


  reply	other threads:[~2024-10-03  2:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03  2:11 [PATCH net-next v3 00/17] ibm: emac: more cleanups Rosen Penev
2024-10-03  2:11 ` Rosen Penev [this message]
2024-10-03  2:11 ` [PATCH net-next v3 02/17] net: ibm: emac: remove custom init/exit functions Rosen Penev
2024-10-04 23:31   ` Jakub Kicinski
2024-10-03  2:11 ` [PATCH net-next v3 03/17] net: ibm: emac: use module_platform_driver for modules Rosen Penev
2024-10-04 23:32   ` Jakub Kicinski
2024-10-05  0:10     ` Rosen Penev
2024-10-06 11:53   ` kernel test robot
2024-10-06 19:13   ` kernel test robot
2024-10-03  2:11 ` [PATCH net-next v3 04/17] net: ibm: emac: use devm_platform_ioremap_resource Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 05/17] net: ibm: emac: use platform_get_irq Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 06/17] net: ibm: emac: remove bootlist support Rosen Penev
2024-10-04 23:34   ` Jakub Kicinski
2024-10-05  0:13     ` Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 07/17] net: ibm: emac: tah: use devm for kzalloc Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 08/17] net: ibm: emac: tah: devm_platform_get_resources Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 09/17] net: ibm: emac: rgmii: use devm for kzalloc Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 10/17] net: ibm: emac: rgmii: devm_platform_get_resource Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 11/17] net: ibm: emac: zmii: use devm for kzalloc Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 12/17] net: ibm: emac: zmii: devm_platform_get_resource Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 13/17] net: ibm: emac: mal: use devm for kzalloc Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 14/17] net: ibm: emac: mal: use devm for request_irq Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 15/17] net: ibm: emac: mal: move irq maps down Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 16/17] net: ibm: emac: mal: add dcr_unmap to _remove Rosen Penev
2024-10-04 23:35   ` Jakub Kicinski
2024-10-04 23:49     ` Rosen Penev
2024-10-03  2:11 ` [PATCH net-next v3 17/17] net: ibm: emac: mal: move dcr map down Rosen Penev
2024-10-04 23:36   ` Jakub Kicinski
2024-10-04 23:43     ` Rosen Penev
2024-10-07 14:05       ` Jakub Kicinski
2024-10-07 15:28         ` Jakub Kicinski
2024-10-04 23:32 ` [PATCH net-next v3 00/17] ibm: emac: more cleanups Jakub Kicinski
2024-10-04 23:38   ` Rosen Penev
2024-10-04 23:36 ` 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=20241003021135.1952928-2-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=chunkeey@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    /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;
as well as URLs for NNTP newsgroup(s).