X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal_pci_vfio_mp_sync.c;h=d9188fdeee4cb6f6ca40bd86b9f874ab2e7831b7;hb=aa664f45cc744d28778656136d0883ccd15839d6;hp=fec7080504ed24e2a5f2d4356afaebc71d5ca48d;hpb=ff708facfcbf42f3dcb3c62d82ecd93e7b8c2506;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c index fec7080504..d9188fdeee 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c @@ -34,6 +34,7 @@ #include #include #include +#include /* sys/un.h with __USE_MISC uses strlen, which is unsafe */ #ifdef __USE_MISC @@ -54,6 +55,7 @@ #include "eal_filesystem.h" #include "eal_pci_init.h" +#include "eal_thread.h" /** * @file @@ -374,6 +376,7 @@ 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"); @@ -383,11 +386,19 @@ pci_vfio_mp_sync_setup(void) 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"); + 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 = rte_thread_setname(socket_thread, thread_name); + if (ret) + RTE_LOG(ERR, EAL, + "Failed to set thread name for secondary processes!\n"); + return 0; }