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 30918A00BE; Fri, 12 Jun 2020 14:56:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF4421BE91; Fri, 12 Jun 2020 14:55:11 +0200 (CEST) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 279B21BEA3 for ; Fri, 12 Jun 2020 14:55:08 +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 E3B861BD6DE; Fri, 12 Jun 2020 05:55:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com E3B861BD6DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1591966508; bh=YEFLrSV6phF/kL4bkHSIl5abIBH+XMHkFlAIOLYJ6gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mV8xHFbbF3SQM1mVRe7fN0D3dg1IHoP20AFUsHrqhgbB/JX8l913nhEHaJxEHaJJE vUfqosPtqjj8Tzx3OGtdbnafqd6SmanqPwSXNluKbFEt98RYLTA0xnnEV1Jrqosbfr 0f7AQFm4BbZL2/h53ceAMLW/E7moLKOq9z7r5LZs= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Jun 2020 18:19:59 +0530 Message-Id: <20200612125024.15989-12-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 11/36] net/bnxt: add resource sub type to class and action tables 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 Added support for resource sub type to class and action tables renamed table id to resource type. Signed-off-by: Kishore Padmanabha Reviewed-by: Michael Baucom Signed-off-by: Somnath Kotur --- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 38 +++++++++++++-------------- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 18 ++++++++----- drivers/net/bnxt/tf_ulp/ulp_template_db.h | 36 ++++++++++++++++--------- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 6 +++-- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 158b430..35b5d72 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -889,7 +889,7 @@ ulp_mapper_action_alloc_and_set(struct bnxt_ulp_mapper_parms *parms, /* Set the allocation parameters for the table*/ alloc_parms.dir = atbls->direction; - alloc_parms.type = atbls->table_type; + alloc_parms.type = atbls->resource_type; alloc_parms.search_enable = atbls->srch_b4_alloc; alloc_parms.result = ulp_blob_data_get(blob, &alloc_parms.result_sz_in_bytes); @@ -910,7 +910,7 @@ ulp_mapper_action_alloc_and_set(struct bnxt_ulp_mapper_parms *parms, /* Need to calculate the idx for the result record */ uint64_t tmpidx = alloc_parms.idx; - if (atbls->table_type == TF_TBL_TYPE_EXT) + if (atbls->resource_type == TF_TBL_TYPE_EXT) tmpidx = TF_ACT_REC_OFFSET_2_PTR(alloc_parms.idx); else tmpidx = alloc_parms.idx; @@ -935,7 +935,7 @@ ulp_mapper_action_alloc_and_set(struct bnxt_ulp_mapper_parms *parms, uint16_t length; set_parm.dir = atbls->direction; - set_parm.type = atbls->table_type; + set_parm.type = atbls->resource_type; set_parm.idx = alloc_parms.idx; set_parm.data = ulp_blob_data_get(blob, &length); set_parm.data_sz_in_bytes = length / 8; @@ -958,7 +958,7 @@ ulp_mapper_action_alloc_and_set(struct bnxt_ulp_mapper_parms *parms, memset(&fid_parms, 0, sizeof(fid_parms)); fid_parms.direction = atbls->direction; fid_parms.resource_func = atbls->resource_func; - fid_parms.resource_type = atbls->table_type; + fid_parms.resource_type = atbls->resource_type; fid_parms.resource_hndl = alloc_parms.idx; fid_parms.critical_resource = 0; @@ -1209,7 +1209,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, } aparms.dir = tbl->direction; - aparms.tcam_tbl_type = tbl->table_type; + aparms.tcam_tbl_type = tbl->resource_type; aparms.search_enable = tbl->srch_b4_alloc; aparms.key_sz_in_bits = tbl->key_bit_size; aparms.key = ulp_blob_data_get(&key, &tmplen); @@ -1339,7 +1339,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL) { fid_parms.direction = tbl->direction; fid_parms.resource_func = tbl->resource_func; - fid_parms.resource_type = tbl->table_type; + fid_parms.resource_type = tbl->resource_type; fid_parms.critical_resource = tbl->critical_resource; fid_parms.resource_hndl = aparms.idx; rc = ulp_flow_db_resource_add(parms->ulp_ctx, @@ -1366,12 +1366,12 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, error: parms->tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL; free_parms.dir = tbl->direction; - free_parms.tcam_tbl_type = tbl->table_type; + free_parms.tcam_tbl_type = tbl->resource_type; free_parms.idx = aparms.idx; trc = tf_free_tcam_entry(tfp, &free_parms); if (trc) BNXT_TF_DBG(ERR, "Failed to free tcam[%d][%d][%d] on failure\n", - tbl->table_type, tbl->direction, aparms.idx); + tbl->resource_type, tbl->direction, aparms.idx); return rc; } @@ -1460,7 +1460,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms, */ iparms.dup_check = 0; iparms.dir = tbl->direction; - iparms.mem = tbl->table_type; + iparms.mem = tbl->resource_type; iparms.key = ulp_blob_data_get(&key, &tmplen); iparms.key_sz_in_bits = tbl->key_bit_size; iparms.em_record = ulp_blob_data_get(&data, &tmplen); @@ -1474,10 +1474,10 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms, /* Mark action process */ if (parms->device_params->global_fid_enable && - tbl->table_type == TF_MEM_EXTERNAL) + tbl->resource_type == TF_MEM_EXTERNAL) rc = ulp_mapper_mark_gfid_process(parms, tbl, iparms.flow_id); else if (!parms->device_params->global_fid_enable && - tbl->table_type == TF_MEM_INTERNAL) + tbl->resource_type == TF_MEM_INTERNAL) rc = ulp_mapper_mark_act_ptr_process(parms, tbl); if (rc) { BNXT_TF_DBG(ERR, "Failed to add mark to flow\n"); @@ -1488,7 +1488,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms, memset(&fid_parms, 0, sizeof(fid_parms)); fid_parms.direction = tbl->direction; fid_parms.resource_func = tbl->resource_func; - fid_parms.resource_type = tbl->table_type; + fid_parms.resource_type = tbl->resource_type; fid_parms.critical_resource = tbl->critical_resource; fid_parms.resource_hndl = iparms.flow_handle; @@ -1561,7 +1561,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, } aparms.dir = tbl->direction; - aparms.type = tbl->table_type; + aparms.type = tbl->resource_type; aparms.search_enable = tbl->srch_b4_alloc; aparms.result = ulp_blob_data_get(&data, &tmplen); aparms.result_sz_in_bytes = ULP_SZ_BITS2BYTES(tbl->result_bit_size); @@ -1571,7 +1571,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, rc = tf_alloc_tbl_entry(tfp, &aparms); if (rc) { BNXT_TF_DBG(ERR, "Alloc table[%d][%s] failed rc=%d\n", - tbl->table_type, + tbl->resource_type, (tbl->direction == TF_DIR_RX) ? "RX" : "TX", rc); return rc; @@ -1588,7 +1588,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, if (!tbl->srch_b4_alloc) { sparms.dir = tbl->direction; - sparms.type = tbl->table_type; + sparms.type = tbl->resource_type; sparms.data = ulp_blob_data_get(&data, &tmplen); sparms.data_sz_in_bytes = ULP_SZ_BITS2BYTES(tbl->result_bit_size); @@ -1598,7 +1598,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, "Set table[%d][%s][%d] failed rc=%d\n", - tbl->table_type, + tbl->resource_type, (tbl->direction == TF_DIR_RX) ? "RX" : "TX", sparms.idx, rc); @@ -1611,7 +1611,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, memset(&fid_parms, 0, sizeof(fid_parms)); fid_parms.direction = tbl->direction; fid_parms.resource_func = tbl->resource_func; - fid_parms.resource_type = tbl->table_type; + fid_parms.resource_type = tbl->resource_type; fid_parms.resource_hndl = aparms.idx; fid_parms.critical_resource = 0; @@ -1632,7 +1632,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, * write to the entry or link the flow */ free_parms.dir = tbl->direction; - free_parms.type = tbl->table_type; + free_parms.type = tbl->resource_type; free_parms.idx = aparms.idx; free_parms.tbl_scope_id = tbl_scope_id; @@ -1760,7 +1760,7 @@ ulp_mapper_cache_tbl_process(struct bnxt_ulp_mapper_parms *parms, * need to set it appropriately via setter. */ ulp_mapper_cache_res_type_set(&fid_parms, - tbl->table_type, + tbl->resource_type, tbl->cache_tbl_id); fid_parms.resource_hndl = (uint64_t)*ckey; fid_parms.critical_resource = tbl->critical_resource; diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c index c6b1b9b..9b793a2 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c @@ -590,7 +590,8 @@ struct bnxt_ulp_mapper_tbl_list_info ulp_class_tmpl_list[] = { struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[] = { { .resource_func = BNXT_ULP_RESOURCE_FUNC_CACHE_TABLE, - .table_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM, + .resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_TT_L2_CNTXT_TCAM_CACHE, .direction = TF_DIR_RX, .priority = BNXT_ULP_PRIORITY_NOT_USED, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, @@ -610,7 +611,8 @@ struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[] = { }, { .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, - .table_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM, + .resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED, .direction = TF_DIR_RX, .priority = BNXT_ULP_PRIORITY_LEVEL_0, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, @@ -630,7 +632,8 @@ struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[] = { }, { .resource_func = BNXT_ULP_RESOURCE_FUNC_CACHE_TABLE, - .table_type = TF_TCAM_TBL_TYPE_PROF_TCAM, + .resource_type = TF_TCAM_TBL_TYPE_PROF_TCAM, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_TT_PROFILE_TCAM_CACHE, .direction = TF_DIR_RX, .priority = BNXT_ULP_PRIORITY_NOT_USED, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, @@ -650,7 +653,8 @@ struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[] = { }, { .resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE, - .table_type = TF_TCAM_TBL_TYPE_PROF_TCAM, + .resource_type = TF_TCAM_TBL_TYPE_PROF_TCAM, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_TT_PROFILE_TCAM_CACHE, .direction = TF_DIR_RX, .priority = BNXT_ULP_PRIORITY_LEVEL_0, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, @@ -670,7 +674,8 @@ struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[] = { }, { .resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE, - .table_type = TF_MEM_EXTERNAL, + .resource_type = TF_MEM_EXTERNAL, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED, .direction = TF_DIR_RX, .priority = BNXT_ULP_PRIORITY_NOT_USED, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, @@ -1613,7 +1618,8 @@ struct bnxt_ulp_mapper_tbl_list_info ulp_act_tmpl_list[] = { struct bnxt_ulp_mapper_act_tbl_info ulp_act_tbl_list[] = { { .resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE, - .table_type = TF_TBL_TYPE_EXT, + .resource_type = TF_TBL_TYPE_EXT, + .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_IT_NORMAL, .direction = TF_DIR_RX, .srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO, .result_start_idx = 0, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h index 1bec4b6..aaf9024 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h @@ -209,19 +209,6 @@ enum bnxt_ulp_regfile_index { BNXT_ULP_REGFILE_INDEX_LAST = 16 }; -enum bnxt_ulp_resource_func { - BNXT_ULP_RESOURCE_FUNC_INVALID = 0x00, - BNXT_ULP_RESOURCE_FUNC_EM_TABLE = 0x20, - BNXT_ULP_RESOURCE_FUNC_RSVD1 = 0x40, - BNXT_ULP_RESOURCE_FUNC_RSVD2 = 0x60, - BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE = 0x80, - BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE = 0x81, - BNXT_ULP_RESOURCE_FUNC_CACHE_TABLE = 0x82, - BNXT_ULP_RESOURCE_FUNC_IDENTIFIER = 0x83, - BNXT_ULP_RESOURCE_FUNC_IF_TABLE = 0x84, - BNXT_ULP_RESOURCE_FUNC_HW_FID = 0x85 -}; - enum bnxt_ulp_result_opc { BNXT_ULP_RESULT_OPC_SET_TO_CONSTANT = 0, BNXT_ULP_RESULT_OPC_SET_TO_ACT_PROP = 1, @@ -287,6 +274,29 @@ enum bnxt_ulp_match_type_bitmask { BNXT_ULP_MATCH_TYPE_BITMASK_WM = 0x0000000000000001 }; +enum bnxt_ulp_resource_func { + BNXT_ULP_RESOURCE_FUNC_INVALID = 0x00, + BNXT_ULP_RESOURCE_FUNC_EM_TABLE = 0x20, + BNXT_ULP_RESOURCE_FUNC_RSVD1 = 0x40, + BNXT_ULP_RESOURCE_FUNC_RSVD2 = 0x60, + BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE = 0x80, + BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE = 0x81, + BNXT_ULP_RESOURCE_FUNC_CACHE_TABLE = 0x82, + BNXT_ULP_RESOURCE_FUNC_IDENTIFIER = 0x83, + BNXT_ULP_RESOURCE_FUNC_IF_TABLE = 0x84, + BNXT_ULP_RESOURCE_FUNC_HW_FID = 0x85 +}; + +enum bnxt_ulp_resource_sub_type { + BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED = 0, + BNXT_ULP_RESOURCE_SUB_TYPE_IT_NORMAL = 0, + BNXT_ULP_RESOURCE_SUB_TYPE_IT_VFR_ACT_IDX = 1, + BNXT_ULP_RESOURCE_SUB_TYPE_IT_INT_CNT_IDX = 2, + BNXT_ULP_RESOURCE_SUB_TYPE_IT_EXT_CNT_IDX = 3, + BNXT_ULP_RESOURCE_SUB_TYPE_TT_L2_CNTXT_TCAM_CACHE = 0, + BNXT_ULP_RESOURCE_SUB_TYPE_TT_PROFILE_TCAM_CACHE = 1 +}; + enum bnxt_ulp_sym { BNXT_ULP_SYM_BIG_ENDIAN = 0, BNXT_ULP_SYM_DECAP_FUNC_NONE = 0, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 3cbed24..ce449d0 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -157,7 +157,8 @@ struct bnxt_ulp_mapper_tbl_list_info { struct bnxt_ulp_mapper_class_tbl_info { enum bnxt_ulp_resource_func resource_func; - uint32_t table_type; + uint32_t resource_type; /* TF_ enum type */ + enum bnxt_ulp_resource_sub_type resource_sub_type; uint8_t direction; uint32_t priority; uint8_t srch_b4_alloc; @@ -187,7 +188,8 @@ struct bnxt_ulp_mapper_class_tbl_info { struct bnxt_ulp_mapper_act_tbl_info { enum bnxt_ulp_resource_func resource_func; - enum tf_tbl_type table_type; + uint32_t resource_type; /* TF_ enum type */ + enum bnxt_ulp_resource_sub_type resource_sub_type; uint8_t direction; uint8_t srch_b4_alloc; uint32_t result_start_idx; -- 2.7.4