#include "ulp_utils.h"
#include "ulp_template_struct.h"
#include "ulp_mapper.h"
+#include "ulp_fc_mgr.h"
#define ULP_FLOW_DB_RES_DIR_BIT 31
#define ULP_FLOW_DB_RES_DIR_MASK 0x80000000
}
/* Store the handle as 64bit only for EM table entries */
- if (params->resource_func != BNXT_ULP_RESOURCE_FUNC_EM_TABLE) {
+ if (params->resource_func != BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE &&
+ params->resource_func != BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE) {
resource_info->resource_hndl = (uint32_t)params->resource_hndl;
resource_info->resource_type = params->resource_type;
resource_info->resource_sub_type = params->resource_sub_type;
/* use the helper function to get the resource func */
params->resource_func = ulp_flow_db_resource_func_get(resource_info);
- if (params->resource_func == BNXT_ULP_RESOURCE_FUNC_EM_TABLE) {
+ if (params->resource_func == BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE ||
+ params->resource_func == BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE) {
params->resource_hndl = resource_info->resource_em_handle;
} else if (params->resource_func & ULP_FLOW_DB_RES_FUNC_NEED_LOWER) {
params->resource_hndl = resource_info->resource_hndl;
/* Populate the regular flow table limits. */
flow_tbl = &flow_db->flow_tbl[BNXT_ULP_REGULAR_FLOW_TABLE];
- flow_tbl->num_flows = dparms->num_flows + 1;
+ flow_tbl->num_flows = dparms->flow_db_num_entries + 1;
flow_tbl->num_resources = (flow_tbl->num_flows *
dparms->num_resources_per_flow);
goto error_free;
/* add 1 since we are not using index 0 for flow id */
- flow_db->func_id_tbl_size = dparms->num_flows + 1;
+ flow_db->func_id_tbl_size = dparms->flow_db_num_entries + 1;
/* Allocate the function Id table */
flow_db->func_id_tbl = rte_zmalloc("bnxt_ulp_flow_db_func_id_table",
flow_db->func_id_tbl_size *
ulp_flow_db_res_params_to_info(fid_resource, params);
}
+ if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
+ params->resource_sub_type ==
+ BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT) {
+ /* Store the first HW counter ID for this table */
+ if (!ulp_fc_mgr_start_idx_isset(ulp_ctxt, params->direction))
+ ulp_fc_mgr_start_idx_set(ulp_ctxt, params->direction,
+ params->resource_hndl);
+
+ ulp_fc_mgr_cntr_set(ulp_ctxt, params->direction,
+ params->resource_hndl);
+
+ if (!ulp_fc_mgr_thread_isstarted(ulp_ctxt))
+ ulp_fc_mgr_thread_start(ulp_ctxt);
+ }
+
/* all good, return success */
return 0;
}
nxt_idx);
}
+ /* Now that the HW Flow counter resource is deleted, reset it's
+ * corresponding slot in the SW accumulation table in the Flow Counter
+ * manager
+ */
+ if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
+ params->resource_sub_type ==
+ BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT) {
+ ulp_fc_mgr_cntr_reset(ulp_ctxt, params->direction,
+ params->resource_hndl);
+ }
+
/* all good, return success */
return 0;
}
}
} else if (resource_func ==
- BNXT_ULP_RESOURCE_FUNC_EM_TABLE){
+ BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE ||
+ resource_func ==
+ BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE) {
*res_hndl = fid_res->resource_em_handle;
return 0;
}
int32_t
ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
uint32_t flow_id,
- uint32_t *cfa_action)
+ uint16_t *cfa_action)
{
- uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_ACT_IDX;
+ uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;
uint64_t hndl;
int32_t rc;
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)
+ if (res_func == BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE ||
+ res_func == BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE)
BNXT_TF_DBG(DEBUG, "EM Handle = 0x%016" PRIX64 "\n",
r->resource_em_handle);
else