All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming
@ 2021-04-21 17:59 Thomas Monjalon
  2021-04-26  5:04 ` Xia, Chenbo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-04-21 17:59 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Viacheslav Ovsiienko

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.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 404e135d5c..ca6e985336 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -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;
-- 
2.31.1


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming
  2021-04-21 17:59 [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming Thomas Monjalon
@ 2021-04-26  5:04 ` Xia, Chenbo
  2021-04-26  7:59 ` Matan Azrad
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Xia, Chenbo @ 2021-04-26  5:04 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Matan Azrad, Viacheslav Ovsiienko

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Thursday, April 22, 2021 1:59 AM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Viacheslav Ovsiienko
> <viacheslavo@nvidia.com>
> Subject: [dpdk-dev] [PATCH] 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.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> index 404e135d5c..ca6e985336 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> @@ -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;
> --
> 2.31.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming
  2021-04-21 17:59 [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming Thomas Monjalon
  2021-04-26  5:04 ` Xia, Chenbo
@ 2021-04-26  7:59 ` Matan Azrad
  2021-04-26  9:04 ` fengchengwen
  2021-04-28  3:29 ` Xia, Chenbo
  3 siblings, 0 replies; 5+ messages in thread
From: Matan Azrad @ 2021-04-26  7:59 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev; +Cc: Slava Ovsiienko



From: Thomas Monjalon
> 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.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>

Thanks!

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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming
  2021-04-21 17:59 [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming Thomas Monjalon
  2021-04-26  5:04 ` Xia, Chenbo
  2021-04-26  7:59 ` Matan Azrad
@ 2021-04-26  9:04 ` fengchengwen
  2021-04-28  3:29 ` Xia, Chenbo
  3 siblings, 0 replies; 5+ messages in thread
From: fengchengwen @ 2021-04-26  9:04 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Matan Azrad, Viacheslav Ovsiienko



On 2021/4/22 1:59, Thomas Monjalon wrote:
> 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.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming
  2021-04-21 17:59 [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming Thomas Monjalon
                   ` (2 preceding siblings ...)
  2021-04-26  9:04 ` fengchengwen
@ 2021-04-28  3:29 ` Xia, Chenbo
  3 siblings, 0 replies; 5+ messages in thread
From: Xia, Chenbo @ 2021-04-28  3:29 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Matan Azrad, Viacheslav Ovsiienko

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Thursday, April 22, 2021 1:59 AM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Viacheslav Ovsiienko
> <viacheslavo@nvidia.com>
> Subject: [dpdk-dev] [PATCH] 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.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> index 404e135d5c..ca6e985336 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> @@ -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;
> --
> 2.31.1

Applied to next-virtio/main, thanks

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

end of thread, other threads:[~2021-04-28  3:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 17:59 [dpdk-dev] [PATCH] vdpa/mlx5: improve portability of thread naming Thomas Monjalon
2021-04-26  5:04 ` Xia, Chenbo
2021-04-26  7:59 ` Matan Azrad
2021-04-26  9:04 ` fengchengwen
2021-04-28  3:29 ` Xia, Chenbo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.