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 5ECE0D568 for ; Fri, 11 Nov 2016 19:20:05 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 11 Nov 2016 10:19:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,474,1473145200"; d="scan'208";a="785377849" Received: from dverkamp-desk2.ch.intel.com (HELO dverkamp-desk2.amr.corp.intel.com) ([143.182.136.118]) by FMSMGA003.fm.intel.com with ESMTP; 11 Nov 2016 10:19:45 -0800 To: Jason Lefley , users@dpdk.org References: Cc: yahya@aclectic.com From: Daniel Verkamp Message-ID: <80e0712c-6bc6-745e-bf5e-610bae2290f0@intel.com> Date: Fri, 11 Nov 2016 11:19:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-users] Using DPDK EAL with existing multi-threaded application X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 18:20:07 -0000 On 11/07/2016 11:39 PM, Jason Lefley wrote: > I am working on leveraging SPDK (which internally uses EAL from DPDK) > from an existing application that uses Intel’s TBB. I do not need to > use EAL for multithreading but SPDK does require at least huge page > support and PCI access from EAL. > > I noticed that if I try to use TBB’s parallel_for() after I have > called rte_eal_init(), then the TBB operation doesn’t actually run in > parallel. If I remove the call to rte_eal_init(), the TBB operations > work as expected however I then cannot use SPDK. Does anyone have any > input regarding how I can keep my existing multi-threaded application > working as intended as I integrate SPDK/DPDK? > > Thanks > Hi Jason, If you are not calling any functions that rely on DPDK's lcore pinning for correctness, you should be able to change the calling thread's CPU affinity with rte_thread_set_affinity() so that newly-created threads can run on more than one CPU core. I am not sure how TBB creates its threads, but as long as you set the affinity before calling any TBB functions, the updated CPU affinity should be inherited by any newly-created threads. There is a recently-implemented helper function in SPDK to temporarily change the thread affinity in this way: https://github.com/spdk/spdk/commit/fa5206c416144b41c384d678cf33f98f1fe1042c Thanks, -- Daniel