From patchwork Wed Jan 17 16:15:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13522008 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 250B9C47258 for ; Wed, 17 Jan 2024 16:17:14 +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=CZB0OuUUeOtlaC hpmgF0SOCB3Q7wX6fRQAzELARf/vfxguUvY26WhIfgCaWRLht9wGuaQZeFTdJpxEEKmGOnp02dPyJ c4Q85rIf8xlW5VyjAl8eJF9B6rb5TAR9BTfgUIyUOGsS9QFmZ6x5NhR6T03Yav3Zp2DLvQZeelvN9 WlxiulAOlI+MeySwyzNxPUK3GRe1oe5sEmd+Mvwp/NsVApZLzeqt7EEtwfe7IPDMz52x9xpFl+Fq1 s0zGIMRFrVF2tFhLfvzH7gK/uN6aRfX0yICpo8HIb9Vr1BjRW/86FogmPcnSxPsBcsq7my/EDKIX9 FvxddpA39GFeMT7GQDBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8aq-0001oC-2P; Wed, 17 Jan 2024 16:16:44 +0000 Received: from mta-64-225.siemens.flowmailer.net ([185.136.64.225]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8aY-0001bH-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 16:16:28 +0000 Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202401171616225cb723581c7a781cc8 for ; Wed, 17 Jan 2024 17:16:22 +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=SbZgm6XaDYngAg9dwufQISnkeojje0ki1FWT3za0KTqSUUw68s4j5eqlJw7gDXjhfAQpbj kLyM3Ym6857simGsmM5aRYrIVRXySxvpNVeknHl8A4GV4YaHrqqmlu1a3UackqDaThmBRvp/ BjY0hasNxsfkZjokV3McFCs8r4xD0=; 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: [PATCH v2 6/8] net: ti: icssg-ethtool: Adjust channel count for SR1.0 Date: Wed, 17 Jan 2024 16:15:00 +0000 Message-ID: <20240117161602.153233-7-diogo.ivo@siemens.com> In-Reply-To: <20240117161602.153233-1-diogo.ivo@siemens.com> References: <20240117161602.153233-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-20240117_081626_841686_C424374B X-CRM114-Status: GOOD ( 10.39 ) 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[] = {