eal: fix control threads pinnning
authorDavid Marchand <david.marchand@redhat.com>
Tue, 19 Feb 2019 20:41:10 +0000 (21:41 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 7 Mar 2019 18:13:48 +0000 (19:13 +0100)
pthread_setaffinity_np returns a >0 value on error.
We could end up letting the ctrl threads on the current process cpu
affinity.

Fixes: d651ee4919cd ("eal: set affinity for control threads")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/common/eal_common_thread.c

index 48ef4d6..a3985ce 100644 (file)
@@ -209,7 +209,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name,
                CPU_SET(rte_get_master_lcore(), &cpuset);
 
        ret = pthread_setaffinity_np(*thread, sizeof(cpuset), &cpuset);
-       if (ret < 0)
+       if (ret)
                goto fail;
 
        ret = pthread_barrier_wait(&params->configured);