DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <thomas@monjalon.net>,
	<david.marchand@redhat.com>, <shepard.siegel@atomicrules.com>,
	<qiming.yang@intel.com>, <rosen.xu@intel.com>,
	<john.mcnamara@intel.com>, <ciara.power@intel.com>,
	<maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH v2 3/7] vdpa/ifc: support set notify and vring relay thread name
Date: Sat, 17 Apr 2021 17:09:44 +0800	[thread overview]
Message-ID: <1618650588-34268-4-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1618650588-34268-1-git-send-email-humin29@huawei.com>

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set notify and vring relay thread name which is
helpful for debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 7a06f97..1dc813d 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -37,6 +37,8 @@ RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
 #define IFCVF_VDPA_MODE		"vdpa"
 #define IFCVF_SW_FALLBACK_LM	"sw-live-migration"
 
+#define THREAD_NAME_LEN	16
+
 static const char * const ifcvf_valid_arguments[] = {
 	IFCVF_VDPA_MODE,
 	IFCVF_SW_FALLBACK_LM,
@@ -494,14 +496,17 @@ notify_relay(void *arg)
 static int
 setup_notify_relay(struct ifcvf_internal *internal)
 {
+	char name[THREAD_NAME_LEN];
 	int ret;
 
-	ret = pthread_create(&internal->tid, NULL, notify_relay,
-			(void *)internal);
-	if (ret) {
+	snprintf(name, sizeof(name), "ifc-notify-%d", internal->vid);
+	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, notify_relay,
+				     (void *)internal);
+	if (ret != 0) {
 		DRV_LOG(ERR, "failed to create notify relay pthread.");
 		return -1;
 	}
+
 	return 0;
 }
 
@@ -797,14 +802,17 @@ vring_relay(void *arg)
 static int
 setup_vring_relay(struct ifcvf_internal *internal)
 {
+	char name[THREAD_NAME_LEN];
 	int ret;
 
-	ret = pthread_create(&internal->tid, NULL, vring_relay,
-			(void *)internal);
-	if (ret) {
+	snprintf(name, sizeof(name), "ifc-vring-%d", internal->vid);
+	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, vring_relay,
+				     (void *)internal);
+	if (ret != 0) {
 		DRV_LOG(ERR, "failed to create ring relay pthread.");
 		return -1;
 	}
+
 	return 0;
 }
 
-- 
2.7.4


  parent reply	other threads:[~2021-04-17  9:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 1/7] net/ark: " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 2/7] net/ice: support set VSI reset " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 3/7] vdpa/ifc: support set notify and vring relay " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 5/7] examples/performance-thread: support set " Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 6/7] telemetry: support set init threads name Min Hu (Connor)
2021-04-10 10:40 ` [dpdk-dev] [PATCH 7/7] examples/vhost_blk: support set ctrl worker thread name Min Hu (Connor)
2021-04-12  7:19 ` [dpdk-dev] [PATCH 0/7] support set " David Marchand
2021-04-12 14:26   ` Power, Ciara
2021-04-13  1:12   ` Min Hu (Connor)
2021-04-16 18:40     ` Thomas Monjalon
2021-04-17  6:15       ` Min Hu (Connor)
2021-04-13  1:20   ` fengchengwen
2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 1/7] net/ark: " Min Hu (Connor)
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 2/7] net/ice: support set VSI reset " Min Hu (Connor)
2021-04-17  9:09   ` Min Hu (Connor) [this message]
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 5/7] examples/performance-thread: support set " Min Hu (Connor)
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 6/7] telemetry: support set init threads name Min Hu (Connor)
2021-04-21 10:39     ` Bruce Richardson
2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 7/7] examples/vhost_blk: support set ctrl worker thread name Min Hu (Connor)
2021-04-21 13:58   ` [dpdk-dev] [PATCH v2 0/7] support set " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618650588-34268-4-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=ciara.power@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=qiming.yang@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=shepard.siegel@atomicrules.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).