diff mbox series

[v2,2/7] net/ice: support set VSI reset thread name

Message ID 1618650588-34268-3-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series support set thread name | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 17, 2021, 9:09 a.m. UTC
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 mbox series

Patch

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);
 	}