From patchwork Thu Mar 7 18:32:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1909438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TrHwQ3ntlz20Qg for ; Fri, 8 Mar 2024 05:32:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1riIXd-0008He-Pa; Thu, 07 Mar 2024 18:32:29 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1riIXX-0008Gh-KK for kernel-team@lists.ubuntu.com; Thu, 07 Mar 2024 18:32:23 +0000 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 586FD3F282 for ; Thu, 7 Mar 2024 18:32:23 +0000 (UTC) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-42ed4c70902so9191051cf.0 for ; Thu, 07 Mar 2024 10:32:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709836341; x=1710441141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=czU5zgDx13Wuhc3ACnQobO2ZEGKiiUfTEQSpR+j6iho=; b=SX8pkaycOOiLz71GVbur4Sv6b7MA+CSuwNqMpAMSedk4cMHNPalXlWory2wYRgYGAq os64bhfEtGzcZLsyCT2jhoW/t2n6CAntkI6rmmByPp93gY6RG2WmWC05QzQGrtTz0BXa rajowTlKb8q9gzqrFtvJXEeYbAhSohdnvdbvG57zh7g8SCLYILgd4hYpEir6FR4XeBtI 1I0cCNvoK1VB1DTGTHWwASE8/vPVZ2r4qswo+c1GlAraXCEJbOFT9DE/JC6fPzfIzkl/ fsDbvY+kEvxHvb4/Zs36iEyuhX33IDoqSA3Zp8bd/yNV5//fCtVYAo2pCddxhItZ8XpY zbZg== X-Gm-Message-State: AOJu0YzuSYCZp+0IOJuI0G6mTQOcNtkQ8cJuRIi3trot9ru7VxgmfxAw rg51Dy74S3ZAYlegJ6Ahl5xGYW1BHwmANFW7UBCm9KjSd/4Y+vXrx8Rnqipezz9PzhhjMyFVGBL 12880UeOYi6NDK7NKz4GdPS1E3QoLAPCtKO7MIzf46bQ+zSkHHU4+IOW9u5GXGvUsjRGgaTpLS6 zakzE83HkW1Q== X-Received: by 2002:ac8:7dc9:0:b0:42e:f8ff:b820 with SMTP id c9-20020ac87dc9000000b0042ef8ffb820mr9387034qte.67.1709836341760; Thu, 07 Mar 2024 10:32:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpehlOjmddHxH/dlf5OjsImOMnjRODUuDB1O5IpDrY00k3FEJVPNiB6gRU22ebtf7P9grHZQ== X-Received: by 2002:ac8:7dc9:0:b0:42e:f8ff:b820 with SMTP id c9-20020ac87dc9000000b0042ef8ffb820mr9387015qte.67.1709836341437; Thu, 07 Mar 2024 10:32:21 -0800 (PST) Received: from cox.home.arpa (104-222-113-121.cpe.teksavvy.com. [104.222.113.121]) by smtp.gmail.com with ESMTPSA id z18-20020a05622a061200b0042ec4f07712sm7130673qta.86.2024.03.07.10.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:32:17 -0800 (PST) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [f/j/m/n:linux-aws][PATCH 1/1] net: ena: Enable DIM by default Date: Thu, 7 Mar 2024 13:32:13 -0500 Message-Id: <20240307183213.106423-2-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307183213.106423-1-philip.cox@canonical.com> References: <20240307183213.106423-1-philip.cox@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Arinzon BugLink: https://bugs.launchpad.net/bugs/2056475 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 Signed-off-by: Paolo Abeni (cherry picked from net-next commit 50d7a2660579889fba28b7e4543d4ce85aa2311b) Signed-off-by: Philip Cox --- 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 1c0a7828d397..adca474828e8 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;