From nobody Mon Feb 9 15:26:59 2026 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 F23B0EB64D7 for ; Fri, 30 Jun 2023 06:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbjF3G3P (ORCPT ); Fri, 30 Jun 2023 02:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbjF3G3G (ORCPT ); Fri, 30 Jun 2023 02:29:06 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88FF42D63; Thu, 29 Jun 2023 23:29:05 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TIb9Pj007758; Thu, 29 Jun 2023 23:28:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=PLWDmL0719Hr2gG3EEl+0qUnU6cpLO9FxdrIP7mwvNs=; b=dsDcFKDgy6Ec0YC38FMCWn1GwXjQjMO++2rQXpZk/vfyykrAwF9MBBdeMmj/cGjKsBqN 7IQTNawyahzvj5AsD8Jz7i1aXT6Hhx/kNqKdn7v2sBaA5Nk6LGAqJzibQUNaJ5ese7sX JdII8AN+iOKxTcG1X1CBRxKfT4XGmaoV1Hru8ZKjcfMxTXnkBsWw1Pj1XIrQbXxDkslS pJ5F3n4Xkyq5ypHbfj21WPMfwJWedKDa1/FbaFXuPhxmvW18I+T2oEZ8kWRHlyVeLZVq Nb/BUanLnQubRxrJA0NqLNF49VWLjOFmez6fgxz70AxR8uQv1NKIhio+KbjbME5VuLPT XA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3rgvpc58rs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 23:28:59 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 29 Jun 2023 23:28:56 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 29 Jun 2023 23:28:56 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 3B8F43F707B; Thu, 29 Jun 2023 23:28:52 -0700 (PDT) From: Hariprasad Kelam To: , CC: , , , , , , , , Subject: [net Patch 2/4] octeontx2-af: Fix mapping for NIX block from CGX connection Date: Fri, 30 Jun 2023 11:58:43 +0530 Message-ID: <20230630062845.26606-3-hkelam@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230630062845.26606-1-hkelam@marvell.com> References: <20230630062845.26606-1-hkelam@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: wddn4KaAuwT7qENWxf-rtnn45D_WJnaY X-Proofpoint-ORIG-GUID: wddn4KaAuwT7qENWxf-rtnn45D_WJnaY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_03,2023-06-27_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Firmware configures NIX block mapping for all MAC blocks. The current implementation reads the configuration and creates the mapping between RVU PF and NIX blocks. But this configuration is only valid for silicons that support multiple blocks. For all other silicons, all MAC blocks map to NIX0. This patch corrects the mapping by adding a check for the same. Fixes: c5a73b632b90 ("octeontx2-af: Map NIX block from CGX connection") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 11 +++++++++++ drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/= ethernet/marvell/octeontx2/af/rvu.h index b5a7ee63508c..d4b8d4546de2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h @@ -23,6 +23,7 @@ #define PCI_DEVID_OCTEONTX2_LBK 0xA061 =20 /* Subsystem Device ID */ +#define PCI_SUBSYS_DEVID_98XX 0xB100 #define PCI_SUBSYS_DEVID_96XX 0xB200 #define PCI_SUBSYS_DEVID_CN10K_A 0xB900 #define PCI_SUBSYS_DEVID_CNF10K_B 0xBC00 @@ -686,6 +687,16 @@ static inline u16 rvu_nix_chan_cpt(struct rvu *rvu, u8= chan) return rvu->hw->cpt_chan_base + chan; } =20 +static inline bool is_rvu_supports_nix1(struct rvu *rvu) +{ + struct pci_dev *pdev =3D rvu->pdev; + + if (pdev->subsystem_device =3D=3D PCI_SUBSYS_DEVID_98XX) + return true; + + return false; +} + /* Function Prototypes * RVU */ diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/= net/ethernet/marvell/octeontx2/af/rvu_cgx.c index 83b342fa8d75..48611e603228 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c @@ -114,7 +114,7 @@ static void rvu_map_cgx_nix_block(struct rvu *rvu, int = pf, p2x =3D cgx_lmac_get_p2x(cgx_id, lmac_id); /* Firmware sets P2X_SELECT as either NIX0 or NIX1 */ pfvf->nix_blkaddr =3D BLKADDR_NIX0; - if (p2x =3D=3D CMR_P2X_SEL_NIX1) + if (is_rvu_supports_nix1(rvu) && p2x =3D=3D CMR_P2X_SEL_NIX1) pfvf->nix_blkaddr =3D BLKADDR_NIX1; } =20 --=20 2.17.1