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 D7E1EA09E4; Fri, 29 Jan 2021 14:45:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FE772401B9; Fri, 29 Jan 2021 14:45:27 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 8A889240111 for ; Fri, 29 Jan 2021 14:45:25 +0100 (CET) IronPort-SDR: KB/B6awwCbyYhaCpq9lNZNHYBXUqr9hutJfbQKIUQGOqKwXxxY+TpzwgTjGwsX7YKka19SnOkl c68kUgGffsMg== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="265254736" X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="265254736" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2021 05:45:19 -0800 IronPort-SDR: pCHGtFKMvbKje1BR/28eoA1rFkosQt4CquHvpRgYK2OoHQLo57ntRiEGqn6YzpVfCrSypuJ0OT tBlFm07/RbGw== X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="389308223" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.59]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 29 Jan 2021 05:45:16 -0800 Date: Fri, 29 Jan 2021 13:45:11 +0000 From: Bruce Richardson To: "Burakov, Anatoly" Cc: Oscar Zhao , dev@dpdk.org Message-ID: <20210129134511.GF929@bricha3-MOBL.ger.corp.intel.com> References: <20210129100537.GB929@bricha3-MOBL.ger.corp.intel.com> <8b287cd6-7ea0-96e9-5a48-89e99d84b1f9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b287cd6-7ea0-96e9-5a48-89e99d84b1f9@intel.com> 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 Fri, Jan 29, 2021 at 12:52:50PM +0000, Burakov, Anatoly wrote: > 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. > That is because the NUMA support in FreeBSD was not in place when we first did the DPDK port. However, I still see no reason not to start adding it now, even if it is only for information purposes at this point.