From patchwork Wed Jan 31 17:05:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 194871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp2033010dyb; Wed, 31 Jan 2024 09:11:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhRufSwj4miB2lcaXv8jSMvPvV7hy4cRArbrSGBcSbE20TggkI2+8afqySNY1eiZAcL1uy X-Received: by 2002:a05:6358:15ce:b0:178:9cd1:daa0 with SMTP id t14-20020a05635815ce00b001789cd1daa0mr2432649rwh.4.1706721095246; Wed, 31 Jan 2024 09:11:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706721095; cv=pass; d=google.com; s=arc-20160816; b=rG3dqV3j4aQpfGaszEZTUzS9vURsEgjfiNwvN5PwwD2uOAWr+gXEvMEVVwSrPaRpM/ T6vp80vdn0S/R7iHYUzCqFBB7ladgKqB9U+nfDusLk+d+PL1Q6N26UEx8fC2Migv6wc9 +i72Bq4CfS838GQv/pXS4ArGyZp7aX721Q8J0uDSVnv+buYaFAEg2sa5dMqAMAtWeq37 abAukPfgePaNJHROGd+Rr/tDZ6Np65iBdESCU4qyCHfX79jc/x5EAi1kjOUvhlIfdUei eVoWErrlNcBTzxA0y0Tki3UuVS1A8qUsOzeZQoHusjG70V6jrfRHP3O3o94exZxbuOm6 LmrA== 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=I4QjJJS90tiunJGtZ79WmudbdYSCoxP0UsrJqwugfcU=; fh=uHrGeOdetHdsKln0mAqMRyEaecJBod3mLbR9q2tpjqI=; b=ZakW/ZO8y22N0bLzk+CrFnmggR4HStePdb9wQg5GtuWC/HWYW0QLt1M1zCHUkYO+N2 TNqqVvHS+ibFevXj+tD967JXKg9/uK8nFQBRMEPCMDsMOXCZ43MiLjivmcrAF60KtyQj 2qkFvq9STq63eFL0Yp2PjWu2cZ/aZlOUsOcNqLVJSbSyWippcy2MnKnjjJ/nTUoK8DYT S3xLBZ/lQKvKtFKVKvk6RffShMbbHuC7wV96BACCy6/TgtSexuhuxOiGNZ+524Ewr4WQ kdktVro5L62MLb4TODz1WQGjdhf5VrgluQpbq6rPTkamWCuXFSGHVk7J8ZSo275p61xr pg3w==; 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-46870-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46870-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCUWeWaa0QF/VEKSRqGbB277eHQirnV7vNzjAKVMecPrazujla3BI7yBYsdtH2ryS0gVlZWPO6LHr71QPkAPierSHrXJkg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q18-20020a656852000000b005d8c55c031dsi6698406pgt.345.2024.01.31.09.11.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 09:11:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46870-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-46870-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46870-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 0C5D8294FF3 for ; Wed, 31 Jan 2024 17:09:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A871313BE8A; Wed, 31 Jan 2024 17:06:19 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 048C413AA57; Wed, 31 Jan 2024 17:06:15 +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=1706720778; cv=none; b=a74aVr7naPU6y1ByxqrB6cqNGV6aEAbeGsGW9mE95Y/e/nJmo+Y7CxAg/PLrxo2lBeR/M/FaMh8oGZehDnHrmMgM04fwVWHmp9vQF9wjqUvjx8RwyVJZFt42dvvutGUCRNlRJ5D+WtKgWvGpfX56EeYwzweFAJzbSiYLd74/2GU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720778; c=relaxed/simple; bh=+zP2Yfb+XDrqENpMYSAPO48dniuvwW7PYMvOK0s1V/Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WVesUzeCeuIlCLiHxTd4pLBANfXDFi53Jq0NlH/0rfDCZQ/22C4rWtpaHFJ/lPh4nNRIgCTJ6pWoq8fnRIKq9X0raywry/2d2FSoOfSYTTEqElFZiZf/f9cBSKOw82+J3tNZcwbfjvqTTXHvNvo/u0VHGSstw/MT9A3pN/xR19w= 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="196315550" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Feb 2024 02:06:15 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.92.158]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0D61440344FE; Thu, 1 Feb 2024 02:06:11 +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 7/8] net: ravb: Enable SW IRQ Coalescing for GbEth Date: Wed, 31 Jan 2024 17:05:21 +0000 Message-Id: <20240131170523.30048-8-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: 1789626779132900195 X-GMAIL-MSGID: 1789626779132900195 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. For the RZ/G2L, network throughput is comparable before and after this change. CPU usage during TCP RX testing dropped by 6.5% and during UDP RX testing dropped by 10%. For the RZ/G2UL, network throughput is generally increased by this change (results obtained with iperf3): * TCP TX: 2.9% more throughput * TCP RX: 1.1% more throughput * UDP TX: similar throughput * UDP RX: 41500% 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. Signed-off-by: Paul Barker --- 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 9e9cf0d36d72..da2c09b14389 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1078,6 +1078,7 @@ struct ravb_hw_info { unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */ unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ unsigned half_duplex:1; /* E-MAC supports half duplex mode */ + unsigned needs_irq_coalesce:1; /* Requires SW IRQ Coalescing to achieve best performance */ }; struct ravb_private { diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c3a5e4bb61f9..483993ec25ba 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2684,6 +2684,7 @@ static const struct ravb_hw_info gbeth_hw_info = { .tx_counters = 1, .carrier_counters = 1, .half_duplex = 1, + .needs_irq_coalesce = 1, }; static const struct of_device_id ravb_match_table[] = { @@ -3028,6 +3029,9 @@ 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) + netdev_sw_irq_coalesce_default_on(ndev); + /* Network device register */ error = register_netdev(ndev); if (error)