From patchwork Wed Jan 31 17:05:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 194873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp2033205dyb; Wed, 31 Jan 2024 09:11:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAkQKWxKJ3jWCArwNGakPu0ANqpaH+mRRmWcTxtQbcOUfm2Z6nEVTIMJIUQhFlr6VJRkj2 X-Received: by 2002:a05:6830:2056:b0:6e0:efa7:8066 with SMTP id f22-20020a056830205600b006e0efa78066mr2135935otp.45.1706721110619; Wed, 31 Jan 2024 09:11:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706721110; cv=pass; d=google.com; s=arc-20160816; b=PyHvlAXalR7kedQJEfaXWY+85AH8lg+LqSB6sxMrLVwdqzNaduJHnLzO2vovlYLz6h +/Zapz271Hj9VifgdfDpKkUr+Qjx0sqpHfsIyYhdgf1Ww+Ph4K2HOpJ/UaHR37pFln7/ fGMddFpuYBYLCQEDIrfG6A+ezJESmBGt25iJioI/UJEKCUn8eCYn/27A/OTisS205trG P3k2SX5lYwRuD0Y8tWO/wIyJq6a7OIgojl7my+2jcR7DjtIqoyzdvwo9J8UD48sBUwvX 7zSRmtY06eUcTgru4Qt8CXyUE9XpEePgIeqGoitIKspkTzLb4mLoZVELMa58Gh228XEN HBwA== 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=HO00wyyC5NX6XMCQeBKV1qKVzgaiUJJr6XlRbWnm6r0=; fh=91BCUBzkkv//MRFIRqCS1mvUaTmKVNEWY8k2Bez40RA=; b=MMpV7HqAZr5qWVswIX7typ8U3/uXfwpahLuBrHbjtuCPAFhcaPTDc/AvxgrkVJsfGB 126ABYTCLeo1exTfp/fYrXYZfEFJ04+vSGlBUnj2DDjlQAa9iiH6DdqTAUDG+82UVDpo c+Gp/64KDwHWXDl9SWpY03wEwgQVTIxuIXuptepjdwsXkbgcWB9jm6cY71b7X7dui9H5 +9vKswDlf8UjIHstcYcp8H5n0dXrDVNDRpP5MxpuFPEFqxkOyIdBLT7miUJUdi9tPrFx J4Er16OrzHtOWTlyut6r1DK3t9YaOHaRrFBNARZ9NObpI3Txair/NP1fehA4xggbFuem iwgQ==; 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-46871-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46871-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCWrnGirWyaDkVBvz9pUYryvMsBSflgjJIk5GLLhjYO5DG3/Iwrlvw8zFcufq+N11z4A+BHMEamp1ZRPxluOt35qvzfqpg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w128-20020a636286000000b005cdffe22101si7882203pgb.444.2024.01.31.09.11.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 09:11:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46871-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-46871-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46871-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 8A7162951AB for ; Wed, 31 Jan 2024 17:09:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E31213BEB9; Wed, 31 Jan 2024 17:06: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 099C013BE92; Wed, 31 Jan 2024 17:06:19 +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=1706720781; cv=none; b=iTzETLdQ/DH/g/VF4PAZkUJfaS1HtnZdkIAN1r1bSSHfIVuxRBBXuBuYwSdKyt9RFXARqHauDwuOp8KYMniILK68XC2GSxnslkdedflZxP4C+4rKI7aDHfN/xuLK5zq3kyno2clctrE82iJf15XTif4sRtPyb4pdh3QFk3BagSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720781; c=relaxed/simple; bh=jF6SdlyJoM2o9TxNb9B6clYF182hsq5bd4yumWvNwvw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LbhEm78opwQpGpZj49Jv96yUOOyGMCfmrSYEers7/x9dMWXXOPo6PFV2TapYoUXmH7dcJ1YGytU786kirGlu7FEbW3Vm+US0jdB7U8CgEd7WQqQy7P1T33P+DSNUxaDmfZaJrsgJd7fHYv2HgqUo1OPbiOcAdvvlMep3xO+lPHk= 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,231,1701097200"; d="scan'208";a="196315555" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Feb 2024 02:06:19 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.92.158]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 34ED640344FE; Thu, 1 Feb 2024 02:06:15 +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: [PATCH net-next 8/8] net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP Date: Wed, 31 Jan 2024 17:05:22 +0000 Message-Id: <20240131170523.30048-9-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131170523.30048-1-paul.barker.ct@bp.renesas.com> References: <20240131170523.30048-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: 1789626795485130798 X-GMAIL-MSGID: 1789626795485130798 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 increased by this change for all test cases except UDP TX (results obtained with iperf3): * 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 483993ec25ba..202a3229d436 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -3029,8 +3029,11 @@ static int ravb_probe(struct platform_device *pdev) if (info->nc_queues) netif_napi_add(ndev, &priv->napi[RAVB_NC], info->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);