The function to initialize ulp dparms with devargs */
| 1185 | |
| 1186 | /* The function to initialize ulp dparms with devargs */ |
| 1187 | static int32_t |
| 1188 | ulp_dparms_init(struct bnxt *bp, struct bnxt_ulp_context *ulp_ctx) |
| 1189 | { |
| 1190 | struct bnxt_ulp_device_params *dparms; |
| 1191 | uint32_t dev_id = BNXT_ULP_DEVICE_ID_LAST; |
| 1192 | |
| 1193 | if (!bp->max_num_kflows) { |
| 1194 | /* Defaults to Internal */ |
| 1195 | bnxt_ulp_cntxt_mem_type_set(ulp_ctx, |
| 1196 | BNXT_ULP_FLOW_MEM_TYPE_INT); |
| 1197 | return 0; |
| 1198 | } |
| 1199 | |
| 1200 | /* The max_num_kflows were set, so move to external */ |
| 1201 | if (bnxt_ulp_cntxt_mem_type_set(ulp_ctx, BNXT_ULP_FLOW_MEM_TYPE_EXT)) |
| 1202 | return -EINVAL; |
| 1203 | |
| 1204 | if (bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id)) { |
| 1205 | BNXT_TF_DBG(DEBUG, "Failed to get device id\n"); |
| 1206 | return -EINVAL; |
| 1207 | } |
| 1208 | |
| 1209 | dparms = bnxt_ulp_device_params_get(dev_id); |
| 1210 | if (!dparms) { |
| 1211 | BNXT_TF_DBG(DEBUG, "Failed to get device parms\n"); |
| 1212 | return -EINVAL; |
| 1213 | } |
| 1214 | |
| 1215 | /* num_flows = max_num_kflows * 1024 */ |
| 1216 | dparms->ext_flow_db_num_entries = bp->max_num_kflows * 1024; |
| 1217 | /* GFID = 2 * num_flows */ |
| 1218 | dparms->mark_db_gfid_entries = dparms->ext_flow_db_num_entries * 2; |
| 1219 | BNXT_TF_DBG(DEBUG, "Set the number of flows = %" PRIu64 "\n", |
| 1220 | dparms->ext_flow_db_num_entries); |
| 1221 | |
| 1222 | return 0; |
| 1223 | } |
| 1224 | |
| 1225 | /* The function to initialize bp flags with truflow features */ |
| 1226 | static int32_t |
no test coverage detected