From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by dpdk.org (Postfix) with ESMTP id CB3881B1A9 for ; Fri, 5 Jan 2018 14:58:13 +0100 (CET) Received: by mail-pl0-f67.google.com with SMTP id d21so3087742pll.1 for ; Fri, 05 Jan 2018 05:58:13 -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=6qZbPMq2jQCmSBcmWyZY8B+w5jiuu+lLyeZ8nDE5C0o=; b=UFewiSb5HU6Eer3PusYzXC7Y8AuhEdM7Syba8vAF4eERCA86Ffha7jFLhtx8utkdmX w89B/lFm7dO6uknBo/uOSNXkvId244B/gZNwSjwv3todL3ovDMa3jnKpax3VhcydWOWX MaNs9JkAASksHMJoHVmmTyxsN73r6uvoIZhkWjmCIn5RbII4bgcoC1R3tOPXPhoLrDuU 5wCLALDNlBRg1g+P3a0HzhtC/nVWJmgTdMAvu/H3eWooqc7hKfrApg+mG9TwS10ih1TE UwXKtel6NPRkgkKe+CRMnSnBvvnBkGDmapouCNwOXQ6ZTGltajAt+rbAIJPMaPGUWIkP FyXA== 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=6qZbPMq2jQCmSBcmWyZY8B+w5jiuu+lLyeZ8nDE5C0o=; b=YiZ7vQMUbvpbSu5GkKPvM9BQ62l5fPJ8+70deIcJLwoiwcNXuCJrI14SYQWdbSw9qc VY/vzGo3s3CbONSd7EEVCkmoQTSsvRUQBCtz+BkoMhMP6TWFrqt2cOtcL9nUY3AjLT4m sZrjDIGaO4vcIPJC7gnUh3wcd0f0/J42RbBe6fUQnrch3yP67KDbxt995+gmJHOJq13z J0kIPeKOneoNWKrRhP+sMUHUnlWeN4ktU34/t5VqVePwm4ugbB3IwWoj5p0pjmiyBmZt zOXf2KcGJf/vGR8WX1CNpPiPI2sGx1mryoW+gAIwYGkzxu1YzEn3/2lbhGBD1ne40Mid 5APQ== X-Gm-Message-State: AKGB3mLx7WptLIkv5c31vriFuFL603G8CzFu8AZ1KX9JpZH9rWiGU8zx GdMhAKj+fvK3IMqleHVAEUS5AFH3 X-Google-Smtp-Source: ACJfBouzm+SGsCPUxvNH2EApgU8rIbT3qcUx+mmJfm8NU6XoR/B54E5TyZsbFNSEJL6fV1fhdeIRHA== X-Received: by 10.84.232.136 with SMTP id i8mr3250711plk.323.1515160692993; Fri, 05 Jan 2018 05:58:12 -0800 (PST) Received: from local.opencloud.tech.localdomain ([183.240.196.56]) by smtp.gmail.com with ESMTPSA id z19sm12390783pfh.39.2018.01.05.05.58.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 05:58:12 -0800 (PST) From: Tonghao Zhang To: dev@dpdk.org Cc: Tonghao Zhang Date: Fri, 5 Jan 2018 05:57:56 -0800 Message-Id: <1515160676-4296-5-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515160676-4296-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1515160676-4296-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 13:58:14 -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 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