From patchwork Wed Feb 21 15:24:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13565709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66738C48BEB for ; Wed, 21 Feb 2024 15:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FxMoEf0YA4RN9vSoM1kLMFnXBQKbhTqsKntoniMnz5U=; b=1eX/lNlz/dWoAj t/fbwW5kdswXu7zgleOKIfQCVkLDmbjBkOO/Yp3668IefteB5U82feMP57YeYe6CLIVYMbhGANZPD f2M2GhW2W+Szjo2QZjIQYGgOZZCJ+4qoTayfEpyKQwEy9VsmpcJaYMCT25Z7HQtQdrPesiYsDtQ/s qsUwoyYu0Zs3LjOh/rxpTICLw5x7LfWmaEurvAdMQYjifjxCty1PV5WmV5viznXvA8ldFkAqPaHfu zAsPWC2LpQXDErADGIZpWNILN+r2rG8r2YNI81b9QdW4eSsIHgerUqG/NgRjKAqEo0M7u2ATkDE63 +zzGYFfUhflGGtqjSDIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcoT0-00000001Sk1-0u8F; Wed, 21 Feb 2024 15:25:02 +0000 Received: from mta-64-225.siemens.flowmailer.net ([185.136.64.225]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcoSa-00000001STH-3W5h for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 15:24:40 +0000 Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20240221152433738db1fa5e8233469b for ; Wed, 21 Feb 2024 16:24:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=diogo.ivo@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=s/caDJaFZJfijRBUbE9HcfXhVRapEiIBClN7x3MNKtE=; b=Tkr091/rSh3MjtECMoVW5DkgdkH0UWSiC2sLNwU+LLImd4mo2bBByoxXOGok1WKln0zJeC KVqNqQYqPm1azt0jCuW6/gxEld+2qTkle3TRf5XGXNOY+lt6NsJF+84BmMcPhgEaOBTZPw3v mXFlUQ0Qd29h2K8rW4knsFGhMgR4k=; From: Diogo Ivo To: danishanwar@ti.com, rogerq@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, hkallweit1@gmail.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: Diogo Ivo , jan.kiszka@siemens.com Subject: [PATCH net-next v3 07/10] net: ti: icssg-prueth: Adjust the number of TX channels for SR1.0 Date: Wed, 21 Feb 2024 15:24:13 +0000 Message-ID: <20240221152421.112324-8-diogo.ivo@siemens.com> In-Reply-To: <20240221152421.112324-1-diogo.ivo@siemens.com> References: <20240221152421.112324-1-diogo.ivo@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1320519:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_072437_548272_77604A80 X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As SR1.0 uses the current higher priority channel to send commands to the firmware, take this into account when setting/getting the number of channels to/from the user. Based on the work of Roger Quadros in TI's 5.10 SDK [1]. [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y Co-developed-by: Jan Kiszka Signed-off-by: Jan Kiszka Signed-off-by: Diogo Ivo Reviewed-by: Roger Quadros --- Changes in v3: - Address Roger's comments on SR1.0 handling drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c index 9a7dd7efcf69..688a148f32b4 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c +++ b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c @@ -142,6 +142,9 @@ static int emac_set_channels(struct net_device *ndev, emac->tx_ch_num = ch->tx_count; + if (emac->is_sr1) + emac->tx_ch_num++; + return 0; } @@ -152,8 +155,15 @@ static void emac_get_channels(struct net_device *ndev, ch->max_rx = 1; ch->max_tx = PRUETH_MAX_TX_QUEUES; + + if (emac->is_sr1) + ch->max_tx--; + ch->rx_count = 1; ch->tx_count = emac->tx_ch_num; + + if (emac->is_sr1) + ch->tx_count--; } static const struct ethtool_rmon_hist_range emac_rmon_ranges[] = {