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 C5429A0C4C for ; Mon, 12 Jul 2021 15:12:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF95D4069D; Mon, 12 Jul 2021 15:12:35 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id 1FE964069D for ; Mon, 12 Jul 2021 15:12:34 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id m2so14526351wrq.2 for ; Mon, 12 Jul 2021 06:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gmmoG86DQ8yjp9xSwSOIRbJGP648u8mbHMByCsiM+PI=; b=cqb8fDHizW94kFKiB/JsSsHzofWxDn5oYDpMwFLlyztA1rdaixrR6eRftwRvQWrqVj nTL9LHeXEUpeZPm0AC4twXl7V9r151eZmeP09zPwP0ollYSykfdCoo0eXGyFdEzarX4b o2Q2i+DFO4Yol1374v4MPZOPug0X0EhI6GTfMC2KAsBlDCgHiXf/jDi5y+spt3gg1AUu Km8UL1V7G1TbhXkFEflPeTZOwij0nUvkaHAoX5XFS6n3QhKccgubb8JAQeVyqdlKw6BP bvEwd6xb4iJT0At2eOedEMj7VU/86PGiaIyl6NJHOsCp1hdkSm07jvA8jnmZeStG6Pd3 XwTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gmmoG86DQ8yjp9xSwSOIRbJGP648u8mbHMByCsiM+PI=; b=ZpDshIB9MFsQwZgJQo/gNQYo2S0xwSuc+p/qN+ZFdrFKjncTVJKOgH2Nq+vUDr/a66 pNeetm7QukFaWZsypOJKrMc331v7Lb3UkufohU1g/MKI3TgPO94G72YyvrMQPpwFTjT1 Yc0rMTHZOxCL+cjlBvQztR2vAk/RuFLoPQNhlfM7oI//BsghebB3AD+vLUSaL1thrhAT pRcynq2p/g9cyHV+Jxs8/XL/HfMPt0xTSGr+Ln1ZSnUL0sUFnlecpWnbXlM+kwut7La5 5sg/BV/UUrdSoK9/f13sYuluEiXoYGOwNVGKJjtPSlhWGpPBFwb/46bnzoYptGe4aU/2 iqZA== X-Gm-Message-State: AOAM533sJ4v8aymbj1P7H6KSRsY/A5JmOTCx3DP6DS1TpBe/yyALXw4M i2r0k/bGnoKheKDwFnF5Z4c= X-Google-Smtp-Source: ABdhPJzc2J8cFxJSQEbjqe9gOXxB2WSiOC57LSJWPJM2AgH/AeO40rmn6lZ3jk5B+LEPX0zMnDKR3w== X-Received: by 2002:adf:f2d1:: with SMTP id d17mr40795443wrp.254.1626095553880; Mon, 12 Jul 2021 06:12:33 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id f13sm14671030wrt.86.2021.07.12.06.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:12:33 -0700 (PDT) From: luca.boccassi@gmail.com To: Satheesh Paul Cc: Jerin Jacob , dpdk stable Date: Mon, 12 Jul 2021 14:04:41 +0100 Message-Id: <20210712130551.2462159-46-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/octeontx2: fix flow creation limit on CN98xx' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/2bc1fd8f040c33b8f4d0e5d6ed5613f46b68b069 Thanks. Luca Boccassi --- >From 2bc1fd8f040c33b8f4d0e5d6ed5613f46b68b069 Mon Sep 17 00:00:00 2001 From: Satheesh Paul Date: Tue, 1 Jun 2021 15:55:51 +0530 Subject: [PATCH] net/octeontx2: fix flow creation limit on CN98xx [ upstream commit b65db6a879bd09799b96aed09a49458ae1b3644b ] 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 Acked-by: Jerin Jacob --- 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 cd4fe517db..9d8dcca791 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 a5900f349b..5ff6a66abb 100644 --- a/drivers/net/octeontx2/otx2_flow.c +++ b/drivers/net/octeontx2/otx2_flow.c @@ -963,12 +963,23 @@ done: 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); @@ -980,7 +991,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 30a823c8a7..efc9bd1a56 100644 --- a/drivers/net/octeontx2/otx2_flow.h +++ b/drivers/net/octeontx2/otx2_flow.h @@ -34,7 +34,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.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.026104329 +0100 +++ 0046-net-octeontx2-fix-flow-creation-limit-on-CN98xx.patch 2021-07-12 13:41:36.346119611 +0100 @@ -1 +1 @@ -From b65db6a879bd09799b96aed09a49458ae1b3644b Mon Sep 17 00:00:00 2001 +From 2bc1fd8f040c33b8f4d0e5d6ed5613f46b68b069 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b65db6a879bd09799b96aed09a49458ae1b3644b ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -35 +36 @@ -index 1c90d753ff..6df0732189 100644 +index a5900f349b..5ff6a66abb 100644 @@ -38 +39 @@ -@@ -1003,12 +1003,23 @@ done: +@@ -963,12 +963,23 @@ done: @@ -63 +64 @@ -@@ -1020,7 +1031,8 @@ otx2_flow_init(struct otx2_eth_dev *hw) +@@ -980,7 +991,8 @@ otx2_flow_init(struct otx2_eth_dev *hw) @@ -74 +75 @@ -index 82a5064d90..790e6ef1e8 100644 +index 30a823c8a7..efc9bd1a56 100644 @@ -77 +78 @@ -@@ -35,7 +35,6 @@ enum { +@@ -34,7 +34,6 @@ enum {