From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D685C433E0 for ; Fri, 29 Jan 2021 10:05:46 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id ABBC364E09 for ; Fri, 29 Jan 2021 10:05:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABBC364E09 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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.