| 4499 | } |
| 4500 | |
| 4501 | void |
| 4502 | ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx) |
| 4503 | { |
| 4504 | struct bnxt_ulp_mapper_data *data; |
| 4505 | struct tf *tfp; |
| 4506 | |
| 4507 | if (!ulp_ctx) { |
| 4508 | BNXT_TF_DBG(ERR, |
| 4509 | "Failed to acquire ulp context, so data may not be released.\n"); |
| 4510 | return; |
| 4511 | } |
| 4512 | |
| 4513 | data = (struct bnxt_ulp_mapper_data *) |
| 4514 | bnxt_ulp_cntxt_ptr2_mapper_data_get(ulp_ctx); |
| 4515 | if (!data) { |
| 4516 | /* Go ahead and return since there is no allocated data. */ |
| 4517 | BNXT_TF_DBG(ERR, "No data appears to have been allocated.\n"); |
| 4518 | return; |
| 4519 | } |
| 4520 | |
| 4521 | tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SESSION_TYPE_DEFAULT); |
| 4522 | if (!tfp) { |
| 4523 | BNXT_TF_DBG(ERR, "Failed to acquire tfp.\n"); |
| 4524 | /* Free the mapper data regardless of errors. */ |
| 4525 | goto free_mapper_data; |
| 4526 | } |
| 4527 | |
| 4528 | /* Free the global resource info table entries */ |
| 4529 | ulp_mapper_glb_resource_info_deinit(ulp_ctx, data); |
| 4530 | |
| 4531 | free_mapper_data: |
| 4532 | /* Free the generic table */ |
| 4533 | (void)ulp_mapper_generic_tbl_list_deinit(data); |
| 4534 | |
| 4535 | rte_free(data); |
| 4536 | /* Reset the data pointer within the ulp_ctx. */ |
| 4537 | bnxt_ulp_cntxt_ptr2_mapper_data_set(ulp_ctx, NULL); |
| 4538 | } |
no test coverage detected