From patchwork Tue Dec 19 17:45:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13498729 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 D3A49C41535 for ; Tue, 19 Dec 2023 17:48:02 +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=2BR81zXsLR5UvCTcXMXMcfxZvK0qjSjQU2wZOIuNl3U=; b=0GYspmyA7n3nA4 bJvlgvCZmv0sJe97748bk1/Roq1rfohkTrtdJ939475Yu6mhLaqTO29ER/cfEYyfpbnGyNlfKvpR/ 5sBc7bv+Nn3qPPgazFPv0f0Vf8AQL7ALv0GPk7joeNIn3H95FqP9kwmKyEKy8luIw9OPdLCGr9m2d B8u+lqE1NTT2qVmcS/hIBC95oTKBqaj6r8wTYv03M/F2VkOxTrMcll31S2CZ3nuYrXsfFMQLcrU91 mrCBWDISC24owUt1xeyRJYUVwI1BPp0OAE4/VlHvAjbgQ+gn3w8A6r3lhPLK8kwQgPyzvTR9pJd/M 1+yyB1a3ogRScQ+EQP1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFeBr-00F20d-2x; Tue, 19 Dec 2023 17:47:35 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFeAy-00F19t-2W for linux-arm-kernel@bombadil.infradead.org; Tue, 19 Dec 2023 17:46:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=YA9kxXyTpKbUvAn5fk/7icCgdnpCMYJTim3PliscYAY=; b=bJ7DnVhIs+PPl+/jBoCpV/HsVM NumP3DNXTtXvXWAecbdnL0erO/AL8zfOs6kx/PuvhlFKg5o/L0J63+sQABSuQFOemwKrEqD+i1c5m XDtljG1Wu5Q/KihUvXxEwoy1g9SgZyVmJGS1YGM5JW1FCFnkdFUMWBQgD6R7fvBjTg7688O6RCYKo +HNrF3z6qNuQH0G3GxpvQrnxA1FYWG0B/Z1MyXQA3immD3cEAXgLjgJap6ewTeOAMvzKtzMksAN/T zN07BmfirvklDNONwtLpnASBOPgCtFpVDiA9eZpHJerJ+jXaohzenEBmtp8/i4Ok9MJUzg+NbeOP0 DhycoRlg==; Received: from mta-64-226.siemens.flowmailer.net ([185.136.64.226]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFeAs-00DXz9-2x for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 17:46:39 +0000 Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202312191746343f58e35ce398b67839 for ; Tue, 19 Dec 2023 18:46: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=YA9kxXyTpKbUvAn5fk/7icCgdnpCMYJTim3PliscYAY=; b=bUXTNPRhEhqRbjbsl+OVO9bgMJNhEDFMxWUCtDAOxz1Igk7PYEoeT5PiTqLiY+rrwsusvQ RH2ZOdLOjod4sT7mlH5TQ4amYNLhQvlfWcRA07U9aA8tGOuW8pqfDaR584RhCISEiW+yxiwl r1CKEhn4Nmucw3UWe3Xc7SM5c6oaM=; From: Diogo Ivo To: danishanwar@ti.com, rogerq@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, grygorii.strashko@ti.com, andrew@lunn.ch, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: Diogo Ivo , Jan Kiszka Subject: [RFC PATCH net-next 6/8] net: ti: icssg-ethtool: Adjust channel count for SR1.0 Date: Tue, 19 Dec 2023 17:45:44 +0000 Message-ID: <20231219174548.3481-7-diogo.ivo@siemens.com> In-Reply-To: <20231219174548.3481-1-diogo.ivo@siemens.com> References: <20231219174548.3481-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-20231219_174635_030076_F15B5F6F X-CRM114-Status: GOOD ( 10.78 ) 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 SR1.0 uses the highest priority channel to transmit control messages to the firmware. Take this into account when computing channels. 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 --- drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c index a27ec1dcc8d5..29e67526fa22 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c +++ b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c @@ -141,6 +141,9 @@ static int emac_set_channels(struct net_device *ndev, return -EBUSY; emac->tx_ch_num = ch->tx_count; + /* highest channel number for management messaging on SR1 */ + if (emac->is_sr1) + emac->tx_ch_num++; return 0; } @@ -151,9 +154,12 @@ static void emac_get_channels(struct net_device *ndev, struct prueth_emac *emac = netdev_priv(ndev); ch->max_rx = 1; - ch->max_tx = PRUETH_MAX_TX_QUEUES; + /* SR1 use high priority channel for management messages */ + ch->max_tx = emac->is_sr1 ? PRUETH_MAX_TX_QUEUES - 1 : + PRUETH_MAX_TX_QUEUES; ch->rx_count = 1; - ch->tx_count = emac->tx_ch_num; + ch->tx_count = emac->is_sr1 ? emac->tx_ch_num - 1 : + emac->tx_ch_num; } static const struct ethtool_rmon_hist_range emac_rmon_ranges[] = {