diff options
author | hsandid <halsandi@cisco.com> | 2023-12-20 15:41:54 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2023-12-22 15:45:07 +0000 |
commit | 832342e3a4c25520ea95b4bac9402798832dfaf2 (patch) | |
tree | f5649e92c130af41fbd9962faa40b1076e8f3b43 /src/vpp | |
parent | ccc17f0a70918ae0f6e94037101718786702295c (diff) |
vlib: add error checks to thread pinning
Type: fix
Added error checks around pthread_setaffinity_np
calls to stop vpp launch if pinning fails.
Change-Id: Iec391c485d1832b6c2ff20fbf789608f6bcf7b57
Signed-off-by: hsandid <halsandi@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r-- | src/vpp/vnet/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c index be34228f01d..3257d9cda57 100644 --- a/src/vpp/vnet/main.c +++ b/src/vpp/vnet/main.c @@ -325,7 +325,13 @@ defaulted: { CPU_ZERO (&cpuset); CPU_SET (main_core, &cpuset); - pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); + if (pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), + &cpuset)) + { + clib_unix_error ( + "pthread_setaffinity_np() on cpu %d failed for main thread", + main_core); + } } /* Set up the plugin message ID allocator right now... */ |