Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1321002lqp; Mon, 15 Apr 2024 02:53:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXy2cWCbf8B+gNh8IwUIK1W1t6jE4G2wSCmyyNZGqvGViPyUnpyc879PpooUrPheFE1cU5GWe6gi9yF+0jakizQZBSUWTs+yGCe1CuGxA== X-Google-Smtp-Source: AGHT+IEzKIbO0JodZ32XrGvWdVcPGg+uChzCQX7irzmcGHRc8O4eOzHPHf7eaXyekBTLcGI6qEiZ X-Received: by 2002:a05:6e02:194e:b0:36a:25fa:c755 with SMTP id x14-20020a056e02194e00b0036a25fac755mr14073025ilu.9.1713174803886; Mon, 15 Apr 2024 02:53:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713174803; cv=pass; d=google.com; s=arc-20160816; b=kLgikeDe7tvftb+HsUBqEegIVwY2JFbME9Bi+hZCGi0pNAZ6WfrK8q1NfYMT6j1iYk tBvT4vaL5MGUNDkJykKhk7o+VlgaUoy3YyeI3ZH49ky6tAYwtnTPYVtJhr+pwEWejujk SvQjA16F8B6cdnOT1nPfCdLXlD1okuD6OhN67JDUNHvP3xvafQ/WDQQo+ovQj4aFzWfY t9vLA3NHRuxJbacsP8EYWFQq/iUUpEkpMEnpj0eMuhf163b8dvIIIyUHrf1TmSLHzDC9 UpftFxY6sxEaLCN+w67be+pRJwt1hHLA0miB/DK1ioPBgJvYQNufkkRBZ44fYrUa7KNA yxOQ== 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=s8ci9swmHmOEzu/Vv+kkjDFwXAtpsSjlsSEUQTCEfVM=; fh=4QG8JldDsSGgNvIBKkpjxUq7EoGw0Kp2cqehO+01mDo=; b=j53ed2fn8m/359pEMnf7ECSXUJ41XknC1nMiADMaC+1Rf8sWPx2zrrmNxx+ZXmvI8k mI0YjvrwYaddcItjPaJT3uqTGE+3KCwlpQ7+4nStDhmhsF4J3W2VBViF/uFDLfJ1qCtw dmgAv3Mt3Ya9k1qiecMzZZEXPpbhhrOB3p8VtrSrfmSyBO1bawe3fiE5qJxgBomxeTwT VR1uyNO4kE0yU8wEdYCJwyQB+i+RVyqsm1607v0FoFvaXl65qFp+HZ/JH2Iy0yh1mxLW BkbbF419/F0jWKLtyLWxppgpSBJrNJf47L8WpQd8ayvRXTEJA7G1Hw/NgTeJadYUxQgo sf9A==; 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-144855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144855-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h22-20020a635316000000b005d3adb65694si7375582pgb.757.2024.04.15.02.53.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 02:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-144855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144855-linux.lists.archive=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 10D1FB2276E for ; Mon, 15 Apr 2024 09:48:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4E4845944; Mon, 15 Apr 2024 09:48:21 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9237D3FB2F; Mon, 15 Apr 2024 09:48:18 +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=1713174501; cv=none; b=AgaznI5231ncORR1pBrSfQKD+2vqnHJIGku3MyrpVoRJvz2r8sZavVGSEoMOt+rtNMFxVR1rYWXhruH3aSh3x5R3IL2GgCr0rF67xCrqEg3XGfN8cvGEELP96aM5dqRaOmUfuU/DRi3ET4M/fXD+PBmFJTd2OufhlaTRnB4Zx7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713174501; c=relaxed/simple; bh=/3tgachGlba0xQYbgA3XnWnpLu/EQzU489/T8ZTP2eg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=di6uqa6+Lway6k5Fj/NPpIQRrH5nKMMZfFQIJVdpkW9xpsKEHBazZvROpQRxgR0s9At/O9ivwfVXlg3HTl44nCzf5iRqimeDy6YJBGpvqqBWR33Kdn9KrArWpnG9jG0KPUlmvD4VZOeOsbP+mmDXp9lZwZDaN/L75x4jt1PyrlE= 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.07,202,1708354800"; d="scan'208";a="201479136" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 15 Apr 2024 18:48:17 +0900 Received: from renesas-deb12.cephei.uk (unknown [10.226.93.74]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 81BA64006DE8; Mon, 15 Apr 2024 18:48:13 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Paul Barker , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Geert Uytterhoeven , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next RFC v3 0/7] Improve GbEth performance on Renesas RZ/G2L and related SoCs Date: Mon, 15 Apr 2024 10:47:57 +0100 Message-Id: <20240415094804.8016-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series aims to improve performance 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 for both GbEth and R-Car code paths. Much of the performance improvement 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. The rest of the performance improvement comes from using a page pool to allocate RX buffers, and reducing the allocation size from >8kB to 2kB. The overall performance impact of this patch series seen in testing with iperf3 is as follows (see patches 5-7 for more detailed results): * RZ/G2L: * TCP TX: +1.8% bandwidth * TCP RX: +1% bandwidth at 47% less CPU load * UDP RX: +1% bandwidth at 26% less CPU load * RZ/G2UL: * TCP TX: +37% bandwidth * TCP RX: +43% bandwidth * UDP TX: -8% bandwidth * UDP RX: +32500% bandwidth (!) * RZ/G3S: * TCP TX: +25% bandwidth * TCP RX: +76% bandwidth * UDP TX: -9% bandwidth * UDP RX: +37900% bandwidth (!) * RZ/Five: * TCP TX: +18% bandwidth * TCP RX: +212% bandwidth * UDP TX: +2% bandwidth * UDP RX: +inf bandwidth (test no longer crashes) There is no significant impact on bandwidth or CPU load in testing on RZ/G2H or R-Car M3N. Fixing the crash in UDP RX testing for RZ/Five is a cumulative effect of patches 1, 2, 5 & 6 so this is very difficult to break out as a bugfix for backporting. This series depends on my recent ravb bugfix patches [1] which are not yet merged. [1]: https://lore.kernel.org/all/20240412100024.2296-1-paul.barker.ct@bp.renesas.com/ Changes v2->v3: * Incorporated feedback on RFC v2 from Sergey. * Split out bugfixes and rebased. This changed the order of what was the first 5 patches of v2 and things look a little different so I've not picked up Reviewed-by tags from v2. * Further refactoring and tidy up of RX ring refill and ravb_rx_gbeth(). * Switched to using a page pool to allocate RX buffers. * Re-tested and provided updated performance figures. Changes v1->v2: * Marked as RFC as the series depends on unmerged patches. * Refactored R-Car code paths as well as GbEth code paths. * Updated references to the patches this series depends on. Paul Barker (7): net: ravb: Simplify poll & receive functions net: ravb: Align poll function with NAPI docs net: ravb: Refactor RX ring refill net: ravb: Refactor GbEth RX code path net: ravb: Enable SW IRQ Coalescing for GbEth net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP net: ravb: Allocate RX buffers via page pool drivers/net/ethernet/renesas/ravb.h | 13 +- drivers/net/ethernet/renesas/ravb_main.c | 430 +++++++++++------------ 2 files changed, 221 insertions(+), 222 deletions(-) -- 2.39.2