From: Kishore Padmanabha Date: Fri, 12 Jun 2020 12:50:23 +0000 (+0530) Subject: net/bnxt: rename fields in device params structure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cd01ecffd8dd7b6422791d9889f4124d74335ecd;p=dpdk.git net/bnxt: rename fields in device params structure The fields in the device params structure are renamed to reflect the usage of those fields. Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Reviewed-by: Mike Baucom Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c index fd3f61b58b..0c3c638ce8 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c @@ -146,14 +146,14 @@ bnxt_init_tbl_scope_parms(struct bnxt *bp, params->rx_max_action_entry_sz_in_bits = BNXT_ULP_DFLT_RX_MAX_ACTN_ENTRY; params->rx_mem_size_in_mb = BNXT_ULP_DFLT_RX_MEM; - params->rx_num_flows_in_k = dparms->num_flows / (1024); + params->rx_num_flows_in_k = dparms->flow_db_num_entries / 1024; params->rx_tbl_if_id = BNXT_ULP_RX_TBL_IF_ID; params->tx_max_key_sz_in_bits = BNXT_ULP_DFLT_TX_MAX_KEY; params->tx_max_action_entry_sz_in_bits = BNXT_ULP_DFLT_TX_MAX_ACTN_ENTRY; params->tx_mem_size_in_mb = BNXT_ULP_DFLT_TX_MEM; - params->tx_num_flows_in_k = dparms->num_flows / (1024); + params->tx_num_flows_in_k = dparms->flow_db_num_entries / 1024; params->tx_tbl_if_id = BNXT_ULP_TX_TBL_IF_ID; } } @@ -299,11 +299,11 @@ ulp_dparms_init(struct bnxt *bp, } /* num_flows = max_num_kflows * 1024 */ - dparms->num_flows = bp->max_num_kflows * 1024; + dparms->flow_db_num_entries = bp->max_num_kflows * 1024; /* GFID = 2 * num_flows */ - dparms->gfid_entries = dparms->num_flows * 2; + dparms->mark_db_gfid_entries = dparms->flow_db_num_entries * 2; BNXT_TF_DBG(DEBUG, "Set the number of flows = %"PRIu64"\n", - dparms->num_flows); + dparms->flow_db_num_entries); return 0; } @@ -328,7 +328,7 @@ ulp_dparms_dev_port_intf_update(struct bnxt *bp, } /* Update the bp flag with gfid flag */ - if (dparms->global_fid_enable) + if (dparms->flow_mem_type == BNXT_ULP_FLOW_MEM_TYPE_EXT) bp->flags |= BNXT_FLAG_GFID_ENABLE; return 0; diff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c index fc4c4da9c1..22996e50e6 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c @@ -300,7 +300,7 @@ int32_t ulp_flow_db_init(struct bnxt_ulp_context *ulp_ctxt) /* 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); @@ -317,7 +317,7 @@ int32_t ulp_flow_db_init(struct bnxt_ulp_context *ulp_ctxt) 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 * diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 7b2b089209..734db7c6ce 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -1291,6 +1291,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms, struct tf_insert_em_entry_parms iparms = { 0 }; struct tf_delete_em_entry_parms free_parms = { 0 }; int32_t trc; + enum bnxt_ulp_flow_mem_type mtype = parms->device_params->flow_mem_type; int32_t rc = 0; kflds = ulp_mapper_key_fields_get(tbl, &num_kflds); @@ -1381,10 +1382,10 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms, } /* Mark action process */ - if (parms->device_params->global_fid_enable && + if (mtype == BNXT_ULP_FLOW_MEM_TYPE_EXT && tbl->resource_type == TF_MEM_EXTERNAL) rc = ulp_mapper_mark_gfid_process(parms, tbl, iparms.flow_id); - else if (!parms->device_params->global_fid_enable && + else if (mtype == BNXT_ULP_FLOW_MEM_TYPE_INT && tbl->resource_type == TF_MEM_INTERNAL) rc = ulp_mapper_mark_act_ptr_process(parms, tbl); if (rc) { diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c index 0c477680c4..89c08ab259 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c @@ -77,7 +77,7 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt) goto mem_error; /* Need to allocate 2 * Num flows to account for hash type bit.*/ - mark_tbl->lfid_num_entries = dparms->lfid_entries; + mark_tbl->lfid_num_entries = dparms->mark_db_lfid_entries; mark_tbl->lfid_tbl = rte_zmalloc("ulp_rx_em_flow_mark_table", mark_tbl->lfid_num_entries * sizeof(struct bnxt_lfid_mark_info), @@ -86,7 +86,7 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt) goto mem_error; /* Need to allocate 2 * Num flows to account for hash type bit */ - mark_tbl->gfid_num_entries = dparms->gfid_entries; + mark_tbl->gfid_num_entries = dparms->mark_db_gfid_entries; mark_tbl->gfid_tbl = rte_zmalloc("ulp_rx_eem_flow_mark_table", mark_tbl->gfid_num_entries * sizeof(struct bnxt_gfid_mark_info), diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h index 5376245772..50a28afc57 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h @@ -139,6 +139,13 @@ enum bnxt_ulp_direction { BNXT_ULP_DIRECTION_LAST = 2 }; +enum bnxt_ulp_flow_mem_type { + BNXT_ULP_FLOW_MEM_TYPE_INT = 0, + BNXT_ULP_FLOW_MEM_TYPE_EXT = 1, + BNXT_ULP_FLOW_MEM_TYPE_BOTH = 2, + BNXT_ULP_FLOW_MEM_TYPE_LAST = 3 +}; + enum bnxt_ulp_glb_regfile_index { BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID = 0, BNXT_ULP_GLB_REGFILE_INDEX_LAST = 1 diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c index 34ad51209b..7d3a30e5a4 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c @@ -313,15 +313,16 @@ struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[] = { struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { [BNXT_ULP_DEVICE_ID_WH_PLUS] = { - .global_fid_enable = BNXT_ULP_SYM_YES, - .byte_order = BNXT_ULP_BYTE_ORDER_LE, - .encap_byte_swap = 1, - .lfid_entries = 16384, - .lfid_entry_size = 4, - .gfid_entries = 65536, - .gfid_entry_size = 4, - .num_flows = 32768, - .num_resources_per_flow = 8 + .description = "Whitney_Plus", + .flow_mem_type = BNXT_ULP_FLOW_MEM_TYPE_EXT, + .byte_order = BNXT_ULP_BYTE_ORDER_LE, + .encap_byte_swap = 1, + .flow_db_num_entries = 32768, + .mark_db_lfid_entries = 65536, + .mark_db_gfid_entries = 65536, + .flow_count_db_entries = 16384, + .num_resources_per_flow = 8, + .num_phy_ports = 2 } }; diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 5d11a7ec46..5c4335847d 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -137,14 +137,14 @@ extern struct bnxt_ulp_act_match_info ulp_act_match_list[]; /* Device specific parameters */ struct bnxt_ulp_device_params { uint8_t description[16]; - uint32_t global_fid_enable; + enum bnxt_ulp_flow_mem_type flow_mem_type; enum bnxt_ulp_byte_order byte_order; uint8_t encap_byte_swap; - uint32_t lfid_entries; - uint32_t lfid_entry_size; - uint64_t gfid_entries; - uint32_t gfid_entry_size; - uint64_t num_flows; + uint8_t num_phy_ports; + uint32_t mark_db_lfid_entries; + uint64_t mark_db_gfid_entries; + uint64_t flow_db_num_entries; + uint32_t flow_count_db_entries; uint32_t num_resources_per_flow; };