From patchwork Mon Jan 29 08:55:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Arinzon, David" X-Patchwork-Id: 13535243 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-52005.amazon.com (smtp-fw-52005.amazon.com [52.119.213.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E45C854BF5 for ; Mon, 29 Jan 2024 08:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706518561; cv=none; b=tVv51xlWcL5JtRDMnmCfP8uVBApY83TRk4w4JfBKHuT61z3/cLLSltdYpeXpzJCiSatcdEnacrzTfYFMWqWhBKp6Vyhn5dzf+1bHFAUKTU7ApsAf36RONi5oDJZ/isC2qyR04CbU8Xp3eoVTs6d/N3Sl9dY/+50TE5l3/dv6OSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706518561; c=relaxed/simple; bh=tc884OSP1l5KwudD90FZD+f02qv4O+U7umLknapxXD8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QYbYEmR+5iy3GppJ0hWDaSk+lopTAVusW2hk/4puFRfsplhFBm4aIHlJd3AFjRCKZuPO9vl/LaQR215j7iT2yvmb07xlCdoFVYfsuRUp1U1CrwPxOmsxb9ddlnLmp94dbbYV6CGbsCaoGD+a7Xtirm9OybHGxCJMC8uUUmCv0WI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=GpB1xCQ8; arc=none smtp.client-ip=52.119.213.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="GpB1xCQ8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1706518560; x=1738054560; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oj3xul//fd9knzMKifIN8C8QFDz93xbRDYm88s9cUhM=; b=GpB1xCQ8pMvFZ8nsWFnA1Y7BXltlUZCQMWUgjRo00j2NDhFmWcxivqFR KDp9RZN8yTCzx2LUC4LyHp0PCvlDKzRVGT30e8+YsqEKCyfF0/FKo2DLr S6Cmqj+dke7GKoa45+oby4+NtxCX4XsxDehbcs4EE2dAE8K5kdDbWIm1/ g=; X-IronPort-AV: E=Sophos;i="6.05,226,1701129600"; d="scan'208";a="630522338" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1e-m6i4x-0aba4706.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-52005.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 08:55:58 +0000 Received: from smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev (iad7-ws-svc-p70-lb3-vlan2.iad.amazon.com [10.32.235.34]) by email-inbound-relay-iad-1e-m6i4x-0aba4706.us-east-1.amazon.com (Postfix) with ESMTPS id 59F22A415D; Mon, 29 Jan 2024 08:55:57 +0000 (UTC) Received: from EX19MTAUWC001.ant.amazon.com [10.0.21.151:62491] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.23.214:2525] with esmtp (Farcaster) id 353d8de5-68f6-4b6b-bb48-23efd940bd01; Mon, 29 Jan 2024 08:55:56 +0000 (UTC) X-Farcaster-Flow-ID: 353d8de5-68f6-4b6b-bb48-23efd940bd01 Received: from EX19D010UWA002.ant.amazon.com (10.13.138.242) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 08:55:56 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D010UWA002.ant.amazon.com (10.13.138.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 08:55:55 +0000 Received: from dev-dsk-darinzon-1c-05962a8d.eu-west-1.amazon.com (172.19.80.187) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Mon, 29 Jan 2024 08:55:52 +0000 From: To: David Miller , Jakub Kicinski , CC: David Arinzon , "Woodhouse, David" , "Machulsky, Zorik" , "Matushevsky, Alexander" , Saeed Bshara , "Wilson, Matt" , "Liguori, Anthony" , "Bshara, Nafea" , "Belgazal, Netanel" , "Saidi, Ali" , "Herrenschmidt, Benjamin" , "Kiyanovski, Arthur" , "Dagan, Noam" , "Agroskin, Shay" , "Itzko, Shahar" , "Abboud, Osama" , "Ostrovsky, Evgeny" , "Tabachnik, Ofir" , "Koler, Nati" Subject: [PATCH v1 net-next 04/11] net: ena: Enable DIM by default Date: Mon, 29 Jan 2024 08:55:24 +0000 Message-ID: <20240129085531.15608-5-darinzon@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240129085531.15608-1-darinzon@amazon.com> References: <20240129085531.15608-1-darinzon@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Precedence: Bulk X-Patchwork-Delegate: kuba@kernel.org From: David Arinzon Dynamic Interrupt Moderation (DIM) is a technique designed to balance the need for timely data processing with the desire to minimize CPU overhead. Instead of generating an interrupt for every received packet, the system can dynamically adjust the rate at which interrupts are generated based on the incoming traffic patterns. Enabling DIM by default to improve the user experience. DIM can be turned on/off through ethtool: `ethtool -C adaptive-rx ` Signed-off-by: Arthur Kiyanovski Signed-off-by: Osama Abboud Signed-off-by: David Arinzon --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index d68d081..0b7f94f 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2134,6 +2134,12 @@ int ena_up(struct ena_adapter *adapter) */ ena_init_napi_in_range(adapter, 0, io_queue_count); + /* Enabling DIM needs to happen before enabling IRQs since DIM + * is run from napi routine + */ + if (ena_com_interrupt_moderation_supported(adapter->ena_dev)) + ena_com_enable_adaptive_moderation(adapter->ena_dev); + rc = ena_request_io_irq(adapter); if (rc) goto err_req_irq;