DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue
@ 2019-11-20  1:55 Li Han
  2019-11-20  7:36 ` David Marchand
  2019-11-20 10:45 ` Ananyev, Konstantin
  0 siblings, 2 replies; 3+ messages in thread
From: Li Han @ 2019-11-20  1:55 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, Li Han

when we run dpdk in docker, process pid may the same.
add rte_rdtsc() to ensure all the names used in rte_fbarray_init
are different.

Signed-off-by: Li Han <han.li1@zte.com.cn>
---
 lib/librte_eal/linux/eal/eal_memalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
index af6d0d0..65a7183 100644
--- a/lib/librte_eal/linux/eal/eal_memalloc.c
+++ b/lib/librte_eal/linux/eal/eal_memalloc.c
@@ -1374,8 +1374,8 @@ struct rte_memseg *
 	local_msl = &local_memsegs[msl_idx];
 
 	/* create distinct fbarrays for each secondary */
-	snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
-		primary_msl->memseg_arr.name, getpid());
+	snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64,
+		primary_msl->memseg_arr.name, getpid(), rte_rdtsc());
 
 	ret = rte_fbarray_init(&local_msl->memseg_arr, name,
 		primary_msl->memseg_arr.len,
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue
  2019-11-20  1:55 [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue Li Han
@ 2019-11-20  7:36 ` David Marchand
  2019-11-20 10:45 ` Ananyev, Konstantin
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2019-11-20  7:36 UTC (permalink / raw)
  To: Li Han; +Cc: Burakov, Anatoly, dev, Yasufumi Ogawa

On Wed, Nov 20, 2019 at 3:48 AM Li Han <han.li1@zte.com.cn> wrote:
>
> when we run dpdk in docker, process pid may the same.
> add rte_rdtsc() to ensure all the names used in rte_fbarray_init
> are different.

There is already a fix being prepared by Yasufumi Ogawa.
https://patchwork.dpdk.org/patch/62972/


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue
  2019-11-20  1:55 [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue Li Han
  2019-11-20  7:36 ` David Marchand
@ 2019-11-20 10:45 ` Ananyev, Konstantin
  1 sibling, 0 replies; 3+ messages in thread
From: Ananyev, Konstantin @ 2019-11-20 10:45 UTC (permalink / raw)
  To: Li Han, Burakov, Anatoly; +Cc: dev


> 
> when we run dpdk in docker, process pid may the same.
> add rte_rdtsc() to ensure all the names used in rte_fbarray_init
> are different.

There is another patch addressing similar issue, but in a slightly
different way:
http://patches.dpdk.org/patch/62972/


> 
> Signed-off-by: Li Han <han.li1@zte.com.cn>
> ---
>  lib/librte_eal/linux/eal/eal_memalloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
> index af6d0d0..65a7183 100644
> --- a/lib/librte_eal/linux/eal/eal_memalloc.c
> +++ b/lib/librte_eal/linux/eal/eal_memalloc.c
> @@ -1374,8 +1374,8 @@ struct rte_memseg *
>  	local_msl = &local_memsegs[msl_idx];
> 
>  	/* create distinct fbarrays for each secondary */
> -	snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
> -		primary_msl->memseg_arr.name, getpid());
> +	snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64,
> +		primary_msl->memseg_arr.name, getpid(), rte_rdtsc());
> 
>  	ret = rte_fbarray_init(&local_msl->memseg_arr, name,
>  		primary_msl->memseg_arr.len,
> --
> 1.8.3.1


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

end of thread, other threads:[~2019-11-20 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20  1:55 [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue Li Han
2019-11-20  7:36 ` David Marchand
2019-11-20 10:45 ` Ananyev, Konstantin

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