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 BB2F6A09E4; Fri, 29 Jan 2021 11:05:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86579240134; Fri, 29 Jan 2021 11:05:44 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 4351D40694 for ; Fri, 29 Jan 2021 11:05:43 +0100 (CET) IronPort-SDR: o4JOdWb+pMKVo3p11VOdNloHb3qOk9zQfU06nEgmzsa6RAC5ACWju21NsSuHBu04SdDtC9o0eN eTf7mzDlsh3A== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="199241099" X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="199241099" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2021 02:05:41 -0800 IronPort-SDR: /Nv32iWSdN2ltUnnq8uVFhK0EunNQSQi3mSLyujRaVagwfYQhuY+GT5IBVQQRAFO29DiVOXFtu RnQpN8NjaJow== X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="474469169" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.59]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 29 Jan 2021 02:05:40 -0800 Date: Fri, 29 Jan 2021 10:05:37 +0000 From: Bruce Richardson To: Oscar Zhao Cc: dev@dpdk.org Message-ID: <20210129100537.GB929@bricha3-MOBL.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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.