DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] set namespace prefix to threads
@ 2023-07-03 11:23 Thomas Monjalon
  2023-07-03 11:38 ` David Marchand
  2023-07-03 12:14 ` [PATCH v2] " Thomas Monjalon
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Monjalon @ 2023-07-03 11:23 UTC (permalink / raw)
  To: dev
  Cc: Timothy McDaniel, Shepard Siegel, Ed Czeck, John Miller,
	Rosen Xu, Matan Azrad, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, Andrew Rybchenko, Tianfei Zhang, Xiao Wang,
	Maxime Coquelin, Chenbo Xia, Anatoly Burakov, Bruce Richardson,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

When looking at threads in a system, it can be confusing
to find some unknown threads without a clue it is started by DPDK.

Let's start all thread names with "dpdk-"
and the driver name if it comes from a driver.

One more constraint: the thread names are generally limited
to 16 characters, including NUL character.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
Please review carefully, I may have missed things.

Note: we should use rte_ctrl_thread_create() as much as possible.

---
 app/test/test_lcores.c                  | 2 +-
 drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 +-
 drivers/net/ark/ark_ethdev.c            | 4 ++--
 drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
 drivers/net/kni/rte_eth_kni.c           | 2 +-
 drivers/net/mlx5/mlx5_hws_cnt.c         | 2 +-
 drivers/net/sfc/sfc_mae_counter.c       | 2 +-
 drivers/raw/ifpga/ifpga_rawdev.c        | 2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c           | 6 +++---
 drivers/vdpa/mlx5/mlx5_vdpa_cthread.c   | 2 +-
 drivers/vdpa/mlx5/mlx5_vdpa_event.c     | 2 +-
 examples/vhost/main.c                   | 4 ++--
 examples/vhost_blk/vhost_blk.c          | 2 +-
 lib/eal/common/eal_common_proc.c        | 2 +-
 lib/eal/freebsd/eal.c                   | 2 +-
 lib/eal/freebsd/eal_interrupts.c        | 2 +-
 lib/eal/linux/eal.c                     | 2 +-
 lib/eal/linux/eal_interrupts.c          | 2 +-
 lib/eal/linux/eal_timer.c               | 2 +-
 lib/eal/windows/eal.c                   | 2 +-
 lib/eventdev/rte_event_eth_rx_adapter.c | 2 +-
 lib/telemetry/telemetry.c               | 4 ++--
 lib/vhost/socket.c                      | 4 ++--
 lib/vhost/vduse.c                       | 2 +-
 24 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c
index 2c945b0136..9522663f1a 100644
--- a/app/test/test_lcores.c
+++ b/app/test/test_lcores.c
@@ -362,7 +362,7 @@ test_ctrl_thread(void)
 	/* Create one control thread */
 	t = &ctrl_thread_context;
 	t->state = Thread_INIT;
-	if (rte_ctrl_thread_create((pthread_t *)&t->id, "test_ctrl_threads",
+	if (rte_ctrl_thread_create((pthread_t *)&t->id, "dpdk-test-ctrlt",
 					NULL, ctrl_thread_loop, t) != 0)
 		return -1;
 
diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h
index cffe22f3c5..75860cca4d 100644
--- a/drivers/event/dlb2/pf/base/dlb2_osdep.h
+++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h
@@ -200,7 +200,7 @@ static inline void os_schedule_work(struct dlb2_hw *hw)
 	dlb2_dev = container_of(hw, struct dlb2_dev, hw);
 
 	ret = rte_ctrl_thread_create(&complete_queue_map_unmap_thread,
-				     "dlb_queue_unmap_waiter",
+				     "dpdk-dlb-qunmap",
 				     NULL,
 				     dlb2_complete_queue_map_unmap,
 				     dlb2_dev);
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index b2995427c8..30814650bf 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -600,11 +600,11 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
 	if (!ark->isvf && ark->start_pg && !ark->pg_running) {
 		pthread_t thread;
 
-		/* Delay packet generatpr start allow the hardware to be ready
+		/* Delay packet generator start allow the hardware to be ready
 		 * This is only used for sanity checking with internal generator
 		 */
 		char tname[32];
-		snprintf(tname, sizeof(tname), "ark-delay-pg-%d",
+		snprintf(tname, sizeof(tname), "dpdk-ark-pg%d",
 			 dev->data->port_id);
 
 		if (rte_ctrl_thread_create(&thread, tname, NULL,
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index e50fc73f43..c82f8b5333 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -2593,7 +2593,7 @@ ipn3ke_rpst_scan_check(void)
 
 	if (ipn3ke_rpst_scan_num == 1) {
 		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
-			"ipn3ke scanner",
+			"dpdk-ipn3ke-scn",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index c0e1f8db40..6b90c4e9b5 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -163,7 +163,7 @@ eth_kni_dev_start(struct rte_eth_dev *dev)
 		internals->stop_thread = 0;
 
 		ret = rte_ctrl_thread_create(&internals->thread,
-			"kni_handle_req", NULL,
+			"dpdk-kni-req", NULL,
 			kni_handle_request, internals);
 		if (ret) {
 			PMD_LOG(ERR,
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index d98df68f39..415bb7dae4 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -453,7 +453,7 @@ mlx5_hws_cnt_service_thread_create(struct mlx5_dev_ctx_shared *sh)
 		DRV_LOG(ERR, "Failed to create HW steering's counter service thread.");
 		return -ENOSYS;
 	}
-	snprintf(name, CNT_THREAD_NAME_MAX - 1, "%s/svc@%d",
+	snprintf(name, CNT_THREAD_NAME_MAX - 1, "dpdk-mlx5-hws-%s/svc@%d",
 		 sh->ibdev_name, service_core);
 	rte_thread_set_name((rte_thread_t){(uintptr_t)sh->cnt_svc->service_thread},
 		name);
diff --git a/drivers/net/sfc/sfc_mae_counter.c b/drivers/net/sfc/sfc_mae_counter.c
index 79043ff7d7..631b54afeb 100644
--- a/drivers/net/sfc/sfc_mae_counter.c
+++ b/drivers/net/sfc/sfc_mae_counter.c
@@ -711,7 +711,7 @@ sfc_mae_counter_thread_spawn(struct sfc_adapter *sa,
 	counter_registry->polling.thread.run = true;
 
 	rc = rte_ctrl_thread_create(&sa->mae.counter_registry.polling.thread.id,
-				    "mae_counter_thread", NULL,
+				    "dpdk-sfc-maecnt", NULL,
 				    sfc_mae_counter_thread, sa);
 
 	return rc;
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index b9f6f432c8..a7b18299de 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -551,7 +551,7 @@ ifpga_monitor_start_func(struct ifpga_rawdev *dev)
 
 	if (!__atomic_fetch_add(&ifpga_monitor_refcnt, 1, __ATOMIC_RELAXED)) {
 		ret = rte_ctrl_thread_create(&ifpga_monitor_start_thread,
-					     "ifpga-monitor", NULL,
+					     "dpdk-ifpga-mon", NULL,
 					     ifpga_rawdev_gsd_handle, NULL);
 		if (ret != 0) {
 			ifpga_monitor_start_thread = 0;
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index e4133568c1..55346bbc08 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -570,7 +570,7 @@ setup_notify_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-notify-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-noti%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, notify_relay,
 				     (void *)internal);
 	if (ret != 0) {
@@ -681,7 +681,7 @@ setup_intr_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-intr-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-int%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->intr_tid, name, NULL,
 				     intr_relay, (void *)internal);
 	if (ret) {
@@ -1019,7 +1019,7 @@ setup_vring_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-vring-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-ring%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, vring_relay,
 				     (void *)internal);
 	if (ret != 0) {
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
index 6e6624e5a3..a1d291bf71 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
@@ -312,7 +312,7 @@ mlx5_vdpa_c_thread_create(int cpu_core)
 			"vdpa multi-threads %d.", thrd_idx);
 			goto c_thread_err;
 		}
-		snprintf(name, sizeof(name), "vDPA-mthread-%d", thrd_idx);
+		snprintf(name, sizeof(name), "dpdk-vmlx5-c%d", thrd_idx);
 		ret = pthread_setname_np(
 				conf_thread_mng.cthrd[thrd_idx].tid, name);
 		if (ret)
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index f3d392c73d..c486ded598 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -546,7 +546,7 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv)
 		DRV_LOG(ERR, "Failed to set thread affinity.");
 		goto out;
 	}
-	snprintf(name, sizeof(name), "vDPA-mlx5-%d", priv->vid);
+	snprintf(name, sizeof(name), "dpdk-vmlx5-%d", priv->vid);
 	rte_thread_set_name((rte_thread_t){(uintptr_t)priv->timer_tid}, name);
 out:
 	if (attrp != NULL)
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index bfe466ff77..9ff2c1f31b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1986,11 +1986,11 @@ main(int argc, char *argv[])
 
 	/* Enable stats if the user option is set. */
 	if (enable_stats) {
-		ret = rte_ctrl_thread_create(&tid, "print-stats", NULL,
+		ret = rte_ctrl_thread_create(&tid, "dpdk-vhost-stat", NULL,
 					print_stats, NULL);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
-				"Cannot create print-stats thread\n");
+				"Cannot create dpdk-vhost-stat thread\n");
 	}
 
 	/* Launch all data cores. */
diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 3709d7ed06..45699eb0b3 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -686,7 +686,7 @@ 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 (rte_ctrl_thread_create(&tid, "vhostblk-ctrlr", NULL,
+	if (rte_ctrl_thread_create(&tid, "dpdk-vhost-blk", NULL,
 				   &ctrlr_worker, ctrlr) != 0) {
 		fprintf(stderr, "Worker Thread Started Failed\n");
 		return -1;
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 7a038e0a3c..39ee9bcd7e 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -635,7 +635,7 @@ rte_mp_channel_init(void)
 		return -1;
 	}
 
-	if (rte_ctrl_thread_create(&mp_handle_tid, "rte_mp_handle",
+	if (rte_ctrl_thread_create(&mp_handle_tid, "dpdk-mp-msg",
 			NULL, mp_handle, NULL) < 0) {
 		RTE_LOG(ERR, EAL, "failed to create mp thread: %s\n",
 			strerror(errno));
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 7008303e11..e201acd1c2 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread_name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-				"rte-worker-%d", i);
+				"dpdk-worker-%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c
index ffcf97ad4c..68cdb9deb3 100644
--- a/lib/eal/freebsd/eal_interrupts.c
+++ b/lib/eal/freebsd/eal_interrupts.c
@@ -637,7 +637,7 @@ rte_eal_intr_init(void)
 	}
 
 	/* create the host thread to wait/handle the interrupt */
-	ret = rte_ctrl_thread_create(&intr_thread, "eal-intr-thread", NULL,
+	ret = rte_ctrl_thread_create(&intr_thread, "dpdk-intr", NULL,
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 145afafde2..655653e2c1 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1272,7 +1272,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread_name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-			"rte-worker-%d", i);
+			"dpdk-worker-%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index c9881143be..19b36787b8 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1188,7 +1188,7 @@ rte_eal_intr_init(void)
 	}
 
 	/* create the host thread to wait/handle the interrupt */
-	ret = rte_ctrl_thread_create(&intr_thread, "eal-intr-thread", NULL,
+	ret = rte_ctrl_thread_create(&intr_thread, "dpdk-intr", NULL,
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 95c8cca992..1898709700 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -176,7 +176,7 @@ rte_eal_hpet_init(int make_default)
 
 	/* create a thread that will increment a global variable for
 	 * msb (hpet is 32 bits by default under linux) */
-	ret = rte_ctrl_thread_create(&msb_inc_thread_id, "hpet-msb-inc", NULL,
+	ret = rte_ctrl_thread_create(&msb_inc_thread_id, "dpdk-hpet-msb", NULL,
 				     hpet_msb_inc, NULL);
 	if (ret != 0) {
 		RTE_LOG(ERR, EAL, "ERROR: Cannot create HPET timer thread!\n");
diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
index 2d7a0e9ab2..d3c9de70f8 100644
--- a/lib/eal/windows/eal.c
+++ b/lib/eal/windows/eal.c
@@ -468,7 +468,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-			"rte-worker-%d", i);
+			"dpdk-worker-%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index f7f93ccdfd..ec5bec020d 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -1620,7 +1620,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter)
 	rte_spinlock_init(&rx_adapter->intr_ring_lock);
 
 	snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN,
-			"rx-intr-thread-%d", rx_adapter->id);
+			"dpdk-evt-rx%d", rx_adapter->id);
 
 	err = rte_ctrl_thread_create(&rx_adapter->rx_intr_thread, thread_name,
 				NULL, rxa_intr_thread, rx_adapter);
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 590720bfa6..76b1677250 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -563,7 +563,7 @@ telemetry_legacy_init(void)
 		return -1;
 	}
 	pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
-	set_thread_name(t_old, "telemetry-v1");
+	set_thread_name(t_old, "dpdk-telemet-v1");
 	TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
 	pthread_detach(t_old);
 	return 0;
@@ -617,7 +617,7 @@ telemetry_v2_init(void)
 		return -1;
 	}
 	pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
-	set_thread_name(t_new, "telemetry-v2");
+	set_thread_name(t_new, "dpdk-telemet-v2");
 	pthread_detach(t_new);
 	atexit(unlink_sockets);
 
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 19a7469e45..906db3871d 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -513,7 +513,7 @@ vhost_user_reconnect_init(void)
 	}
 	TAILQ_INIT(&reconn_list.head);
 
-	ret = rte_ctrl_thread_create(&reconn_tid, "vhost_reconn", NULL,
+	ret = rte_ctrl_thread_create(&reconn_tid, "dpdk-vhost-reco", NULL,
 			     vhost_user_client_reconnect, NULL);
 	if (ret != 0) {
 		VHOST_LOG_CONFIG("thread", ERR, "failed to create reconnect thread\n");
@@ -1239,7 +1239,7 @@ rte_vhost_driver_start(const char *path)
 		}
 
 		int ret = rte_ctrl_thread_create(&fdset_tid,
-			"vhost-events", NULL, fdset_event_dispatch,
+			"dpdk-vhost-evts", NULL, fdset_event_dispatch,
 			&vhost_user.fdset);
 		if (ret != 0) {
 			VHOST_LOG_CONFIG(path, ERR, "failed to create fdset handling thread\n");
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index a509daf80c..50dad7022f 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -455,7 +455,7 @@ vduse_device_create(const char *path)
 			return -1;
 		}
 
-		ret = rte_ctrl_thread_create(&fdset_tid, "vduse-events", NULL,
+		ret = rte_ctrl_thread_create(&fdset_tid, "dpdk-vduse-evt", NULL,
 				fdset_event_dispatch, &vduse.fdset);
 		if (ret != 0) {
 			VHOST_LOG_CONFIG(path, ERR, "failed to create vduse fdset handling thread\n");
-- 
2.41.0


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

* Re: [PATCH] set namespace prefix to threads
  2023-07-03 11:23 [PATCH] set namespace prefix to threads Thomas Monjalon
@ 2023-07-03 11:38 ` David Marchand
  2023-07-03 11:49   ` Thomas Monjalon
  2023-07-03 12:14 ` [PATCH v2] " Thomas Monjalon
  1 sibling, 1 reply; 10+ messages in thread
From: David Marchand @ 2023-07-03 11:38 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Timothy McDaniel, Shepard Siegel, Ed Czeck, John Miller,
	Rosen Xu, Matan Azrad, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, Andrew Rybchenko, Tianfei Zhang, Xiao Wang,
	Maxime Coquelin, Chenbo Xia, Anatoly Burakov, Bruce Richardson,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> When looking at threads in a system, it can be confusing
> to find some unknown threads without a clue it is started by DPDK.
>
> Let's start all thread names with "dpdk-"
> and the driver name if it comes from a driver.
>
> One more constraint: the thread names are generally limited
> to 16 characters, including NUL character.

Yes, and no way to discover this limit.


>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> Please review carefully, I may have missed things.
>
> Note: we should use rte_ctrl_thread_create() as much as possible.
>

As for this comment, we should advertise rte_thread_create_control()
instead, as it is thread library agnostic.
Which leads me to suggest looking at rte_thread_create_control() calls too.


> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index 7008303e11..e201acd1c2 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
>
>                 /* Set thread_name for aid in debugging. */
>                 snprintf(thread_name, sizeof(thread_name),
> -                               "rte-worker-%d", i);
> +                               "dpdk-worker-%d", i);
>                 rte_thread_set_name(lcore_config[i].thread_id, thread_name);
>
>                 ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,

We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
name for high order lcores") which offered up to 4 digits for lcores.
With your proposal, we are back to only 3 digits, which is probably
enough, but I preferred to raise it.



-- 
David Marchand


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

* Re: [PATCH] set namespace prefix to threads
  2023-07-03 11:38 ` David Marchand
@ 2023-07-03 11:49   ` Thomas Monjalon
  2023-07-17 14:09     ` Bruce Richardson
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2023-07-03 11:49 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Timothy McDaniel, Shepard Siegel, Ed Czeck, John Miller,
	Rosen Xu, Matan Azrad, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, Andrew Rybchenko, Tianfei Zhang, Xiao Wang,
	Maxime Coquelin, Chenbo Xia, Anatoly Burakov, Bruce Richardson,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

03/07/2023 13:38, David Marchand:
> On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > When looking at threads in a system, it can be confusing
> > to find some unknown threads without a clue it is started by DPDK.
> >
> > Let's start all thread names with "dpdk-"
> > and the driver name if it comes from a driver.
> >
> > One more constraint: the thread names are generally limited
> > to 16 characters, including NUL character.
> 
> Yes, and no way to discover this limit.
> 
> 
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > Please review carefully, I may have missed things.
> >
> > Note: we should use rte_ctrl_thread_create() as much as possible.
> >
> 
> As for this comment, we should advertise rte_thread_create_control()
> instead, as it is thread library agnostic.
> Which leads me to suggest looking at rte_thread_create_control() calls too.

You're right, I'll do a second pass.

> > diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> > index 7008303e11..e201acd1c2 100644
> > --- a/lib/eal/freebsd/eal.c
> > +++ b/lib/eal/freebsd/eal.c
> > @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
> >
> >                 /* Set thread_name for aid in debugging. */
> >                 snprintf(thread_name, sizeof(thread_name),
> > -                               "rte-worker-%d", i);
> > +                               "dpdk-worker-%d", i);
> >                 rte_thread_set_name(lcore_config[i].thread_id, thread_name);
> >
> >                 ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
> 
> We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
> name for high order lcores") which offered up to 4 digits for lcores.
> With your proposal, we are back to only 3 digits, which is probably
> enough, but I preferred to raise it.

In general no need of hyphen before a number.
I will change to dpdk-worker%d.



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

* [PATCH v2] set namespace prefix to threads
  2023-07-03 11:23 [PATCH] set namespace prefix to threads Thomas Monjalon
  2023-07-03 11:38 ` David Marchand
@ 2023-07-03 12:14 ` Thomas Monjalon
  2023-07-04  9:18   ` fengchengwen
  2023-07-10 18:42   ` Tyler Retzlaff
  1 sibling, 2 replies; 10+ messages in thread
From: Thomas Monjalon @ 2023-07-03 12:14 UTC (permalink / raw)
  To: dev
  Cc: Chengwen Feng, Kevin Laatz, Bruce Richardson, Timothy McDaniel,
	Shepard Siegel, Ed Czeck, John Miller, Jingjing Wu, Beilei Xing,
	Qiming Yang, Qi Zhang, Rosen Xu, Wenjun Wu, Matan Azrad,
	Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Andrew Rybchenko,
	Tianfei Zhang, Xiao Wang, Maxime Coquelin, Chenbo Xia,
	Anatoly Burakov, Harman Kalra, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam,
	Naga Harish K S V, Jerin Jacob, Ciara Power

When looking at threads in a system, it can be confusing
to find some unknown threads without a clue it is started by DPDK.

Let's start all thread names with "dpdk-"
plus the driver name if it comes from a driver.

One more constraint: the thread names are generally limited
to 16 characters, including the NUL character.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
Please review carefully, I may have missed things.

Note: we should use rte_thread_create_control() as much as possible.

---
 app/test/test_lcores.c                  | 2 +-
 app/test/test_threads.c                 | 2 +-
 drivers/dma/skeleton/skeleton_dmadev.c  | 2 +-
 drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 +-
 drivers/net/ark/ark_ethdev.c            | 4 ++--
 drivers/net/iavf/iavf_vchnl.c           | 2 +-
 drivers/net/ice/ice_dcf_parent.c        | 2 +-
 drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c        | 2 +-
 drivers/net/kni/rte_eth_kni.c           | 2 +-
 drivers/net/mlx5/mlx5_hws_cnt.c         | 6 ++----
 drivers/net/sfc/sfc_mae_counter.c       | 2 +-
 drivers/raw/ifpga/ifpga_rawdev.c        | 2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c           | 6 +++---
 drivers/vdpa/mlx5/mlx5_vdpa_cthread.c   | 2 +-
 drivers/vdpa/mlx5/mlx5_vdpa_event.c     | 2 +-
 examples/vhost/main.c                   | 4 ++--
 examples/vhost_blk/vhost_blk.c          | 2 +-
 lib/eal/common/eal_common_proc.c        | 2 +-
 lib/eal/freebsd/eal.c                   | 2 +-
 lib/eal/freebsd/eal_interrupts.c        | 2 +-
 lib/eal/linux/eal.c                     | 2 +-
 lib/eal/linux/eal_interrupts.c          | 2 +-
 lib/eal/linux/eal_timer.c               | 2 +-
 lib/eal/windows/eal.c                   | 2 +-
 lib/eal/windows/eal_interrupts.c        | 2 +-
 lib/eventdev/rte_event_eth_rx_adapter.c | 2 +-
 lib/telemetry/telemetry.c               | 4 ++--
 lib/vhost/socket.c                      | 4 ++--
 lib/vhost/vduse.c                       | 2 +-
 30 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c
index 2c945b0136..9522663f1a 100644
--- a/app/test/test_lcores.c
+++ b/app/test/test_lcores.c
@@ -362,7 +362,7 @@ test_ctrl_thread(void)
 	/* Create one control thread */
 	t = &ctrl_thread_context;
 	t->state = Thread_INIT;
-	if (rte_ctrl_thread_create((pthread_t *)&t->id, "test_ctrl_threads",
+	if (rte_ctrl_thread_create((pthread_t *)&t->id, "dpdk-test-ctrlt",
 					NULL, ctrl_thread_loop, t) != 0)
 		return -1;
 
diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index a4c4f651a4..4ad5902969 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -239,7 +239,7 @@ test_thread_control_create_join(void)
 	rte_thread_t thread_main_id;
 
 	thread_id_ready = 0;
-	RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "test_control_threads",
+	RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc",
 		NULL, thread_main, &thread_main_id) == 0,
 		"Failed to create thread.");
 
diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index c2d776dbbd..493224542f 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -127,7 +127,7 @@ skeldma_start(struct rte_dma_dev *dev)
 
 	rte_mb();
 
-	snprintf(name, sizeof(name), "dma_skel_%d", dev->data->dev_id);
+	snprintf(name, sizeof(name), "dpdk-dma-skel%d", dev->data->dev_id);
 	ret = rte_thread_create_control(&hw->thread, name, NULL,
 				     cpucopy_thread, dev);
 	if (ret) {
diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h
index cffe22f3c5..75860cca4d 100644
--- a/drivers/event/dlb2/pf/base/dlb2_osdep.h
+++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h
@@ -200,7 +200,7 @@ static inline void os_schedule_work(struct dlb2_hw *hw)
 	dlb2_dev = container_of(hw, struct dlb2_dev, hw);
 
 	ret = rte_ctrl_thread_create(&complete_queue_map_unmap_thread,
-				     "dlb_queue_unmap_waiter",
+				     "dpdk-dlb-qunmap",
 				     NULL,
 				     dlb2_complete_queue_map_unmap,
 				     dlb2_dev);
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index b2995427c8..30814650bf 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -600,11 +600,11 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
 	if (!ark->isvf && ark->start_pg && !ark->pg_running) {
 		pthread_t thread;
 
-		/* Delay packet generatpr start allow the hardware to be ready
+		/* Delay packet generator start allow the hardware to be ready
 		 * This is only used for sanity checking with internal generator
 		 */
 		char tname[32];
-		snprintf(tname, sizeof(tname), "ark-delay-pg-%d",
+		snprintf(tname, sizeof(tname), "dpdk-ark-pg%d",
 			 dev->data->port_id);
 
 		if (rte_ctrl_thread_create(&thread, tname, NULL,
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 524732f67d..c31a6d5c98 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -135,7 +135,7 @@ iavf_dev_event_handler_init(void)
 	TAILQ_INIT(&handler->pending);
 	pthread_mutex_init(&handler->lock, NULL);
 
-	if (rte_thread_create_control(&handler->tid, "iavf-event-thread",
+	if (rte_thread_create_control(&handler->tid, "dpdk-iavf-event",
 				NULL, iavf_dev_event_handle, NULL)) {
 		__atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED);
 		return -1;
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index d62837840d..ad98a531de 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -181,7 +181,7 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 	param->vfr = vfr;
 	param->vf_id = vf_id;
 
-	snprintf(name, sizeof(name), "ice-reset-%u", vf_id);
+	snprintf(name, sizeof(name), "dpdk-ice-rst%u", vf_id);
 	ret = rte_thread_create_control(&thread, name, NULL,
 				     ice_dcf_vsi_update_service_handler, param);
 	if (ret != 0) {
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index e50fc73f43..c82f8b5333 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -2593,7 +2593,7 @@ ipn3ke_rpst_scan_check(void)
 
 	if (ipn3ke_rpst_scan_num == 1) {
 		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
-			"ipn3ke scanner",
+			"dpdk-ipn3ke-scn",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 14a7d571e0..7eac05ee60 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4329,7 +4329,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				 */
 				intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
-					"ixgbe-link-handler",
+					"dpdk-ixgbe-link",
 					NULL,
 					ixgbe_dev_setup_link_thread_handler,
 					dev) < 0) {
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index c0e1f8db40..6b90c4e9b5 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -163,7 +163,7 @@ eth_kni_dev_start(struct rte_eth_dev *dev)
 		internals->stop_thread = 0;
 
 		ret = rte_ctrl_thread_create(&internals->thread,
-			"kni_handle_req", NULL,
+			"dpdk-kni-req", NULL,
 			kni_handle_request, internals);
 		if (ret) {
 			PMD_LOG(ERR,
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index d98df68f39..732c4598c4 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -439,8 +439,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,
 int
 mlx5_hws_cnt_service_thread_create(struct mlx5_dev_ctx_shared *sh)
 {
-#define CNT_THREAD_NAME_MAX 256
-	char name[CNT_THREAD_NAME_MAX];
+	char name[RTE_MAX_THREAD_NAME_LEN];
 	rte_cpuset_t cpuset;
 	int ret;
 	uint32_t service_core = sh->cnt_svc->service_core;
@@ -453,8 +452,7 @@ mlx5_hws_cnt_service_thread_create(struct mlx5_dev_ctx_shared *sh)
 		DRV_LOG(ERR, "Failed to create HW steering's counter service thread.");
 		return -ENOSYS;
 	}
-	snprintf(name, CNT_THREAD_NAME_MAX - 1, "%s/svc@%d",
-		 sh->ibdev_name, service_core);
+	snprintf(name, RTE_MAX_THREAD_NAME_LEN, "dpdk-mlx5-%d", service_core);
 	rte_thread_set_name((rte_thread_t){(uintptr_t)sh->cnt_svc->service_thread},
 		name);
 	CPU_SET(service_core, &cpuset);
diff --git a/drivers/net/sfc/sfc_mae_counter.c b/drivers/net/sfc/sfc_mae_counter.c
index 79043ff7d7..631b54afeb 100644
--- a/drivers/net/sfc/sfc_mae_counter.c
+++ b/drivers/net/sfc/sfc_mae_counter.c
@@ -711,7 +711,7 @@ sfc_mae_counter_thread_spawn(struct sfc_adapter *sa,
 	counter_registry->polling.thread.run = true;
 
 	rc = rte_ctrl_thread_create(&sa->mae.counter_registry.polling.thread.id,
-				    "mae_counter_thread", NULL,
+				    "dpdk-sfc-maecnt", NULL,
 				    sfc_mae_counter_thread, sa);
 
 	return rc;
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index b9f6f432c8..a7b18299de 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -551,7 +551,7 @@ ifpga_monitor_start_func(struct ifpga_rawdev *dev)
 
 	if (!__atomic_fetch_add(&ifpga_monitor_refcnt, 1, __ATOMIC_RELAXED)) {
 		ret = rte_ctrl_thread_create(&ifpga_monitor_start_thread,
-					     "ifpga-monitor", NULL,
+					     "dpdk-ifpga-mon", NULL,
 					     ifpga_rawdev_gsd_handle, NULL);
 		if (ret != 0) {
 			ifpga_monitor_start_thread = 0;
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index e4133568c1..55346bbc08 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -570,7 +570,7 @@ setup_notify_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-notify-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-noti%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, notify_relay,
 				     (void *)internal);
 	if (ret != 0) {
@@ -681,7 +681,7 @@ setup_intr_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-intr-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-int%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->intr_tid, name, NULL,
 				     intr_relay, (void *)internal);
 	if (ret) {
@@ -1019,7 +1019,7 @@ setup_vring_relay(struct ifcvf_internal *internal)
 	char name[THREAD_NAME_LEN];
 	int ret;
 
-	snprintf(name, sizeof(name), "ifc-vring-%d", internal->vid);
+	snprintf(name, sizeof(name), "dpdk-ifc-ring%d", internal->vid);
 	ret = rte_ctrl_thread_create(&internal->tid, name, NULL, vring_relay,
 				     (void *)internal);
 	if (ret != 0) {
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
index 6e6624e5a3..a1d291bf71 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
@@ -312,7 +312,7 @@ mlx5_vdpa_c_thread_create(int cpu_core)
 			"vdpa multi-threads %d.", thrd_idx);
 			goto c_thread_err;
 		}
-		snprintf(name, sizeof(name), "vDPA-mthread-%d", thrd_idx);
+		snprintf(name, sizeof(name), "dpdk-vmlx5-c%d", thrd_idx);
 		ret = pthread_setname_np(
 				conf_thread_mng.cthrd[thrd_idx].tid, name);
 		if (ret)
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index f3d392c73d..c486ded598 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -546,7 +546,7 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv)
 		DRV_LOG(ERR, "Failed to set thread affinity.");
 		goto out;
 	}
-	snprintf(name, sizeof(name), "vDPA-mlx5-%d", priv->vid);
+	snprintf(name, sizeof(name), "dpdk-vmlx5-%d", priv->vid);
 	rte_thread_set_name((rte_thread_t){(uintptr_t)priv->timer_tid}, name);
 out:
 	if (attrp != NULL)
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index bfe466ff77..9ff2c1f31b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1986,11 +1986,11 @@ main(int argc, char *argv[])
 
 	/* Enable stats if the user option is set. */
 	if (enable_stats) {
-		ret = rte_ctrl_thread_create(&tid, "print-stats", NULL,
+		ret = rte_ctrl_thread_create(&tid, "dpdk-vhost-stat", NULL,
 					print_stats, NULL);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
-				"Cannot create print-stats thread\n");
+				"Cannot create dpdk-vhost-stat thread\n");
 	}
 
 	/* Launch all data cores. */
diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 3709d7ed06..45699eb0b3 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -686,7 +686,7 @@ 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 (rte_ctrl_thread_create(&tid, "vhostblk-ctrlr", NULL,
+	if (rte_ctrl_thread_create(&tid, "dpdk-vhost-blk", NULL,
 				   &ctrlr_worker, ctrlr) != 0) {
 		fprintf(stderr, "Worker Thread Started Failed\n");
 		return -1;
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 7a038e0a3c..39ee9bcd7e 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -635,7 +635,7 @@ rte_mp_channel_init(void)
 		return -1;
 	}
 
-	if (rte_ctrl_thread_create(&mp_handle_tid, "rte_mp_handle",
+	if (rte_ctrl_thread_create(&mp_handle_tid, "dpdk-mp-msg",
 			NULL, mp_handle, NULL) < 0) {
 		RTE_LOG(ERR, EAL, "failed to create mp thread: %s\n",
 			strerror(errno));
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 7008303e11..1c02aef716 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread_name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-				"rte-worker-%d", i);
+				"dpdk-worker%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c
index ffcf97ad4c..68cdb9deb3 100644
--- a/lib/eal/freebsd/eal_interrupts.c
+++ b/lib/eal/freebsd/eal_interrupts.c
@@ -637,7 +637,7 @@ rte_eal_intr_init(void)
 	}
 
 	/* create the host thread to wait/handle the interrupt */
-	ret = rte_ctrl_thread_create(&intr_thread, "eal-intr-thread", NULL,
+	ret = rte_ctrl_thread_create(&intr_thread, "dpdk-intr", NULL,
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 145afafde2..44b8ba6897 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1272,7 +1272,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread_name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-			"rte-worker-%d", i);
+			"dpdk-worker%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index c9881143be..19b36787b8 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1188,7 +1188,7 @@ rte_eal_intr_init(void)
 	}
 
 	/* create the host thread to wait/handle the interrupt */
-	ret = rte_ctrl_thread_create(&intr_thread, "eal-intr-thread", NULL,
+	ret = rte_ctrl_thread_create(&intr_thread, "dpdk-intr", NULL,
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 95c8cca992..1898709700 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -176,7 +176,7 @@ rte_eal_hpet_init(int make_default)
 
 	/* create a thread that will increment a global variable for
 	 * msb (hpet is 32 bits by default under linux) */
-	ret = rte_ctrl_thread_create(&msb_inc_thread_id, "hpet-msb-inc", NULL,
+	ret = rte_ctrl_thread_create(&msb_inc_thread_id, "dpdk-hpet-msb", NULL,
 				     hpet_msb_inc, NULL);
 	if (ret != 0) {
 		RTE_LOG(ERR, EAL, "ERROR: Cannot create HPET timer thread!\n");
diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
index 2d7a0e9ab2..4fdb74c9cc 100644
--- a/lib/eal/windows/eal.c
+++ b/lib/eal/windows/eal.c
@@ -468,7 +468,7 @@ rte_eal_init(int argc, char **argv)
 
 		/* Set thread name for aid in debugging. */
 		snprintf(thread_name, sizeof(thread_name),
-			"rte-worker-%d", i);
+			"dpdk-worker%d", i);
 		rte_thread_set_name(lcore_config[i].thread_id, thread_name);
 
 		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c
index 49c4b9620a..b1b1228c2b 100644
--- a/lib/eal/windows/eal_interrupts.c
+++ b/lib/eal/windows/eal_interrupts.c
@@ -98,7 +98,7 @@ rte_eal_intr_init(void)
 		return -1;
 	}
 
-	ret = rte_thread_create_control(&intr_thread, "eal-intr-thread", NULL,
+	ret = rte_thread_create_control(&intr_thread, "dpdk-intr", NULL,
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index f7f93ccdfd..ec5bec020d 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -1620,7 +1620,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter)
 	rte_spinlock_init(&rx_adapter->intr_ring_lock);
 
 	snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN,
-			"rx-intr-thread-%d", rx_adapter->id);
+			"dpdk-evt-rx%d", rx_adapter->id);
 
 	err = rte_ctrl_thread_create(&rx_adapter->rx_intr_thread, thread_name,
 				NULL, rxa_intr_thread, rx_adapter);
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 590720bfa6..76b1677250 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -563,7 +563,7 @@ telemetry_legacy_init(void)
 		return -1;
 	}
 	pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
-	set_thread_name(t_old, "telemetry-v1");
+	set_thread_name(t_old, "dpdk-telemet-v1");
 	TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
 	pthread_detach(t_old);
 	return 0;
@@ -617,7 +617,7 @@ telemetry_v2_init(void)
 		return -1;
 	}
 	pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
-	set_thread_name(t_new, "telemetry-v2");
+	set_thread_name(t_new, "dpdk-telemet-v2");
 	pthread_detach(t_new);
 	atexit(unlink_sockets);
 
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 19a7469e45..cef67c771d 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -513,7 +513,7 @@ vhost_user_reconnect_init(void)
 	}
 	TAILQ_INIT(&reconn_list.head);
 
-	ret = rte_ctrl_thread_create(&reconn_tid, "vhost_reconn", NULL,
+	ret = rte_ctrl_thread_create(&reconn_tid, "dpdk-vhost-reco", NULL,
 			     vhost_user_client_reconnect, NULL);
 	if (ret != 0) {
 		VHOST_LOG_CONFIG("thread", ERR, "failed to create reconnect thread\n");
@@ -1239,7 +1239,7 @@ rte_vhost_driver_start(const char *path)
 		}
 
 		int ret = rte_ctrl_thread_create(&fdset_tid,
-			"vhost-events", NULL, fdset_event_dispatch,
+			"dpdk-vhost-evt", NULL, fdset_event_dispatch,
 			&vhost_user.fdset);
 		if (ret != 0) {
 			VHOST_LOG_CONFIG(path, ERR, "failed to create fdset handling thread\n");
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index a509daf80c..50dad7022f 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -455,7 +455,7 @@ vduse_device_create(const char *path)
 			return -1;
 		}
 
-		ret = rte_ctrl_thread_create(&fdset_tid, "vduse-events", NULL,
+		ret = rte_ctrl_thread_create(&fdset_tid, "dpdk-vduse-evt", NULL,
 				fdset_event_dispatch, &vduse.fdset);
 		if (ret != 0) {
 			VHOST_LOG_CONFIG(path, ERR, "failed to create vduse fdset handling thread\n");
-- 
2.41.0


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

* Re: [PATCH v2] set namespace prefix to threads
  2023-07-03 12:14 ` [PATCH v2] " Thomas Monjalon
@ 2023-07-04  9:18   ` fengchengwen
  2023-07-10 18:42   ` Tyler Retzlaff
  1 sibling, 0 replies; 10+ messages in thread
From: fengchengwen @ 2023-07-04  9:18 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Kevin Laatz, Bruce Richardson, Timothy McDaniel, Shepard Siegel,
	Ed Czeck, John Miller, Jingjing Wu, Beilei Xing, Qiming Yang,
	Qi Zhang, Rosen Xu, Wenjun Wu, Matan Azrad, Viacheslav Ovsiienko,
	Ori Kam, Suanming Mou, Andrew Rybchenko, Tianfei Zhang,
	Xiao Wang, Maxime Coquelin, Chenbo Xia, Anatoly Burakov,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

+1 for same prefix.
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2023/7/3 20:14, Thomas Monjalon wrote:
> When looking at threads in a system, it can be confusing
> to find some unknown threads without a clue it is started by DPDK.
> 
> Let's start all thread names with "dpdk-"
> plus the driver name if it comes from a driver.
> 
> One more constraint: the thread names are generally limited
> to 16 characters, including the NUL character.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> Please review carefully, I may have missed things.
> 
> Note: we should use rte_thread_create_control() as much as possible.
> 

...

> 

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

* Re: [PATCH v2] set namespace prefix to threads
  2023-07-03 12:14 ` [PATCH v2] " Thomas Monjalon
  2023-07-04  9:18   ` fengchengwen
@ 2023-07-10 18:42   ` Tyler Retzlaff
  2023-08-31 14:37     ` Thomas Monjalon
  1 sibling, 1 reply; 10+ messages in thread
From: Tyler Retzlaff @ 2023-07-10 18:42 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Chengwen Feng, Kevin Laatz, Bruce Richardson,
	Timothy McDaniel, Shepard Siegel, Ed Czeck, John Miller,
	Jingjing Wu, Beilei Xing, Qiming Yang, Qi Zhang, Rosen Xu,
	Wenjun Wu, Matan Azrad, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, Andrew Rybchenko, Tianfei Zhang, Xiao Wang,
	Maxime Coquelin, Chenbo Xia, Anatoly Burakov, Harman Kalra,
	Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy,
	Pallavi Kadam, Naga Harish K S V, Jerin Jacob, Ciara Power

On Mon, Jul 03, 2023 at 02:14:06PM +0200, Thomas Monjalon wrote:
> When looking at threads in a system, it can be confusing
> to find some unknown threads without a clue it is started by DPDK.
> 
> Let's start all thread names with "dpdk-"
> plus the driver name if it comes from a driver.
> 
> One more constraint: the thread names are generally limited
> to 16 characters, including the NUL character.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> Please review carefully, I may have missed things.

i think the only caution here is that some of the new names may be
truncated where the valuable information is lost in the truncation?

#define RTE_MAX_THREAD_NAME_LEN 16

a limit inherited from linux and adopted as the dpdk standard/maximum.
by prefixing dpdk- we end up with a bit less name length budget to spend
potentially causing the most important part of the thread name to be lost.

a couple of notes though.
  * some of the existing names may already suffer from truncation. i
    didn't check but can see some that look close.
  * some of your new names have reduced the length so they are in fact
    better.

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>


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

* Re: [PATCH] set namespace prefix to threads
  2023-07-03 11:49   ` Thomas Monjalon
@ 2023-07-17 14:09     ` Bruce Richardson
  2023-07-17 16:07       ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Bruce Richardson @ 2023-07-17 14:09 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: David Marchand, dev, Timothy McDaniel, Shepard Siegel, Ed Czeck,
	John Miller, Rosen Xu, Matan Azrad, Viacheslav Ovsiienko,
	Ori Kam, Suanming Mou, Andrew Rybchenko, Tianfei Zhang,
	Xiao Wang, Maxime Coquelin, Chenbo Xia, Anatoly Burakov,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

On Mon, Jul 03, 2023 at 01:49:55PM +0200, Thomas Monjalon wrote:
> 03/07/2023 13:38, David Marchand:
> > On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > >
> > > When looking at threads in a system, it can be confusing
> > > to find some unknown threads without a clue it is started by DPDK.
> > >
> > > Let's start all thread names with "dpdk-"
> > > and the driver name if it comes from a driver.
> > >
> > > One more constraint: the thread names are generally limited
> > > to 16 characters, including NUL character.
> > 
> > Yes, and no way to discover this limit.
> > 
> > 
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > ---
> > > Please review carefully, I may have missed things.
> > >
> > > Note: we should use rte_ctrl_thread_create() as much as possible.
> > >
> > 
> > As for this comment, we should advertise rte_thread_create_control()
> > instead, as it is thread library agnostic.
> > Which leads me to suggest looking at rte_thread_create_control() calls too.
> 
> You're right, I'll do a second pass.
> 
> > > diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> > > index 7008303e11..e201acd1c2 100644
> > > --- a/lib/eal/freebsd/eal.c
> > > +++ b/lib/eal/freebsd/eal.c
> > > @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
> > >
> > >                 /* Set thread_name for aid in debugging. */
> > >                 snprintf(thread_name, sizeof(thread_name),
> > > -                               "rte-worker-%d", i);
> > > +                               "dpdk-worker-%d", i);
> > >                 rte_thread_set_name(lcore_config[i].thread_id, thread_name);
> > >
> > >                 ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
> > 
> > We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
> > name for high order lcores") which offered up to 4 digits for lcores.
> > With your proposal, we are back to only 3 digits, which is probably
> > enough, but I preferred to raise it.
> 
> In general no need of hyphen before a number.
> I will change to dpdk-worker%d.
> 
While I know that "dpdk-" is probably the clearer prefix, "rte-" is also
well-know as the standard API prefix for DPDK. Give we have a 16-char
limit, I would suggest keeping using the "rte" prefix on the basis of
brevity!
A third alternative is to just use "dp-" as prefix...

/Bruce

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

* Re: [PATCH] set namespace prefix to threads
  2023-07-17 14:09     ` Bruce Richardson
@ 2023-07-17 16:07       ` Thomas Monjalon
  2023-07-17 16:14         ` Bruce Richardson
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2023-07-17 16:07 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: David Marchand, dev, Timothy McDaniel, Shepard Siegel, Ed Czeck,
	John Miller, Rosen Xu, Matan Azrad, Viacheslav Ovsiienko,
	Ori Kam, Suanming Mou, Andrew Rybchenko, Tianfei Zhang,
	Xiao Wang, Maxime Coquelin, Chenbo Xia, Anatoly Burakov,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

17/07/2023 16:09, Bruce Richardson:
> On Mon, Jul 03, 2023 at 01:49:55PM +0200, Thomas Monjalon wrote:
> > 03/07/2023 13:38, David Marchand:
> > > On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > > >
> > > > When looking at threads in a system, it can be confusing
> > > > to find some unknown threads without a clue it is started by DPDK.
> > > >
> > > > Let's start all thread names with "dpdk-"
> > > > and the driver name if it comes from a driver.
> > > >
> > > > One more constraint: the thread names are generally limited
> > > > to 16 characters, including NUL character.
> > > 
> > > Yes, and no way to discover this limit.
> > > 
> > > 
> > > >
> > > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > > ---
> > > > Please review carefully, I may have missed things.
> > > >
> > > > Note: we should use rte_ctrl_thread_create() as much as possible.
> > > >
> > > 
> > > As for this comment, we should advertise rte_thread_create_control()
> > > instead, as it is thread library agnostic.
> > > Which leads me to suggest looking at rte_thread_create_control() calls too.
> > 
> > You're right, I'll do a second pass.
> > 
> > > > diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> > > > index 7008303e11..e201acd1c2 100644
> > > > --- a/lib/eal/freebsd/eal.c
> > > > +++ b/lib/eal/freebsd/eal.c
> > > > @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
> > > >
> > > >                 /* Set thread_name for aid in debugging. */
> > > >                 snprintf(thread_name, sizeof(thread_name),
> > > > -                               "rte-worker-%d", i);
> > > > +                               "dpdk-worker-%d", i);
> > > >                 rte_thread_set_name(lcore_config[i].thread_id, thread_name);
> > > >
> > > >                 ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
> > > 
> > > We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
> > > name for high order lcores") which offered up to 4 digits for lcores.
> > > With your proposal, we are back to only 3 digits, which is probably
> > > enough, but I preferred to raise it.
> > 
> > In general no need of hyphen before a number.
> > I will change to dpdk-worker%d.
> > 
> While I know that "dpdk-" is probably the clearer prefix, "rte-" is also
> well-know as the standard API prefix for DPDK. Give we have a 16-char
> limit, I would suggest keeping using the "rte" prefix on the basis of
> brevity!

It's one character less :)
"rte" is used for API.
"dpdk-" is used for file prefixes.
When running an application, users may understand what is a "dpdk-xyz" thread,
while "rte-xyz" is more cryptic if they are not involved with DPDK at all.

> A third alternative is to just use "dp-" as prefix...

A third alternative looks like more confusion.
The idea of the thread prefix is to indicate,
to anyone monitoring a system, where the threads come from.



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

* Re: [PATCH] set namespace prefix to threads
  2023-07-17 16:07       ` Thomas Monjalon
@ 2023-07-17 16:14         ` Bruce Richardson
  0 siblings, 0 replies; 10+ messages in thread
From: Bruce Richardson @ 2023-07-17 16:14 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: David Marchand, dev, Timothy McDaniel, Shepard Siegel, Ed Czeck,
	John Miller, Rosen Xu, Matan Azrad, Viacheslav Ovsiienko,
	Ori Kam, Suanming Mou, Andrew Rybchenko, Tianfei Zhang,
	Xiao Wang, Maxime Coquelin, Chenbo Xia, Anatoly Burakov,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Naga Harish K S V, Jerin Jacob,
	Ciara Power

On Mon, Jul 17, 2023 at 06:07:59PM +0200, Thomas Monjalon wrote:
> 17/07/2023 16:09, Bruce Richardson:
> > On Mon, Jul 03, 2023 at 01:49:55PM +0200, Thomas Monjalon wrote:
> > > 03/07/2023 13:38, David Marchand:
> > > > On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > > > >
> > > > > When looking at threads in a system, it can be confusing
> > > > > to find some unknown threads without a clue it is started by DPDK.
> > > > >
> > > > > Let's start all thread names with "dpdk-"
> > > > > and the driver name if it comes from a driver.
> > > > >
> > > > > One more constraint: the thread names are generally limited
> > > > > to 16 characters, including NUL character.
> > > > 
> > > > Yes, and no way to discover this limit.
> > > > 
> > > > 
> > > > >
> > > > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > > > ---
> > > > > Please review carefully, I may have missed things.
> > > > >
> > > > > Note: we should use rte_ctrl_thread_create() as much as possible.
> > > > >
> > > > 
> > > > As for this comment, we should advertise rte_thread_create_control()
> > > > instead, as it is thread library agnostic.
> > > > Which leads me to suggest looking at rte_thread_create_control() calls too.
> > > 
> > > You're right, I'll do a second pass.
> > > 
> > > > > diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> > > > > index 7008303e11..e201acd1c2 100644
> > > > > --- a/lib/eal/freebsd/eal.c
> > > > > +++ b/lib/eal/freebsd/eal.c
> > > > > @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
> > > > >
> > > > >                 /* Set thread_name for aid in debugging. */
> > > > >                 snprintf(thread_name, sizeof(thread_name),
> > > > > -                               "rte-worker-%d", i);
> > > > > +                               "dpdk-worker-%d", i);
> > > > >                 rte_thread_set_name(lcore_config[i].thread_id, thread_name);
> > > > >
> > > > >                 ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
> > > > 
> > > > We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
> > > > name for high order lcores") which offered up to 4 digits for lcores.
> > > > With your proposal, we are back to only 3 digits, which is probably
> > > > enough, but I preferred to raise it.
> > > 
> > > In general no need of hyphen before a number.
> > > I will change to dpdk-worker%d.
> > > 
> > While I know that "dpdk-" is probably the clearer prefix, "rte-" is also
> > well-know as the standard API prefix for DPDK. Give we have a 16-char
> > limit, I would suggest keeping using the "rte" prefix on the basis of
> > brevity!
> 
> It's one character less :)

Yes, but when you are limited to 16 characters, each char counts! "dpdk-"
uses 31% of the available chars, vs 25% for the shorter prefix.

> "rte" is used for API.
> "dpdk-" is used for file prefixes.
> When running an application, users may understand what is a "dpdk-xyz" thread,
> while "rte-xyz" is more cryptic if they are not involved with DPDK at all.
> 
> > A third alternative is to just use "dp-" as prefix...
> 
> A third alternative looks like more confusion.
> The idea of the thread prefix is to indicate,
> to anyone monitoring a system, where the threads come from.
> 
Sure. No massive objections either way, just keen to see the names being as
meaningful as possible.

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

* Re: [PATCH v2] set namespace prefix to threads
  2023-07-10 18:42   ` Tyler Retzlaff
@ 2023-08-31 14:37     ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2023-08-31 14:37 UTC (permalink / raw)
  To: dev
  Cc: Chengwen Feng, Kevin Laatz, Bruce Richardson, Timothy McDaniel,
	Shepard Siegel, Ed Czeck, John Miller, Jingjing Wu, Beilei Xing,
	Qiming Yang, Qi Zhang, Rosen Xu, Wenjun Wu, Matan Azrad,
	Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Andrew Rybchenko,
	Tianfei Zhang, Xiao Wang, Maxime Coquelin, Chenbo Xia,
	Anatoly Burakov, Harman Kalra, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam,
	Naga Harish K S V, Jerin Jacob, Ciara Power, Tyler Retzlaff

10/07/2023 20:42, Tyler Retzlaff:
> On Mon, Jul 03, 2023 at 02:14:06PM +0200, Thomas Monjalon wrote:
> > When looking at threads in a system, it can be confusing
> > to find some unknown threads without a clue it is started by DPDK.
> > 
> > Let's start all thread names with "dpdk-"
> > plus the driver name if it comes from a driver.
> > 
> > One more constraint: the thread names are generally limited
> > to 16 characters, including the NUL character.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > Please review carefully, I may have missed things.
> 
> i think the only caution here is that some of the new names may be
> truncated where the valuable information is lost in the truncation?
> 
> #define RTE_MAX_THREAD_NAME_LEN 16
> 
> a limit inherited from linux and adopted as the dpdk standard/maximum.
> by prefixing dpdk- we end up with a bit less name length budget to spend
> potentially causing the most important part of the thread name to be lost.
> 
> a couple of notes though.
>   * some of the existing names may already suffer from truncation. i
>     didn't check but can see some that look close.
>   * some of your new names have reduced the length so they are in fact
>     better.
> 
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Updated for the recently added txgbe thread,
and applied.



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

end of thread, other threads:[~2023-08-31 14:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 11:23 [PATCH] set namespace prefix to threads Thomas Monjalon
2023-07-03 11:38 ` David Marchand
2023-07-03 11:49   ` Thomas Monjalon
2023-07-17 14:09     ` Bruce Richardson
2023-07-17 16:07       ` Thomas Monjalon
2023-07-17 16:14         ` Bruce Richardson
2023-07-03 12:14 ` [PATCH v2] " Thomas Monjalon
2023-07-04  9:18   ` fengchengwen
2023-07-10 18:42   ` Tyler Retzlaff
2023-08-31 14:37     ` 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).