From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73B41A0524; Tue, 1 Jun 2021 12:26:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F061240689; Tue, 1 Jun 2021 12:26:08 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7D77E40041 for ; Tue, 1 Jun 2021 12:26:07 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 151A6WQg004969 for ; Tue, 1 Jun 2021 03:26:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Ns94SrduQZyQafOcE0o7jDnCUKkX/DzCsspdWwiammY=; b=IKGHn6slBkYCvvdUIphbjqyHpod95XKjs9si0B7mqxLsODdJmvEoBCkHlzBv55b885Rf 2E5YJeqakUR0MAcnZoyQetYL0U3gFhNDCeWNZ1PdDBxnFySPNBp63KS0+vwSD//uDBuT kCk/1uitv6bYRYq/okL9lu4sWyHbeXwUNSSzXDhWijeZcACqaJuqZ2mSZ0Ty7PRY1mu/ yd1/1xwc1YKRBlMkUGh+enXcTDmojGBXzjBk/Q5REsMkI6SL1ebXNqSscuN/PcTOdvZe imhH6EE4CnrWrH2/emrsTzAHxUUpJYnkkzQ8ESkzbfZLG98Uhjw2B6Ldzh4yCOCU6ODL BQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 38vtnjbqjh-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 01 Jun 2021 03:26:06 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 1 Jun 2021 03:26:04 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 1 Jun 2021 03:26:04 -0700 Received: from localhost.localdomain (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id 5FFB53F704D; Tue, 1 Jun 2021 03:26:03 -0700 (PDT) From: To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: , Satheesh Paul Date: Tue, 1 Jun 2021 15:55:51 +0530 Message-ID: <20210601102551.279714-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: a-aw7-X5wxA4KkqnchF8UU8-OaM09mjo X-Proofpoint-ORIG-GUID: a-aw7-X5wxA4KkqnchF8UU8-OaM09mjo X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-01_05:2021-05-31, 2021-06-01 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: fix flow create on CN98xx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Satheesh Paul CN96xx and CN98xx have 4096 and 16384 MCAM entries respectively. Aligning the code with the same numbers. Fixes: 092b3834185 ("net/octeontx2: add flow init and fini") Signed-off-by: Satheesh Paul --- drivers/common/octeontx2/otx2_dev.h | 3 +++ drivers/net/octeontx2/otx2_flow.c | 16 ++++++++++++++-- drivers/net/octeontx2/otx2_flow.h | 1 - 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/common/octeontx2/otx2_dev.h b/drivers/common/octeontx2/otx2_dev.h index cd4fe517d..9d8dcca79 100644 --- a/drivers/common/octeontx2/otx2_dev.h +++ b/drivers/common/octeontx2/otx2_dev.h @@ -55,6 +55,9 @@ (RVU_PCI_REV_MINOR(otx2_dev_revid(dev)) == 0x0) && \ (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x0)) +#define otx2_dev_is_98xx(dev) \ + (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x3) + struct otx2_dev; /* Link status callback */ diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c index 1c90d753f..6df073218 100644 --- a/drivers/net/octeontx2/otx2_flow.c +++ b/drivers/net/octeontx2/otx2_flow.c @@ -1003,12 +1003,23 @@ flow_fetch_kex_cfg(struct otx2_eth_dev *dev) return rc; } +#define OTX2_MCAM_TOT_ENTRIES_96XX (4096) +#define OTX2_MCAM_TOT_ENTRIES_98XX (16384) + +static int otx2_mcam_tot_entries(struct otx2_eth_dev *dev) +{ + if (otx2_dev_is_98xx(dev)) + return OTX2_MCAM_TOT_ENTRIES_98XX; + else + return OTX2_MCAM_TOT_ENTRIES_96XX; +} + int otx2_flow_init(struct otx2_eth_dev *hw) { uint8_t *mem = NULL, *nix_mem = NULL, *npc_mem = NULL; struct otx2_npc_flow_info *npc = &hw->npc_flow; - uint32_t bmap_sz; + uint32_t bmap_sz, tot_mcam_entries = 0; int rc = 0, idx; rc = flow_fetch_kex_cfg(hw); @@ -1020,7 +1031,8 @@ otx2_flow_init(struct otx2_eth_dev *hw) rte_atomic32_init(&npc->mark_actions); npc->vtag_actions = 0; - npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX]; + tot_mcam_entries = otx2_mcam_tot_entries(hw); + npc->mcam_entries = tot_mcam_entries >> npc->keyw[NPC_MCAM_RX]; /* Free, free_rev, live and live_rev entries */ bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries); mem = rte_zmalloc(NULL, 4 * bmap_sz * npc->flow_max_priority, diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h index 82a5064d9..790e6ef1e 100644 --- a/drivers/net/octeontx2/otx2_flow.h +++ b/drivers/net/octeontx2/otx2_flow.h @@ -35,7 +35,6 @@ enum { /* 32 bytes from LDATA_CFG & 32 bytes from FLAGS_CFG */ #define NPC_MAX_EXTRACT_DATA_LEN (64) #define NPC_LDATA_LFLAG_LEN (16) -#define NPC_MCAM_TOT_ENTRIES (4096) #define NPC_MAX_KEY_NIBBLES (31) /* Nibble offsets */ #define NPC_LAYER_KEYX_SZ (3) -- 2.25.4