MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eth_dev_close

Function eth_dev_close

dpdk/drivers/net/vhost/rte_eth_vhost.c:1180–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180static int
1181eth_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
1226static int
1227eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,

Callers 1

rte_pmd_vhost_removeFunction · 0.70

Calls 8

rte_eal_process_typeFunction · 0.85
pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
rte_freeFunction · 0.85
eth_vhost_uninstall_intrFunction · 0.85
eth_dev_stopFunction · 0.70
find_internal_resourceFunction · 0.70

Tested by

no test coverage detected