From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id DAF7CDE0 for ; Mon, 25 Nov 2013 10:29:26 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga101.ch.intel.com with ESMTP; 25 Nov 2013 01:30:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,766,1378882800"; d="scan'208";a="433225459" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga001.fm.intel.com with ESMTP; 25 Nov 2013 01:30:21 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 25 Nov 2013 09:29:05 +0000 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.66]) by IRSMSX151.ger.corp.intel.com ([169.254.4.126]) with mapi id 14.03.0123.003; Mon, 25 Nov 2013 09:29:05 +0000 From: "Richardson, Bruce" To: Prashant Upadhyaya , "dev@dpdk.org" Thread-Topic: Query regarding multiple processes in DPDK Thread-Index: Ac7nf/izY2xhv9ftQ/6e54GzBsCm/QABo68QAABRxpAAAFXlQACCerVAAAthgQA= Date: Mon, 25 Nov 2013 09:29:04 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B01A977283@IRSMSX103.ger.corp.intel.com> References: <59AF69C657FD0841A61C55336867B5B01A976C1F@IRSMSX103.ger.corp.intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 09:29:27 -0000 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 secondar= y one, to ensure it reattaches to memory properly instead of trying to re-i= nitialize 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 >=20 > Hi Bruce, >=20 > One more question -- >=20 > 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 ha= d > done the lookup intact, or does the fact that primary died will lead to a= ll the > memory also taken away with it so that the secondary can no longer > function now ? >=20 > Regards > -Prashant >=20 >=20 > -----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 >=20 > Thanks Bruce, I think your suggested example of multi_process answers my > questions. >=20 > Regards > -Prashant >=20 >=20 > -----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 >=20 > Hi Bruce, >=20 > Thanks. >=20 > 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 w= ill > 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. >=20 > I was really hoping that the --proc-type=3Dauto, would make the DPDK > libraries internally resolving all this stuff, is that not the case ? I h= ave 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=3Dauto is used ? >=20 > Regards > -Prashant >=20 > -----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 >=20 > Hi Prashant >=20 > > =3D=3D=3D > > The EAL also supports an auto-detection mode (set by EAL > > --proc-type=3Dauto flag), whereby an Intel(r) DPDK process is started a= s > > a secondary instance if a primary instance is already running. > > =3D=3D=3D > > > > 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 =3D 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=3Dauto, then > > this second instance automatically becomes secondary ? > [BR] Yes, that is the idea. >=20 > > > > 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 w= ill > 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. >=20 > Regards, > /Bruce >=20 >=20 >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Please refer to http://www.aricent.com/legal/email_disclaimer.html > for important disclosures regarding this electronic communication. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Please refer to http://www.aricent.com/legal/email_disclaimer.html > for important disclosures regarding this electronic communication. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Please refer to http://www.aricent.com/legal/email_disclaimer.html > for important disclosures regarding this electronic communication. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D