Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2916050rdb; Tue, 6 Feb 2024 01:21:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEICpZznim/+rW5EUzfIKEFlPe5Tg+pJEDQyM5P2aisEv07Ke9EEdD0FAWWar050MQQ6ux2 X-Received: by 2002:a17:903:1c4:b0:1d9:14fb:d142 with SMTP id e4-20020a17090301c400b001d914fbd142mr1220943plh.32.1707211308128; Tue, 06 Feb 2024 01:21:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211308; cv=pass; d=google.com; s=arc-20160816; b=vAyUvvSMLDCLyIbX8lwYq3P62SRZs9NIK0TIZLvILGwedKUvteWw/OSm3EL451Dubl zKrGyNuvF9VA3BsMLRYNw+PE2FcKD35ZPW+D718kHVGGNSz1qKgzP+sDQ7Esd4/rP9aU bNQNcerV6wd9ghVOdEmocE/OdgC+9pg/ctYgUcZ8Uv6bLrypDjaXbudAi8/QEwJUShwE 6Do4FAwVZFYF+K3S99aRZKVIHmxNZlX2aw1UP/XMLfozZcoih95EFBHhDPAkai3gRoq0 g9NKRlf+2u3ipskEM9idyxA/SF78NE6uHndThBOp+KgiAT7WfIvkR3ec0l4AkFpqMzyQ 1r4A== 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=orIdYT7AuClTayTcNbEN2U4/Adm1j/HUKFnAGLPfIG0=; b=W6Kcf9qqyQvu0vNjS7Wzxr9OCU/D3T6oSDj/98jh+5FbJbLrnzU1CvxRTxuGSUIAfl JrU1hKu+P8Qrlzt+Hb3i6jPOsr40/sQHz40xX60E8FzBidFzUXMwc3FNc+HCd+wTeMqS IoncC7rsIVzkdGdzv8ugkQF6eXhwLDx+ip5Rl0hHMLJv/3iEB6BwWp9hF6BSS0iagQF0 +By1BphaqafuH5zwhEAGjbkuf3bSeoaSgAgHu/xcDRnQXmlnRQi39UGBeSjUpnWl7ZzI cbHSmxLyxUeKQBzGYgVz53s7P+IsIe0YPTsxW5rA+lNV/peg9nZDLgJ0u3TBsjh4IGdV DKmw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCUH3iwR6vsWSVN8FehZQ3Mwaod+JLAyWiV2Ehb0TjTiV4c3CgF8S9WkfZruPQwuUaTMvNQja1EsXCGV26FwgJHet/dRqK7KZpYTh9MUuA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d10-20020a170902c18a00b001d9a609ddb3si1355484pld.37.2024.02.06.01.21.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54576-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54576-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C48DB285931 for ; Tue, 6 Feb 2024 09:21:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDF2B12F395; Tue, 6 Feb 2024 09:19:50 +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 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). 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 --- 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); -- 2.39.2