From patchwork Thu Oct 22 22:05:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 81842 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8704BA04DD; Fri, 23 Oct 2020 00:09:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56130A8FB; Fri, 23 Oct 2020 00:06:43 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 6B45EA8F9 for ; Fri, 23 Oct 2020 00:06:35 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id l18so1885531pgg.0 for ; Thu, 22 Oct 2020 15:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=RPd6exad8kM7nJZdb42Bd8n+1g2HG0ca3G20TB1nHRA=; b=De/fFrqpw8J597ZrR+KtNbayTI7Gl//jGhzDN4II+fz6enA3LepFRXw+uAc0LZmlbq nnhxU0Fr4wxvQNPzs2Lfmeoem/xwEo/ZzjSKbq6VYL58+m7vOtc7ZHnGCxUndgLiPpoh 6QeaPQHMJnDpKNdYK2TutZo7kmVM/IxwKWwYs= 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; bh=RPd6exad8kM7nJZdb42Bd8n+1g2HG0ca3G20TB1nHRA=; b=hLs6OPNeBv5Esf5jXhEQq9JIMoFRT5/ToFSF/08x2xEUgLTw4TS+Mw4Q5nSgUpuIt7 zQDEIwqqk2g/gmLBdEMGlsUJArNJhiG6ETtatGvkc6yd5pIj/+IGoUbQ7TFWEEqm4L8S Fw2rVokCsF06tQdHLcIzOGJ6cghzASYuB5Ins9vBWP0rYNp+Kwlg6PqZ1z67BNbDWfq1 ABLIRt53VuZxleCsfVaovoS7J0bSeuAvcw5ceWvqbEkGcaEKpU0fLjp1kpGPgmh9pJKp lruWeUDdymQy9ta8J/vFDNK1HQhkaxOQgAw/cc6qYac1Fv+lF5f2GUlwu5iVpeVBsJWx Tj4Q== X-Gm-Message-State: AOAM532BeTFBMrSSPKMWprZ2ZG/f46nGk0AZ3N0K9+PssOVuasvg5RG1 v/1aHEa7xwxhDYd6sVw1KuFdFFGq3Dgq6gbujLwAeINg3yYCrVHTcDWiSWzpCR0AJttqbeFN/Zj K/119iSsBPGWVeLSaOt5DuowQZla3OmNxqzFrXUdvQFMHmqG+xtQroD53ZDlYNlR0EA== X-Google-Smtp-Source: ABdhPJyUpbpZqPsZZNaGzRB0/FzkDBcxBriapp8RgEk6xV/dVGAP5xeH5iOkFj7UvlZYlPVy67o8Iw== X-Received: by 2002:a63:210d:: with SMTP id h13mr3973457pgh.280.1603404393157; Thu, 22 Oct 2020 15:06:33 -0700 (PDT) Received: from localhost.localdomain ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id q14sm3214059pjp.43.2020.10.22.15.06.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2020 15:06:32 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Peter Spreadborough , Farah Smith , Randy Schacher Date: Thu, 22 Oct 2020 15:05:36 -0700 Message-Id: <20201022220542.84166-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201020215538.59242-1-ajit.khaparde@broadcom.com> References: <20201020215538.59242-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH v3 04/11] net/bnxt: update ULP resource counts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Peter Spreadborough - Update the SR ULP requested resource counts to reflect those available after AFM resources are accounted for. - Add build option to select either 2 or 4 slot EM entries. The default is 4 slot entries. Signed-off-by: Peter Spreadborough Signed-off-by: Farah Smith Reviewed-by: Randy Schacher Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_core/tf_session.h | 16 +++++------ drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 40 +++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/net/bnxt/tf_core/tf_session.h b/drivers/net/bnxt/tf_core/tf_session.h index aa7a27877d..6a5c894033 100644 --- a/drivers/net/bnxt/tf_core/tf_session.h +++ b/drivers/net/bnxt/tf_core/tf_session.h @@ -33,16 +33,16 @@ #define TF_SESSION_ID_INVALID 0xFFFFFFFF /** Invalid Session ID define */ /** - * Number of EM entries. Static for now will be removed - * when parameter added at a later date. At this stage we - * are using fixed size entries so that each stack entry - * represents 4 RT (f/n)blocks. So we take the total block - * allocation for truflow and divide that by 4. + * At this stage we are using fixed size entries so that each + * stack entry represents either 2 or 4 RT (f/n)blocks. So we + * take the total block allocation for truflow and divide that + * by either 2 or 4. */ -#define TF_SESSION_TOTAL_FN_BLOCKS (1024 * 8) /* 8K blocks */ +#ifdef TF_EM_ENTRY_IPV4_ONLY +#define TF_SESSION_EM_ENTRY_SIZE 2 /* 2 blocks per entry */ +#else #define TF_SESSION_EM_ENTRY_SIZE 4 /* 4 blocks per entry */ -#define TF_SESSION_EM_POOL_SIZE \ - (TF_SESSION_TOTAL_FN_BLOCKS / TF_SESSION_EM_ENTRY_SIZE) +#endif /** * Session diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c index b22929a634..d753b5af9f 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c @@ -153,11 +153,11 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp, case BNXT_ULP_DEVICE_ID_STINGRAY: /** RX **/ /* Identifiers */ - res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_L2_CTXT_HIGH] = 100; + res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_L2_CTXT_HIGH] = 315; res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_L2_CTXT_LOW] = 6; - res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_WC_PROF] = 10; - res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_PROF_FUNC] = 10; - res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_EM_PROF] = 10; + res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_WC_PROF] = 192; + res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_PROF_FUNC] = 64; + res->ident_cnt[TF_DIR_RX].cnt[TF_IDENT_TYPE_EM_PROF] = 192; /* Table Types */ res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_FULL_ACT_RECORD] = 8192; @@ -170,28 +170,28 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp, /* TCAMs */ res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH] = - 100; + 315; res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW] = 6; - res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM] = 100; - res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_WC_TCAM] = 0; + res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM] = 960; + res->tcam_cnt[TF_DIR_RX].cnt[TF_TCAM_TBL_TYPE_WC_TCAM] = 112; /* EM */ - res->em_cnt[TF_DIR_RX].cnt[TF_EM_TBL_TYPE_EM_RECORD] = 13168; + res->em_cnt[TF_DIR_RX].cnt[TF_EM_TBL_TYPE_EM_RECORD] = 13200; /* EEM */ res->em_cnt[TF_DIR_RX].cnt[TF_EM_TBL_TYPE_TBL_SCOPE] = 1; /* SP */ - res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_ACT_SP_SMAC] = 255; + res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_ACT_SP_SMAC] = 256; /** TX **/ /* Identifiers */ - res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_L2_CTXT_HIGH] = 100; - res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_L2_CTXT_LOW] = 100; - res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_WC_PROF] = 10; - res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_PROF_FUNC] = 10; - res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_EM_PROF] = 10; + res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_L2_CTXT_HIGH] = 292; + res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_L2_CTXT_LOW] = 127; + res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_WC_PROF] = 192; + res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_PROF_FUNC] = 64; + res->ident_cnt[TF_DIR_TX].cnt[TF_IDENT_TYPE_EM_PROF] = 192; /* Table Types */ res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_FULL_ACT_RECORD] = 8192; @@ -199,17 +199,17 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp, res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_MODIFY_IPV4] = 1023; /* ENCAP */ - res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_ENCAP_64B] = 511; + res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_ENCAP_64B] = 367; res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_ENCAP_16B] = 223; res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_ENCAP_8B] = 255; /* TCAMs */ res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH] = - 100; + 292; res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW] = - 100; - res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM] = 100; - res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_WC_TCAM] = 0; + 127; + res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM] = 960; + res->tcam_cnt[TF_DIR_TX].cnt[TF_TCAM_TBL_TYPE_WC_TCAM] = 928; /* EM */ res->em_cnt[TF_DIR_TX].cnt[TF_EM_TBL_TYPE_EM_RECORD] = 15232; @@ -219,7 +219,7 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp, /* SP */ res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_SP_SMAC_IPV4] = 488; - res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = 511; + res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = 512; break; default: return -EINVAL;