From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 683C091; Thu, 14 Feb 2019 14:31:03 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B9682F9457; Thu, 14 Feb 2019 13:31:02 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-16.brq.redhat.com [10.40.204.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33DC410021B6; Thu, 14 Feb 2019 13:30:46 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, anatoly.burakov@intel.com, ktraynor@redhat.com, stable@dpdk.org Date: Thu, 14 Feb 2019 14:30:41 +0100 Message-Id: <1550151042-9764-1-git-send-email-david.marchand@redhat.com> In-Reply-To: <1550074412-31285-1-git-send-email-david.marchand@redhat.com> References: <1550074412-31285-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 14 Feb 2019 13:31:02 +0000 (UTC) Subject: [dpdk-stable] [PATCH v2 1/2] eal: fix potential incorrect pinning for ctrl threads X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2019 13:31:03 -0000 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") Signed-off-by: David Marchand --- 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