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;
}
}
}
/* 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;
}
}
/* 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;
/* 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 *
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);
}
/* 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) {
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),
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),
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
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
}
};
/* 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;
};