From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57804A00BE; Fri, 12 Jun 2020 14:58:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D48801BF75; Fri, 12 Jun 2020 14:55:23 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id F39231BEDF for ; Fri, 12 Jun 2020 14:55:18 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id A5BAC1BD6AF; Fri, 12 Jun 2020 05:55:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com A5BAC1BD6AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1591966519; bh=UN9FLZDppAKJ6hnsrYzod4A1hhZWpG8mSQzwudDCd8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tKFApLTvNY4v6dQPZsEINXYdatMdBIaCN6LAdjSjPZEAJbv8x9Q/tB+OjxHqu8YIY Ifxw5WcjkAyDA9fAfQWyO0gtMZtjLzo7yT4TFLMSbZ5MUmSOtRj0+ckkruGV1XqXqG 7LMj8Y6Ujb10AAZrL7tz+Ov02QBGmQdPt6VWW5Ik= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Jun 2020 18:20:07 +0530 Message-Id: <20200612125024.15989-20-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200612125024.15989-1-somnath.kotur@broadcom.com> References: <20200612125024.15989-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 19/36] net/bnxt: add enum to the critical resource 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: Kishore Padmanabha The critical resource field in the template table is assigned enumeration values instead of hard coded values. Signed-off-by: Kishore Padmanabha Reviewed-by: Michael Baucom Signed-off-by: Somnath Kotur --- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 14 +++++++------- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 10 +++++----- drivers/net/bnxt/tf_ulp/ulp_template_db.h | 6 ++++++ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 7f7335a..41c4f2f 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -568,7 +568,7 @@ ulp_mapper_ident_process(struct bnxt_ulp_mapper_parms *parms, fid_parms.resource_func = ident->resource_func; fid_parms.resource_type = ident->ident_type; fid_parms.resource_hndl = iparms.id; - fid_parms.critical_resource = 0; + fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO; rc = ulp_flow_db_resource_add(parms->ulp_ctx, parms->tbl_idx, @@ -922,7 +922,7 @@ ulp_mapper_mark_gfid_process(struct bnxt_ulp_mapper_parms *parms, } fid_parms.direction = tbl->direction; fid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID; - fid_parms.critical_resource = 0; + fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO; fid_parms.resource_type = mark_flag; fid_parms.resource_hndl = gfid; rc = ulp_flow_db_resource_add(parms->ulp_ctx, @@ -970,7 +970,7 @@ ulp_mapper_mark_act_ptr_process(struct bnxt_ulp_mapper_parms *parms, } fid_parms.direction = tbl->direction; fid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID; - fid_parms.critical_resource = 0; + fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO; fid_parms.resource_type = mark_flag; fid_parms.resource_hndl = act_idx; rc = ulp_flow_db_resource_add(parms->ulp_ctx, @@ -1506,7 +1506,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, fid_parms.resource_func = tbl->resource_func; fid_parms.resource_type = tbl->resource_type; fid_parms.resource_hndl = aparms.idx; - fid_parms.critical_resource = 0; + fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO; rc = ulp_flow_db_resource_add(parms->ulp_ctx, parms->tbl_idx, @@ -1870,7 +1870,7 @@ ulp_mapper_resources_free(struct bnxt_ulp_context *ulp_ctx, * Set the critical resource on the first resource del, then iterate * while status is good */ - res_parms.critical_resource = 1; + res_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_YES; rc = ulp_flow_db_resource_del(ulp_ctx, tbl_type, fid, &res_parms); if (rc) { @@ -1896,8 +1896,8 @@ ulp_mapper_resources_free(struct bnxt_ulp_context *ulp_ctx, tbl_type, fid, res_parms.resource_func, res_parms.resource_hndl, trc); - /* All subsequent call require the critical_resource be zero */ - res_parms.critical_resource = 0; + /* All subsequent call require the non-critical_resource */ + res_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO; rc = ulp_flow_db_resource_del(ulp_ctx, tbl_type, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c index bac3bce..a9e1681 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c @@ -607,7 +607,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .ident_nums = 1, .mark_enable = BNXT_ULP_MARK_ENABLE_NO, .vfr_flag = BNXT_ULP_VFR_FLAG_NO, - .critical_resource = 0, + .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO, .regfile_wr_idx = BNXT_ULP_REGFILE_INDEX_NOT_USED }, { @@ -629,7 +629,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .ident_nums = 0, .mark_enable = BNXT_ULP_MARK_ENABLE_NO, .vfr_flag = BNXT_ULP_VFR_FLAG_NO, - .critical_resource = 0, + .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO, .regfile_wr_idx = BNXT_ULP_REGFILE_INDEX_NOT_USED }, { @@ -651,7 +651,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .ident_nums = 1, .mark_enable = BNXT_ULP_MARK_ENABLE_NO, .vfr_flag = BNXT_ULP_VFR_FLAG_NO, - .critical_resource = 0, + .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO, .regfile_wr_idx = BNXT_ULP_REGFILE_INDEX_NOT_USED }, { @@ -673,7 +673,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .ident_nums = 0, .mark_enable = BNXT_ULP_MARK_ENABLE_NO, .vfr_flag = BNXT_ULP_VFR_FLAG_NO, - .critical_resource = 0, + .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO, .regfile_wr_idx = BNXT_ULP_REGFILE_INDEX_NOT_USED }, { @@ -695,7 +695,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .ident_nums = 0, .mark_enable = BNXT_ULP_MARK_ENABLE_YES, .vfr_flag = BNXT_ULP_VFR_FLAG_NO, - .critical_resource = 1, + .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_YES, .regfile_wr_idx = BNXT_ULP_REGFILE_INDEX_NOT_USED } }; diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h index a850e22..44ef839 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h @@ -120,6 +120,12 @@ enum bnxt_ulp_cf_idx { BNXT_ULP_CF_IDX_LAST = 28 }; +enum bnxt_ulp_critical_resource { + BNXT_ULP_CRITICAL_RESOURCE_NO = 0, + BNXT_ULP_CRITICAL_RESOURCE_YES = 1, + BNXT_ULP_CRITICAL_RESOURCE_LAST = 2 +}; + enum bnxt_ulp_device_id { BNXT_ULP_DEVICE_ID_WH_PLUS = 0, BNXT_ULP_DEVICE_ID_THOR = 1, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index df3519d..aaa91c3 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -162,7 +162,7 @@ struct bnxt_ulp_mapper_tbl_info { uint8_t direction; uint32_t priority; uint8_t srch_b4_alloc; - uint32_t critical_resource; + enum bnxt_ulp_critical_resource critical_resource; /* Information for accessing the ulp_key_field_list */ uint32_t key_start_idx; -- 2.7.4