| 127 | } |
| 128 | |
| 129 | int |
| 130 | ml_test_device_configure(struct ml_test *test, struct ml_options *opt) |
| 131 | { |
| 132 | struct test_common *t = ml_test_priv(test); |
| 133 | struct rte_ml_dev_config dev_config; |
| 134 | int ret; |
| 135 | |
| 136 | ret = rte_ml_dev_info_get(opt->dev_id, &t->dev_info); |
| 137 | if (ret != 0) { |
| 138 | ml_err("Failed to get mldev info, dev_id = %d\n", opt->dev_id); |
| 139 | return ret; |
| 140 | } |
| 141 | |
| 142 | /* configure device */ |
| 143 | dev_config.socket_id = opt->socket_id; |
| 144 | dev_config.nb_models = t->dev_info.max_models; |
| 145 | dev_config.nb_queue_pairs = opt->queue_pairs; |
| 146 | ret = rte_ml_dev_configure(opt->dev_id, &dev_config); |
| 147 | if (ret != 0) { |
| 148 | ml_err("Failed to configure ml device, dev_id = %d\n", opt->dev_id); |
| 149 | return ret; |
| 150 | } |
| 151 | |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | int |
| 156 | ml_test_device_close(struct ml_test *test, struct ml_options *opt) |
no test coverage detected