Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1424571lqj; Tue, 4 Jun 2024 00:34:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvMai4XVojCBMoaKwMpWUuZWG57PioXNqRPYUHLqpWYSp2wX76w7p+AabYR0QemKCIKy+jJMqHwxuPYT/FpycIkay0vSGZkZ5b5hDdXA== X-Google-Smtp-Source: AGHT+IEm2LdfA9phtyW3bNLH5exv9/zzI3fw4S27+zRm9yovYY+kRRkEZU3Lm5+Pg/Gaj5tmHe/i X-Received: by 2002:a05:6a21:1f27:b0:1b2:748a:c875 with SMTP id adf61e73a8af0-1b2a2c84111mr2121807637.22.1717486457455; Tue, 04 Jun 2024 00:34:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717486457; cv=pass; d=google.com; s=arc-20160816; b=MPme8XhH4LtCE1EPCveXTKOyNjeEVYLd77eTkJN86Hv8YkgFCKNaIlTqh9uaX/Awfo sHZPSfEcMEMP0ecDmiAOtlV1MtpRWh0GgSmG6w5Z0SEJqBm4TSrDeaqx5TRkSGLbhsoI fhlD5K4fDiGC31DY5W1mtmuQuycI1OfotXcx8kyjwtdiAvIYqaPMWrz+hDRNXAv8AQOe gVc+zDHfw/wyKMRz7j8TmAG2W5yiewS4Ofq/h/0VhPX7eiu5HWXjIIWLKOK0xFVnoou9 AyUwSV4ancd7LPC948Y1CVN2FsdF63FF1E4b+PHcVKy7Z4khELUaFW1jN9IoDX7FaWCZ eOMg== 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=Wb+EmZx65wqyxJN3FnuDESxndArGsj7WqPbmfGsU1MQ=; fh=cXKldWdygt6OvRh95xLWtvOg/a1bY7Hjo06mK/L4two=; b=Sc9/TZty/LAHDuGMrz6OeuDHMvZZsdjOSByGpGlCIFj0ooOBSTjv4dOf+63brhBOZS BYHXKtz5QYFVFEWlbCCsMm/LHKtsnKcQDKCJxmkFI56q0CzLc1pHQetHn4QQ/SasBJUD z8Vz3pEZDbM3fRj3gnYttiuQr4ZMBfKb870creYqbqJSpcq3ZP0Mz+yhgeDcNVWHtxl3 8JKTNjGONfkbePEU7MLNYXuufi5+YKedmmtAuzdwY+l6E51Jyvtu7c9jHRVZtPh+UMlU jz5hEANr5UqK1mQAHIORIpBzD0tBc0aEFch9vtn0cvkMQ1RKSAu4tmqo5c0c7/1H3bk6 3Chw==; 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-200158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200158-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 41be03b00d2f7-6c3540fb432si923592a12.132.2024.06.04.00.34.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 00:34:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200158-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-200158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200158-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 F3A63B249FE for ; Tue, 4 Jun 2024 07:31:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ED6314374C; Tue, 4 Jun 2024 07:29:16 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35CB31411F4; Tue, 4 Jun 2024 07:29:12 +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=1717486156; cv=none; b=PjL7kMTFZMNV/5QzndEVv673lwUOaenLphr5iQDejwfJqEOvxlnRaZltxRyfHnDGDEUHUhIqIKccHm5dPnivoL/ARLwGO+XNwrmsOA3HBfrGDd88/Clt2HEfQmj7aDub/VaU/4kb8/pULVkgYEeU4C7kblF95PtCNAi9kXkDRm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717486156; c=relaxed/simple; bh=XuVlm0U5SW4Dli6mAr7+sut314HZYUNxyu/rQnq8fJA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DVb7jlGkBSRtVQ/EKufYsTmurjNqMslF0W9ZpnhU+Na0AmMHethGdlg6HrvjmLO6VKNWv/E0s1jFM9GSA8SmlZtsUtih0koUmEydB8sBt5QCWLe5nHfX7vCmsXWgC8+66eLw0OM5vA02RZxqVZK5Eamf4NBmbzGBstPHorrf7E0= 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.08,213,1712588400"; d="scan'208";a="206651387" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 04 Jun 2024 16:29:12 +0900 Received: from renesas-deb12.mshome.net (unknown [10.226.92.239]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 36CA141FCFCA; Tue, 4 Jun 2024 16:29:06 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Simon Horman Cc: Paul Barker , Biju Das , Claudiu Beznea , Yoshihiro Shimoda , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH v5 6/7] net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP Date: Tue, 4 Jun 2024 08:28:24 +0100 Message-Id: <20240604072825.7490-7-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240604072825.7490-1-paul.barker.ct@bp.renesas.com> References: <20240604072825.7490-1-paul.barker.ct@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit NAPI Threaded mode (along with the previously enabled SW IRQ Coalescing) is required to improve network stack performance for single core SoCs using the GbEth IP (currently the RZ/G2L SoC family and the RZ/G3S SoC). This patch gives the following improvements during testing with iperf3. * RZ/G2UL: * TCP TX: +32% bandwidth (638Mbps -> 841Mbps) * TXP RX: +8.8% bandwidth (667Mbps -> 726Mbps) * UDP RX: +104% bandwidth (53Mbps -> 108Mbps) * RZ/G3S: * TCP TX: 29% bandwidth (529Mbps -> 681Mbps) * UDP RX: +1290% bandwidth (6.46Mbps -> 90Mbps) * RZ/Five: * UDP RX: Test no longer crashes (0 -> 20 Mbps) This patch gives the following reductions in performance in the same testing: * RZ/G2UL: * UDP TX: -7.5% bandwidth (594Mbps -> 549Mbps) * RZ/G3S: * UDP TX: -5% bandwidth (625Mbps -> 594Mbps) These losses are considered acceptable given the benefits shown above. If UDP TX bandwidth must be maximised for a particular use case, NAPI threaded mode can be disabled at runtime via sysfs writes. The improvement of UDP RX bandwidth for the single core SoCs (RZ/G2UL & RZ/G3S) is particularly critical. Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov --- No changes v4->v5 Changes v3->v4: * Added Sergey's Reviewed-by tag. drivers/net/ethernet/renesas/ravb_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 2c24cb0271af..c89bb38492b4 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2944,8 +2944,11 @@ static int ravb_probe(struct platform_device *pdev) if (info->nc_queues) netif_napi_add(ndev, &priv->napi[RAVB_NC], ravb_poll); - if (info->coalesce_irqs) + if (info->coalesce_irqs) { netdev_sw_irq_coalesce_default_on(ndev); + if (num_present_cpus() == 1) + dev_set_threaded(ndev, true); + } /* Network device register */ error = register_netdev(ndev); -- 2.39.2