From patchwork Tue Feb 6 09:19:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 197281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1417876dyb; Tue, 6 Feb 2024 01:21:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1pHrwpCK/d38X2R/tvomuVTf/koTctZ1GcNbrJ610sc/FXFW//UefSBOetDsli+hPKEG9 X-Received: by 2002:a17:90b:1e04:b0:296:8e43:3621 with SMTP id pg4-20020a17090b1e0400b002968e433621mr1982074pjb.38.1707211317243; Tue, 06 Feb 2024 01:21:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211317; cv=pass; d=google.com; s=arc-20160816; b=ZawxlLeiInExHD27pHpTOpYpqC+3w11wNaawCe88d82anwAdBp4Fh8dJ6JEfvnQIRT iXbRXedWNSplypI0zKJnDy5dWBofP7ObCYyaE7g4FfIx+ygDK1R3c/HnvguP9xgu3Y43 NMrE3mmQSxAU4Y6dqdZP3wRJLDb+kR2Li1rPJD3nYzBP5oyGGc35Apg8jFl9MW3l0t/I 2ckRuIowIB43aTZVjgdhxBoDpssWhYM0QiwOm7ld6/z3POyP4nXzQoBXr3fnO5kqBAvX rTntuydjCj9nEIJKhCiQCMC42ZQLYn7582c9bLYHPqOxW05o0JGsWs9XKBbSToTkFaKG U49A== 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=oEcGMnyc23bpvOOUcWo6dTsqNJogDJWYfz1sHAv2iNY=; fh=Xb3qtrBZmn+pwAQLZysIFyhfA31t+OeKgMzq7JQVits=; b=t1ZRNu/bsmqH8x2254kcKu7MVHR4v6uvTW2v623LAuqedgK4eNFgaSh2sUrEWJCWBq VQtK8+5+wXlAQf1wRDJ9eMq0ooDKUjrfuClz2vkCKVYIO2aqTg1ZbRALQLajhKmMZTqq OEJ0Y7QUezGfay8lAPFLraLLOr3YPRvQ/wbCXDOHvaxMnTy+QOP7oq9iAMjXKYK6WBC3 My/ov2UW6UcAudddUnt8R6Fr4yC4UQ+aJA9A7zqpgIwyw7HxbSejvIvFsH++xcuGLTPR U4lBSa5PU5TI6uRVsstS7LJ6i9hjkPMpXoZ1OxkQu+mNbc4k5WMY34Tl3uDqutW/Mm3R nxyA==; 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-54576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54576-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCX2rf7RKATGXqGb3kkCJvJDGmfAnlZ5ZyZxscBAa9C9y7S4zyjh206Pj9diFVQXcMJIMI4BWksimRiqpGVj++/5La2FjA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i18-20020a17090acf9200b002953a1e7e33si820907pju.164.2024.02.06.01.21.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:21:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-54576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54576-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F1BFC285D73 for ; Tue, 6 Feb 2024 09:21:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23BE812F59D; Tue, 6 Feb 2024 09:19:52 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B98712F386; Tue, 6 Feb 2024 09:19:48 +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=1707211190; cv=none; b=aPVtSolvTgHCUQCFBsoPWzBHkz7EV1SacPjyuv4SInB8HVm9nN3kP43j+T9k6yXe9LMvM7tR7EOiSZaO4wFvdZfQS9/l7F/a+Zw69+B4uchcYQw6ICnY6v9fAadu6KO3ed0/iyyxOUcYX2ioftbVTSsU6GBRwmnh7o46y/I+HRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211190; c=relaxed/simple; bh=v30FjsWUe3ZhLh+6uEKl3Kbs4m0Yb16dWTX3b3fdzp8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GbynWw0Ew48m1AaJbTPC2Tyf7uRoVT4SAxPnDEQJvJRVIC5fOAKPbMwNP0xlVHTbKPeLKN+EYuT7TquEpfkPG6WDx6iLVLQQSNZ91H6IDBhYArvkGIpkoPMPgI9TnLOode2F6vdNoWBYTux81nMsDEX7jwK1fumhr915XpOl+mE= 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,246,1701097200"; d="scan'208";a="196934676" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 06 Feb 2024 18:19:47 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.93.63]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0C8F041B8EF7; Tue, 6 Feb 2024 18:19:43 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Paul Barker , Yoshihiro Shimoda , Wolfram Sang , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next v2 7/7] net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP Date: Tue, 6 Feb 2024 09:19:09 +0000 Message-Id: <20240206091909.3191-8-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206091909.3191-1-paul.barker.ct@bp.renesas.com> References: <20240206091909.3191-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790140814142968141 X-GMAIL-MSGID: 1790140814142968141 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). For the RZ/G2UL, network throughput is greatly increased by this change (results obtained with iperf3) for all test cases except UDP TX: * TCP TX: 30% more throughput * TCP RX: 9.8% more throughput * UDP TX: 9.7% less throughput * UDP RX: 89% more throughput For the RZ/G3S we see improvements in network throughput similar to the RZ/G2UL. The improvement of UDP RX bandwidth for the single core SoCs (RZ/G2UL & RZ/G3S) is particularly critical. NAPI Threaded mode can be disabled at runtime via sysfs for applications where UDP TX performance is a priority. Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov --- 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 7bb80608f260..522df82524ff 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2984,8 +2984,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->needs_irq_coalesce) + if (info->needs_irq_coalesce) { netdev_sw_irq_coalesce_default_on(ndev); + if (num_present_cpus() == 1) + dev_set_threaded(ndev, true); + } /* Network device register */ error = register_netdev(ndev);