From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 550385683 for ; Thu, 26 Nov 2015 23:20:26 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 26 Nov 2015 14:20:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,348,1444719600"; d="scan'208";a="829779417" Received: from kvkhairn-mobl.ger.corp.intel.com ([10.252.21.53]) by orsmga001.jf.intel.com with SMTP; 26 Nov 2015 14:20:23 -0800 Received: by (sSMTP sendmail emulation); Thu, 26 Nov 2015 22:20:21 +0025 Date: Thu, 26 Nov 2015 22:20:21 +0000 From: Bruce Richardson To: "Sugumaran, Varthamanan" Message-ID: <20151126222021.GA18416@bricha3-MOBL3> References: <5D52F6EC3531E949B1A9130CBFCE032F99359829@ONWVEXCHMB04.ciena.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5D52F6EC3531E949B1A9130CBFCE032F99359829@ONWVEXCHMB04.ciena.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" , "Bly, Mike" Subject: Re: [dpdk-dev] Issues with running multicore 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: Thu, 26 Nov 2015 22:20:26 -0000 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 >