From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH v3 1/2] eal: fix potential incorrect pinning for ctrl threads Date: Tue, 19 Feb 2019 21:41:10 +0100 Message-ID: <1550608871-5251-1-git-send-email-david.marchand@redhat.com> References: <1550151042-9764-1-git-send-email-david.marchand@redhat.com> Cc: olivier.matz@6wind.com, anatoly.burakov@intel.com, ktraynor@redhat.com, stable@dpdk.org To: dev@dpdk.org Return-path: In-Reply-To: <1550151042-9764-1-git-send-email-david.marchand@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- Changelog since v2: - added missing Cc: stable@dpdk.org --- lib/librte_eal/common/eal_common_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c index 48ef4d6..a3985ce 100644 --- a/lib/librte_eal/common/eal_common_thread.c +++ b/lib/librte_eal/common/eal_common_thread.c @@ -209,7 +209,7 @@ static void *rte_thread_init(void *arg) 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(¶ms->configured); -- 1.8.3.1