/* 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);
/* 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;
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;
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;
}
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);
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,
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;
}
uint32_t i, num_kflds, num_dflds;
uint16_t tmplen;
struct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
- struct ulp_rte_act_prop *a_prop = parms->act_prop;
struct ulp_flow_db_res_params fid_parms = { 0 };
struct tf_insert_em_entry_parms iparms = { 0 };
struct tf_delete_em_entry_parms free_parms = { 0 };
*/
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);
return rc;
}
- if (tbl->mark_enable &&
- ULP_BITMAP_ISSET(parms->act_bitmap->bits,
- BNXT_ULP_ACTION_BIT_MARK)) {
- uint32_t val, mark, gfid, flag;
- /* TBD: Need to determine if GFID is enabled globally */
- if (sizeof(val) != BNXT_ULP_ACT_PROP_SZ_MARK) {
- BNXT_TF_DBG(ERR, "Mark size (%d) != expected (%zu)\n",
- BNXT_ULP_ACT_PROP_SZ_MARK, sizeof(val));
- rc = -EINVAL;
- goto error;
- }
-
- memcpy(&val,
- &a_prop->act_details[BNXT_ULP_ACT_PROP_IDX_MARK],
- sizeof(val));
-
- mark = tfp_be_to_cpu_32(val);
-
- TF_GET_GFID_FROM_FLOW_ID(iparms.flow_id, gfid);
- flag = BNXT_ULP_MARK_GLOBAL_HW_FID;
- rc = ulp_mark_db_mark_add(parms->ulp_ctx,
- flag,
- gfid,
- mark);
- if (rc) {
- BNXT_TF_DBG(ERR, "Failed to add mark to flow\n");
- goto error;
- }
-
- /*
- * Link the mark resource to the flow in the flow db
- * The mark is never the critical resource, so it is 0.
- */
- memset(&fid_parms, 0, sizeof(fid_parms));
- fid_parms.direction = tbl->direction;
- fid_parms.resource_func = BNXT_ULP_RESOURCE_FUNC_HW_FID;
- fid_parms.resource_type = flag;
- fid_parms.resource_hndl = gfid;
- fid_parms.critical_resource = 0;
-
- rc = ulp_flow_db_resource_add(parms->ulp_ctx,
- parms->tbl_idx,
- parms->fid,
- &fid_parms);
- if (rc) {
- BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n",
- rc);
- /* Need to free the identifier, so goto error */
- goto error;
- }
- }
-
/* Link the EM resource to the flow in the flow db */
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;
}
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);
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;
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);
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);
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;
* 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;
* 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;
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,
},
{
.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,
},
{
.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,
},
{
.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,
},
{
.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,
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,
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,
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,