From patchwork Tue Aug 1 01:15:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zulkifli, Muhammad Husaini" X-Patchwork-Id: 1815329 X-Patchwork-Delegate: anthony.l.nguyen@intel.com 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=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=n554tnx0; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RFHT75YJxz1yfG for ; Tue, 1 Aug 2023 11:24:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1D9F760592; Tue, 1 Aug 2023 01:24:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1D9F760592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1690853066; bh=YslFJ13rBheCzV7KvdqJLOBXFbxYriXafZdPXUr4fug=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=n554tnx0fFr3c/0NM2qWAieNJg3jNUv8DUNKfim12ml+7n26XKMbuixO2SXlXFRdE OFOVhIonznyrpJF8j6BFjm/vr8jL5SWojub5DoqZB4O6HxEy/dLGIWwfEqzXzCnxZh UOBo5Qf3cIk9nAr7PQrWfcorsj+47e/TdoshA+tBjg4gNiNFxxBRKIgr031jB2XegU VVqL0Y8qKJkFcVo0lcuZkUUERUm8BIuGK97GHhvKWdCXKyPqkkO6mx1mS4o31sp3QP KOMYhbtDxXPiwDkeu5DLzWPzV7cspw1+MlzMcF1qvsXuJ2hrkccGUDJvVmzPNTzOQa uHZ9VE1/hQatA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GWiuLaf5RJon; Tue, 1 Aug 2023 01:24:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id A96F160F01; Tue, 1 Aug 2023 01:24:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A96F160F01 X-Original-To: intel-wired-lan@osuosl.org Delivered-To: intel-wired-lan@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 390C31BF98D for ; Tue, 1 Aug 2023 01:24:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B7E1F80C0C for ; Tue, 1 Aug 2023 01:23:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B7E1F80C0C X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id arR8g7xjLfWj for ; Tue, 1 Aug 2023 01:23:56 +0000 (UTC) Received: from mgamail.intel.com (unknown [134.134.136.65]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4FBA980BE0 for ; Tue, 1 Aug 2023 01:23:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4FBA980BE0 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="372792727" X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; d="scan'208";a="372792727" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 18:16:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="798458559" X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; d="scan'208";a="798458559" Received: from zulkifl3-ilbpg0.png.intel.com ([10.88.229.82]) by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 18:16:42 -0700 From: Muhammad Husaini Zulkifli To: intel-wired-lan@osuosl.org Date: Tue, 1 Aug 2023 09:15:17 +0800 Message-Id: <20230801011518.25370-2-muhammad.husaini.zulkifli@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230801011518.25370-1-muhammad.husaini.zulkifli@intel.com> References: <20230801011518.25370-1-muhammad.husaini.zulkifli@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690853036; x=1722389036; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=iNbzwRMjAEvSzQbxsOi+KU8F2Wyrzf5JNrk8JE3lgeI=; b=hKCF1v53FYsKO1uWPUflqC4FfzsbHgJDrZjvDLaJYWtUYmzcb2nm/yxU uOWm9QXYPNXFJ/h5NTnEGANWSze6FYlq/lOpD0E/bJg2Naufa672yqfLF 1jwPtE2ck+qUxT8tpiFdUf9cuXSuwewBAiwfklaEZWpPTGbWrzUp+ds8o Rrnd2rm3rcUWOTmQAYKT+icxEaY2wCpsR6SLEtTscADp3tuUdV6tTlK1O GVtDk4SyZaehvEwHau48cFCEitovcqSf6uFeXbYGCzs5v9y/J9wRcVPhu b01e0gSw9Awl4Botl6JOLuQL1hJ+q9JwDluzVtlKQjtnT9L198Y1eVQPH A==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=hKCF1v53 Subject: [Intel-wired-lan] [PATCH iwl-net v3 1/2] igc: Expose tx-usecs coalesce setting to user X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, edumazet@google.com, anthony.l.nguyen@intel.com, horms@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" When users attempt to obtain the coalesce setting using the ethtool command, current code always returns 0 for tx-usecs. This is because I225/6 always uses a queue pair setting, hence tx_coalesce_usecs does not return a value during the igc_ethtool_get_coalesce() callback process. The pair queue condition checking in igc_ethtool_get_coalesce() is removed by this patch so that the user gets information of the value of tx-usecs. Even if i225/6 is using queue pair setting, there is no harm in notifying the user of the tx-usecs. The implementation of the current code may have previously been a copy of the legacy code i210. How to test: User can get the coalesce value using ethtool command. Example command: Get: ethtool -c Previous output: rx-usecs: 3 rx-frames: n/a rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 0 tx-frames: n/a tx-usecs-irq: n/a tx-frames-irq: n/a New output: rx-usecs: 3 rx-frames: n/a rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 3 tx-frames: n/a tx-usecs-irq: n/a tx-frames-irq: n/a Fixes: 8c5ad0dae93c ("igc: Add ethtool support") Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 93bce729be76..62d925b26f2c 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -880,12 +880,10 @@ static int igc_ethtool_get_coalesce(struct net_device *netdev, else ec->rx_coalesce_usecs = adapter->rx_itr_setting >> 2; - if (!(adapter->flags & IGC_FLAG_QUEUE_PAIRS)) { - if (adapter->tx_itr_setting <= 3) - ec->tx_coalesce_usecs = adapter->tx_itr_setting; - else - ec->tx_coalesce_usecs = adapter->tx_itr_setting >> 2; - } + if (adapter->tx_itr_setting <= 3) + ec->tx_coalesce_usecs = adapter->tx_itr_setting; + else + ec->tx_coalesce_usecs = adapter->tx_itr_setting >> 2; return 0; } @@ -910,9 +908,6 @@ static int igc_ethtool_set_coalesce(struct net_device *netdev, ec->tx_coalesce_usecs == 2) return -EINVAL; - if ((adapter->flags & IGC_FLAG_QUEUE_PAIRS) && ec->tx_coalesce_usecs) - return -EINVAL; - /* If ITR is disabled, disable DMAC */ if (ec->rx_coalesce_usecs == 0) { if (adapter->flags & IGC_FLAG_DMAC)