From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 94CC81B1B6 for ; Wed, 24 Jan 2018 16:40:49 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BFFB2226BA; Wed, 24 Jan 2018 10:40:48 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fudb6SsQpdMSqZjmn 7qDc1qrO0MU1BmT7MnPEIVNrbc=; b=cb5wRRQ18JsMckZ9/hJIHr+ljuzLXvdSz /Mi2n6CJtXUOg3DBjfAyX6Kk+kR3rOvzFVvQYmztWC4bbdMFHaEQXfgM8hrgQIfi /eOwNnCkI8yDaETgwGtRuUdRBi7GlgYVdJGupkfP7UBxie5gkSCEKCEpcdXWUFgV cL287b5rdheOK5IBGOb003SRFNz5EHhQ2OhgABngMe5ycmN4UZwvcORyZidoa8HR HFZbh1G6XGinQkvOjY8b0CJNun/ooFzQLkN8spz6i0SZX8bL663jbA69Qtkm8gDD T424dyz22YaNCBtWYWqYsnAp0F1qRYLZc82D9DnBacGNs6nQ6e/Ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=fudb6SsQpdMSqZjmn7qDc1qrO0MU1BmT7MnPEIVNrbc=; b=gT0lQPEj G7SvU/f/ox52pIAGq4E3bfOcX/XxY5LtjjR1apoBEW/J4oZuy2dgpjMfnV83QcxG jTYZ7Nv+91WG2wxG0ea1Z+0QU7Q2HYxj8Z00YKxfQmFcS+IvGVIcw7UxT0aRC3xy 4h0Tunn5400t6YblhXh8EcauVfW23VsMdBxmQV1XSxIAh97fI+CDg4WK8LoPnch4 YnwEjVMwhfcK5UuU7t4cHCsH577aO48ge/hkh5P206p7VPh494dNIsSFYXVh7fk8 C6Qx3C8pqlXpfduoVjqi6oCalSZnO3m2rR8+z2h0xs+DiaGwQ6Vgn2WsaCk8+HVG MnpPHyxaF/EYgA== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 04EE87E354; Wed, 24 Jan 2018 10:40:45 -0500 (EST) From: Yuanhan Liu To: Olivier Matz Cc: Maxime Coquelin , Jens Freimann , dpdk stable Date: Wed, 24 Jan 2018 23:32:58 +0800 Message-Id: <1516808026-25523-110-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'vhost: fix error code check when creating thread' has been queued to LTS release 17.11.1 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: Wed, 24 Jan 2018 15:40:49 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 12c0a0276118fa3db7cc8d9329eb024a29fa2f5c Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 8 Dec 2017 11:19:49 +0100 Subject: [PATCH] vhost: fix error code check when creating thread [ upstream commit da51d2f6b8b652da8eb9d4b50df4f3f5a24b656f ] On error, pthread_create() returns a positive number (errno). Fix the test on the return value. Fixes: af1475918124 ("vhost: introduce API to start a specific driver") Fixes: e623e0c6d8a5 ("vhost: add reconnect ability") Signed-off-by: Olivier Matz Reviewed-by: Maxime Coquelin Reviewed-by: Jens Freimann --- lib/librte_vhost/socket.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 422da00..811e6bf 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -472,7 +472,7 @@ vhost_user_reconnect_init(void) ret = pthread_create(&reconn_tid, NULL, vhost_user_client_reconnect, NULL); - if (ret < 0) { + if (ret != 0) { RTE_LOG(ERR, VHOST_CONFIG, "failed to create reconnect thread"); if (pthread_mutex_destroy(&reconn_list.mutex)) { RTE_LOG(ERR, VHOST_CONFIG, @@ -678,9 +678,8 @@ rte_vhost_driver_register(const char *path, uint64_t flags) if ((flags & RTE_VHOST_USER_CLIENT) != 0) { vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT); if (vsocket->reconnect && reconn_tid == 0) { - if (vhost_user_reconnect_init() < 0) { + if (vhost_user_reconnect_init() != 0) goto out_mutex; - } } } else { vsocket->is_server = true; @@ -837,7 +836,7 @@ rte_vhost_driver_start(const char *path) if (fdset_tid == 0) { int ret = pthread_create(&fdset_tid, NULL, fdset_event_dispatch, &vhost_user.fdset); - if (ret < 0) + if (ret != 0) RTE_LOG(ERR, VHOST_CONFIG, "failed to create fdset handling thread"); } -- 2.7.4