From patchwork Sun Jun 13 00:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 94137 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62845A0C41; Sun, 13 Jun 2021 02:13:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D89A41157; Sun, 13 Jun 2021 02:09:16 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 9912C4115F for ; Sun, 13 Jun 2021 02:09:14 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id e1so4676954pld.13 for ; Sat, 12 Jun 2021 17:09:14 -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=GRndT4xlOzmMVXe440m6/mY3oZsaAwtEWvbW4wlsJyg=; b=NcMVCLBcDGZIifzlFkEjQhb8A0Ewai7H5Eyhh96/xDGLGtmKW25TJ6DfOpVhat9BiN UFU6CLBu2qvL4wMZF8xBQBODVaBQIhd3dBgTUZfSjbwUTnMXG0MKxQFAYIPn0Ckknr4V m2PEPfYP3zrDEKP5zQwv0T3JEhNJvNhMfU3Ak= 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=GRndT4xlOzmMVXe440m6/mY3oZsaAwtEWvbW4wlsJyg=; b=lTXVcpobNl/VdrZDeK7Vfbt6t4uFCiRyGDKh2YbG7VQMIP3cxCTQ0SigxG50UzyQNV n36BuAoB3+T3L2gBOzPgGi//KHlJpMoWN7noGHkH7RrSfjtoUpS6f1njJFm+uBZVszmK crcOVY0iKDtQHY6av+g2fXR4MsM3MUknlkzHEtXOzfWsXCjyXKhx2cP8D/fcnQxCZTzQ YYXfaKs08vRcpApKRcr8tn5p/bV2A9GC4lWPlX+kdRO9PQ11Q0CKszws/YW4Pghq13sP 48dOBi9+DSZCHf1LcsPq4+YONBC5gDylACsRjojSSFJSktik5u/I7rX4U47yqoWL0tNT BsuA== X-Gm-Message-State: AOAM532scpDKkSJ9fUZ9W613pNHaOdJW0MFOb/yOFAbph0omUPEBfVCu 4BkLXKN7Q+45ycN0CEXQvhu1QbD8gN8KcARIpjtsmdhueiWjNwBEvDXYpZ6IISRiGhOsF8gJsMb FqHII/nxHZcp/aQ7N/fQbN7CdnCWmuT6MwW3UKwnPrv7RlPa1GkEkGPd2zaTwJIY= X-Google-Smtp-Source: ABdhPJzUk90yV8IbPwF4Z1GJz/xirROz2mnBAJXc+2w9yBotaesdzZcKtqhE38U3E4Oq95xHcedBHQ== X-Received: by 2002:a17:902:f54d:b029:107:b14c:423d with SMTP id h13-20020a170902f54db0290107b14c423dmr10387960plf.77.1623542953118; Sat, 12 Jun 2021 17:09:13 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id gg22sm12774609pjb.17.2021.06.12.17.09.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 17:09:12 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Mike Baucom , Venkat Duvvuru , Randy Schacher Date: Sat, 12 Jun 2021 17:06:45 -0700 Message-Id: <20210613000652.28191-52-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20210613000652.28191-1-ajit.khaparde@broadcom.com> References: <20210530085929.29695-1-venkatkumar.duvvuru@broadcom.com> <20210613000652.28191-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH v2 51/58] net/bnxt: process resource lists before session open 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: Mike Baucom Shared sessions require both named and unnamed resources to be requested during a tf_open_session. ULP uses named resources for global resources that are pre-allocated and remain through the life of the application. Unnamed resources are generally per flow resources and allocated on demand. The sum of both named and unnamed resources must be requested when initializing the session. The ulp_init now processes both lists prior to calling tf_open_session for both shared and regular sessions. Signed-off-by: Mike Baucom Signed-off-by: Venkat Duvvuru Reviewed-by: Randy Schacher Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 177 ++++++++++++------ drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 4 +- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 37 ++-- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 1 + drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 36 ++++ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 6 + 6 files changed, 183 insertions(+), 78 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c index 632334674c..98b86f2c52 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c @@ -77,6 +77,15 @@ bnxt_ulp_app_cap_list_get(uint32_t *num_entries) return ulp_app_cap_info_list; } +static struct bnxt_ulp_resource_resv_info * +bnxt_ulp_app_resource_resv_list_get(uint32_t *num_entries) +{ + if (num_entries == NULL) + return NULL; + *num_entries = BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ; + return ulp_app_resource_resv_list; +} + struct bnxt_ulp_resource_resv_info * bnxt_ulp_resource_resv_list_get(uint32_t *num_entries) { @@ -96,23 +105,18 @@ bnxt_ulp_app_glb_resource_info_list_get(uint32_t *num_entries) } static int32_t -bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx, - struct tf_session_resources *res) +bnxt_ulp_named_resources_calc(struct bnxt_ulp_context *ulp_ctx, + struct bnxt_ulp_glb_resource_info *info, + uint32_t num, + struct tf_session_resources *res) { - struct bnxt_ulp_resource_resv_info *info = NULL; - uint32_t dev_id, res_type, i, num; + uint32_t dev_id, res_type, i; enum tf_dir dir; uint8_t app_id; int32_t rc = 0; - if (!ulp_ctx || !res) { - BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n"); - return -EINVAL; - } - - info = bnxt_ulp_resource_resv_list_get(&num); - if (!info) { - BNXT_TF_DBG(ERR, "Unable to get resource reservation list.\n"); + if (ulp_ctx == NULL || info == NULL || res == NULL || num == 0) { + BNXT_TF_DBG(ERR, "Invalid parms to named resources calc.\n"); return -EINVAL; } @@ -124,31 +128,33 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx, rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id); if (rc) { - BNXT_TF_DBG(ERR, "Unable to get the device id from ulp.\n"); + BNXT_TF_DBG(ERR, "Unable to get the dev id from ulp.\n"); return -EINVAL; } for (i = 0; i < num; i++) { - if (app_id != info[i].app_id || dev_id != info[i].device_id) + if (dev_id != info[i].device_id || app_id != info[i].app_id) continue; dir = info[i].direction; res_type = info[i].resource_type; switch (info[i].resource_func) { case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER: - res->ident_cnt[dir].cnt[res_type] = info[i].count; + res->ident_cnt[dir].cnt[res_type]++; break; case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE: - res->tbl_cnt[dir].cnt[res_type] = info[i].count; + res->tbl_cnt[dir].cnt[res_type]++; break; case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE: - res->tcam_cnt[dir].cnt[res_type] = info[i].count; + res->tcam_cnt[dir].cnt[res_type]++; break; case BNXT_ULP_RESOURCE_FUNC_EM_TABLE: - res->em_cnt[dir].cnt[res_type] = info[i].count; + res->em_cnt[dir].cnt[res_type]++; break; default: - break; + BNXT_TF_DBG(ERR, "Unknown resource func (0x%x)\n,", + info[i].resource_func); + continue; } } @@ -156,14 +162,20 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx, } static int32_t -bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx, - struct tf_session_resources *res) +bnxt_ulp_unnamed_resources_calc(struct bnxt_ulp_context *ulp_ctx, + struct bnxt_ulp_resource_resv_info *info, + uint32_t num, + struct tf_session_resources *res) { - struct bnxt_ulp_glb_resource_info *info; - uint32_t dev_id, res_type, i, num; + uint32_t dev_id, res_type, i; enum tf_dir dir; uint8_t app_id; - int32_t rc; + int32_t rc = 0; + + if (ulp_ctx == NULL || res == NULL || info == NULL || num == 0) { + BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n"); + return -EINVAL; + } rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id); if (rc) { @@ -173,48 +185,108 @@ bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx, rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id); if (rc) { - BNXT_TF_DBG(ERR, "Unable to get device id from ulp.\n"); + BNXT_TF_DBG(ERR, "Unable to get the dev id from ulp.\n"); return -EINVAL; } - /* Make sure the resources are zero before accumulating. */ - memset(res, 0, sizeof(struct tf_session_resources)); - - /* Get the list and tally the resources. */ - info = bnxt_ulp_app_glb_resource_info_list_get(&num); - if (!info) { - BNXT_TF_DBG(ERR, "Unable to get app global resource list\n"); - return -EINVAL; - } for (i = 0; i < num; i++) { - if (dev_id != info[i].device_id || app_id != info[i].app_id) + if (app_id != info[i].app_id || dev_id != info[i].device_id) continue; dir = info[i].direction; res_type = info[i].resource_type; switch (info[i].resource_func) { case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER: - res->ident_cnt[dir].cnt[res_type]++; + res->ident_cnt[dir].cnt[res_type] = info[i].count; break; case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE: - res->tbl_cnt[dir].cnt[res_type]++; + res->tbl_cnt[dir].cnt[res_type] = info[i].count; break; case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE: - res->tcam_cnt[dir].cnt[res_type]++; + res->tcam_cnt[dir].cnt[res_type] = info[i].count; break; case BNXT_ULP_RESOURCE_FUNC_EM_TABLE: - res->em_cnt[dir].cnt[res_type]++; + res->em_cnt[dir].cnt[res_type] = info[i].count; break; default: - BNXT_TF_DBG(ERR, "Unknown resource func (0x%x)\n,", - info[i].resource_func); - continue; + break; } } - return 0; } +static int32_t +bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx, + struct tf_session_resources *res) +{ + struct bnxt_ulp_resource_resv_info *unnamed = NULL; + uint32_t unum; + int32_t rc = 0; + + if (ulp_ctx == NULL || res == NULL) { + BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n"); + return -EINVAL; + } + + unnamed = bnxt_ulp_resource_resv_list_get(&unum); + if (unnamed == NULL) { + BNXT_TF_DBG(ERR, "Unable to get resource resv list.\n"); + return -EINVAL; + } + + rc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res); + if (rc) + BNXT_TF_DBG(ERR, "Unable to calc resources for session.\n"); + + return rc; +} + +static int32_t +bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx, + struct tf_session_resources *res) +{ + struct bnxt_ulp_resource_resv_info *unnamed; + struct bnxt_ulp_glb_resource_info *named; + uint32_t unum, nnum; + int32_t rc; + + if (ulp_ctx == NULL || res == NULL) { + BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n"); + return -EINVAL; + } + + /* Make sure the resources are zero before accumulating. */ + memset(res, 0, sizeof(struct tf_session_resources)); + + /* + * Shared resources are comprised of both named and unnamed resources. + * First get the unnamed counts, and then add the named to the result. + */ + /* Get the baseline counts */ + unnamed = bnxt_ulp_app_resource_resv_list_get(&unum); + if (unnamed == NULL) { + BNXT_TF_DBG(ERR, "Unable to get shared resource resv list.\n"); + return -EINVAL; + } + rc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res); + if (rc) { + BNXT_TF_DBG(ERR, "Unable to calc resources for shared session.\n"); + return -EINVAL; + } + + /* Get the named list and add the totals */ + named = bnxt_ulp_app_glb_resource_info_list_get(&nnum); + if (named == NULL) { + BNXT_TF_DBG(ERR, "Unable to get app global resource list\n"); + return -EINVAL; + } + rc = bnxt_ulp_named_resources_calc(ulp_ctx, named, nnum, res); + if (rc) + BNXT_TF_DBG(ERR, "Unable to calc named resources\n"); + + return rc; +} + int32_t bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx, uint8_t app_id, uint32_t dev_id) @@ -320,10 +392,8 @@ ulp_ctx_shared_session_open(struct bnxt *bp, strncat(parms.ctrl_chan_name, "-tf_shared", copy_num_bytes); rc = bnxt_ulp_tf_shared_session_resources_get(bp->ulp_ctx, resources); - if (rc) { - BNXT_TF_DBG(ERR, "Unable to get shared resource count.\n"); + if (rc) return rc; - } rc = bnxt_ulp_cntxt_dev_id_get(bp->ulp_ctx, &ulp_dev_id); if (rc) { @@ -342,8 +412,7 @@ ulp_ctx_shared_session_open(struct bnxt *bp, parms.device_type = TF_DEVICE_TYPE_THOR; break; default: - BNXT_TF_DBG(ERR, "Unable to determine device for " - "opening session.\n"); + BNXT_TF_DBG(ERR, "Unable to determine dev for opening session.\n"); return rc; } @@ -450,18 +519,14 @@ ulp_ctx_session_open(struct bnxt *bp, params.device_type = TF_DEVICE_TYPE_THOR; break; default: - BNXT_TF_DBG(ERR, "Unable to determine device for " - "opening session.\n"); + BNXT_TF_DBG(ERR, "Unable to determine device for opening session.\n"); return rc; } resources = ¶ms.resources; rc = bnxt_ulp_tf_resources_get(bp->ulp_ctx, resources); - if (rc) { - BNXT_TF_DBG(ERR, "Unable to determine tf resources for " - "session open.\n"); + if (rc) return rc; - } params.bp = bp; rc = tf_open_session(&bp->tfp, ¶ms); @@ -708,8 +773,8 @@ ulp_ctx_init(struct bnxt *bp, rc = bnxt_ulp_cntxt_app_caps_init(bp->ulp_ctx, bp->app_id, devid); if (rc) { - BNXT_TF_DBG(ERR, "Unable to set capabilities for " - " app(%x)/dev(%x)\n", bp->app_id, devid); + BNXT_TF_DBG(ERR, "Unable to set caps for app(%x)/dev(%x)\n", + bp->app_id, devid); goto error_deinit; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c index b688288a62..483030edbf 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c @@ -321,8 +321,8 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev, ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev); if (!ulp_ctx) { - BNXT_TF_DBG(ERR, "ULP context is not initialized. " - "Failed to create default flow.\n"); + BNXT_TF_DBG(ERR, + "ULP context is not initialized. Failed to create dflt flow.\n"); return -EINVAL; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 8fd8a329bf..b5cefbeb08 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -2296,8 +2296,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, tbl->tbl_operand, ®val, &shared)) { BNXT_TF_DBG(ERR, - "Failed to get tbl idx from Global " - "regfile[%d].\n", + "Failed to get tbl idx from Glb RF[%d].\n", tbl->tbl_operand); return -EINVAL; } @@ -2347,8 +2346,9 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, gparms.data_sz_in_bytes, data.byte_order); if (rc) { - BNXT_TF_DBG(ERR, "Failed to read fields on tbl read " - "rc=%d\n", rc); + BNXT_TF_DBG(ERR, + "Failed to get flds on tbl read rc=%d\n", + rc); return rc; } return 0; @@ -2433,8 +2433,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, rc = tf_set_tbl_entry(tfp, &sparms); if (rc) { BNXT_TF_DBG(ERR, - "Index table[%s][%s][%x] write failed " - "rc=%d\n", + "Index table[%s][%s][%x] write fail rc=%d\n", tf_tbl_type_2_str(sparms.type), tf_dir_2_str(sparms.dir), sparms.idx, rc); @@ -2833,15 +2832,15 @@ ulp_mapper_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx, rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id); if (rc) { - BNXT_TF_DBG(ERR, "Failed to get device id for " - "global init (%d)\n", rc); + BNXT_TF_DBG(ERR, "Failed to get device id for glb init (%d)\n", + rc); return rc; } rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id); if (rc) { - BNXT_TF_DBG(ERR, "Failed to get app id for " - "global init (%d)\n", rc); + BNXT_TF_DBG(ERR, "Failed to get app id for glb init (%d)\n", + rc); return rc; } @@ -2916,15 +2915,15 @@ ulp_mapper_app_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx, rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id); if (rc) { - BNXT_TF_DBG(ERR, "Failed to get the app id in global init " - "(%d).\n", rc); + BNXT_TF_DBG(ERR, "Failed to get the app id in glb init (%d).\n", + rc); return rc; } rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id); if (rc) { - BNXT_TF_DBG(ERR, "Failed to get device id for app " - "global init (%d)\n", rc); + BNXT_TF_DBG(ERR, "Failed to get dev id for app glb init (%d)\n", + rc); return rc; } @@ -3413,8 +3412,8 @@ ulp_mapper_tbls_process(struct bnxt_ulp_mapper_parms *parms, uint32_t tid) cond_tbls, num_cond_tbls, &cond_rc); if (rc) { - BNXT_TF_DBG(ERR, "Failed to process cond opc list " - "(%d)\n", rc); + BNXT_TF_DBG(ERR, "Failed to proc cond opc list (%d)\n", + rc); goto error; } /* Skip the table if False */ @@ -3812,8 +3811,7 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx) if (bnxt_ulp_cntxt_shared_session_enabled(ulp_ctx)) { rc = ulp_mapper_app_glb_resource_info_init(ulp_ctx, data); if (rc) { - BNXT_TF_DBG(ERR, "Failed to initialize app " - "global resources\n"); + BNXT_TF_DBG(ERR, "Failed to init app glb resources\n"); goto error; } } @@ -3840,8 +3838,7 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx) if (!ulp_ctx) { BNXT_TF_DBG(ERR, - "Failed to acquire ulp context, so data may " - "not be released.\n"); + "Failed to acquire ulp context, so data may not be released.\n"); return; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h index 4a2f7337be..bc701aa8a5 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h @@ -29,6 +29,7 @@ #define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33 #define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 27 #define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 219 +#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 4 #define BNXT_ULP_APP_CAP_TBL_MAX_SZ 6 #define BNXT_ULP_COND_GOTO_REJECT 1023 #define BNXT_ULP_COND_GOTO_RF 0x10000 diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c index f3146cc1a3..ffa42ffa8b 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c @@ -270,6 +270,42 @@ struct bnxt_ulp_app_capabilities_info ulp_app_cap_info_list[] = { } }; +/* List of unnamed app tf resources required to be reserved per app/device */ +struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[] = { + { + .app_id = 1, + .device_id = BNXT_ULP_DEVICE_ID_WH_PLUS, + .direction = TF_DIR_RX, + .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, + .resource_type = TF_TCAM_TBL_TYPE_WC_TCAM, + .count = 256 + }, + { + .app_id = 1, + .device_id = BNXT_ULP_DEVICE_ID_THOR, + .direction = TF_DIR_RX, + .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, + .resource_type = TF_TCAM_TBL_TYPE_WC_TCAM, + .count = 256 + }, + { + .app_id = 2, + .device_id = BNXT_ULP_DEVICE_ID_WH_PLUS, + .direction = TF_DIR_RX, + .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, + .resource_type = TF_TCAM_TBL_TYPE_WC_TCAM, + .count = 256 + }, + { + .app_id = 2, + .device_id = BNXT_ULP_DEVICE_ID_THOR, + .direction = TF_DIR_RX, + .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, + .resource_type = TF_TCAM_TBL_TYPE_WC_TCAM, + .count = 256 + } +}; + /* List of device specific parameters */ struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[] = { { diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index cf6a27e771..ed943a7c92 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -391,6 +391,12 @@ extern struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[]; */ extern struct bnxt_ulp_resource_resv_info ulp_resource_resv_list[]; +/* + * The ulp_app_resource_resv_list provides the list of tf resources required + * when calling tf_open. + */ +extern struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[]; + /* * The_app_cap_info_list provides the list of ULP capabilities per app/device. */