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 29916A0548; Sat, 26 Jun 2021 09:03:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A6474068A; Sat, 26 Jun 2021 09:03:07 +0200 (CEST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mails.dpdk.org (Postfix) with ESMTP id B11A64014E for ; Sat, 26 Jun 2021 09:03:06 +0200 (CEST) Received: by mail-io1-f42.google.com with SMTP id r12so15340527ioa.7 for ; Sat, 26 Jun 2021 00:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKjKkM1kTIHmeRjwUpogDa7VBvTZY0NFZbPTL1GodhA=; b=LlR4Zd4UwdV13y34FMU7aAfJeWANDHaTUgB1lfo4LBF6XSRmrO847WGOMwzkCvJPlg +1amm0Efl3wbEd4GdHuAKeCyoqfOCHZ+peYOdgi9yDX09B6vZoSkfK2NobvkPbM/o4zx KMBmjMLxg9OBCB3mF5vfRWvBMngDv4NGxkfq6XEReh2/jrohdzApHwjgGP34eDuvGJC8 hlBQj4QXz/qfkDKKRXUEGnla9BsaDS9NKgtZMvxH796Q573HxMNZvUFaH8yP/qLy/HQi 0m7QAWUzn/Rjelohgv9baaizlbqvXBoRJKj2tKdwaEEGEzXBu+VcffHZmc7PphAaBvpa QvjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xKjKkM1kTIHmeRjwUpogDa7VBvTZY0NFZbPTL1GodhA=; b=QWVfkW+EurEyHNNT0dSAxwOWy8t7cBRff3xui+e+pjg9Nm+mgGS7q5P7lWlzgZtZGJ JYsDqbF55PE+E1LHMtjIyIBNJv4fgrbu4NAW5VtmeBWlL89/XQsuVrPS5YPDP0BUhdHZ xMVpnmL7UMk4h+wQsL38Y57aS1LKrcA9hpzLq7cyBT2qv8sJRN3Z7Lmn8t4vZPiwTq+F sU0DgoSe7g0tRdrt5nbT/hYtxZACP+1nNaBs3KGset0MUL12BmdJh/VnY+8aW9+FXUMG 3jJ+LVWQjcI+R/ds8EZxnMBBgyqEjfJLpRtYOI4lKokdbb/xdoUD0rMuz3fK9+tkp7B6 4KFg== X-Gm-Message-State: AOAM530zNlgxKqR9bdxWievv4OVD7Dxpls9w2m5zz4JR3cZf1aZiNRPq E23aPX5jf17tVoWJaoHO8L5FQaNfF8XUZHapA7w= X-Google-Smtp-Source: ABdhPJzyEY78O0AChGaGbTRcPHGW1t3PaK+aBZT4+j8nPpqt3cz7eeVnouVlSYKq0cQl4Hl3PdYXeRGdc+T0C7Uo3YU= X-Received: by 2002:a6b:b554:: with SMTP id e81mr11968920iof.163.1624690986001; Sat, 26 Jun 2021 00:03:06 -0700 (PDT) MIME-Version: 1.0 References: <20210601102551.279714-1-psatheesh@marvell.com> In-Reply-To: <20210601102551.279714-1-psatheesh@marvell.com> From: Jerin Jacob Date: Sat, 26 Jun 2021 12:32:39 +0530 Message-ID: To: Satheesh Paul Cc: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Tue, Jun 1, 2021 at 3:56 PM wrote: > > 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 Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > 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 >