Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp32400lqb; Tue, 28 May 2024 08:07:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEbZT91iM/hB3mspLlTMX697mCnW2GObILDlJWV7fwskeD/zyQpUdzQB77LLFGC0GGHElAOzkGCf7iocxFb0ezcgR7mBMu7D0l4dOfSQ== X-Google-Smtp-Source: AGHT+IFvCIpTjdDoUI/qUCGRlkw89ajLB29BoxWVBMpacrH3Tk7aKEtixuUvOhDGKQ+0AS/vjer1 X-Received: by 2002:a05:6870:ec8c:b0:24f:c164:2ce5 with SMTP id 586e51a60fabf-24fc164a4demr12278457fac.32.1716908870257; Tue, 28 May 2024 08:07:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716908870; cv=pass; d=google.com; s=arc-20160816; b=MAtDGFLlUwJZlP6zA2GbOJwBnIsH51CxJdGQcXdMg7DWHr+wfB0/txCcwuJotDRSoK RZYapGoYjzU8HzeYl9LP5BKAtnhsVcEHcrjsuv6qecSD5G/CCwmJY0pFnZz5fVw1wkzn Qd4ae2nXho/TViorEVpSC/u3+pZG3IISRKLY6uk6aSwOI/K9zIEZ7QbmoB9IM/ZmXLrv eSiDZwbL/C6J17Vp2JDA83878nv+b4QSj1gl86xTViX0++iskoi3YzYwFly++VA+BJ71 mQbeaQmkLX9X7O5Mq/gx00sF6m5swE7m6vRYLDZBIrSoni75tbCCk2TX4a9ZaIOLaIpW Xgyg== 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=NorFQUvwPY6dMqTzrcoV1jMTFAAC6DdDu7QrgChjZDw=; fh=sUSjRpK/Wu5cmnXAa9+f+Tp7sXIZjWkQDF+/Uu3kmYo=; b=Y9c9/VMUNfHYqRD5Whz5DjXj6Sok7qQGS6fLD/wlLaiNCDBuFQmc/7SaW8iuJuyHPR nWHUnz7xbA8GOanB7b/CFPaIZAy3uTLqduj3E8m3iQDO+AbRz7UEFDacDFDweCeAB+ZB igLfZAAm09m4lsNl90cq0BRmbyws5vkiEgK2aXfHrIoxaTr5VcL7VEaR22vQe3LG9zjF 5hkRwnW2/zdXeYUobFsXKIFUPQmIft/IzY1GmrMXyR7d67HEroWukAJcyucKgJupKIZB lu8w1uctRst5h1rjNYu9PmHviXIV7DBFMNPiHq4BhqPvPVKkFAhiU839QKvtlZahGd3R XSog==; 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-192608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-804cc016988si2233491241.149.2024.05.28.08.07.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 08:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-192608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192608-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D9EFB1C227B8 for ; Tue, 28 May 2024 15:07:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18EC8178394; Tue, 28 May 2024 15:04:18 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99EF01DFEB; Tue, 28 May 2024 15:04: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=1716908657; cv=none; b=J9vf7npGuwIaOFdufu288+v496PyBNZ+afvzjriDpabybsSBwXwYXIl8cOrFAXzbqgFnS9aP7mos/cWQctCRKs5h2lEdX40BjYZSV5NUy9WHorqioSyAIPaJBN8yp9iRNcrZdbA2xzr/QXntLGi45bBOtDTiZHY/vlDKUBJiqNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716908657; c=relaxed/simple; bh=xQ12ylFC5WkFHpA9uHUWTrEbaIL6DTbR2GcoZ/c3Vqo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ps/ECJlYQ+2kd1w+EWx8Pv1odJGugWh+9djXysclois4AFngTq09M5DhvqKfyomJFEG4RZuDCQTlWRaZ38fuFBU3Wg1YiEdAGQBKStMPHOwFK3PtinPM9cK29NLrbsuFLFL9+07a2I9kROWgHtMHc/32L6RbL2U/P2aqtJX+pHg= 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="209903753" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 May 2024 00:04:14 +0900 Received: from renesas-deb12.cephei.uk (unknown [10.226.93.69]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 54357400CF19; Wed, 29 May 2024 00:04:10 +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 5/7] net: ravb: Enable SW IRQ Coalescing for GbEth Date: Tue, 28 May 2024 16:03:37 +0100 Message-Id: <20240528150339.6791-6-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 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. This patch gives the following improvements during testing with iperf3: * RZ/G2L: * TCP RX: same bandwidth with -6% CPU load (76% -> 71%) * UDP RX: same bandwidth with -10% CPU load (99% -> 89%) * RZ/G2UL: * UDP RX: +4200% bandwidth (1.23Mbps -> 53Mbps) * RZ/G3S: * UDP RX: +425% bandwidth (1.23Mbps -> 6.46Mbps) 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: * Renamed needs_irq_coalesce -> coalesce_irqs. * Added Sergey's Reviewed-by tag. 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 71de2a7aa27c..6a7aa7dd17e6 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1054,6 +1054,7 @@ struct ravb_hw_info { u32 rx_max_desc_use; u32 rx_desc_size; unsigned aligned_tx: 1; + unsigned coalesce_irqs:1; /* Needs software IRQ coalescing */ /* hardware features */ unsigned internal_delay:1; /* AVB-DMAC has internal delays */ diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c9c5cc641589..e95e0b6e1fe6 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2667,6 +2667,7 @@ static const struct ravb_hw_info gbeth_hw_info = { .rx_max_desc_use = 4080, .rx_desc_size = sizeof(struct ravb_rx_desc), .aligned_tx = 1, + .coalesce_irqs = 1, .tx_counters = 1, .carrier_counters = 1, .half_duplex = 1, @@ -2943,6 +2944,9 @@ 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) + netdev_sw_irq_coalesce_default_on(ndev); + /* Network device register */ error = register_netdev(ndev); if (error) -- 2.39.2