Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1424400lqj; Tue, 4 Jun 2024 00:33:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9WP+EFNj5VrE9y4SaBQuBtNC1e8+CXPm6AMzqEivVLrmoARn0FxgrUPDfT8lyRsHs+DtXZI0vz29+P6UImPiC3J7DOtpba2LOfL7+Wg== X-Google-Smtp-Source: AGHT+IHCD9IhhNyjp7yUaVhfICFV6ERfWYBYVgvbWDldm7rMGQplelFz7jIOxcM+hV3K1Vi3u9ph X-Received: by 2002:a17:903:32c8:b0:1f2:fee2:82ed with SMTP id d9443c01a7336-1f6938ed651mr26957465ad.30.1717486428632; Tue, 04 Jun 2024 00:33:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717486428; cv=pass; d=google.com; s=arc-20160816; b=iR0sSgfnZCZxXcyBezTngsMChk5mZv5WX/BgsXO6VhATt0JT85nY5NI5HJuMNfa2aC jvecL98WUCKMyRujtsp8YL/fWozkjOlmXOGlqZBSkPkhRwKFNckkm4V5A7fjyv4sy8eV MzLaea2OU/xfKpC+uFbQ3vLbSzSiuAVyYU6Q4jwIDbb4YolXO5iE0Ii6NQ/EmZ7bnyCW aNBMVKJiqBuIJP+s4BQe8O2I+AmK04MOsNBZHi/ZpdsATbPK2N5YDRgm5vh+eThB0b2r Fu9J07VoEpEuIvgmLlQSc/U4Bj4Gya+chk++BWemY6gN5VqOOnJtww7q7ocYSZ/O2QJh WiDA== 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=V8b+kz/teAVRusxR3hC3sYFbLIGGfpi+BXOlqZ4pfIc=; fh=cXKldWdygt6OvRh95xLWtvOg/a1bY7Hjo06mK/L4two=; b=dyWAUqrGQ/n494aKHSj0PSDS8bBVr2R8/jdmBOjbpMbw6xdr2BPcqTGb26e02o9j9l xDcCtoYmOqvfDO08ZyMHRyY/xaEUhJlCt+UnlZeGVcUjr5PNM8i1TktUWHUHmvNddrMP 8M54+IPnHn1sVNEoCgyg7HfXY4R4IBPMDrTMRnqGXPb0yan71ny8a0eBlWSHRkiGJt5Z oPoeW9qhgQgfnZc4bSWcjOJ0GG7YYthHvZIyVazYQnDIUpd8rvuG4sLda4mOG0Idly9x hb+VizfJ96j+0VpQrZAEDJHiN4OHwiNmbgbm2nNmKMye9Yw/bwUzr5L1ytGfsXDxN5TG FFhg==; 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-200157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200157-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 d9443c01a7336-1f66cf5b724si39648245ad.3.2024.06.04.00.33.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 00:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200157-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-200157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200157-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 B627EB247A1 for ; Tue, 4 Jun 2024 07:30:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C331142E93; Tue, 4 Jun 2024 07:29:10 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE1D5130A68; Tue, 4 Jun 2024 07:29:07 +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=1717486149; cv=none; b=TRq1G4crEPjpBSNHq6VSRRyFJrU1ucH3sE4H9WTGoe3xfFpwiyEeU9tayMyZ/xcVHq8mPK8f9A6QjBOgK0UiS5U++nAAMLpeAV7GHEpGKW0elFFTnMJAA10NXu7WesKiiHyCmj/9yaTTn/4RE1U+XDehTyXPwTIAuf4r/PhZRGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717486149; c=relaxed/simple; bh=3gEZCTL28/ZgT3H/CqmcdTDxG82gz3LtvnvdDELxE4w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jzsj9tDACEuKSCUcH0o5ycCloOCKZqunrdMR7GDMk5vgbdvxBkuf10KZCmicHi5XSzaPp0e1WAwPNtLZzW0ry+/XrvpXBBNGPf0BtEZXkLcwm3/GINNpSbyQLLdsKBqlkEr99WKSvRejiqqa6d87E7y5PEJINASkiAwJCRrqg94= 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="206651367" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 04 Jun 2024 16:29:06 +0900 Received: from renesas-deb12.mshome.net (unknown [10.226.92.239]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id BF8E741FCFB9; Tue, 4 Jun 2024 16:29:01 +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 5/7] net: ravb: Enable SW IRQ Coalescing for GbEth Date: Tue, 4 Jun 2024 08:28:23 +0100 Message-Id: <20240604072825.7490-6-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 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. This patch gives the following improvements during testing with iperf3: * RZ/G2L: * TCP RX: same bandwidth with -6% CPU load (76% -> 71%) * UDP RX: same bandwidth with -10% CPU load (99% -> 89%) * RZ/G2UL: * UDP RX: +4200% bandwidth (1.23Mbps -> 53Mbps) * RZ/G3S: * UDP RX: +425% bandwidth (1.23Mbps -> 6.46Mbps) 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: * Renamed needs_irq_coalesce -> coalesce_irqs. * Added Sergey's Reviewed-by tag. drivers/net/ethernet/renesas/ravb.h | 1 + drivers/net/ethernet/renesas/ravb_main.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h index 71de2a7aa27c..6a7aa7dd17e6 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1054,6 +1054,7 @@ struct ravb_hw_info { u32 rx_max_desc_use; u32 rx_desc_size; unsigned aligned_tx: 1; + unsigned coalesce_irqs:1; /* Needs software IRQ coalescing */ /* hardware features */ unsigned internal_delay:1; /* AVB-DMAC has internal delays */ diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index e8c3f48b213d..2c24cb0271af 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2667,6 +2667,7 @@ static const struct ravb_hw_info gbeth_hw_info = { .rx_max_desc_use = 4080, .rx_desc_size = sizeof(struct ravb_rx_desc), .aligned_tx = 1, + .coalesce_irqs = 1, .tx_counters = 1, .carrier_counters = 1, .half_duplex = 1, @@ -2943,6 +2944,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->coalesce_irqs) + netdev_sw_irq_coalesce_default_on(ndev); + /* Network device register */ error = register_netdev(ndev); if (error) -- 2.39.2