/* * set up a local socket and tell it to listen for incoming connections */ int pci_vfio_mp_sync_setup(void) { int ret; char thread_name[RTE_MAX_THREAD_NAME_LEN]; if (vfio_mp_sync_socket_setup() < 0) { RTE_LOG(ERR, EAL, "Failed to set up local socket!\n"); return -1; } ret = pthread_create(&socket_thread, NULL, pci_vfio_mp_sync_thread, NULL); if (ret) { RTE_LOG(ERR, EAL, "Failed to create thread for communication with secondary processes!\n"); close(mp_socket_fd); return -1; } /* Set thread_name for aid in debugging. */ snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, "pci-vfio-sync"); ret = pthread_setname_np(socket_thread, thread_name); if (ret) RTE_LOG(ERR, EAL, "Failed to set thread name for secondary processes!\n"); return 0; }
/* * set up a local socket and tell it to listen for incoming connections */ int pci_vfio_mp_sync_setup(void) { int ret; if (vfio_mp_sync_socket_setup() < 0) { RTE_LOG(ERR, EAL, "Failed to set up local socket!\n"); return -1; } ret = pthread_create(&socket_thread, NULL, pci_vfio_mp_sync_thread, NULL); if (ret) { RTE_LOG(ERR, EAL, "Failed to create thread for communication with " "secondary processes!\n"); close(mp_socket_fd); return -1; } return 0; }