From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8D2DF58E8 for ; Tue, 8 Apr 2014 18:14:51 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 08 Apr 2014 08:51:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,818,1389772800"; d="scan'208";a="516771659" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by fmsmga002.fm.intel.com with ESMTP; 08 Apr 2014 08:51:02 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 8 Apr 2014 08:50:28 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.3.218]) by fmsmsx158.amr.corp.intel.com ([169.254.15.20]) with mapi id 14.03.0123.003; Tue, 8 Apr 2014 08:50:28 -0700 From: "Shaw, Jeffrey B" To: Etai Lev Ran , "dev@dpdk.org" Thread-Topic: [dpdk-dev] Using DPDK in a multiprocess environment Thread-Index: Ac9TOe2Fbx0c5tRdT7KSQmnYo1ywDwAB4Djw Date: Tue, 8 Apr 2014 15:50:28 +0000 Message-ID: <4032A54B6BB5F04B8C08B6CFF08C59285540FFDA@FMSMSX103.amr.corp.intel.com> References: <032101cf533c$f871bb60$e9553220$@gmail.com> In-Reply-To: <032101cf533c$f871bb60$e9553220$@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Using DPDK in a multiprocess environment 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, 08 Apr 2014 16:14:52 -0000 Have you tried calling "rte_eal_init()" closer to the beginning of the prog= ram in your secondary process (i.e. the first thing in main())? The same mmap address is required. The reason is simple, if process A thin= ks the virtual address of an mbuf is 123, and process B thinks the virtual = address of the same mbuf is 456, either process may segmentation fault, acc= essing mbuf memory that is not actually mapped into the processes address s= pace. Jeff -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Etai Lev Ran Sent: Tuesday, April 08, 2014 8:13 AM To: dev@dpdk.org Subject: [dpdk-dev] Using DPDK in a multiprocess environment Hi, =20 I'd like to split DPDK application functionality into a setup (primary) pro= cess and business logic (secondary) processes. The secondary processes access the hardware queues directly (exclusive queu= e per process) and not through software rings. =20 I'm running into an initialization problem: - The primary starts and sets up memory and ports and then goes to sleep waiting for termination signal - Secondary processes fail when probing the PCI bus for devices (required, otherwise I get 0 ports visible in the secondary) =20 The error is directly related to the secondary failing to get the *same* vi= rtual address for mmap'ing the UIO device fd's. The reason is that the secondary processes has considerably more shared obj= ects loaded and some of these are loaded and mapped into addresses which the primary used to map UIO fd's. The pci_map_resource() (linuxapp/eal_pci.c) code explicitly requires that = the secondary processes get the same mmap'ed address as given to the primary. =20 1) Is this behavior (same mmap address) required? 2) If so, is there a workaround to cause PCI areas of UIO devices to b= e mapped to the same location in arbitrary processes? =20 The samples work just fine since all primary and secondary processes have s= imilar set and load order for .so's =20 Using v1.6 on Ubuntu 12.04 64b, ixgbe devices, 1GB hugepages, ASLR disable= d. =20 Thanks, Etai =20