From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BEC9A09E4; Fri, 29 Jan 2021 13:52:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E309B2401D0; Fri, 29 Jan 2021 13:52:56 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 52C57240134 for ; Fri, 29 Jan 2021 13:52:55 +0100 (CET) IronPort-SDR: gPR6AVKiGXhZpxdnElidFM7wimzovPAL0aYxn6jwMql1Et0HmjILyShI2hJQMvbuqk9ZLcT2KA 37GEI9EYcsEw== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="180557813" X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="180557813" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2021 04:52:53 -0800 IronPort-SDR: dlqEqjcUiLt2/pTwlBcUDj33VRwFqvnAKM+tCloYSb6nADPsgMjZMuLmRMRmha1YWR4Ur6AkpI 0PM5ImLD/kTA== X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="365238153" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.210.186]) ([10.213.210.186]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2021 04:52:52 -0800 To: Bruce Richardson , Oscar Zhao Cc: dev@dpdk.org References: <20210129100537.GB929@bricha3-MOBL.ger.corp.intel.com> From: "Burakov, Anatoly" Message-ID: <8b287cd6-7ea0-96e9-5a48-89e99d84b1f9@intel.com> Date: Fri, 29 Jan 2021 12:52:50 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210129100537.GB929@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] Feature Discussion: CPU topology detection on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 29-Jan-21 10:05 AM, Bruce Richardson wrote: > On Thu, Jan 28, 2021 at 04:07:07AM +0000, Oscar Zhao wrote: >> Hello dpdk devs, >> >> I would like to discuss the feasibility of implementing CPU topology detection on FreeBSD. Currently both eal_cpu_core_id() and eal_cpu_socket_id() in rte_eal library always return 0 on FreeBSD, making NUMA-aware development impossible without resorting to external libraries or system APIs. >> >> The CPU topology information is available via sysct kern.sched.topology_spec. The only issue is that the return value is an XML formatted object (see https://forums.freebsd.org/threads/number-of-cpus-and-cores.41299/). (https://forums.freebsd.org/threads/number-of-cpus-and-cores.41299/) I'm not sure how feasible it is to parse XML inside DPDK. >> >> On a side note, obtaining the physical NUMA node id of a core is easy - sysctl dev.cpu.[cpu#].%domain returns the corresponding node id but I have yet found a straightforward way to detect hyperthreads besides the XML thing. >> >> Oscar > > Even adding in the numa node information would be a welcome start. > There's little value in it though, because as far as i'm aware we can't allocate memory on specific NUMA nodes in FreeBSD. -- Thanks, Anatoly