Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp32611lqb; Tue, 28 May 2024 08:08:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURTynMiZb9FGe3+LN3I+LQ0Kcgsd5/1LAMs1BdBwDSCSreloYkho4+IXtBrUUaGD2cMidFhnopeK6LwX489V35c2f9M+p887EbszZlDQ== X-Google-Smtp-Source: AGHT+IGmuNZq1TTpzR7l2H5iGEf6yl4FRINLrvx2hNa3dPB0Z5zbS6ufnrtprWlwW8NufFAJ8wdu X-Received: by 2002:a17:906:2b82:b0:a59:c3bb:b83b with SMTP id a640c23a62f3a-a62641b1bbfmr807651666b.1.1716908885831; Tue, 28 May 2024 08:08:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716908885; cv=pass; d=google.com; s=arc-20160816; b=Ew8i/Jf5Uo308QtI1yHAUzcqYQ3inIHwyIyVVO1bt2VwkNcFkTvnysg0NKbVDcThsh HabTdXh/IfPk4Y00eGxdcmMhIXofikeCKMVqGrGVrNFRo1JGIK0ecTi5Uw7C5Ppz0uyN Gh5dKsYg+Zo0OFqhBsrYXUOQdWvmO7VP0qgmocJ6r9M1DvKoXSX1CmLHPrl/PpTtY20L 3FfeKweTH/IZnjoP3QLu5ydQxayCw58vaLQXw62tDh86TFTK3FJUzexw3UwHHwF9mzDE yMdzc8GrOdkRQiGbcIwDS5IHSL3ONcFGQCY0AbnuZrcMD084fp1vfFCCPSmyXYfA1tww 2drg== 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=mNJHIlL0l2GPhHP7DBftpxPQ8j0pC6I9aAIgKCNIbkc=; fh=sUSjRpK/Wu5cmnXAa9+f+Tp7sXIZjWkQDF+/Uu3kmYo=; b=HsQ8RT9CFJG+xJ+VOSgqwqTDVFze6D7BP82u7XQR31F8z/STrsVEuH5MSUiOrMHfb8 /S4p9nvmJDkTWr1bkYX+j99Xda0zd5lKKjX3UeZgX75CPcvkhjZU363xVYqlnF2Ewqc7 PGmRINvhy80wQjEIlVRSuT9bDk86unTyz5LNLk7g9d2uYciUVxswwLpLRfkJizDBtF4s 4XQrn6pGEZTMsn6apSaiV9HGX6b/kt9BQQqPjXpa09IN8MOGMvOzpM5KMSXdNKiW7d6R 7mqDFKAM/FHsaVw7UcOxapcBckbxnXKW5P9sO5jpgtXr/6T0Y/30wKdgnEY6jtThBwnq U47w==; 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-192609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a634a0854c7si69450266b.858.2024.05.28.08.08.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 08:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-192609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192609-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 am.mirrors.kernel.org (Postfix) with ESMTPS id F0D161F22FFC for ; Tue, 28 May 2024 15:08:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09CC4178CE8; Tue, 28 May 2024 15:04:23 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4949716E86B; Tue, 28 May 2024 15:04:20 +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=1716908662; cv=none; b=AY3hcDunsxLvi7u3YpikIiwhcLGVd7Wa1BEyYLObQW0q+9S8aNgCziTWpFwQFB4Ud9iCB+S8cUjlQQbfw++g4VNGxnxl7F+IVIAjhJeUaQARcX7sV9r00/9XncydNFhqcVCzgNMvAQSVo8ENT1ZrGYMHvmHQ4v61g6oheNk2Rvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716908662; c=relaxed/simple; bh=JJ1kS+65yLC4QFiraFR+FaHio7QvvCTFL570K0Kz+4c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g0BKPR/8YlIPcut0kpSRM+c/7E/gyDa3MIgrBBZp5+Snb6bsKZr4l2lkLjEbks8bq2AC82545FBIQGNlgxfRM/Ea4H6NJjUG9UDy7aGQRHqLlGauuY3wnpBq5Yp0xujcTBPYCcthYX4o8wbAT1BDElvHeCTeeQsZK8O2NJYDkGg= 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.08,195,1712588400"; d="scan'208";a="209903757" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 May 2024 00:04:20 +0900 Received: from renesas-deb12.cephei.uk (unknown [10.226.93.69]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 7F390400CF1E; Wed, 29 May 2024 00:04:15 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?q?Niklas=20S=C3=B6derlund?= 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 v4 6/7] net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP Date: Tue, 28 May 2024 16:03:38 +0100 Message-Id: <20240528150339.6791-7-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240528150339.6791-1-paul.barker.ct@bp.renesas.com> References: <20240528150339.6791-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 --- 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 e95e0b6e1fe6..dd92f074881a 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