#define BNXT_TF_DBG(lvl, fmt, args...) PMD_DRV_LOG(lvl, fmt, ## args)
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#define BNXT_TF_INF(fmt, args...) PMD_DRV_LOG(INFO, fmt, ## args)
-#else
#define BNXT_TF_INF(fmt, args...)
-#endif
#define BNXT_ULP_EM_FLOWS 8192
#define BNXT_ULP_1M_FLOWS 1000000
rc);
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
- BNXT_TF_DBG(DEBUG, "TableScope=0x%0x %d\n",
- params.tbl_scope_id,
- params.tbl_scope_id);
-#endif
rc = bnxt_ulp_cntxt_tbl_scope_id_set(bp->ulp_ctx, params.tbl_scope_id);
if (rc) {
BNXT_TF_DBG(ERR, "Unable to set table scope id\n");
#include "ulp_ha_mgr.h"
#include "ulp_tun.h"
#include <rte_malloc.h>
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#endif
static int32_t
bnxt_ulp_flow_validate_args(const struct rte_flow_attr *attr,
if (ret == BNXT_TF_RC_ERROR)
goto free_fid;
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_PARSER
- /* Dump the rte flow pattern */
- ulp_parser_hdr_info_dump(¶ms);
- /* Dump the rte flow action */
- ulp_parser_act_info_dump(¶ms);
-#endif
-#endif
-
ret = ulp_matcher_pattern_match(¶ms, ¶ms.class_id);
if (ret != BNXT_TF_RC_SUCCESS)
goto free_fid;
if (flow_type == BNXT_ULP_FDB_TYPE_REGULAR)
ulp_flow_db_func_id_set(flow_db, *fid, func_id);
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
- BNXT_TF_DBG(ERR, "flow_id = %u:%u allocated\n", flow_type, *fid);
-#endif
/* return success */
return 0;
}
if (flow_type == BNXT_ULP_FDB_TYPE_REGULAR)
ulp_flow_db_func_id_set(flow_db, fid, 0);
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
- BNXT_TF_DBG(ERR, "flow_id = %u:%u freed\n", flow_type, fid);
-#endif
/* all good, return success */
return 0;
}
if (res && (shared & BNXT_ULP_SHARED_SESSION_YES))
res->fdb_flags |= ULP_FDB_FLAG_SHARED_SESSION;
}
-
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-/*
- * Dump the entry details
- *
- * ulp_ctxt [in] Ptr to ulp_context
- *
- * returns none
- */
-static void ulp_flow_db_res_dump(struct ulp_fdb_resource_info *r,
- uint32_t *nxt_res)
-{
- uint8_t res_func = ulp_flow_db_resource_func_get(r);
-
- BNXT_TF_DBG(DEBUG, "Resource func = %x, nxt_resource_idx = %x\n",
- res_func, (ULP_FLOW_DB_RES_NXT_MASK & r->nxt_resource_idx));
- if (res_func == BNXT_ULP_RESOURCE_FUNC_EM_TABLE)
- BNXT_TF_DBG(DEBUG, "EM Handle = 0x%016" PRIX64 "\n",
- r->resource_em_handle);
- else
- BNXT_TF_DBG(DEBUG, "Handle = 0x%08x\n", r->resource_hndl);
-
- *nxt_res = 0;
- ULP_FLOW_DB_RES_NXT_SET(*nxt_res,
- r->nxt_resource_idx);
-}
-
-/*
- * Dump the flow entry details
- *
- * flow_db [in] Ptr to flow db
- * fid [in] flow id
- *
- * returns none
- */
-void
-ulp_flow_db_debug_fid_dump(struct bnxt_ulp_flow_db *flow_db, uint32_t fid)
-{
- struct ulp_fdb_resource_info *r;
- struct bnxt_ulp_flow_tbl *flow_tbl;
- uint32_t nxt_res = 0;
- uint32_t def_flag = 0, reg_flag = 0;
-
- flow_tbl = &flow_db->flow_tbl;
- if (ulp_flow_db_active_flows_bit_is_set(flow_db,
- BNXT_ULP_FDB_TYPE_REGULAR, fid))
- reg_flag = 1;
- if (ulp_flow_db_active_flows_bit_is_set(flow_db,
- BNXT_ULP_FDB_TYPE_DEFAULT, fid))
- def_flag = 1;
-
- if (reg_flag && def_flag)
- BNXT_TF_DBG(DEBUG, "RID = %u\n", fid);
- else if (reg_flag)
- BNXT_TF_DBG(DEBUG, "Regular fid = %u and func id = %u\n",
- fid, flow_db->func_id_tbl[fid]);
- else if (def_flag)
- BNXT_TF_DBG(DEBUG, "Default fid = %u\n", fid);
- else
- return;
- /* iterate the resource */
- nxt_res = fid;
- do {
- r = &flow_tbl->flow_resources[nxt_res];
- ulp_flow_db_res_dump(r, &nxt_res);
- } while (nxt_res);
-}
-
-/*
- * Dump the flow database entry details
- *
- * ulp_ctxt [in] Ptr to ulp_context
- * flow_id [in] if zero then all fids are dumped.
- *
- * returns none
- */
-int32_t ulp_flow_db_debug_dump(struct bnxt_ulp_context *ulp_ctxt,
- uint32_t flow_id)
-{
- struct bnxt_ulp_flow_db *flow_db;
- struct bnxt_ulp_flow_tbl *flow_tbl;
- uint32_t fid;
-
- if (!ulp_ctxt || !ulp_ctxt->cfg_data) {
- BNXT_TF_DBG(ERR, "Invalid Arguments\n");
- return -EINVAL;
- }
- flow_db = bnxt_ulp_cntxt_ptr2_flow_db_get(ulp_ctxt);
- if (!flow_db) {
- BNXT_TF_DBG(ERR, "Invalid Arguments\n");
- return -EINVAL;
- }
-
- flow_tbl = &flow_db->flow_tbl;
- if (flow_id) {
- ulp_flow_db_debug_fid_dump(flow_db, flow_id);
- return 0;
- }
-
- BNXT_TF_DBG(DEBUG, "Dump flows = %u:%u\n",
- flow_tbl->num_flows,
- flow_tbl->num_resources);
- BNXT_TF_DBG(DEBUG, "Head_index = %u, Tail_index = %u\n",
- flow_tbl->head_index, flow_tbl->tail_index);
- for (fid = 1; fid < flow_tbl->num_flows; fid++)
- ulp_flow_db_debug_fid_dump(flow_db, fid);
- BNXT_TF_DBG(DEBUG, "Done.\n");
- return 0;
-}
-#endif
void ulp_flow_db_shared_session_set(struct ulp_flow_db_res_params *res,
enum bnxt_ulp_shared_session shared);
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-/*
- * Dump the flow entry details
- *
- * flow_db [in] Ptr to flow db
- * fid [in] flow id
- *
- * returns none
- */
-void
-ulp_flow_db_debug_fid_dump(struct bnxt_ulp_flow_db *flow_db, uint32_t fid);
-
-/*
- * Dump the flow database entry details
- *
- * ulp_ctxt [in] Ptr to ulp_context
- * flow_id [in] if zero then all fids are dumped.
- *
- * returns none
- */
-int32_t ulp_flow_db_debug_dump(struct bnxt_ulp_context *ulp_ctxt,
- uint32_t flow_id);
-#endif
-
#endif /* _ULP_FLOW_DB_H_ */
#include "ulp_mapper.h"
#include "ulp_flow_db.h"
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#include "ulp_tf_debug.h"
-#endif
-
/* Retrieve the generic table initialization parameters for the tbl_idx */
static struct bnxt_ulp_generic_tbl_params*
ulp_mapper_gen_tbl_params_get(uint32_t tbl_idx)
#include "ulp_ha_mgr.h"
#include "bnxt_tf_pmd_shim.h"
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#include "ulp_tf_debug.h"
-#endif
-
static uint8_t mapper_fld_zeros[16] = { 0 };
static uint8_t mapper_fld_ones[16] = {
tf_free_identifier(tfp, &fparms);
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- BNXT_TF_DBG(DEBUG, "Allocated Glb Res Ident [%s][%d][%d] = 0x%04x\n",
- tf_dir_2_str(iparms.dir),
- glb_res->glb_regfile_index, iparms.ident_type, iparms.id);
-#endif
-#endif
return rc;
}
tf_free_tbl_entry(tfp, &free_parms);
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- BNXT_TF_DBG(DEBUG, "Allocated Glb Res Index [%s][%d][%d] = 0x%04x\n",
- tf_dir_2_str(aparms.dir),
- glb_res->glb_regfile_index, aparms.type, aparms.idx);
-#endif
-#endif
return rc;
}
} else {
*val = iparms.id;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_ident_field_dump("Ident", ident, tbl, iparms.id);
-#endif
-#endif
return 0;
error:
goto error;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_ident_field_dump("Ident", ident, tbl, sparms.search_id);
-#endif
-#endif
return 0;
error:
}
if (!rc) {
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- if (fld->field_src1 != BNXT_ULP_FIELD_SRC_ZERO && val_len)
- ulp_mapper_field_dump(name, fld, blob, write_idx, val,
- val_len);
-#endif
-#endif
return rc;
}
error:
return rc;
}
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- BNXT_TF_DBG(DEBUG, "Result dump\n");
- ulp_mapper_blob_dump(data);
-#endif
-#endif
return rc;
}
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_tcam_entry_dump("TCAM", idx, tbl, key, mask, data);
-#endif
-#endif
return rc;
}
{
ulp_blob_perform_64B_word_swap(blob);
ulp_blob_perform_64B_byte_swap(blob);
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- BNXT_TF_DBG(INFO, "Dump after wc tcam post process\n");
- ulp_mapper_blob_dump(blob);
-#endif
-#endif
}
static int32_t ulp_mapper_tcam_is_wc_tcam(struct bnxt_ulp_mapper_tbl_info *tbl)
BNXT_TF_DBG(ERR, "Failed to build the result blob\n");
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_result_dump("EM Result", tbl, &data);
-#endif
-#endif
if (dparms->dynamic_pad_en) {
uint32_t abits = dparms->em_blk_align_bits;
ulp_blob_pad_align(&data, abits);
ulp_blob_perform_byte_reverse(&data, ULP_BITS_2_BYTE(abits));
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_result_dump("EM Merged Result", tbl, &data);
-#endif
-#endif
}
/* do the transpose for the internal EM keys */
}
tmplen = ulp_blob_data_len_get(&key);
ulp_blob_perform_byte_reverse(&key, ULP_BITS_2_BYTE(tmplen));
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_result_dump("EM Key Transpose", tbl, &key);
-#endif
-#endif
}
rc = bnxt_ulp_cntxt_tbl_scope_id_get(parms->ulp_ctx,
return rc;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_em_dump("EM", &key, &data, &iparms);
- /* tf_dump_tables(tfp, iparms.tbl_scope_id); */
-#endif
-#endif
/* Mark action process */
if (mtype == BNXT_ULP_FLOW_MEM_TYPE_EXT &&
tbl->resource_type == TF_MEM_EXTERNAL)
/* The_key is a byte array convert it to a search index */
cache_key = ulp_blob_data_get(&key, &tmplen);
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_gen_tbl_dump(tbl->resource_sub_type, tbl->direction, &key);
-#endif
-#endif
/* get the generic table */
gen_tbl_list = &parms->mapper_data->gen_tbl_list[tbl_idx];
for (tbl_idx = 0; tbl_idx < num_tbls && cond_goto;) {
tbl = &tbls[tbl_idx];
cond_goto = tbl->execute_info.cond_true_goto;
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
- ulp_mapper_table_dump(tbl, tbl_idx);
-#endif
-#endif
/* Process the conditional func code opcodes */
if (ulp_mapper_func_info_process(parms, tbl)) {
BNXT_TF_DBG(ERR, "Failed to process cond update\n");
#include "ulp_matcher.h"
#include "ulp_utils.h"
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#endif
-
/* Utility function to calculate the class matcher hash */
static uint32_t
ulp_matcher_class_hash_calculate(uint64_t hi_sig, uint64_t lo_sig)
error:
BNXT_TF_DBG(DEBUG, "Did not find any matching template\n");
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
- BNXT_TF_DBG(DEBUG, "class_hid:0x%x, Hdr:%" PRIX64 " Fld:%" PRIX64 "\n",
- class_hid, params->hdr_bitmap.bits,
- params->fld_bitmap.bits);
-#endif
*class_id = 0;
return BNXT_TF_RC_ERROR;
}
error:
BNXT_TF_DBG(DEBUG, "Did not find any matching action template\n");
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
- BNXT_TF_DBG(DEBUG, "act_hid:0x%x, Hdr:%" PRIX64 "\n",
- act_hid, params->act_bitmap.bits);
-#endif
*act_id = 0;
return BNXT_TF_RC_ERROR;
}
#include "ulp_port_db.h"
#include "tfp.h"
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_tf_debug.h"
-#endif
-
static uint32_t
ulp_port_db_allocate_ifindex(struct bnxt_ulp_port_db *port_db)
{
port_data->port_vport = bnxt_pmd_get_vport(port_id);
port_data->port_valid = true;
}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_PORT
- ulp_port_db_dump(port_db, intf, port_id);
-#endif
-#endif
return 0;
}