DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/7] support set thread name
@ 2021-04-10 10:40 Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 1/7] net/ark: " Min Hu (Connor)
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

This set of patches support set thread name for debugging.

Chengwen Feng (7):
  net/ark: support set thread name
  net/ice: support set VSI reset thread name
  vdpa/ifc: support set notify and vring relay thread name
  raw/ifpga: support set monitor thread name
  examples/performance-thread: support set thread name
  telemetry: support set init threads name
  examples/vhost_blk: support set ctrl worker thread name

 drivers/net/ark/ark_ethdev.c                    |  1 +
 drivers/net/ice/ice_dcf_parent.c                |  5 +++++
 drivers/raw/ifpga/ifpga_rawdev.c                |  1 +
 drivers/vdpa/ifc/ifcvf_vdpa.c                   | 12 ++++++++++++
 examples/performance-thread/pthread_shim/main.c |  5 +++++
 examples/vhost_blk/vhost_blk.c                  |  1 +
 lib/librte_telemetry/telemetry.c                |  3 ++-
 7 files changed, 27 insertions(+), 1 deletion(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 1/7] net/ark: support set thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
@ 2021-04-10 10:40 ` Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 2/7] net/ice: support set VSI reset " Min Hu (Connor)
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set delay packet generator start 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/net/ark/ark_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 9dea5fa..d62a869 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -574,6 +574,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
 				    "starter thread\n");
 			return -1;
 		}
+		rte_thread_setname(thread, "ark-delay-pg");
 	}
 
 	if (ark->user_ext.dev_start)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 2/7] net/ice: support set VSI reset thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 1/7] net/ark: " Min Hu (Connor)
@ 2021-04-10 10:40 ` Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 3/7] vdpa/ifc: support set notify and vring relay " Min Hu (Connor)
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set VSI reset 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/net/ice/ice_dcf_parent.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index a8571b3..86aa32b 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -151,7 +151,9 @@ ice_dcf_vsi_update_service_handler(void *param)
 static void
 start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 {
+#define THREAD_NAME_LEN	16
 	struct ice_dcf_reset_event_param *param;
+	char name[THREAD_NAME_LEN];
 	pthread_t thread;
 	int ret;
 
@@ -171,6 +173,9 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 		PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
 		free(param);
 	}
+
+	snprintf(name, sizeof(name), "ice-reset-%u", vf_id);
+	rte_thread_setname(thread, name);
 }
 
 void
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 3/7] vdpa/ifc: support set notify and vring relay thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name 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 ` Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

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 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 39237ae..8a5efa9 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.net.ifcvf_vdpa, 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,6 +496,7 @@ 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,
@@ -502,6 +505,10 @@ setup_notify_relay(struct ifcvf_internal *internal)
 		DRV_LOG(ERR, "failed to create notify relay pthread.");
 		return -1;
 	}
+
+	snprintf(name, sizeof(name), "ifc-notify-%d", internal->vid);
+	rte_thread_setname(internal->tid, name);
+
 	return 0;
 }
 
@@ -797,6 +804,7 @@ 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,
@@ -805,6 +813,10 @@ setup_vring_relay(struct ifcvf_internal *internal)
 		DRV_LOG(ERR, "failed to create ring relay pthread.");
 		return -1;
 	}
+
+	snprintf(name, sizeof(name), "ifc-vring-%d", internal->vid);
+	rte_thread_setname(internal->tid, name);
+
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 4/7] raw/ifpga: support set monitor thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (2 preceding siblings ...)
  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 ` Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 5/7] examples/performance-thread: support set " Min Hu (Connor)
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set monitor 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/raw/ifpga/ifpga_rawdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 05d79bf..4db6884 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -534,6 +534,7 @@ ifpga_monitor_start_func(void)
 				"Fail to create ifpga nonitor thread");
 			return -1;
 		}
+		rte_thread_setname(ifpga_monitor_start_thread, "ifpga-monitor");
 		ifpga_monitor_start = 1;
 	}
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 5/7] examples/performance-thread: support set thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (3 preceding siblings ...)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
@ 2021-04-10 10:40 ` Min Hu (Connor)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 6/7] telemetry: support set init threads name Min Hu (Connor)
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set helloworld thread name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/performance-thread/pthread_shim/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 23e3b5e..4ce3622 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -27,6 +27,7 @@
 
 #define DEBUG_APP 0
 #define HELLOW_WORLD_MAX_LTHREADS 10
+#define THREAD_NAME_LEN	16
 
 #ifndef __GLIBC__ /* sched_getcpu() is glibc-specific */
 #define sched_getcpu() rte_lcore_id()
@@ -149,6 +150,7 @@ static void *initial_lthread(void *args __rte_unused)
 		 */
 		pthread_attr_t attr;
 		rte_cpuset_t cpuset;
+		char name[THREAD_NAME_LEN];
 
 		CPU_ZERO(&cpuset);
 		CPU_SET(lcore, &cpuset);
@@ -160,6 +162,9 @@ static void *initial_lthread(void *args __rte_unused)
 				helloworld_pthread, (void *) i);
 		if (ret != 0)
 			rte_exit(EXIT_FAILURE, "Cannot create helloworld thread\n");
+
+		snprintf(name, sizeof(name), "helloworld-%u", (uint32_t)i);
+		rte_thread_setname(tid[i], name);
 	}
 
 	/* wait for 1s to allow threads
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 6/7] telemetry: support set init threads name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (4 preceding siblings ...)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 5/7] examples/performance-thread: support set " Min Hu (Connor)
@ 2021-04-10 10:40 ` 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)
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set init threads name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/librte_telemetry/telemetry.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
index 7e08afd..8f48337 100644
--- a/lib/librte_telemetry/telemetry.c
+++ b/lib/librte_telemetry/telemetry.c
@@ -442,7 +442,7 @@ telemetry_legacy_init(void)
 		return -1;
 	pthread_create(&t_old, NULL, socket_listener, &v1_socket);
 	pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
-
+	pthread_setname_np(t_old, "telemetry-v1");
 	TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
 	return 0;
 }
@@ -471,6 +471,7 @@ telemetry_v2_init(void)
 		return -1;
 	pthread_create(&t_new, NULL, socket_listener, &v2_socket);
 	pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
+	pthread_setname_np(t_new, "telemetry-v2");
 	atexit(unlink_sockets);
 
 	return 0;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 7/7] examples/vhost_blk: support set ctrl worker thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (5 preceding siblings ...)
  2021-04-10 10:40 ` [dpdk-dev] [PATCH 6/7] telemetry: support set init threads name Min Hu (Connor)
@ 2021-04-10 10:40 ` Min Hu (Connor)
  2021-04-12  7:19 ` [dpdk-dev] [PATCH 0/7] support set " David Marchand
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
  8 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-10 10:40 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, shepard.siegel, qiming.yang, rosen.xu,
	john.mcnamara, ciara.power, maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set ctrl worker thread name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/vhost_blk/vhost_blk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 5c64071..4d24dca 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -689,6 +689,7 @@ new_device(int vid)
 		fprintf(stderr, "Worker Thread Started Failed\n");
 		return -1;
 	}
+	rte_thread_setname(tid, "vhostblk-ctrlr");
 
 	/* device has been started */
 	ctrlr->started = 1;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (6 preceding siblings ...)
  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 ` David Marchand
  2021-04-12 14:26   ` Power, Ciara
                     ` (2 more replies)
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
  8 siblings, 3 replies; 24+ messages in thread
From: David Marchand @ 2021-04-12  7:19 UTC (permalink / raw)
  To: Min Hu (Connor),
	Shepard Siegel, Qiming Yang, Xiao Wang, Rosen Xu,
	Maxime Coquelin
  Cc: dev, Yigit, Ferruh, Mcnamara, John, Ciara Power

On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>
> This set of patches support set thread name for debugging.
>
> Chengwen Feng (7):
>   net/ark: support set thread name
>   net/ice: support set VSI reset thread name
>   vdpa/ifc: support set notify and vring relay thread name
>   raw/ifpga: support set monitor thread name
>   examples/performance-thread: support set thread name
>   telemetry: support set init threads name
>   examples/vhost_blk: support set ctrl worker thread name

Rather than add those calls, can maintainers check if their component
can use ctrl threads instead?
rte_ctrl_thread_create ensures both that the name is set, and that the
ctrl thread won't run on the same cpu as "datapath" threads.

I also saw some issues with components creating threads.
I'll post a series addressing those later (net/ark, net/ice not
detaching/joining created threads + telemetry not checking
pthread_create failures).


-- 
David Marchand


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  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-13  1:20   ` fengchengwen
  2 siblings, 0 replies; 24+ messages in thread
From: Power, Ciara @ 2021-04-12 14:26 UTC (permalink / raw)
  To: David Marchand, Min Hu (Connor),
	Shepard Siegel, Yang,  Qiming, Wang, Xiao W, Xu,  Rosen,
	Maxime Coquelin
  Cc: dev, Yigit, Ferruh, Mcnamara, John


>-----Original Message-----
>From: David Marchand <david.marchand@redhat.com>
>Sent: Monday 12 April 2021 08:20
>To: Min Hu (Connor) <humin29@huawei.com>; Shepard Siegel
><shepard.siegel@atomicrules.com>; Yang, Qiming <qiming.yang@intel.com>;
>Wang, Xiao W <xiao.w.wang@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
>Maxime Coquelin <maxime.coquelin@redhat.com>
>Cc: dev <dev@dpdk.org>; Yigit, Ferruh <ferruh.yigit@intel.com>; Mcnamara,
>John <john.mcnamara@intel.com>; Power, Ciara <ciara.power@intel.com>
>Subject: Re: [dpdk-dev] [PATCH 0/7] support set thread name
>
>On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com>
>wrote:
>>
>> This set of patches support set thread name for debugging.
>>
>> Chengwen Feng (7):
>>   net/ark: support set thread name
>>   net/ice: support set VSI reset thread name
>>   vdpa/ifc: support set notify and vring relay thread name
>>   raw/ifpga: support set monitor thread name
>>   examples/performance-thread: support set thread name
>>   telemetry: support set init threads name
>>   examples/vhost_blk: support set ctrl worker thread name
>
>Rather than add those calls, can maintainers check if their component can use
>ctrl threads instead?
>rte_ctrl_thread_create ensures both that the name is set, and that the ctrl
>thread won't run on the same cpu as "datapath" threads.
>
>I also saw some issues with components creating threads.
>I'll post a series addressing those later (net/ark, net/ice not detaching/joining
>created threads + telemetry not checking pthread_create failures).
>
>

Hi David,

Telemetry has no dependency on EAL, so using the ctrl thread functions isn't possible for that component.

Thanks,
Ciara

>--
>David Marchand


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  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-13  1:20   ` fengchengwen
  2 siblings, 1 reply; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-13  1:12 UTC (permalink / raw)
  To: David Marchand, Shepard Siegel, Qiming Yang, Xiao Wang, Rosen Xu,
	Maxime Coquelin
  Cc: dev, Yigit, Ferruh, Mcnamara, John, Ciara Power



在 2021/4/12 15:19, David Marchand 写道:
> On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>>
>> This set of patches support set thread name for debugging.
>>
>> Chengwen Feng (7):
>>    net/ark: support set thread name
>>    net/ice: support set VSI reset thread name
>>    vdpa/ifc: support set notify and vring relay thread name
>>    raw/ifpga: support set monitor thread name
>>    examples/performance-thread: support set thread name
>>    telemetry: support set init threads name
>>    examples/vhost_blk: support set ctrl worker thread name
> 
> Rather than add those calls, can maintainers check if their component
> can use ctrl threads instead?
> rte_ctrl_thread_create ensures both that the name is set, and that the
> ctrl thread won't run on the same cpu as "datapath" threads.
> 
> I also saw some issues with components creating threads.
> I'll post a series addressing those later (net/ark, net/ice not
> detaching/joining created threads + telemetry not checking
> pthread_create failures).
> 
  Totally agree with David.
By the way, for "telemetry not checking pthread_create failures", I have
sent patches to fix it. Please check it out.
	Thanks.
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  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-13  1:20   ` fengchengwen
  2 siblings, 0 replies; 24+ messages in thread
From: fengchengwen @ 2021-04-13  1:20 UTC (permalink / raw)
  To: David Marchand, Min Hu (Connor),
	Shepard Siegel, Qiming Yang, Xiao Wang, Rosen Xu,
	Maxime Coquelin
  Cc: dev, Yigit, Ferruh, Mcnamara, John, Ciara Power



On 2021/4/12 15:19, David Marchand wrote:
> On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>>
>> This set of patches support set thread name for debugging.
>>
>> Chengwen Feng (7):
>>   net/ark: support set thread name
>>   net/ice: support set VSI reset thread name
>>   vdpa/ifc: support set notify and vring relay thread name
>>   raw/ifpga: support set monitor thread name
>>   examples/performance-thread: support set thread name
>>   telemetry: support set init threads name
>>   examples/vhost_blk: support set ctrl worker thread name
> 
> Rather than add those calls, can maintainers check if their component
> can use ctrl threads instead?
> rte_ctrl_thread_create ensures both that the name is set, and that the
> ctrl thread won't run on the same cpu as "datapath" threads.
> 
> I also saw some issues with components creating threads.
> I'll post a series addressing those later (net/ark, net/ice not
> detaching/joining created threads + telemetry not checking
> pthread_create failures).
> 
> 

There already have reviewing patches:
([dpdk-dev] [PATCH v2 0/2] fix missing check for thread creation)
to fix telemetry not checking pthread_create failure.

Please review it, thanks



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  2021-04-13  1:12   ` Min Hu (Connor)
@ 2021-04-16 18:40     ` Thomas Monjalon
  2021-04-17  6:15       ` Min Hu (Connor)
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Monjalon @ 2021-04-16 18:40 UTC (permalink / raw)
  To: David Marchand, Shepard Siegel, Qiming Yang, Xiao Wang, Rosen Xu,
	Maxime Coquelin, dev, Yigit, Ferruh
  Cc: Mcnamara, John, Ciara Power, Min Hu (Connor)

13/04/2021 03:12, Min Hu (Connor):
> 在 2021/4/12 15:19, David Marchand 写道:
> > On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com> wrote:
> >>
> >> This set of patches support set thread name for debugging.
> >>
> >> Chengwen Feng (7):
> >>    net/ark: support set thread name
> >>    net/ice: support set VSI reset thread name
> >>    vdpa/ifc: support set notify and vring relay thread name
> >>    raw/ifpga: support set monitor thread name
> >>    examples/performance-thread: support set thread name
> >>    telemetry: support set init threads name
> >>    examples/vhost_blk: support set ctrl worker thread name
> > 
> > Rather than add those calls, can maintainers check if their component
> > can use ctrl threads instead?
> > rte_ctrl_thread_create ensures both that the name is set, and that the
> > ctrl thread won't run on the same cpu as "datapath" threads.
> > 
> > I also saw some issues with components creating threads.
> > I'll post a series addressing those later (net/ark, net/ice not
> > detaching/joining created threads + telemetry not checking
> > pthread_create failures).
> > 
>   Totally agree with David.
> By the way, for "telemetry not checking pthread_create failures", I have
> sent patches to fix it. Please check it out.
> 	Thanks.

Do I understand correctly that we prefer switching
to rte_ctrl_thread_create() instead of this patch series
adding rte_thread_setname()?

Any volunteer to add the use of rte_ctrl_thread_create()
in these drivers and examples?



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/7] support set thread name
  2021-04-16 18:40     ` Thomas Monjalon
@ 2021-04-17  6:15       ` Min Hu (Connor)
  0 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  6:15 UTC (permalink / raw)
  To: Thomas Monjalon, David Marchand, Shepard Siegel, Qiming Yang,
	Xiao Wang, Rosen Xu, Maxime Coquelin, dev, Yigit, Ferruh
  Cc: Mcnamara, John, Ciara Power



在 2021/4/17 2:40, Thomas Monjalon 写道:
> 13/04/2021 03:12, Min Hu (Connor):
>> 在 2021/4/12 15:19, David Marchand 写道:
>>> On Sat, Apr 10, 2021 at 12:40 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>>>>
>>>> This set of patches support set thread name for debugging.
>>>>
>>>> Chengwen Feng (7):
>>>>     net/ark: support set thread name
>>>>     net/ice: support set VSI reset thread name
>>>>     vdpa/ifc: support set notify and vring relay thread name
>>>>     raw/ifpga: support set monitor thread name
>>>>     examples/performance-thread: support set thread name
>>>>     telemetry: support set init threads name
>>>>     examples/vhost_blk: support set ctrl worker thread name
>>>
>>> Rather than add those calls, can maintainers check if their component
>>> can use ctrl threads instead?
>>> rte_ctrl_thread_create ensures both that the name is set, and that the
>>> ctrl thread won't run on the same cpu as "datapath" threads.
>>>
>>> I also saw some issues with components creating threads.
>>> I'll post a series addressing those later (net/ark, net/ice not
>>> detaching/joining created threads + telemetry not checking
>>> pthread_create failures).
>>>
>>    Totally agree with David.
>> By the way, for "telemetry not checking pthread_create failures", I have
>> sent patches to fix it. Please check it out.
>> 	Thanks.
> 
> Do I understand correctly that we prefer switching
> to rte_ctrl_thread_create() instead of this patch series
> adding rte_thread_setname()?
> 
> Any volunteer to add the use of rte_ctrl_thread_create()
> in these drivers and examples?
> 
Hi, Thomos, we will send next patch to fix it, thanks.
> 
> .
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 0/7] support set thread name
  2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name Min Hu (Connor)
                   ` (7 preceding siblings ...)
  2021-04-12  7:19 ` [dpdk-dev] [PATCH 0/7] support set " David Marchand
@ 2021-04-17  9:09 ` Min Hu (Connor)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 1/7] net/ark: " Min Hu (Connor)
                     ` (7 more replies)
  8 siblings, 8 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

This set of patches support set thread name for debugging.

Chengwen Feng (7):
  net/ark: support set thread name
  net/ice: support set VSI reset thread name
  vdpa/ifc: support set notify and vring relay thread name
  raw/ifpga: support set monitor thread name
  examples/performance-thread: support set thread name
  telemetry: support set init threads name
  examples/vhost_blk: support set ctrl worker thread name
---
v2:
* change 'pthread_create' to 'rte_ctrl_thread_create' except two:
'examples/performance-thread', because special CPU affinity needs
to be set, the ctrl interface cannot be used to set the affinity.
'telemetry', telemetry is an independent lib and does not depend
on EAL.

 drivers/net/ark/ark_ethdev.c                    |  4 ++--
 drivers/net/ice/ice_dcf_parent.c                |  9 ++++++---
 drivers/raw/ifpga/ifpga_rawdev.c                |  8 ++++----
 drivers/vdpa/ifc/ifcvf_vdpa.c                   | 20 ++++++++++++++------
 examples/performance-thread/pthread_shim/main.c |  5 +++++
 examples/vhost_blk/vhost_blk.c                  |  3 ++-
 lib/librte_telemetry/telemetry.c                |  3 ++-
 7 files changed, 35 insertions(+), 17 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 1/7] net/ark: support set thread name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
@ 2021-04-17  9:09   ` Min Hu (Connor)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 2/7] net/ice: support set VSI reset " Min Hu (Connor)
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set delay packet generator start 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/net/ark/ark_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 9dea5fa..6372cf7 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -568,8 +568,8 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
 		/* Delay packet generatpr start allow the hardware to be ready
 		 * This is only used for sanity checking with internal generator
 		 */
-		if (pthread_create(&thread, NULL,
-				   ark_pktgen_delay_start, ark->pg)) {
+		if (rte_ctrl_thread_create(&thread, "ark-delay-pg", NULL,
+					   ark_pktgen_delay_start, ark) != 0) {
 			ARK_PMD_LOG(ERR, "Could not create pktgen "
 				    "starter thread\n");
 			return -1;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 2/7] net/ice: support set VSI reset thread name
  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   ` Min Hu (Connor)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 3/7] vdpa/ifc: support set notify and vring relay " Min Hu (Connor)
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set VSI reset 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/net/ice/ice_dcf_parent.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index a8571b3..c8e4332 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -151,7 +151,9 @@ ice_dcf_vsi_update_service_handler(void *param)
 static void
 start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 {
+#define THREAD_NAME_LEN	16
 	struct ice_dcf_reset_event_param *param;
+	char name[THREAD_NAME_LEN];
 	pthread_t thread;
 	int ret;
 
@@ -165,9 +167,10 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 	param->vfr = vfr;
 	param->vf_id = vf_id;
 
-	ret = pthread_create(&thread, NULL,
-			     ice_dcf_vsi_update_service_handler, param);
-	if (ret) {
+	snprintf(name, sizeof(name), "ice-reset-%u", vf_id);
+	ret = rte_ctrl_thread_create(&thread, name, NULL,
+				     ice_dcf_vsi_update_service_handler, param);
+	if (ret != 0) {
 		PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
 		free(param);
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 3/7] vdpa/ifc: support set notify and vring relay thread name
  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)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

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


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 4/7] raw/ifpga: support set monitor thread name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
                     ` (2 preceding siblings ...)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 3/7] vdpa/ifc: support set notify and vring relay " Min Hu (Connor)
@ 2021-04-17  9:09   ` Min Hu (Connor)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 5/7] examples/performance-thread: support set " Min Hu (Connor)
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set monitor 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/raw/ifpga/ifpga_rawdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index d9a46ef..f2551be 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -526,10 +526,10 @@ ifpga_monitor_start_func(void)
 	int ret;
 
 	if (ifpga_monitor_start == 0) {
-		ret = pthread_create(&ifpga_monitor_start_thread,
-			NULL,
-			ifpga_rawdev_gsd_handle, NULL);
-		if (ret) {
+		ret = rte_ctrl_thread_create(&ifpga_monitor_start_thread,
+					     "ifpga-monitor", NULL,
+					     ifpga_rawdev_gsd_handle, NULL);
+		if (ret != 0) {
 			IFPGA_RAWDEV_PMD_ERR(
 				"Fail to create ifpga nonitor thread");
 			return -1;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 5/7] examples/performance-thread: support set thread name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
                     ` (3 preceding siblings ...)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 4/7] raw/ifpga: support set monitor " Min Hu (Connor)
@ 2021-04-17  9:09   ` Min Hu (Connor)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 6/7] telemetry: support set init threads name Min Hu (Connor)
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set helloworld thread name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/performance-thread/pthread_shim/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 23e3b5e..4ce3622 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -27,6 +27,7 @@
 
 #define DEBUG_APP 0
 #define HELLOW_WORLD_MAX_LTHREADS 10
+#define THREAD_NAME_LEN	16
 
 #ifndef __GLIBC__ /* sched_getcpu() is glibc-specific */
 #define sched_getcpu() rte_lcore_id()
@@ -149,6 +150,7 @@ static void *initial_lthread(void *args __rte_unused)
 		 */
 		pthread_attr_t attr;
 		rte_cpuset_t cpuset;
+		char name[THREAD_NAME_LEN];
 
 		CPU_ZERO(&cpuset);
 		CPU_SET(lcore, &cpuset);
@@ -160,6 +162,9 @@ static void *initial_lthread(void *args __rte_unused)
 				helloworld_pthread, (void *) i);
 		if (ret != 0)
 			rte_exit(EXIT_FAILURE, "Cannot create helloworld thread\n");
+
+		snprintf(name, sizeof(name), "helloworld-%u", (uint32_t)i);
+		rte_thread_setname(tid[i], name);
 	}
 
 	/* wait for 1s to allow threads
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 6/7] telemetry: support set init threads name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
                     ` (4 preceding siblings ...)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 5/7] examples/performance-thread: support set " Min Hu (Connor)
@ 2021-04-17  9:09   ` 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
  7 siblings, 1 reply; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set init threads name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/librte_telemetry/telemetry.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
index 7e08afd..8f48337 100644
--- a/lib/librte_telemetry/telemetry.c
+++ b/lib/librte_telemetry/telemetry.c
@@ -442,7 +442,7 @@ telemetry_legacy_init(void)
 		return -1;
 	pthread_create(&t_old, NULL, socket_listener, &v1_socket);
 	pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
-
+	pthread_setname_np(t_old, "telemetry-v1");
 	TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
 	return 0;
 }
@@ -471,6 +471,7 @@ telemetry_v2_init(void)
 		return -1;
 	pthread_create(&t_new, NULL, socket_listener, &v2_socket);
 	pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
+	pthread_setname_np(t_new, "telemetry-v2");
 	atexit(unlink_sockets);
 
 	return 0;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 7/7] examples/vhost_blk: support set ctrl worker thread name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
                     ` (5 preceding siblings ...)
  2021-04-17  9:09   ` [dpdk-dev] [PATCH v2 6/7] telemetry: support set init threads name Min Hu (Connor)
@ 2021-04-17  9:09   ` Min Hu (Connor)
  2021-04-21 13:58   ` [dpdk-dev] [PATCH v2 0/7] support set " Thomas Monjalon
  7 siblings, 0 replies; 24+ messages in thread
From: Min Hu (Connor) @ 2021-04-17  9:09 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set ctrl worker thread name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/vhost_blk/vhost_blk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 5c64071..54f81b3 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -685,7 +685,8 @@ new_device(int vid)
 	/* start polling vring */
 	worker_thread_status = WORKER_STATE_START;
 	fprintf(stdout, "New Device %s, Device ID %d\n", path, vid);
-	if (pthread_create(&tid, NULL, &ctrlr_worker, ctrlr) < 0) {
+	if (rte_ctrl_thread_create(&tid, "vhostblk-ctrlr", NULL,
+				   &ctrlr_worker, ctrlr) != 0) {
 		fprintf(stderr, "Worker Thread Started Failed\n");
 		return -1;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 6/7] telemetry: support set init threads name
  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
  0 siblings, 0 replies; 24+ messages in thread
From: Bruce Richardson @ 2021-04-21 10:39 UTC (permalink / raw)
  To: Min Hu (Connor)
  Cc: dev, ferruh.yigit, thomas, david.marchand, shepard.siegel,
	qiming.yang, rosen.xu, john.mcnamara, ciara.power,
	maxime.coquelin

On Sat, Apr 17, 2021 at 05:09:47PM +0800, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> This patch supports set init threads name which is helpful for
> debugging.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/7] support set thread name
  2021-04-17  9:09 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
                     ` (6 preceding siblings ...)
  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   ` Thomas Monjalon
  7 siblings, 0 replies; 24+ messages in thread
From: Thomas Monjalon @ 2021-04-21 13:58 UTC (permalink / raw)
  To: Min Hu (Connor)
  Cc: dev, ferruh.yigit, david.marchand, shepard.siegel, qiming.yang,
	rosen.xu, john.mcnamara, ciara.power, maxime.coquelin

17/04/2021 11:09, Min Hu (Connor):
> This set of patches support set thread name for debugging.
> 
> Chengwen Feng (7):
>   net/ark: support set thread name
>   net/ice: support set VSI reset thread name
>   vdpa/ifc: support set notify and vring relay thread name
>   raw/ifpga: support set monitor thread name
>   examples/performance-thread: support set thread name
>   telemetry: support set init threads name
>   examples/vhost_blk: support set ctrl worker thread name
> ---
> v2:
> * change 'pthread_create' to 'rte_ctrl_thread_create' except two:
> 'examples/performance-thread', because special CPU affinity needs
> to be set, the ctrl interface cannot be used to set the affinity.
> 'telemetry', telemetry is an independent lib and does not depend
> on EAL.

Applied, thanks



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-04-21 13:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10 10:40 [dpdk-dev] [PATCH 0/7] support set thread name 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   ` [dpdk-dev] [PATCH v2 3/7] vdpa/ifc: support set notify and vring relay " Min Hu (Connor)
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

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).