From nobody Thu Dec 18 13:01:02 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 216F3C32772 for ; Tue, 23 Aug 2022 08:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243757AbiHWI3k (ORCPT ); Tue, 23 Aug 2022 04:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243765AbiHWIZ5 (ORCPT ); Tue, 23 Aug 2022 04:25:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08198726B4; Tue, 23 Aug 2022 01:13:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 742E6612DA; Tue, 23 Aug 2022 08:13:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36455C433D6; Tue, 23 Aug 2022 08:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242431; bh=JQEUw8tP4VU//I0a12Xo3QRH2ouVlQAfOCMHgm0J5a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLIu7q0crvDsWeCKCQ4LIvTRHPHYzb2qhsScJVYF9VjqU7k4Rdp8pqH7VB6jm1dcx qFEAulxacFqctloI5Y25D5flNgFTd92iFLX3WQfzSIheCmhAUgdAT5o39dQ5BMSo2+ atIR1ka06LxpLkRU2qSsiH0mE+h4cLqXGNELHSno= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naveen Mamindlapalli , Sunil Kovvuri Goutham , Jakub Kicinski Subject: [PATCH 5.19 114/365] octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration Date: Tue, 23 Aug 2022 10:00:15 +0200 Message-Id: <20220823080122.980341348@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Naveen Mamindlapalli commit 13c9f4dc102f2856e80b92486c41841e25e23772 upstream. For packets scheduled to RPM and LBK, NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL] selects the TL3 or TL2 scheduling level as the one used for link/channel selection and backpressure. For each scheduling queue at the selected level: Setting NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG[ENA] =3D 1 allows the TL3/TL2 queue to schedule packets to a specified RPM or LBK link and channel. There is an issue in the code where NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL] is set to TL3 where as the NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG is configured for TL2 queue in some cases. As a result packets will not transmit on that link/channel. This patch fixes the issue by configuring the NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG register depending on the NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL] value. Fixes: caa2da34fd25a ("octeontx2-pf: Initialize and config queues") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Link: https://lore.kernel.org/r/20220802142813.25031-1-naveenm@marvell.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 19 ++++++++++= +---- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 1=20 2 files changed, 15 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -632,6 +632,12 @@ int otx2_txschq_config(struct otx2_nic * req->num_regs++; req->reg[1] =3D NIX_AF_TL3X_SCHEDULE(schq); req->regval[1] =3D dwrr_val; + if (lvl =3D=3D hw->txschq_link_cfg_lvl) { + req->num_regs++; + req->reg[2] =3D NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link); + /* Enable this queue and backpressure */ + req->regval[2] =3D BIT_ULL(13) | BIT_ULL(12); + } } else if (lvl =3D=3D NIX_TXSCH_LVL_TL2) { parent =3D hw->txschq_list[NIX_TXSCH_LVL_TL1][0]; req->reg[0] =3D NIX_AF_TL2X_PARENT(schq); @@ -641,11 +647,12 @@ int otx2_txschq_config(struct otx2_nic * req->reg[1] =3D NIX_AF_TL2X_SCHEDULE(schq); req->regval[1] =3D TXSCH_TL1_DFLT_RR_PRIO << 24 | dwrr_val; =20 - req->num_regs++; - req->reg[2] =3D NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link); - /* Enable this queue and backpressure */ - req->regval[2] =3D BIT_ULL(13) | BIT_ULL(12); - + if (lvl =3D=3D hw->txschq_link_cfg_lvl) { + req->num_regs++; + req->reg[2] =3D NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link); + /* Enable this queue and backpressure */ + req->regval[2] =3D BIT_ULL(13) | BIT_ULL(12); + } } else if (lvl =3D=3D NIX_TXSCH_LVL_TL1) { /* Default config for TL1. * For VF this is always ignored. @@ -1591,6 +1598,8 @@ void mbox_handler_nix_txsch_alloc(struct for (schq =3D 0; schq < rsp->schq[lvl]; schq++) pf->hw.txschq_list[lvl][schq] =3D rsp->schq_list[lvl][schq]; + + pf->hw.txschq_link_cfg_lvl =3D rsp->link_cfg_lvl; } EXPORT_SYMBOL(mbox_handler_nix_txsch_alloc); =20 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -195,6 +195,7 @@ struct otx2_hw { u16 sqb_size; =20 /* NIX */ + u8 txschq_link_cfg_lvl; u16 txschq_list[NIX_TXSCH_LVL_CNT][MAX_TXSCHQ_PER_FUNC]; u16 matchall_ipolicer; u32 dwrr_mtu;