DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Query regarding multiple processes in DPDK
@ 2013-11-22 12:50 Prashant Upadhyaya
  2013-11-22 13:31 ` Richardson, Bruce
  0 siblings, 1 reply; 8+ messages in thread
From: Prashant Upadhyaya @ 2013-11-22 12:50 UTC (permalink / raw)
  To: dev

Hi guys,

The DPDP programmer's guide mentions -

===
The EAL also supports an auto-detection mode (set by EAL --proc-type=auto flag),
whereby an Intel(r) DPDK process is started as a secondary instance if a primary
instance is already running.
===

So does this mean that if I have a DPDK exe foo.out, then when I run the first instance of foo.out with -proc-type = auto, then foo.out will run as a primary process and when I spawn the second instance of foo.out (with first already running) again with -proc-type=auto, then this second instance automatically becomes secondary ?

Also is there any user code initialization change required or exactly the same code will work for both the processes ?

Regards
-Prashant






===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-22 12:50 [dpdk-dev] Query regarding multiple processes in DPDK Prashant Upadhyaya
@ 2013-11-22 13:31 ` Richardson, Bruce
  2013-11-22 13:40   ` Prashant Upadhyaya
  0 siblings, 1 reply; 8+ messages in thread
From: Richardson, Bruce @ 2013-11-22 13:31 UTC (permalink / raw)
  To: Prashant Upadhyaya, dev

Hi Prashant

> ===
> The EAL also supports an auto-detection mode (set by EAL --proc-type=auto
> flag), whereby an Intel(r) DPDK process is started as a secondary instance if
> a primary instance is already running.
> ===
> 
> So does this mean that if I have a DPDK exe foo.out, then when I run the
> first instance of foo.out with -proc-type = auto, then foo.out will run as a
> primary process and when I spawn the second instance of foo.out (with first
> already running) again with -proc-type=auto, then this second instance
> automatically becomes secondary ?
[BR] Yes, that is the idea.

> 
> Also is there any user code initialization change required or exactly the
> same code will work for both the processes ?
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead. 
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

Regards,
/Bruce

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-22 13:31 ` Richardson, Bruce
@ 2013-11-22 13:40   ` Prashant Upadhyaya
  2013-11-22 13:46     ` Prashant Upadhyaya
  0 siblings, 1 reply; 8+ messages in thread
From: Prashant Upadhyaya @ 2013-11-22 13:40 UTC (permalink / raw)
  To: Richardson, Bruce, dev

Hi Bruce,

Thanks.

Regarding your comment --
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

I was really hoping that the --proc-type=auto, would make the DPDK libraries internally resolving all this stuff, is that not the case ? I have not started reading the code for all this yet.
I must launch the same executable twice in my usecase. Even if the executable code has to make different calls when it comes up as secondary, is there a way for the usercode to know that it has really come up as secondary when the --proc-type=auto is used ?

Regards
-Prashant

-----Original Message-----
From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
Sent: Friday, November 22, 2013 7:02 PM
To: Prashant Upadhyaya; dev@dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

Hi Prashant

> ===
> The EAL also supports an auto-detection mode (set by EAL
> --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> a secondary instance if a primary instance is already running.
> ===
>
> So does this mean that if I have a DPDK exe foo.out, then when I run
> the first instance of foo.out with -proc-type = auto, then foo.out
> will run as a primary process and when I spawn the second instance of
> foo.out (with first already running) again with -proc-type=auto, then
> this second instance automatically becomes secondary ?
[BR] Yes, that is the idea.

>
> Also is there any user code initialization change required or exactly
> the same code will work for both the processes ?
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

Regards,
/Bruce





===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-22 13:40   ` Prashant Upadhyaya
@ 2013-11-22 13:46     ` Prashant Upadhyaya
  2013-11-25  4:08       ` Prashant Upadhyaya
  0 siblings, 1 reply; 8+ messages in thread
From: Prashant Upadhyaya @ 2013-11-22 13:46 UTC (permalink / raw)
  To: Richardson, Bruce, dev

Thanks Bruce, I think your suggested example of multi_process answers my questions.

Regards
-Prashant


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant Upadhyaya
Sent: Friday, November 22, 2013 7:10 PM
To: Richardson, Bruce; dev@dpdk.org
Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK

Hi Bruce,

Thanks.

Regarding your comment --
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

I was really hoping that the --proc-type=auto, would make the DPDK libraries internally resolving all this stuff, is that not the case ? I have not started reading the code for all this yet.
I must launch the same executable twice in my usecase. Even if the executable code has to make different calls when it comes up as secondary, is there a way for the usercode to know that it has really come up as secondary when the --proc-type=auto is used ?

Regards
-Prashant

-----Original Message-----
From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
Sent: Friday, November 22, 2013 7:02 PM
To: Prashant Upadhyaya; dev@dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

Hi Prashant

> ===
> The EAL also supports an auto-detection mode (set by EAL
> --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> a secondary instance if a primary instance is already running.
> ===
>
> So does this mean that if I have a DPDK exe foo.out, then when I run
> the first instance of foo.out with -proc-type = auto, then foo.out
> will run as a primary process and when I spawn the second instance of
> foo.out (with first already running) again with -proc-type=auto, then
> this second instance automatically becomes secondary ?
[BR] Yes, that is the idea.

>
> Also is there any user code initialization change required or exactly
> the same code will work for both the processes ?
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

Regards,
/Bruce





===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================




===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-22 13:46     ` Prashant Upadhyaya
@ 2013-11-25  4:08       ` Prashant Upadhyaya
  2013-11-25  9:29         ` Richardson, Bruce
  0 siblings, 1 reply; 8+ messages in thread
From: Prashant Upadhyaya @ 2013-11-25  4:08 UTC (permalink / raw)
  To: Richardson, Bruce, dev

Hi Bruce,

One more question --

Suppose the first instance comes up as primary and creates the mbuf pool and rings etc. [ok]
Now, the second instance comes up as secondary and does the corresponding lookup functions [ok]
Now the primary exits -- at this point can the secondary still run with all the memory to which it had done the lookup intact, or does the fact that primary died will lead to all the memory also taken away with it so that the secondary can no longer function now ?

Regards
-Prashant


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant Upadhyaya
Sent: Friday, November 22, 2013 7:16 PM
To: Richardson, Bruce; dev@dpdk.org
Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK

Thanks Bruce, I think your suggested example of multi_process answers my questions.

Regards
-Prashant


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant Upadhyaya
Sent: Friday, November 22, 2013 7:10 PM
To: Richardson, Bruce; dev@dpdk.org
Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK

Hi Bruce,

Thanks.

Regarding your comment --
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

I was really hoping that the --proc-type=auto, would make the DPDK libraries internally resolving all this stuff, is that not the case ? I have not started reading the code for all this yet.
I must launch the same executable twice in my usecase. Even if the executable code has to make different calls when it comes up as secondary, is there a way for the usercode to know that it has really come up as secondary when the --proc-type=auto is used ?

Regards
-Prashant

-----Original Message-----
From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
Sent: Friday, November 22, 2013 7:02 PM
To: Prashant Upadhyaya; dev@dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

Hi Prashant

> ===
> The EAL also supports an auto-detection mode (set by EAL
> --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> a secondary instance if a primary instance is already running.
> ===
>
> So does this mean that if I have a DPDK exe foo.out, then when I run
> the first instance of foo.out with -proc-type = auto, then foo.out
> will run as a primary process and when I spawn the second instance of
> foo.out (with first already running) again with -proc-type=auto, then
> this second instance automatically becomes secondary ?
[BR] Yes, that is the idea.

>
> Also is there any user code initialization change required or exactly
> the same code will work for both the processes ?
[BR] It will depend upon the application, but in most cases you probably want to have slightly different code paths for primary and secondary instances. For example, if a process is running as primary instance, it will probably call rte_mempool_create or rte_ring_create. A secondary instance which wants to use these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and secondary process, I suggest looking at the symmetric_mp example application in the examples/multi_process/ directory.

Regards,
/Bruce





===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================




===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================




===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-25  4:08       ` Prashant Upadhyaya
@ 2013-11-25  9:29         ` Richardson, Bruce
  2013-11-25 13:57           ` Prashant Upadhyaya
  0 siblings, 1 reply; 8+ messages in thread
From: Richardson, Bruce @ 2013-11-25  9:29 UTC (permalink / raw)
  To: Prashant Upadhyaya, dev

If the primary process dies:
a) The memory does not go away, so the second process can still use it
b) When restarting the primary process, you should restart it as a secondary one, to ensure it reattaches to memory properly instead of trying to re-initialize it.

Regards
/Bruce

> -----Original Message-----
> From: Prashant Upadhyaya [mailto:prashant.upadhyaya@aricent.com]
> Sent: Monday, November 25, 2013 4:08 AM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
> 
> Hi Bruce,
> 
> One more question --
> 
> Suppose the first instance comes up as primary and creates the mbuf pool
> and rings etc. [ok] Now, the second instance comes up as secondary and
> does the corresponding lookup functions [ok] Now the primary exits -- at
> this point can the secondary still run with all the memory to which it had
> done the lookup intact, or does the fact that primary died will lead to all the
> memory also taken away with it so that the secondary can no longer
> function now ?
> 
> Regards
> -Prashant
> 
> 
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:16 PM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
> 
> Thanks Bruce, I think your suggested example of multi_process answers my
> questions.
> 
> Regards
> -Prashant
> 
> 
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:10 PM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
> 
> Hi Bruce,
> 
> Thanks.
> 
> Regarding your comment --
> [BR] It will depend upon the application, but in most cases you probably
> want to have slightly different code paths for primary and secondary
> instances. For example, if a process is running as primary instance, it will
> probably call rte_mempool_create or rte_ring_create. A secondary instance
> which wants to use these should instead call rte_mempool_lookup and
> rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both primary
> and secondary process, I suggest looking at the symmetric_mp example
> application in the examples/multi_process/ directory.
> 
> I was really hoping that the --proc-type=auto, would make the DPDK
> libraries internally resolving all this stuff, is that not the case ? I have not
> started reading the code for all this yet.
> I must launch the same executable twice in my usecase. Even if the
> executable code has to make different calls when it comes up as secondary,
> is there a way for the usercode to know that it has really come up as
> secondary when the --proc-type=auto is used ?
> 
> Regards
> -Prashant
> 
> -----Original Message-----
> From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
> Sent: Friday, November 22, 2013 7:02 PM
> To: Prashant Upadhyaya; dev@dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
> 
> Hi Prashant
> 
> > ===
> > The EAL also supports an auto-detection mode (set by EAL
> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> > a secondary instance if a primary instance is already running.
> > ===
> >
> > So does this mean that if I have a DPDK exe foo.out, then when I run
> > the first instance of foo.out with -proc-type = auto, then foo.out
> > will run as a primary process and when I spawn the second instance of
> > foo.out (with first already running) again with -proc-type=auto, then
> > this second instance automatically becomes secondary ?
> [BR] Yes, that is the idea.
> 
> >
> > Also is there any user code initialization change required or exactly
> > the same code will work for both the processes ?
> [BR] It will depend upon the application, but in most cases you probably
> want to have slightly different code paths for primary and secondary
> instances. For example, if a process is running as primary instance, it will
> probably call rte_mempool_create or rte_ring_create. A secondary instance
> which wants to use these should instead call rte_mempool_lookup and
> rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both primary
> and secondary process, I suggest looking at the symmetric_mp example
> application in the examples/multi_process/ directory.
> 
> Regards,
> /Bruce
> 
> 
> 
> 
> 
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================
> 
> 
> 
> 
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================
> 
> 
> 
> 
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-25  9:29         ` Richardson, Bruce
@ 2013-11-25 13:57           ` Prashant Upadhyaya
  2013-11-25 19:55             ` Jeff Venable, Sr.
  0 siblings, 1 reply; 8+ messages in thread
From: Prashant Upadhyaya @ 2013-11-25 13:57 UTC (permalink / raw)
  To: Richardson, Bruce, dev

Hi Bruce,

Thanks, this was very useful information.

Regards
-Prashant


-----Original Message-----
From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
Sent: Monday, November 25, 2013 2:59 PM
To: Prashant Upadhyaya; dev@dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

If the primary process dies:
a) The memory does not go away, so the second process can still use it
b) When restarting the primary process, you should restart it as a secondary one, to ensure it reattaches to memory properly instead of trying to re-initialize it.

Regards
/Bruce

> -----Original Message-----
> From: Prashant Upadhyaya [mailto:prashant.upadhyaya@aricent.com]
> Sent: Monday, November 25, 2013 4:08 AM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
>
> Hi Bruce,
>
> One more question --
>
> Suppose the first instance comes up as primary and creates the mbuf
> pool and rings etc. [ok] Now, the second instance comes up as
> secondary and does the corresponding lookup functions [ok] Now the
> primary exits -- at this point can the secondary still run with all
> the memory to which it had done the lookup intact, or does the fact
> that primary died will lead to all the memory also taken away with it
> so that the secondary can no longer function now ?
>
> Regards
> -Prashant
>
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:16 PM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>
> Thanks Bruce, I think your suggested example of multi_process answers
> my questions.
>
> Regards
> -Prashant
>
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:10 PM
> To: Richardson, Bruce; dev@dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>
> Hi Bruce,
>
> Thanks.
>
> Regarding your comment --
> [BR] It will depend upon the application, but in most cases you
> probably want to have slightly different code paths for primary and
> secondary instances. For example, if a process is running as primary
> instance, it will probably call rte_mempool_create or rte_ring_create.
> A secondary instance which wants to use these should instead call
> rte_mempool_lookup and rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both
> primary and secondary process, I suggest looking at the symmetric_mp
> example application in the examples/multi_process/ directory.
>
> I was really hoping that the --proc-type=auto, would make the DPDK
> libraries internally resolving all this stuff, is that not the case ?
> I have not started reading the code for all this yet.
> I must launch the same executable twice in my usecase. Even if the
> executable code has to make different calls when it comes up as
> secondary, is there a way for the usercode to know that it has really
> come up as secondary when the --proc-type=auto is used ?
>
> Regards
> -Prashant
>
> -----Original Message-----
> From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
> Sent: Friday, November 22, 2013 7:02 PM
> To: Prashant Upadhyaya; dev@dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
>
> Hi Prashant
>
> > ===
> > The EAL also supports an auto-detection mode (set by EAL
> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started
> > as a secondary instance if a primary instance is already running.
> > ===
> >
> > So does this mean that if I have a DPDK exe foo.out, then when I run
> > the first instance of foo.out with -proc-type = auto, then foo.out
> > will run as a primary process and when I spawn the second instance
> > of foo.out (with first already running) again with -proc-type=auto,
> > then this second instance automatically becomes secondary ?
> [BR] Yes, that is the idea.
>
> >
> > Also is there any user code initialization change required or
> > exactly the same code will work for both the processes ?
> [BR] It will depend upon the application, but in most cases you
> probably want to have slightly different code paths for primary and
> secondary instances. For example, if a process is running as primary
> instance, it will probably call rte_mempool_create or rte_ring_create.
> A secondary instance which wants to use these should instead call
> rte_mempool_lookup and rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both
> primary and secondary process, I suggest looking at the symmetric_mp
> example application in the examples/multi_process/ directory.
>
> Regards,
> /Bruce
>
>
>
>
>
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================
>
>
>
>
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================
>
>
>
>
> ==========================================================
> =====================
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==========================================================
> =====================




===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

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

* Re: [dpdk-dev] Query regarding multiple processes in DPDK
  2013-11-25 13:57           ` Prashant Upadhyaya
@ 2013-11-25 19:55             ` Jeff Venable, Sr.
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Venable, Sr. @ 2013-11-25 19:55 UTC (permalink / raw)
  To: Prashant Upadhyaya, Richardson, Bruce, dev

The memory configuration will persist while the files describing them do.
By default, these are located in /var/run/.rte_config and
/var/run/.rte_hugepage_info.  Even if you terminate all processes, you can
still launch new secondary processes which will find those files and
attach, and unless something is messing with your huge pages the memory
state will be as it was left before.  The logic for these file locations
is in lib/librte_eal/linuxapp/eal/include/eal_filesystem.h if you want to
review the code.  You can search the rest of the code for calls to these
functions to locate the logic regarding what¹s stored in the files.

Jeff

On 11/25/13, 5:57 AM, "Prashant Upadhyaya"
<prashant.upadhyaya@aricent.com> wrote:

>Hi Bruce,
>
>Thanks, this was very useful information.
>
>Regards
>-Prashant
>
>
>-----Original Message-----
>From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
>Sent: Monday, November 25, 2013 2:59 PM
>To: Prashant Upadhyaya; dev@dpdk.org
>Subject: RE: Query regarding multiple processes in DPDK
>
>If the primary process dies:
>a) The memory does not go away, so the second process can still use it
>b) When restarting the primary process, you should restart it as a
>secondary one, to ensure it reattaches to memory properly instead of
>trying to re-initialize it.
>
>Regards
>/Bruce
>
>> -----Original Message-----
>> From: Prashant Upadhyaya [mailto:prashant.upadhyaya@aricent.com]
>> Sent: Monday, November 25, 2013 4:08 AM
>> To: Richardson, Bruce; dev@dpdk.org
>> Subject: RE: Query regarding multiple processes in DPDK
>>
>> Hi Bruce,
>>
>> One more question --
>>
>> Suppose the first instance comes up as primary and creates the mbuf
>> pool and rings etc. [ok] Now, the second instance comes up as
>> secondary and does the corresponding lookup functions [ok] Now the
>> primary exits -- at this point can the secondary still run with all
>> the memory to which it had done the lookup intact, or does the fact
>> that primary died will lead to all the memory also taken away with it
>> so that the secondary can no longer function now ?
>>
>> Regards
>> -Prashant
>>
>>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
>> Upadhyaya
>> Sent: Friday, November 22, 2013 7:16 PM
>> To: Richardson, Bruce; dev@dpdk.org
>> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>>
>> Thanks Bruce, I think your suggested example of multi_process answers
>> my questions.
>>
>> Regards
>> -Prashant
>>
>>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Prashant
>> Upadhyaya
>> Sent: Friday, November 22, 2013 7:10 PM
>> To: Richardson, Bruce; dev@dpdk.org
>> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>>
>> Hi Bruce,
>>
>> Thanks.
>>
>> Regarding your comment --
>> [BR] It will depend upon the application, but in most cases you
>> probably want to have slightly different code paths for primary and
>> secondary instances. For example, if a process is running as primary
>> instance, it will probably call rte_mempool_create or rte_ring_create.
>> A secondary instance which wants to use these should instead call
>> rte_mempool_lookup and rte_ring_lookup instead.
>> For an example of how to write the one binary to be used as both
>> primary and secondary process, I suggest looking at the symmetric_mp
>> example application in the examples/multi_process/ directory.
>>
>> I was really hoping that the --proc-type=auto, would make the DPDK
>> libraries internally resolving all this stuff, is that not the case ?
>> I have not started reading the code for all this yet.
>> I must launch the same executable twice in my usecase. Even if the
>> executable code has to make different calls when it comes up as
>> secondary, is there a way for the usercode to know that it has really
>> come up as secondary when the --proc-type=auto is used ?
>>
>> Regards
>> -Prashant
>>
>> -----Original Message-----
>> From: Richardson, Bruce [mailto:bruce.richardson@intel.com]
>> Sent: Friday, November 22, 2013 7:02 PM
>> To: Prashant Upadhyaya; dev@dpdk.org
>> Subject: RE: Query regarding multiple processes in DPDK
>>
>> Hi Prashant
>>
>> > ===
>> > The EAL also supports an auto-detection mode (set by EAL
>> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started
>> > as a secondary instance if a primary instance is already running.
>> > ===
>> >
>> > So does this mean that if I have a DPDK exe foo.out, then when I run
>> > the first instance of foo.out with -proc-type = auto, then foo.out
>> > will run as a primary process and when I spawn the second instance
>> > of foo.out (with first already running) again with -proc-type=auto,
>> > then this second instance automatically becomes secondary ?
>> [BR] Yes, that is the idea.
>>
>> >
>> > Also is there any user code initialization change required or
>> > exactly the same code will work for both the processes ?
>> [BR] It will depend upon the application, but in most cases you
>> probably want to have slightly different code paths for primary and
>> secondary instances. For example, if a process is running as primary
>> instance, it will probably call rte_mempool_create or rte_ring_create.
>> A secondary instance which wants to use these should instead call
>> rte_mempool_lookup and rte_ring_lookup instead.
>> For an example of how to write the one binary to be used as both
>> primary and secondary process, I suggest looking at the symmetric_mp
>> example application in the examples/multi_process/ directory.
>>
>> Regards,
>> /Bruce
>>
>>
>>
>>
>>
>> ==========================================================
>> =====================
>> Please refer to http://www.aricent.com/legal/email_disclaimer.html
>> for important disclosures regarding this electronic communication.
>> ==========================================================
>> =====================
>>
>>
>>
>>
>> ==========================================================
>> =====================
>> Please refer to http://www.aricent.com/legal/email_disclaimer.html
>> for important disclosures regarding this electronic communication.
>> ==========================================================
>> =====================
>>
>>
>>
>>
>> ==========================================================
>> =====================
>> Please refer to http://www.aricent.com/legal/email_disclaimer.html
>> for important disclosures regarding this electronic communication.
>> ==========================================================
>> =====================
>
>
>
>
>==========================================================================
>=====
>Please refer to http://www.aricent.com/legal/email_disclaimer.html
>for important disclosures regarding this electronic communication.
>==========================================================================
>=====

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

end of thread, other threads:[~2013-11-25 19:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-22 12:50 [dpdk-dev] Query regarding multiple processes in DPDK Prashant Upadhyaya
2013-11-22 13:31 ` Richardson, Bruce
2013-11-22 13:40   ` Prashant Upadhyaya
2013-11-22 13:46     ` Prashant Upadhyaya
2013-11-25  4:08       ` Prashant Upadhyaya
2013-11-25  9:29         ` Richardson, Bruce
2013-11-25 13:57           ` Prashant Upadhyaya
2013-11-25 19:55             ` Jeff Venable, Sr.

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