Message ID | 20240131170523.30048-1-paul.barker.ct@bp.renesas.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-46862-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp2048075dyb; Wed, 31 Jan 2024 09:35:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8tMYBPxqK9eW0wkQuHRJX9dnUdF1ABhQnz9kjbsMYcRRTHfvpDFXv2U864epLRh8r317Y X-Received: by 2002:a17:902:b595:b0:1d7:5943:21b8 with SMTP id a21-20020a170902b59500b001d7594321b8mr2300305pls.16.1706722515430; Wed, 31 Jan 2024 09:35:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706722515; cv=pass; d=google.com; s=arc-20160816; b=AYpRPuSQ0U2sx4jMIM6keIwkH4eVZhhxH9lXYAn619l5zhEgD+81n/679rjNAGkLg6 mq2SyzIL668YdsUJZjjwjJ6rliz8XAuSIfCwf/MxklW7pvsUj7BuXvzJD1ta5o7XmTkG m1dSkxQbXamsHfe+1Aya2U5wArCjsxjUjj7vJH6+T2l1fC/nb20CqQrpTNgy8xVFfeof 8krIJ9EC07jYhmbI4pav3DsHn885NANxLhzk7kATUWRUNI+AmqzE209M1fzTyS+FEveL UxwSoSj951IVC3r8joimpn+3tv+jjzbAEQano74msOUJbjClVPD9uRfrKuW088KPJ7JU qqRw== 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:message-id:date:subject:cc:to :from; bh=o4qI7i7hKJgNMkWhYq6tElk0bSZ1cmmWor/Y13AETyE=; fh=a3oh8rZ7Bh0vBiTHP7HrPfWv8RVPdNF+NAOiUZlFFIg=; b=SQeZJE2x/ww2TVFZu5eIaB3grFI/oCj+Tp3k15j4w/Ydq1skxw8DAMo9ziUZl3i8WX qEuA7boxo+BT7wKQ/9G3tKRi0rQjLYNvXsE9PKVH/Gl3n7eGTUefERbS48akXHb2ByDE TKejamjWRorRFpr0IzvjwpBAJqNlF8W6wCSRPUYV6n4sxRGnk06+CrR81HIfznhYNqEG RHYYGPNXi9vuyOM7WYzSUMuX0QIcFmp83Rk8RW7Mlx+oHM3TyheGS3uUd3f3Fd8uie7G h16k59GOMuDixzpORpyglr6OPFwTRnAKoiVDa0q67OQdLnemIK7iE0u6Py25gpg0eF9E VXig==; 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-46862-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46862-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCU0crKr5V5dSDqau8ESkkDrJFWqwHTQKOhwaEY7CgCyIlLorPc70ltcf/4XK5LwtdXYzvlhmzcPAjC0yrMapD8NMplaoA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r4-20020a1709028bc400b001d7105e7ff9si9694629plo.546.2024.01.31.09.35.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 09:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46862-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-46862-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46862-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 90338B3136C for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 17:06:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08E4612CDB3; Wed, 31 Jan 2024 17:05:57 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2B9A84A3C; Wed, 31 Jan 2024 17:05:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720755; cv=none; b=rG0FQWF+04idBdJMuR9QKLmraUO+JZ20HI+pXPqhZ0r7VTr7Ag/4XxRWVvXnUxKFF2QmQCXMbp/XrJJIr4EFGoxI9JenxTd+5I45Iix7RZrYAGvgYN/0+7mhMh1P6iWg6Ay8uIprI6TcsqdYHbAcbQmZlEbtxfxmhHykox9RJXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720755; c=relaxed/simple; bh=uJl5pmP7pzP0qSuDUSpGf4Bz6mdCugoDwzVWMXmOkvQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UaIPMkjVpWRV/RdqmNJvwPAfXVLOEKfeyebFacTGFIlTVK1TO1qiLcW3B2eSnnblpR6Kemdkv/N5NWwvQ6zfgF/Ul0QC7TObEVq2Aj1qxmJDr3fjDcP9VCXICfdzh83L+8BBkJi5z4EMqgpm9Cm8PWk58tfFKK4900dbZcRjX4k= 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.172 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,231,1701097200"; d="scan'208";a="196315512" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Feb 2024 02:05:46 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.92.158]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id BE78A40344F5; Thu, 1 Feb 2024 02:05:42 +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: [PATCH net-next 0/8] Improve GbEth performance on Renesas RZ/G2L and related SoCs Date: Wed, 31 Jan 2024 17:05:14 +0000 Message-Id: <20240131170523.30048-1-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 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: 1789628268279522336 X-GMAIL-MSGID: 1789628268279522336 |
Series |
Improve GbEth performance on Renesas RZ/G2L and related SoCs
|
|
Message
Paul Barker
Jan. 31, 2024, 5:05 p.m. UTC
This series aims to improve peformance of the GbEth IP in the Renesas RZ/G2L SoC family and the RZ/G3S SoC, which use the ravb driver. Along the way, we do some refactoring and ensure that napi_complete_done() is used in accordance with the NAPI documentation. Performance improvment mainly comes from enabling SW IRQ Coalescing for all SoCs using the GbEth IP, and NAPI Threaded mode for single core SoCs using the GbEth IP. These can be enabled/disabled at runtime via sysfs, but our goal is to set sensible defaults which get good performance on the affected SoCs. Changes are made specific to the GbEth IP, avoiding potential impact on the other Renesas R-Car based SoCs which also use the ravb driver. This follows the principle of only submitting patches that we can fully test. The performance impact of this series on iperf3 testing is as follows: * RZ/G2L Ethernet throughput is unchanged, but CPU usage drops: * Bidirectional and TCP RX: 6.5% less CPU usage * UDP RX: 10% less CPU usage * RZ/G2UL and RZ/G3S Ethernet throughput is increased for all test cases except UDP TX, which suffers a slight loss: * TCP TX: 32% more throughput * TCP RX: 11% more throughput * UDP TX: 10% less throughput * UDP RX: 10183% more throughput - the previous throughput of 1.06Mbps is what prompted this work. * RZ/G2N CPU usage and Ethernet throughput is unchanged (tested as a representative of the SoCs which use the R-Car based RAVB IP). This series depends on: * "net: ravb: Let IP-specific receive function to interrogate descriptors" v5 https://lore.kernel.org/all/20240131084133.1671440-2-claudiu.beznea.uj@bp.renesas.com/ To get the results shown above, you'll also need: * "topology: Set capacity_freq_ref in all cases" https://lore.kernel.org/all/20240117190545.596057-1-vincent.guittot@linaro.org/ * "ravb: Add Rx checksum offload support" v2 https://lore.kernel.org/all/20240124102115.132154-2-biju.das.jz@bp.renesas.com/ * "ravb: Add Tx checksum offload support" v2 https://lore.kernel.org/all/20240124102115.132154-3-biju.das.jz@bp.renesas.com/ Work in this area will continue, in particular we expect to improve TCP/UDP RX performance further with future changes to RX buffer handling. Paul Barker (8): net: ravb: Split R-Car & GbEth poll functions net: ravb: Simplify GbEth poll & receive functions net: ravb: Count packets in GbEth RX (not descriptors) net: ravb: Always process TX descriptor ring in GbEth poll net: ravb: Always update error counters net: ravb: Align GbEth poll function with NAPI docs net: ravb: Enable SW IRQ Coalescing for GbEth net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP drivers/net/ethernet/renesas/ravb.h | 3 +- drivers/net/ethernet/renesas/ravb_main.c | 103 ++++++++++++++++------- 2 files changed, 74 insertions(+), 32 deletions(-)
Comments
> Changes are made specific to the GbEth IP, avoiding potential impact on > the other Renesas R-Car based SoCs which also use the ravb driver. This > follows the principle of only submitting patches that we can fully test. Are you saying that Renesas does not have access to all Renesas RDKs? I don't particularly like the way your first patch makes a copy of shared functions. Is it not likely that R-Car would also benefit from this? Andrew
On 1/31/24 8:05 PM, Paul Barker wrote: > This series aims to improve peformance of the GbEth IP in the Renesas Performance. > RZ/G2L SoC family and the RZ/G3S SoC, which use the ravb driver. Along > the way, we do some refactoring and ensure that napi_complete_done() is > used in accordance with the NAPI documentation. > > Performance improvment mainly comes from enabling SW IRQ Coalescing for Improvement. > all SoCs using the GbEth IP, and NAPI Threaded mode for single core SoCs > using the GbEth IP. These can be enabled/disabled at runtime via sysfs, > but our goal is to set sensible defaults which get good performance on > the affected SoCs. > > Changes are made specific to the GbEth IP, avoiding potential impact on > the other Renesas R-Car based SoCs which also use the ravb driver. This > follows the principle of only submitting patches that we can fully test. > > The performance impact of this series on iperf3 testing is as follows: > * RZ/G2L Ethernet throughput is unchanged, but CPU usage drops: > * Bidirectional and TCP RX: 6.5% less CPU usage > * UDP RX: 10% less CPU usage > > * RZ/G2UL and RZ/G3S Ethernet throughput is increased for all test > cases except UDP TX, which suffers a slight loss: > * TCP TX: 32% more throughput > * TCP RX: 11% more throughput > * UDP TX: 10% less throughput > * UDP RX: 10183% more throughput - the previous throughput of 10183%, really? 8-) > 1.06Mbps is what prompted this work. > > * RZ/G2N CPU usage and Ethernet throughput is unchanged (tested as a > representative of the SoCs which use the R-Car based RAVB IP). > > This series depends on: > * "net: ravb: Let IP-specific receive function to interrogate descriptors" v5 > https://lore.kernel.org/all/20240131084133.1671440-2-claudiu.beznea.uj@bp.renesas.com/ So this is based on yet unmerged patch? Dave, Jakub, et al., the series should be considered RFC then. > To get the results shown above, you'll also need: > * "topology: Set capacity_freq_ref in all cases" > https://lore.kernel.org/all/20240117190545.596057-1-vincent.guittot@linaro.org/ > > * "ravb: Add Rx checksum offload support" v2 > https://lore.kernel.org/all/20240124102115.132154-2-biju.das.jz@bp.renesas.com/ > > * "ravb: Add Tx checksum offload support" v2 > https://lore.kernel.org/all/20240124102115.132154-3-biju.das.jz@bp.renesas.com/ Those 2 are not finalized yet... > Work in this area will continue, in particular we expect to improve > TCP/UDP RX performance further with future changes to RX buffer > handling. > > Paul Barker (8): > net: ravb: Split R-Car & GbEth poll functions > net: ravb: Simplify GbEth poll & receive functions > net: ravb: Count packets in GbEth RX (not descriptors) > net: ravb: Always process TX descriptor ring in GbEth poll > net: ravb: Always update error counters > net: ravb: Align GbEth poll function with NAPI docs > net: ravb: Enable SW IRQ Coalescing for GbEth > net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP > > drivers/net/ethernet/renesas/ravb.h | 3 +- > drivers/net/ethernet/renesas/ravb_main.c | 103 ++++++++++++++++------- > 2 files changed, 74 insertions(+), 32 deletions(-) MBR, Sergey
On 31/01/2024 18:26, Andrew Lunn wrote: >> Changes are made specific to the GbEth IP, avoiding potential impact on >> the other Renesas R-Car based SoCs which also use the ravb driver. This >> follows the principle of only submitting patches that we can fully test. > > Are you saying that Renesas does not have access to all Renesas RDKs? > > I don't particularly like the way your first patch makes a copy of > shared functions. Is it not likely that R-Car would also benefit from > this? We have the required RDKs. For the R-Car based SoCs, we need to confirm that gPTP still works if we change the poll/receive code paths - this will require an AVB-capable network switch and additional time to test. So our plan was to handle the GbEth code paths first without affecting R-Car, then follow up with another patch set for the R-Car code paths when we've done the required tests. I discussed this with our team, and we're happy to do this in one go for both R-Car and GbEth code paths if that's preferred. I'll send the patches as an RFC (as Sergey has commented it should be an RFC anyway as it depends on an unmerged patch) and we'll do the gPTP test with a couple of R-Car boards. Thanks, Paul
On Fri, Feb 02, 2024 at 09:39:42AM +0000, Paul Barker wrote: > On 31/01/2024 18:26, Andrew Lunn wrote: > >> Changes are made specific to the GbEth IP, avoiding potential impact on > >> the other Renesas R-Car based SoCs which also use the ravb driver. This > >> follows the principle of only submitting patches that we can fully test. > > > > Are you saying that Renesas does not have access to all Renesas RDKs? > > > > I don't particularly like the way your first patch makes a copy of > > shared functions. Is it not likely that R-Car would also benefit from > > this? > > We have the required RDKs. For the R-Car based SoCs, we need to confirm > that gPTP still works if we change the poll/receive code paths - this > will require an AVB-capable network switch and additional time to test. > So our plan was to handle the GbEth code paths first without affecting > R-Car, then follow up with another patch set for the R-Car code paths > when we've done the required tests. > > I discussed this with our team, and we're happy to do this in one go for > both R-Car and GbEth code paths if that's preferred. Hi Paul I think it would be simpler, since you would then need to recombine the code paths you have just split. Its better to not split them in the first place if possible. Andrew