| 56 | } |
| 57 | |
| 58 | int |
| 59 | ml_model_unload(struct ml_test *test, struct ml_options *opt, struct ml_model *model, uint16_t fid) |
| 60 | { |
| 61 | struct test_common *t = ml_test_priv(test); |
| 62 | int ret; |
| 63 | |
| 64 | RTE_SET_USED(t); |
| 65 | |
| 66 | if (model->state == MODEL_INITIAL) |
| 67 | return 0; |
| 68 | |
| 69 | if (model->state != MODEL_LOADED) |
| 70 | return -EINVAL; |
| 71 | |
| 72 | /* unload model */ |
| 73 | ret = rte_ml_model_unload(opt->dev_id, model->id); |
| 74 | if (ret != 0) { |
| 75 | ml_err("Failed to unload model: %s\n", opt->filelist[fid].model); |
| 76 | model->state = MODEL_ERROR; |
| 77 | return ret; |
| 78 | } |
| 79 | |
| 80 | model->state = MODEL_INITIAL; |
| 81 | |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | int |
| 86 | ml_model_start(struct ml_test *test, struct ml_options *opt, struct ml_model *model, uint16_t fid) |
no test coverage detected