| 1178 | } |
| 1179 | |
| 1180 | static int |
| 1181 | eth_dev_close(struct rte_eth_dev *dev) |
| 1182 | { |
| 1183 | struct pmd_internal *internal; |
| 1184 | struct internal_list *list; |
| 1185 | unsigned int i, ret; |
| 1186 | |
| 1187 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 1188 | return 0; |
| 1189 | |
| 1190 | internal = dev->data->dev_private; |
| 1191 | if (!internal) |
| 1192 | return 0; |
| 1193 | |
| 1194 | ret = eth_dev_stop(dev); |
| 1195 | |
| 1196 | list = find_internal_resource(internal->iface_name); |
| 1197 | if (list) { |
| 1198 | rte_vhost_driver_unregister(internal->iface_name); |
| 1199 | pthread_mutex_lock(&internal_list_lock); |
| 1200 | TAILQ_REMOVE(&internal_list, list, next); |
| 1201 | pthread_mutex_unlock(&internal_list_lock); |
| 1202 | rte_free(list); |
| 1203 | } |
| 1204 | |
| 1205 | if (dev->data->rx_queues) |
| 1206 | for (i = 0; i < dev->data->nb_rx_queues; i++) |
| 1207 | rte_free(dev->data->rx_queues[i]); |
| 1208 | |
| 1209 | if (dev->data->tx_queues) |
| 1210 | for (i = 0; i < dev->data->nb_tx_queues; i++) |
| 1211 | rte_free(dev->data->tx_queues[i]); |
| 1212 | |
| 1213 | rte_free(internal->iface_name); |
| 1214 | rte_free(internal); |
| 1215 | |
| 1216 | eth_vhost_uninstall_intr(dev); |
| 1217 | |
| 1218 | dev->data->dev_private = NULL; |
| 1219 | |
| 1220 | rte_free(vring_states[dev->data->port_id]); |
| 1221 | vring_states[dev->data->port_id] = NULL; |
| 1222 | |
| 1223 | return ret; |
| 1224 | } |
| 1225 | |
| 1226 | static int |
| 1227 | eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, |
no test coverage detected