From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by dpdk.org (Postfix) with ESMTP id 4EF651B1B6 for ; Fri, 5 Jan 2018 15:12:03 +0100 (CET) Received: by mail-pf0-f193.google.com with SMTP id y89so2230571pfk.0 for ; Fri, 05 Jan 2018 06:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3GmAaWhtrRZJnA+QV5B6RjI09NwekV4fW6QDPlAvXMo=; b=SItYptd2ndRCW5mQukgqnR7X/73rTZ93LF1QU7HhOCm3AOUWwlKQDgubBMDRaoVkpx I8qMP6Mez65Tx1lywOhNlMT5zpoJlN5eaVN4xrHxY4F1kmS1XSUdMcleGcN4S6e8oGt7 aHO97RJ72JgjIkoQaVKHC/n9vgRx2x5NSWeTepMFBzfFPwthWdyrV+HfY5ZW6MG8I5Bp 7M5ADUGwMQHQY59kPPiPqeWDrGj8jbza4kHrv9fqVzKbaTSeuZihfFsJDB4dwYNg6dRN 7FcMgRuPHwx3fMYKJTq7uMRiiu4Nv8IcMVfxP2GTU2hAtDJqfTXAyWqv2r4aDNNP5RHa wrAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3GmAaWhtrRZJnA+QV5B6RjI09NwekV4fW6QDPlAvXMo=; b=DYWuGA2w5iowjeJznX0cQ5cnchIqHR4UncLyaqMwsyLlNhFMux9+du8LrO9B1kiONN Ylz5KQmOaeyc6MDnzDrdBJdS6ehTBvuIy7fdsOfUHLONohqdUsYP9VoZN8jgaMRdBYXv Y7zDPgXADJheIqC4URLgyxeMK8XvICmkQMaLSx9VlQaR3gx9rSpaZFDiLu6pWlPNwH+G W7CtjxOWMG1RZ5M4NDI2hOknFepEnTNzTPh9dvUy7RcSAt5lV201ZG6Ah/5RC1p57KTP Y6t0d4cc0XtvcDB4GRJ7+I2Lrmtk3tDafo7kLgOCDU6aCdXj2MGss+xsa6D6W/Iw6WFC By/Q== X-Gm-Message-State: AKGB3mLzaL56QM4BBACGHBvzHUgbz6I7RPZBuuKLMM1jvTTw4UXkoJpT AYA4pCAkDcidtiad7wZQrRIPe3dgZiA= X-Google-Smtp-Source: ACJfBouq2IyHejBRv1vwTTQuCqzAe1I55rhu7Go9M5YPIGgwJU+GyW+FXsfVSjjNAoA1LJihayUqGA== X-Received: by 10.101.72.197 with SMTP id o5mr2625139pgs.298.1515161522493; Fri, 05 Jan 2018 06:12:02 -0800 (PST) Received: from local.opencloud.tech.localdomain ([219.147.95.160]) by smtp.gmail.com with ESMTPSA id w19sm12990407pfa.127.2018.01.05.06.12.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 06:12:01 -0800 (PST) From: Tonghao Zhang To: dev@dpdk.org Cc: Tonghao Zhang Date: Fri, 5 Jan 2018 06:10:39 -0800 Message-Id: <1515161439-4792-5-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515161439-4792-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1515161439-4792-1-git-send-email-xiangxia.m.yue@gmail.com> Subject: [dpdk-dev] [PATCH 5/5] vhost: add reconnect thread name for client mode. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2018 14:12:03 -0000 This patch adds the name for vhost-user reconnect thread. It can help us to know whether the thread is running. Signed-off-by: Tonghao Zhang --- lib/librte_vhost/socket.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index d44a0f1..c2e34e0 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -433,6 +433,7 @@ struct vhost_user_reconnect_list { vhost_user_reconnect_init(void) { int ret; + char thread_name[RTE_MAX_THREAD_NAME_LEN]; ret = pthread_mutex_init(&reconn_list.mutex, NULL); if (ret < 0) { @@ -449,6 +450,13 @@ struct vhost_user_reconnect_list { RTE_LOG(ERR, VHOST_CONFIG, "failed to destroy reconnect mutex"); } + } else { + snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, + "vhost-reconn"); + + if (rte_thread_setname(reconn_tid, thread_name)) + RTE_LOG(DEBUG, VHOST_CONFIG, + "Failed to set thread name for vhost-user reconnect"); } return ret; -- 1.8.3.1