DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Issues with running multicore
@ 2015-11-25 17:59 Sugumaran, Varthamanan
  2015-11-26 22:20 ` Bruce Richardson
  0 siblings, 1 reply; 4+ messages in thread
From: Sugumaran, Varthamanan @ 2015-11-25 17:59 UTC (permalink / raw)
  To: dev; +Cc: Bly, Mike

Hi All,
Iam trying to create multi core application by mapping separate function for each core.
I had followed Multi process example and I had used pthread.
The use case is:

1.      In a single process, launch pthread and run rte_eal_init

2.      Once  rte_eal_init is done, create 3 pthreads

3.      Launch master core.

4.      In each of 3 pthread, launch slave core.

The issue is, I don't see 4 cores running. Instead I see only single core running.

Here is the Pseudo code:

Init_pmd{
   ret = rte_eal_init(args, argv) ==> I had set the number of cores to 4 in the params.

    pthread_create(&thread1, NULL, (void*)threadFun1, NULL);
    pthread_create(&thread2, NULL, (void*)threadFun2, NULL);
    pthread_create(&thread3, NULL, (void*)threadFun3, NULL);

   rte_eal_mp_remote_launch(launch_pmd_single_lcore, NULL, CALL_MASTER);

}

Iam mapping each core to threadFun1, threadFun2 and threadFun3.

threadFun1
{
   RTE_LCORE_FOREACH_SLAVE(lcore_id)
   {
      if( lcore_id == 1 )
         rte_eal_remote_launch(threadFun1_launch_one_lcore, NULL, lcore_id);
   }
}

Has anyone seen this issue?
Please let me know if iam missing something?

Thanks
Vartha

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

* Re: [dpdk-dev] Issues with running multicore
  2015-11-25 17:59 [dpdk-dev] Issues with running multicore Sugumaran, Varthamanan
@ 2015-11-26 22:20 ` Bruce Richardson
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2015-11-26 22:20 UTC (permalink / raw)
  To: Sugumaran, Varthamanan; +Cc: dev, Bly, Mike

On Wed, Nov 25, 2015 at 12:59:01PM -0500, Sugumaran, Varthamanan wrote:
> Hi All,
> Iam trying to create multi core application by mapping separate function for each core.
> I had followed Multi process example and I had used pthread.
> The use case is:
> 
> 1.      In a single process, launch pthread and run rte_eal_init
> 
> 2.      Once  rte_eal_init is done, create 3 pthreads
> 
> 3.      Launch master core.
> 
> 4.      In each of 3 pthread, launch slave core.
> 
> The issue is, I don't see 4 cores running. Instead I see only single core running.
> 
> Here is the Pseudo code:
> 
> Init_pmd{
>    ret = rte_eal_init(args, argv) ==> I had set the number of cores to 4 in the params.

Just to clarify here, what did you actually use as the coremask. If you used
-c 4, then that will cause only a single thread to be used running on core 2.

> 
>     pthread_create(&thread1, NULL, (void*)threadFun1, NULL);
>     pthread_create(&thread2, NULL, (void*)threadFun2, NULL);
>     pthread_create(&thread3, NULL, (void*)threadFun3, NULL);

These threads are separate from any threads used by DPDK, and DPDK will not use
them for anything, or assign them to any lcores. Unless you configure them
otherwise in your code, they will run on the same physical core as the master
thread.

> 
>    rte_eal_mp_remote_launch(launch_pmd_single_lcore, NULL, CALL_MASTER);
> 

This call will only launch functions on the threads created by DPDK - not the
other threads you created above.

> }
> 
> Iam mapping each core to threadFun1, threadFun2 and threadFun3.
> 
> threadFun1
> {
>    RTE_LCORE_FOREACH_SLAVE(lcore_id)
>    {
>       if( lcore_id == 1 )
>          rte_eal_remote_launch(threadFun1_launch_one_lcore, NULL, lcore_id);
>    }
> }
> 
> Has anyone seen this issue?
> Please let me know if iam missing something?

I'm not sure your understanding of how DPDK threads work is correct. See my
comments above, and perhaps check how things are done in a number of the DPDK
sample applications to see if what you want can be done without additional 
pthread calls in your application.

/Bruce

> 
> Thanks
> Vartha
> 

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

* Re: [dpdk-dev] Issues with running multicore
  2015-11-25 19:23 Abdul, Jaffar
@ 2015-11-25 19:29 ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-11-25 19:29 UTC (permalink / raw)
  To: Abdul, Jaffar; +Cc: dev

2015-11-25 12:59, Sugumaran, Varthamanan
2015-11-25 14:18, Abdul, Jaffar
2015-11-25 14:23, Abdul, Jaffar

OK we got the question. 3 times actually.

An advice for next time: the mailing list users@dpdk.org is
dedicated to this kind of question.

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

* [dpdk-dev]  Issues with running multicore
@ 2015-11-25 19:23 Abdul, Jaffar
  2015-11-25 19:29 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Abdul, Jaffar @ 2015-11-25 19:23 UTC (permalink / raw)
  To: dev

Hi All,
Iam trying to create multi core application by mapping separate function for each core.
I had followed Multi process example and I had used pthread.
The use case is:

1.      In a single process, launch pthread and run rte_eal_init

2.      Once  rte_eal_init is done, create 3 pthreads

3.      Launch master core.

4.      In each of 3 pthread, launch slave core.

The issue is, I don't see 4 cores running. Instead I see only single core running.

Here is the Pseudo code:

Init_pmd{
   ret = rte_eal_init(args, argv) ==> I had set the number of cores to 4 in the params.

    pthread_create(&thread1, NULL, (void*)threadFun1, NULL);
    pthread_create(&thread2, NULL, (void*)threadFun2, NULL);
    pthread_create(&thread3, NULL, (void*)threadFun3, NULL);

   rte_eal_mp_remote_launch(launch_pmd_single_lcore, NULL, CALL_MASTER);

}

Iam mapping each core to threadFun1, threadFun2 and threadFun3.

threadFun1
{
   RTE_LCORE_FOREACH_SLAVE(lcore_id)
   {
      if( lcore_id == 1 )
         rte_eal_remote_launch(threadFun1_launch_one_lcore, NULL, lcore_id);
   }
}

Has anyone seen this issue?
Please let me know if iam missing something?

Thanks
Jaffar

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

end of thread, other threads:[~2015-11-26 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-25 17:59 [dpdk-dev] Issues with running multicore Sugumaran, Varthamanan
2015-11-26 22:20 ` Bruce Richardson
2015-11-25 19:23 Abdul, Jaffar
2015-11-25 19:29 ` 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).