X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_flow_db.c;h=7144517409e7b530f21754eb9aa854d077d5ca81;hb=f6194540cf8c47738041c151430e42cffde4af7e;hp=7696de2a54b9799b1e5a1cade39cc6764ad6d452;hpb=bbc5f1a0f5e9718276314a55cec52ae4b215b909;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c index 7696de2a54..7144517409 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c @@ -10,6 +10,7 @@ #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 @@ -484,6 +485,21 @@ int32_t ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt, 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; } @@ -574,6 +590,17 @@ int32_t ulp_flow_db_resource_del(struct bnxt_ulp_context *ulp_ctxt, 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; } @@ -935,7 +962,7 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx, 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_CFA_ACTION; uint64_t hndl;