From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5A34468C5 for ; Tue, 18 Feb 2014 13:51:56 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 18 Feb 2014 04:49:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,501,1389772800"; d="scan'208";a="485167099" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga002.jf.intel.com with ESMTP; 18 Feb 2014 04:53:18 -0800 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 18 Feb 2014 12:53:17 +0000 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.84]) by IRSMSX152.ger.corp.intel.com ([163.33.192.66]) with mapi id 14.03.0123.003; Tue, 18 Feb 2014 12:53:17 +0000 From: "Richardson, Bruce" To: Mauro Annarumma , "dev@dpdk.org" Thread-Topic: [dpdk-dev] Question on DPDK multi-process support Thread-Index: AQHPK/e2nwsjY5JTlEiVmV6WzTEdYpq5pZKQgAFRPACAAABUwA== Date: Tue, 18 Feb 2014 12:53:17 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B01A99D524@IRSMSX103.ger.corp.intel.com> References: , <59AF69C657FD0841A61C55336867B5B01A99D070@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.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Question on DPDK multi-process support 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: Tue, 18 Feb 2014 12:51:57 -0000 If you disable mempool caches, you may be able to run more processes than y= ou have cores, but other issues with duplicate core id's might arise, and y= our application performance will suffer as the memory pools will be very si= gnificantly slower. However, there is no requirement that the lcore_id actually matches the phy= sical core on which the thread is running, so for threads where the core id= s will overlap, you could assign a new core id value for some of the them. = This can be done in your code by just writing to the global variable _lcore= _id, which is defined in eal_thread.c. The core id value must be unique to = each thread, and must be between 0 and RTE_MAX_LCORE. In general, though, it is recommended that for packet processing you run on= ly a single thread pinned to each logical core on a system. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mauro > Annarumma > Sent: Tuesday, February 18, 2014 12:46 PM > To: dev@dpdk.org > Subject: Re: [dpdk-dev] Question on DPDK multi-process support >=20 > Hi Bruce, > just for dispel > any doubt: if there is one primary process and N secondary processes, an= d > each process uses only one logical core (they have a coremask equal to > 0x01, 0x02, 0x04, ....), I can run at the same time at most "my CPU logic= al > cores - 1" secondary processes. Is it right? > Is it true also if I disable the mempool per-core cache? >=20 > Thanks for your help, regards. >=20 > Mauro >=20 > > From: bruce.richardson@intel.com > > To: mauroannarumma@hotmail.it; dev@dpdk.org > > Subject: RE: [dpdk-dev] Question on DPDK multi-process support > > Date: Mon, 17 Feb 2014 16:44:55 +0000 > > > > > Hi, > > > I have some doubts on the DPDK multi-process support: > > > > > > 1) According to the Programmers Guide (pag. 109 - 20.3 Multi-process > > > Limitations), one of the multi-process limitations is: > > > > > > "All Intel(r) DPDK processes running as a single application and > > > using shared memory must have distinct coremask arguments. It is not > > > possible to have a primary and secondary instance, or two secondary > > > instances, using any of the same logical cores. Attempting to do so > > > can cause corruption of memory pool caches, among other issues." > > > > > > Does it mean that I can run a number of DPDK processes at most equal > > > to the number of my CPU logical cores? In the case I run 2 > > > mono-lcore DPDK processes with the same coremask, what are the > possible issues? > > > > > The potential issues are caused by a dependence on the lcore_id interna= lly > by Intel DPDK data structures, especially mempools. If two processes use > the same lcore they will have the same lcore_id value, and will try and > access the same mempool cache which is not thread-safe. This will cause > mempool corruption. > > NOTE: this applies only to co-operating processes, i.e. those run as > primary and secondary processes. There are no mempool issues with > running completely independent Intel DPDK processes on the same cores, > i.e. processes run using different "--file-prefix=3D" parameters, since t= hose do > not share any memory and data structures. > > > > > > > > 2) Can a secondary process use the rte_eth_rx_burst over a queue of > > > a NIC port configured in the primary process? > > > > > Yes. NIC ports and their data structures are shared between co-operatin= g > processes. Multiple processes doing RX on the same port is shown in the > "examples/multi_process/symmetric_mp" example application. >=20