X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fvhost%2Frte_eth_vhost.c;h=65c5ef2021af603291bfc090e0f926e7207ef261;hb=af14759181240120f76c82f894982e8f33f0ba2a;hp=34c241dd02783c1fc50c99da05914fe28ead2e0d;hpb=52f8091f05ff8e30ecfd2b26cfb4b364741feda1;p=dpdk.git diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 34c241dd02..65c5ef2021 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -128,9 +128,6 @@ static struct internal_list_head internal_list = static pthread_mutex_t internal_list_lock = PTHREAD_MUTEX_INITIALIZER; -static rte_atomic16_t nb_started_ports; -static pthread_t session_th; - static struct rte_eth_link pmd_link = { .link_speed = 10000, .link_duplex = ETH_LINK_FULL_DUPLEX, @@ -769,42 +766,6 @@ rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) return vid; } -static void * -vhost_driver_session(void *param __rte_unused) -{ - /* start event handling */ - rte_vhost_driver_session_start(); - - return NULL; -} - -static int -vhost_driver_session_start(void) -{ - int ret; - - ret = pthread_create(&session_th, - NULL, vhost_driver_session, NULL); - if (ret) - RTE_LOG(ERR, PMD, "Can't create a thread\n"); - - return ret; -} - -static void -vhost_driver_session_stop(void) -{ - int ret; - - ret = pthread_cancel(session_th); - if (ret) - RTE_LOG(ERR, PMD, "Can't cancel the thread\n"); - - ret = pthread_join(session_th, NULL); - if (ret) - RTE_LOG(ERR, PMD, "Can't join the thread\n"); -} - static int eth_dev_start(struct rte_eth_dev *dev) { @@ -1120,10 +1081,10 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues, goto error; } - /* We need only one message handling thread */ - if (rte_atomic16_add_return(&nb_started_ports, 1) == 1) { - if (vhost_driver_session_start()) - goto error; + if (rte_vhost_driver_start(iface_name) < 0) { + RTE_LOG(ERR, PMD, "Failed to start driver for %s\n", + iface_name); + goto error; } return data->port_id; @@ -1250,9 +1211,6 @@ rte_pmd_vhost_remove(const char *name) eth_dev_close(eth_dev); - if (rte_atomic16_sub_return(&nb_started_ports, 1) == 0) - vhost_driver_session_stop(); - rte_free(vring_states[eth_dev->data->port_id]); vring_states[eth_dev->data->port_id] = NULL;