Message ID | 20240206091909.3191-7-paul.barker.ct@bp.renesas.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1417788dyb; Tue, 6 Feb 2024 01:21:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTrjYGxLjWSuiSzlSBAg7lYkhr4my8oK7Royoiq5UP5FVjY+RBCpL4dznv6DL3wB6DnjAC X-Received: by 2002:a05:620a:1124:b0:783:df10:a0e5 with SMTP id p4-20020a05620a112400b00783df10a0e5mr1671748qkk.73.1707211299356; Tue, 06 Feb 2024 01:21:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211299; cv=pass; d=google.com; s=arc-20160816; b=KoLrIgFUp2//KBh2jKg4rujVdA4v68GiHtjh6PTIwZ3peNKscfeAOzcEbIHiVQG31s Pz9Lwle/E3JlN9Jg8NT7vlhp6cmNGViuK4VTUo3zic7ZujaatY+wFX8uuCEHvpIv17cX 2BnkaWmk0qMbdgLUxuC9Rr7NXcEP25jywoHaYO5IzFvFsgwAW9X+nJPV5+i3GhRkyvTR Ug0Hdd5LgPTykMUHHZLhws/sHhr4Ut+dCiiu5CxmJjQLcritLybboZcgs1Jaq+IudMeD sf2T3vtV+3xG4Ag21gqCIFvwwsShk4DGYT33HGERiopdzmKo4zuKGgbifQhlMTBoa5uj jf8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=rfuTluO4LlL/ukcj2oNHny17ZywTMv0sKmbc4/mtTpo=; fh=HMHu5Ee56nNcNuXLtvd3B50DWjJs1vM9HF5Wx+iCjGk=; b=b+5XbTAyEOHaNhyTLDZoYr//ng7lqGv0OqbsSFCIzoIgnX3ZNV7kyWMziZ8yxABIjb qHp4nzJrLJgoa3/dGOU7Au4zdF5FmJfFVY/3vnZff42W3jUe7ld5KYMofXP/i8hvOmcZ y/8X+ceVjoXfP7JIlZZG3Z2Mv3UdpG8IxVnIZXERclQgz4bLx0a4O86KPL6Aehj5Ja7l mcwJtGc5zd+MWCYtxNRZl8R3lqVU4mL7lznDJOzau5vekLp38SgZX/P/txqU5n+SYwBN 87YuGLpSGkL9sDAxxKSUqIKqn7/sTdhBI/dLQfEFwp+algn8fYDGIjNvi+MC5P7XQPjO 3Fbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCVDDs9gewe3WwY9o9Wf1MaK3l4G+5fPU7KZ9+O+w19YxZCDIjQeJCU0oJQ4k9D+elmxUYbjiY1qjySXfgxj19wyF+Iz9w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vw2-20020a05620a564200b00783e2eb9b2fsi1831178qkn.491.2024.02.06.01.21.39 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:21:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54575-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 292111C22157 for <ouuuleilei@gmail.com>; Tue, 6 Feb 2024 09:21:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53DCC12D176; Tue, 6 Feb 2024 09:19:48 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A184012EBFA; Tue, 6 Feb 2024 09:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211186; cv=none; b=kmvL59kKGPatmadeToN4eKyREwEyTpTL3Gw/YYHzw3rtykaqtuVqt7/E7RnokBriQsRCKOFXgU09fZtSEhLRfiHSwIW54y8ajXqMKypGm6dFNYgWL7sRP24L+bDBo5lk1XZMur8CN3U1t91YxNBS4TUceLmV40gmHydy92oH6n0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211186; c=relaxed/simple; bh=K2OpG4YqvGtxSFVnu+Kxv9nWWw/e4YY7sJiQxe5ZN2I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B20oA7PMcW72MRe7U27IsbNX3y944XoMiIJzESer4yQR7pPkLgnyIqvykqYTNtZ3X2r0irhtLxZNGUVpbM2WB/5oHplXFeFVqZE9y1jeB4SYZzAbyz7vrnd0T2BI64z67OZcP9FhjHjMpNcybWjsrWysRhjR/fA5nfHMYMuCmCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.05,246,1701097200"; d="scan'208";a="193022712" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 06 Feb 2024 18:19:43 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.93.63]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id BFCCE41B86C7; Tue, 6 Feb 2024 18:19:39 +0900 (JST) From: Paul Barker <paul.barker.ct@bp.renesas.com> To: Sergey Shtylyov <s.shtylyov@omp.ru>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Paul Barker <paul.barker.ct@bp.renesas.com>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next v2 6/7] net: ravb: Enable SW IRQ Coalescing for GbEth Date: Tue, 6 Feb 2024 09:19:08 +0000 Message-Id: <20240206091909.3191-7-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206091909.3191-1-paul.barker.ct@bp.renesas.com> References: <20240206091909.3191-1-paul.barker.ct@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790140795921766933 X-GMAIL-MSGID: 1790140795921766933 |
Series |
Improve GbEth performance on Renesas RZ/G2L and related SoCs
|
|
Commit Message
Paul Barker
Feb. 6, 2024, 9:19 a.m. UTC
Software IRQ Coalescing is required to improve network stack performance
in the RZ/G2L SoC family and the RZ/G3S SoC, i.e. the SoCs which use the
GbEth IP.
For the RZ/G2L, network throughput is comparable before and after this
change. CPU usage during TCP RX testing dropped by 6.5% and during UDP
RX testing dropped by 10%.
For the RZ/G2UL, network throughput is greatly increased by this change
(results obtained with iperf3):
* TCP TX: 2.9% more throughput
* TCP RX: 1.1% more throughput
* UDP TX: similar throughput
* UDP RX: 41500% more throughput
For the RZ/G3S we see improvements in network throughput similar to the
RZ/G2UL.
The improvement of UDP RX bandwidth for the single core SoCs (RZ/G2UL &
RZ/G3S) is particularly critical.
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 1 +
drivers/net/ethernet/renesas/ravb_main.c | 4 ++++
2 files changed, 5 insertions(+)
Comments
On 2/6/24 12:19 PM, Paul Barker wrote: > Software IRQ Coalescing is required to improve network stack performance > in the RZ/G2L SoC family and the RZ/G3S SoC, i.e. the SoCs which use the > GbEth IP. > > For the RZ/G2L, network throughput is comparable before and after this > change. CPU usage during TCP RX testing dropped by 6.5% and during UDP > RX testing dropped by 10%. > > For the RZ/G2UL, network throughput is greatly increased by this change > (results obtained with iperf3): > * TCP TX: 2.9% more throughput > * TCP RX: 1.1% more throughput > * UDP TX: similar throughput > * UDP RX: 41500% more throughput Wow! 8-) > For the RZ/G3S we see improvements in network throughput similar to the > RZ/G2UL. > > The improvement of UDP RX bandwidth for the single core SoCs (RZ/G2UL & > RZ/G3S) is particularly critical. > > Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> [...] > diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h > index 55a7a08aabef..ca7a66759e35 100644 > --- a/drivers/net/ethernet/renesas/ravb.h > +++ b/drivers/net/ethernet/renesas/ravb.h > @@ -1078,6 +1078,7 @@ struct ravb_hw_info { > unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ > unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ > unsigned half_duplex:1; /* E-MAC supports half duplex mode */ > + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ Is this really a hardware feature? Also, s/Requires SW/Needs software/ and s/to achieve best performance//, please... [...] MBR, Sergey
On 10/02/2024 18:42, Sergey Shtylyov wrote: > On 2/6/24 12:19 PM, Paul Barker wrote: >> diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h >> index 55a7a08aabef..ca7a66759e35 100644 >> --- a/drivers/net/ethernet/renesas/ravb.h >> +++ b/drivers/net/ethernet/renesas/ravb.h >> @@ -1078,6 +1078,7 @@ struct ravb_hw_info { >> unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ >> unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ >> unsigned half_duplex:1; /* E-MAC supports half duplex mode */ >> + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ > > Is this really a hardware feature? It's more like a requirement to get the best out of this hardware and the Linux networking stack. I considered checking the compatible string in the probe function but I decided that storing a configuration bit in the HW info struct was cleaner. > Also, s/Requires SW/Needs software/ and s/to achieve best performance//, > please... Will do. > > [...] > > MBR, Sergey Thanks for the review, Paul
On 2/12/24 2:45 PM, Paul Barker wrote: [...] >>> diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h >>> index 55a7a08aabef..ca7a66759e35 100644 >>> --- a/drivers/net/ethernet/renesas/ravb.h >>> +++ b/drivers/net/ethernet/renesas/ravb.h >>> @@ -1078,6 +1078,7 @@ struct ravb_hw_info { >>> unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ >>> unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ >>> unsigned half_duplex:1; /* E-MAC supports half duplex mode */ >>> + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ >> >> Is this really a hardware feature? > > It's more like a requirement to get the best out of this hardware and the Linux networking stack. > > I considered checking the compatible string in the probe function but I decided that storing a configuration bit in the HW info struct was cleaner. Yes, but you added the new bit under the "hardware features" commet. :-) >> Also, s/Requires SW/Needs software/ and s/to achieve best performance//, >> please... > > Will do. The comment is too long, I think. :-) [...] > Thanks for the review, > Paul MBR, Sergey
On 12/02/2024 20:40, Sergey Shtylyov wrote: > On 2/12/24 2:45 PM, Paul Barker wrote: > [...] >>>> diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h >>>> index 55a7a08aabef..ca7a66759e35 100644 >>>> --- a/drivers/net/ethernet/renesas/ravb.h >>>> +++ b/drivers/net/ethernet/renesas/ravb.h >>>> @@ -1078,6 +1078,7 @@ struct ravb_hw_info { >>>> unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ >>>> unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ >>>> unsigned half_duplex:1; /* E-MAC supports half duplex mode */ >>>> + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ >>> >>> Is this really a hardware feature? >> >> It's more like a requirement to get the best out of this hardware and the Linux networking stack. >> >> I considered checking the compatible string in the probe function but I decided that storing a configuration bit in the HW info struct was cleaner. > > Yes, but you added the new bit under the "hardware features" commet. :-) > >>> Also, s/Requires SW/Needs software/ and s/to achieve best performance//, >>> please... >> >> Will do. > > The comment is too long, I think. :-) I'll fix both in the next revision.
diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h index 55a7a08aabef..ca7a66759e35 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1078,6 +1078,7 @@ struct ravb_hw_info { unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ unsigned half_duplex:1; /* E-MAC supports half duplex mode */ + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ }; struct ravb_private { diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 661fd86899ac..7bb80608f260 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2639,6 +2639,7 @@ static const struct ravb_hw_info gbeth_hw_info = { .tx_counters = 1, .carrier_counters = 1, .half_duplex = 1, + .needs_irq_coalesce = 1, }; static const struct of_device_id ravb_match_table[] = { @@ -2983,6 +2984,9 @@ static int ravb_probe(struct platform_device *pdev) if (info->nc_queues) netif_napi_add(ndev, &priv->napi[RAVB_NC], ravb_poll); + if (info->needs_irq_coalesce) + netdev_sw_irq_coalesce_default_on(ndev); + /* Network device register */ error = register_netdev(ndev); if (error)