vdpa/mlx5: improve portability of thread naming
Subsystems (2)
PATCH 1/1 vdpa/mlx5: improve portability of thread naming
The function pthread_setname_np is non-portable,
so it may be unavailable in old glibc or other systems. The function rte_thread_setname is workarounding portability issues.
--- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_event.c +1 -1
@@ -544,7 +544,7 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) goto error; }snprintf (name,sizeof (name),"vDPA-mlx5-%d" , priv->vid); - ret =pthread_setname_np (priv->timer_tid, name); + ret =rte_thread_setname (priv->timer_tid, name);if (ret) {DRV_LOG (ERR ,"Failed to set timer thread name." );return -1 ;
Signature · 1 line
2.31.1
Quoted 32 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Thomas Monjalon
Sent: Thursday, April 22, 2021 1:59 AM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Viacheslav Ovsiienko <[email protected]>
Subject: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread namingThe function
pthread_setname_npis non-portable,
so it may be unavailable in old glibc or other systems. The functionrte_thread_setnameis workarounding portability issues.Signed-off-by Thomas Monjalon <[email protected]>--- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/mlx5_vdpa_event.c +1
-2@@ -544,7 +544,7 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) goto error; }snprintf (name,sizeof (name),"vDPA-mlx5-%d" , priv->vid); - ret =pthread_setname_np (priv->timer_tid, name); + ret =rte_thread_setname (priv->timer_tid, name);if (ret) {DRV_LOG (ERR ,"Failed to set timer thread name." );return -1 ; --
Quoted 1 line
2.31.1
From: Thomas Monjalon
Quoted 5 lines
The function
pthread_setname_npis non-portable, so it may be unavailable in old glibc or other systems.
The functionrte_thread_setnameis workarounding portability issues.Signed-off-by Thomas Monjalon <[email protected]>
Thanks!
Quoted 5 lines · Thomas Monjalon
The function
pthread_setname_npis non-portable,
so it may be unavailable in old glibc or other systems. The functionrte_thread_setnameis workarounding portability issues.Signed-off-by Thomas Monjalon <[email protected]>
Xia, Chenbo
AppliedQuoted 32 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Thomas Monjalon
Sent: Thursday, April 22, 2021 1:59 AM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Viacheslav Ovsiienko <[email protected]>
Subject: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread namingThe function
pthread_setname_npis non-portable,
so it may be unavailable in old glibc or other systems. The functionrte_thread_setnameis workarounding portability issues.Signed-off-by Thomas Monjalon <[email protected]>--- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/mlx5_vdpa_event.c +1
-2@@ -544,7 +544,7 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) goto error; }snprintf (name,sizeof (name),"vDPA-mlx5-%d" , priv->vid); - ret =pthread_setname_np (priv->timer_tid, name); + ret =rte_thread_setname (priv->timer_tid, name);if (ret) {DRV_LOG (ERR ,"Failed to set timer thread name." );return -1 ; --
Quoted 1 line
2.31.1
Applied to next-virtio/main, thanks