#include "tf_util.h"
#include "ulp_template_db_tbl.h"
#include "ulp_port_db.h"
+#include "ulp_ha_mgr.h"
+#include "bnxt_tf_pmd_shim.h"
static uint8_t mapper_fld_zeros[16] = { 0 };
struct tf *tfp;
int32_t rc = 0;
- tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SHARED_SESSION_NO);
if (!tfp)
return -EINVAL;
uint32_t tbl_scope_id;
int32_t rc = 0;
- tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SHARED_SESSION_NO);
if (!tfp)
return -EINVAL;
}
static inline int32_t
-ulp_mapper_tcam_entry_free(struct bnxt_ulp_context *ulp __rte_unused,
+ulp_mapper_tcam_entry_free(struct bnxt_ulp_context *ulp,
struct tf *tfp,
struct ulp_flow_db_res_params *res)
{
.idx = (uint16_t)res->resource_hndl
};
+ /* If HA is enabled, we may have to remap the TF Type */
+ if (bnxt_ulp_cntxt_ha_enabled(ulp)) {
+ enum ulp_ha_mgr_region region;
+ int32_t rc;
+
+ switch (res->resource_type) {
+ case TF_TCAM_TBL_TYPE_WC_TCAM_HIGH:
+ case TF_TCAM_TBL_TYPE_WC_TCAM_LOW:
+ rc = ulp_ha_mgr_region_get(ulp, ®ion);
+ if (rc)
+ /* Log this, but assume region is correct */
+ BNXT_TF_DBG(ERR,
+ "Unable to get HA region (%d)\n",
+ rc);
+ else
+ fparms.tcam_tbl_type =
+ (region == ULP_HA_REGION_LOW) ?
+ TF_TCAM_TBL_TYPE_WC_TCAM_LOW :
+ TF_TCAM_TBL_TYPE_WC_TCAM_HIGH;
+ break;
+ default:
+ break;
+ }
+ }
return tf_free_tcam_entry(tfp, &fparms);
}
struct tf *tfp;
int rc;
- tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to get tf pointer\n");
return -EINVAL;
fid_parms.resource_type = ident->ident_type;
fid_parms.resource_hndl = iparms.id;
fid_parms.critical_resource = tbl->critical_resource;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc) {
int rc;
/* Get the tfp from ulp context */
- tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to get tf pointer\n");
return -EINVAL;
fid_parms.resource_type = ident->ident_type;
fid_parms.resource_hndl = sparms.search_id;
fid_parms.critical_resource = tbl->critical_resource;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc) {
BNXT_TF_DBG(ERR, "Failed to link res to flow rc = %d\n",
return -EINVAL;
}
idx = tfp_be_to_cpu_16(idx);
- if (idx >= BNXT_ULP_CF_IDX_LAST || bytelen > sizeof(uint32_t)) {
+ if (idx >= BNXT_ULP_CF_IDX_LAST || bytelen > sizeof(uint64_t)) {
BNXT_TF_DBG(ERR, "comp field [%d] read oob %d\n", idx,
bytelen);
return -EINVAL;
}
buffer = (uint8_t *)&parms->comp_fld[idx];
- *val = &buffer[sizeof(uint32_t) - bytelen];
+ *val = &buffer[sizeof(uint64_t) - bytelen];
*value = ULP_COMP_FLD_IDX_RD(parms, idx);
break;
case BNXT_ULP_FIELD_SRC_RF:
fid_parms.critical_resource = tbl->critical_resource;
fid_parms.resource_type = mark_flag;
fid_parms.resource_hndl = gfid;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc)
BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
fid_parms.critical_resource = tbl->critical_resource;
fid_parms.resource_type = mark_flag;
fid_parms.resource_hndl = act_idx;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc)
BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
fid_parms.critical_resource = tbl->critical_resource;
fid_parms.resource_type = mark_flag;
fid_parms.resource_hndl = act_idx;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc)
BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
uint16_t tmplen;
int32_t rc;
- tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to get truflow pointer\n");
return -EINVAL;
return 0;
}
- tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to get truflow pointer\n");
return -EINVAL;
}
/* For wild card tcam perform the post process to swap the blob */
- if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM) {
+ if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM ||
+ tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_HIGH ||
+ tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_LOW) {
if (dparms->dynamic_pad_en) {
/* Sets up the slices for writing to the WC TCAM */
rc = ulp_mapper_wc_tcam_tbl_dyn_post_process(dparms,
fid_parms.resource_type = tbl->resource_type;
fid_parms.critical_resource = tbl->critical_resource;
fid_parms.resource_hndl = idx;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc) {
BNXT_TF_DBG(ERR, "Failed to link resource to flow rc = %d\n",
struct ulp_blob key, data;
uint32_t i, num_kflds;
uint16_t tmplen;
- struct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ struct tf *tfp;
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 };
int32_t rc = 0;
int32_t pad = 0;
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
rc = bnxt_ulp_cntxt_mem_type_get(parms->ulp_ctx, &mtype);
if (rc) {
BNXT_TF_DBG(ERR, "Failed to get the mem type for EM\n");
struct tf_get_tbl_entry_parms gparms = { 0 };
struct tf_free_tbl_entry_parms free_parms = { 0 };
uint32_t tbl_scope_id;
- struct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
- struct bnxt_ulp_glb_resource_info glb_res;
+ struct tf *tfp;
+ struct bnxt_ulp_glb_resource_info glb_res = { 0 };
uint16_t bit_size;
bool alloc = false;
bool write = false;
uint64_t act_rec_size;
bool shared = false;
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
/* use the max size if encap is enabled */
if (tbl->encap_num_fields)
bit_size = BNXT_ULP_FLMP_BLOB_SIZE_IN_BITS;
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;
}
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;
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);
fid_parms.resource_sub_type = tbl->resource_sub_type;
fid_parms.resource_hndl = index;
fid_parms.critical_resource = tbl->critical_resource;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc) {
int32_t rc = 0;
struct tf_set_if_tbl_entry_parms iftbl_params = { 0 };
struct tf_get_if_tbl_entry_parms get_parms = { 0 };
- struct tf *tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+ struct tf *tfp;
enum bnxt_ulp_if_tbl_opc if_opc = tbl->tbl_opcode;
uint32_t res_size;
+ tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx, tbl->shared_session);
/* Initialize the blob data */
if (!ulp_blob_init(&data, tbl->result_bit_size,
parms->device_params->byte_order)) {
struct ulp_flow_db_res_params fid_parms;
struct ulp_mapper_gen_tbl_entry gen_tbl_ent, *g;
struct ulp_gen_hash_entry_params hash_entry;
- uint16_t tmplen;
+ uint16_t tmplen = 0;
struct ulp_blob key, data;
uint8_t *cache_key;
int32_t tbl_idx;
}
} else {
/* convert key to index directly */
+ if (ULP_BITS_2_BYTE(tmplen) > (int32_t)sizeof(key_index)) {
+ BNXT_TF_DBG(ERR, "%s: keysize is bigger then 4 bytes\n",
+ gen_tbl_list->gen_tbl_name);
+ return -EINVAL;
+ }
memcpy(&key_index, cache_key, ULP_BITS_2_BYTE(tmplen));
/* Get the generic table entry */
if (ulp_mapper_gen_tbl_entry_get(gen_tbl_list, key_index,
fid_parms.resource_sub_type = tbl->resource_sub_type;
fid_parms.resource_hndl = key_index;
fid_parms.critical_resource = tbl->critical_resource;
+ ulp_flow_db_shared_session_set(&fid_parms, tbl->shared_session);
+
rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
if (rc)
BNXT_TF_DBG(ERR, "Fail to add gen ent flowdb %d\n", rc);
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;
}
ulp_mapper_app_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,
struct bnxt_ulp_mapper_data *mapper_data)
{
+ struct tf_get_shared_tbl_increment_parms iparms;
struct bnxt_ulp_glb_resource_info *glb_res;
struct tf_get_session_info_parms sparms;
uint32_t num_entries, i, dev_id, res;
struct tf_resource_info *res_info;
+ uint32_t addend;
uint64_t regval;
enum tf_dir dir;
int32_t rc = 0;
uint8_t app_id;
memset(&sparms, 0, sizeof(sparms));
-
glb_res = bnxt_ulp_app_glb_resource_info_list_get(&num_entries);
if (!glb_res || !num_entries) {
BNXT_TF_DBG(ERR, "Invalid Arguments\n");
return -EINVAL;
}
-
tfp = bnxt_ulp_cntxt_shared_tfp_get(ulp_ctx);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to get tfp for app global init");
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;
}
continue;
dir = glb_res[i].direction;
res = glb_res[i].resource_type;
+ addend = 1;
switch (glb_res[i].resource_func) {
case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:
res_info = &sparms.session_info.ident[dir].info[res];
break;
case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:
+ /*
+ * Tables may have various strides for the allocations.
+ * Need to account.
+ */
+ memset(&iparms, 0, sizeof(iparms));
+ iparms.dir = dir;
+ iparms.type = res;
+ rc = tf_get_shared_tbl_increment(tfp, &iparms);
+ if (rc) {
+ BNXT_TF_DBG(ERR,
+ "Failed to get addend for %s[%s] rc=(%d)\n",
+ tf_tbl_type_2_str(res),
+ tf_dir_2_str(dir), rc);
+ return rc;
+ }
+ addend = iparms.increment_cnt;
res_info = &sparms.session_info.tbl[dir].info[res];
break;
case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:
glb_res[i].resource_func);
continue;
}
-
regval = tfp_cpu_to_be_64((uint64_t)res_info->start);
- res_info->start++;
-
+ res_info->start += addend;
/*
* All resources written to the global regfile are shared for
* this function.
}
static int32_t
-ulp_mapper_cc_upd_opr_compute(struct bnxt_ulp_mapper_parms *parms,
- enum tf_dir dir,
- enum bnxt_ulp_cc_upd_src cc_src,
- uint16_t cc_opr,
- uint64_t *result)
+ulp_mapper_func_opr_compute(struct bnxt_ulp_mapper_parms *parms,
+ enum tf_dir dir,
+ enum bnxt_ulp_func_src func_src,
+ uint16_t func_opr,
+ uint64_t *result)
{
uint64_t regval;
bool shared;
*result = false;
- switch (cc_src) {
- case BNXT_ULP_CC_UPD_SRC_COMP_FIELD:
- if (cc_opr >= BNXT_ULP_CF_IDX_LAST) {
- BNXT_TF_DBG(ERR, "invalid index %u\n", cc_opr);
+ switch (func_src) {
+ case BNXT_ULP_FUNC_SRC_COMP_FIELD:
+ if (func_opr >= BNXT_ULP_CF_IDX_LAST) {
+ BNXT_TF_DBG(ERR, "invalid index %u\n", func_opr);
return -EINVAL;
}
- *result = (uint64_t)ULP_COMP_FLD_IDX_RD(parms, cc_opr);
+ *result = ULP_COMP_FLD_IDX_RD(parms, func_opr);
break;
- case BNXT_ULP_CC_UPD_SRC_REGFILE:
- if (!ulp_regfile_read(parms->regfile, cc_opr, ®val)) {
- BNXT_TF_DBG(ERR, "regfile[%d] read oob\n", cc_opr);
+ case BNXT_ULP_FUNC_SRC_REGFILE:
+ if (!ulp_regfile_read(parms->regfile, func_opr, ®val)) {
+ BNXT_TF_DBG(ERR, "regfile[%d] read oob\n", func_opr);
return -EINVAL;
}
*result = tfp_be_to_cpu_64(regval);
break;
- case BNXT_ULP_CC_UPD_SRC_GLB_REGFILE:
+ case BNXT_ULP_FUNC_SRC_GLB_REGFILE:
if (ulp_mapper_glb_resource_read(parms->mapper_data, dir,
- cc_opr, ®val, &shared)) {
+ func_opr, ®val, &shared)) {
BNXT_TF_DBG(ERR, "global regfile[%d] read failed.\n",
- cc_opr);
+ func_opr);
return -EINVAL;
}
*result = tfp_be_to_cpu_64(regval);
break;
- case BNXT_ULP_CC_UPD_SRC_CONST:
- *result = cc_opr;
+ case BNXT_ULP_FUNC_SRC_CONST:
+ *result = func_opr;
break;
default:
- BNXT_TF_DBG(ERR, "invalid src code %u\n", cc_src);
+ BNXT_TF_DBG(ERR, "invalid src code %u\n", func_src);
return -EINVAL;
}
return 0;
}
static int32_t
-ulp_mapper_cc_upd_info_process(struct bnxt_ulp_mapper_parms *parms,
- struct bnxt_ulp_mapper_tbl_info *tbl)
+ulp_mapper_func_info_process(struct bnxt_ulp_mapper_parms *parms,
+ struct bnxt_ulp_mapper_tbl_info *tbl)
{
- struct bnxt_ulp_mapper_cc_upd_info *cc_upd = &tbl->cc_upd_info;
- uint64_t res = 0, res1, res2;
+ struct bnxt_ulp_mapper_func_info *func_info = &tbl->func_info;
+ uint64_t res = 0, res1 = 0, res2 = 0;
int32_t rc = 0;
+ uint32_t process_src1 = 0, process_src2 = 0;
- if (cc_upd->cc_opc == BNXT_ULP_CC_UPD_OPC_NOP)
+ /* determine which functional operands to compute */
+ switch (func_info->func_opc) {
+ case BNXT_ULP_FUNC_OPC_NOP:
return rc;
+ case BNXT_ULP_FUNC_OPC_EQ:
+ case BNXT_ULP_FUNC_OPC_NE:
+ case BNXT_ULP_FUNC_OPC_GE:
+ case BNXT_ULP_FUNC_OPC_GT:
+ case BNXT_ULP_FUNC_OPC_LE:
+ case BNXT_ULP_FUNC_OPC_LT:
+ process_src1 = 1;
+ process_src2 = 1;
+ break;
+ case BNXT_ULP_FUNC_OPC_COPY_SRC1_TO_RF:
+ process_src1 = 1;
+ break;
+ default:
+ break;
+ }
- rc = ulp_mapper_cc_upd_opr_compute(parms, tbl->direction,
- cc_upd->cc_src1,
- cc_upd->cc_opr1, &res1);
- if (rc)
- return rc;
+ if (process_src1) {
+ rc = ulp_mapper_func_opr_compute(parms, tbl->direction,
+ func_info->func_src1,
+ func_info->func_opr1, &res1);
+ if (rc)
+ return rc;
+ }
- rc = ulp_mapper_cc_upd_opr_compute(parms, tbl->direction,
- cc_upd->cc_src2,
- cc_upd->cc_opr2, &res2);
- if (rc)
- return rc;
+ if (process_src2) {
+ rc = ulp_mapper_func_opr_compute(parms, tbl->direction,
+ func_info->func_src2,
+ func_info->func_opr2, &res2);
+ if (rc)
+ return rc;
+ }
- switch (cc_upd->cc_opc) {
- case BNXT_ULP_CC_UPD_OPC_NOP:
- res = 1;
- break;
- case BNXT_ULP_CC_UPD_OPC_EQ:
+ /* perform the functional opcode operations */
+ switch (func_info->func_opc) {
+ case BNXT_ULP_FUNC_OPC_EQ:
if (res1 == res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_NE:
+ case BNXT_ULP_FUNC_OPC_NE:
if (res1 != res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_GE:
+ case BNXT_ULP_FUNC_OPC_GE:
if (res1 >= res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_GT:
+ case BNXT_ULP_FUNC_OPC_GT:
if (res1 > res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_LE:
+ case BNXT_ULP_FUNC_OPC_LE:
if (res1 <= res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_LT:
+ case BNXT_ULP_FUNC_OPC_LT:
if (res1 < res2)
res = 1;
break;
- case BNXT_ULP_CC_UPD_OPC_LAST:
- BNXT_TF_DBG(ERR, "invalid code %u\n", cc_upd->cc_opc);
+ case BNXT_ULP_FUNC_OPC_COPY_SRC1_TO_RF:
+ res = res1;
+ break;
+ case BNXT_ULP_FUNC_OPC_RSS_CONFIG:
+ /* apply the rss config using pmd method */
+ return bnxt_rss_config_action_apply(parms);
+ case BNXT_ULP_FUNC_OPC_GET_PARENT_MAC_ADDR:
+ rc = bnxt_pmd_get_parent_mac_addr(parms, (uint8_t *)&res);
+ if (rc)
+ return -EINVAL;
+ res = tfp_be_to_cpu_64(res);
+ break;
+ default:
+ BNXT_TF_DBG(ERR, "invalid func code %u\n", func_info->func_opc);
return -EINVAL;
}
- if (ulp_regfile_write(parms->regfile, cc_upd->cc_dst_opr,
+ if (ulp_regfile_write(parms->regfile, func_info->func_dst_opr,
tfp_cpu_to_be_64(res))) {
- BNXT_TF_DBG(ERR, "Failed write the cc_opc %u\n",
- cc_upd->cc_dst_opr);
+ BNXT_TF_DBG(ERR, "Failed write the func_opc %u\n",
+ func_info->func_dst_opr);
return -EINVAL;
}
{
int32_t rc = 0;
uint64_t regval;
- uint64_t comp_sig_id;
+ uint64_t comp_sig;
*res = 0;
switch (tbl->accept_opcode) {
BNXT_ULP_RF_IDX_FLOW_SIG_ID);
return -EINVAL;
}
- comp_sig_id = ULP_COMP_FLD_IDX_RD(parms,
- BNXT_ULP_CF_IDX_FLOW_SIG_ID);
+ comp_sig = ULP_COMP_FLD_IDX_RD(parms,
+ BNXT_ULP_CF_IDX_FLOW_SIG_ID);
regval = tfp_be_to_cpu_64(regval);
- if (comp_sig_id == regval)
+ if (comp_sig == regval)
*res = 1;
else
- BNXT_TF_DBG(ERR, "failed signature match %x:%x\n",
- (uint32_t)comp_sig_id, (uint32_t)regval);
+ BNXT_TF_DBG(ERR, "failed signature match 0x%016"
+ PRIX64 ":%x\n", comp_sig, (uint32_t)regval);
break;
default:
BNXT_TF_DBG(ERR, "Invalid accept opcode %d\n",
for (tbl_idx = 0; tbl_idx < num_tbls && cond_goto;) {
tbl = &tbls[tbl_idx];
- /* Process the conditional code update opcodes */
- if (ulp_mapper_cc_upd_info_process(parms, tbl)) {
+ cond_goto = tbl->execute_info.cond_true_goto;
+ /* Process the conditional func code opcodes */
+ if (ulp_mapper_func_info_process(parms, tbl)) {
BNXT_TF_DBG(ERR, "Failed to process cond update\n");
rc = -EINVAL;
goto error;
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 */
BNXT_TF_DBG(ERR, "Unable to free resource\n ");
return -EINVAL;
}
-
- tfp = bnxt_ulp_cntxt_tfp_get(ulp);
+ if (res->fdb_flags & ULP_FDB_FLAG_SHARED_SESSION)
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp, BNXT_ULP_SHARED_SESSION_YES);
+ else
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp, BNXT_ULP_SHARED_SESSION_NO);
if (!tfp) {
BNXT_TF_DBG(ERR, "Unable to free resource failed to get tfp\n");
return -EINVAL;
parms.hdr_field = cparms->hdr_field;
parms.fld_bitmap = cparms->fld_bitmap;
parms.comp_fld = cparms->comp_fld;
- parms.tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
parms.ulp_ctx = ulp_ctx;
parms.act_tid = cparms->act_tid;
parms.class_tid = cparms->class_tid;
parms.flow_pattern_id = cparms->flow_pattern_id;
parms.act_pattern_id = cparms->act_pattern_id;
parms.app_id = cparms->app_id;
+ parms.port_id = cparms->port_id;
/* Get the device id from the ulp context */
if (bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &parms.dev_id)) {
if (!ulp_ctx)
return -EINVAL;
- tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SHARED_SESSION_NO);
if (!tfp)
return -EINVAL;
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;
}
}
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;
}
return;
}
- tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
+ tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SHARED_SESSION_NO);
if (!tfp) {
BNXT_TF_DBG(ERR, "Failed to acquire tfp.\n");
/* Free the mapper data regardless of errors. */