eal: set name when creating a control thread
[dpdk.git] / lib / librte_vhost / socket.c
index db9be6a..4a561ad 100644 (file)
@@ -467,7 +467,6 @@ static int
 vhost_user_reconnect_init(void)
 {
        int ret;
-       char thread_name[RTE_MAX_THREAD_NAME_LEN];
 
        ret = pthread_mutex_init(&reconn_list.mutex, NULL);
        if (ret < 0) {
@@ -476,7 +475,7 @@ vhost_user_reconnect_init(void)
        }
        TAILQ_INIT(&reconn_list.head);
 
-       ret = rte_ctrl_thread_create(&reconn_tid, NULL,
+       ret = rte_ctrl_thread_create(&reconn_tid, "vhost_reconn", NULL,
                             vhost_user_client_reconnect, NULL);
        if (ret != 0) {
                RTE_LOG(ERR, VHOST_CONFIG, "failed to create reconnect thread");
@@ -484,14 +483,6 @@ vhost_user_reconnect_init(void)
                        RTE_LOG(ERR, VHOST_CONFIG,
                                "failed to destroy reconnect mutex");
                }
-       } else {
-               snprintf(thread_name, sizeof(thread_name),
-                        "vhost-reconn");
-
-               if (rte_thread_setname(reconn_tid, thread_name)) {
-                       RTE_LOG(DEBUG, VHOST_CONFIG,
-                               "failed to set reconnect thread name");
-               }
        }
 
        return ret;
@@ -1000,7 +991,6 @@ rte_vhost_driver_start(const char *path)
 {
        struct vhost_user_socket *vsocket;
        static pthread_t fdset_tid;
-       char thread_name[RTE_MAX_THREAD_NAME_LEN];
 
        pthread_mutex_lock(&vhost_user.mutex);
        vsocket = find_vhost_user_socket(path);
@@ -1020,22 +1010,15 @@ rte_vhost_driver_start(const char *path)
                        return -1;
                }
 
-               int ret = rte_ctrl_thread_create(&fdset_tid, NULL,
-                       fdset_event_dispatch, &vhost_user.fdset);
+               int ret = rte_ctrl_thread_create(&fdset_tid,
+                       "vhost-events", NULL, fdset_event_dispatch,
+                       &vhost_user.fdset);
                if (ret != 0) {
                        RTE_LOG(ERR, VHOST_CONFIG,
                                "failed to create fdset handling thread");
 
                        fdset_pipe_uninit(&vhost_user.fdset);
                        return -1;
-               } else {
-                       snprintf(thread_name, sizeof(thread_name),
-                                "vhost-events");
-
-                       if (rte_thread_setname(fdset_tid, thread_name)) {
-                               RTE_LOG(DEBUG, VHOST_CONFIG,
-                                       "failed to set vhost-event thread name");
-                       }
                }
        }