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 C269E292D for ; Tue, 8 Mar 2016 18:38:20 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 08 Mar 2016 09:38:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,557,1449561600"; d="scan'208";a="919520103" Received: from ywang8-mobl1.ccr.corp.intel.com (HELO [10.255.31.199]) ([10.255.31.199]) by fmsmga001.fm.intel.com with ESMTP; 08 Mar 2016 09:38:18 -0800 To: Panu Matilainen , dev@dpdk.org References: <1453661393-85704-1-git-send-email-jianfeng.tan@intel.com> <1457085957-115339-1-git-send-email-jianfeng.tan@intel.com> <56DE9359.1090705@redhat.com> From: "Tan, Jianfeng" Message-ID: <56DF0E0A.8000108@intel.com> Date: Wed, 9 Mar 2016 01:38:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56DE9359.1090705@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: add option --avail-cores to detect lcores 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 Mar 2016 17:38:21 -0000 Hi Panu, On 3/8/2016 4:54 PM, Panu Matilainen wrote: > On 03/04/2016 12:05 PM, Jianfeng Tan wrote: >> This patch adds option, --avail-cores, to use lcores which are available >> by calling pthread_getaffinity_np() to narrow down detected cores before >> parsing coremask (-c), corelist (-l), and coremap (--lcores). >> >> Test example: >> $ taskset 0xc0000 ./examples/helloworld/build/helloworld \ >> --avail-cores -m 1024 >> >> Signed-off-by: Jianfeng Tan >> Acked-by: Neil Horman > > Hmm, to me this sounds like something that should be done always so > there's no need for an option. Or if there's a chance it might do the > wrong thing in some rare circumstance then perhaps there should be a > disabler option instead? Thanks for comments. Yes, there's a use case that we cannot handle. If we make it as default, DPDK applications may fail to start, when user specifies a core in isolcpus and its parent process (say bash) has a cpuset affinity that excludes isolcpus. Originally, DPDK applications just blindly do pthread_setaffinity_np() and it always succeeds because it always has root privilege to change any cpu affinity. Now, if we do the checking in rte_eal_cpu_init(), those lcores will be flagged as undetected (in my older implementation) and leads to failure. To make it correct, we would always add "taskset mask" (or other ways) before DPDK application cmd lines. How do you think? Thanks, Jianfeng > > Or am I just missing something? > > - Panu - >