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 9E2DAA09E4; Fri, 29 Jan 2021 10:45:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39479240151; Fri, 29 Jan 2021 10:45:31 +0100 (CET) Received: from mx.quacker.org (mx.quacker.org [129.97.75.228]) by mails.dpdk.org (Postfix) with ESMTP id 2707E1410B3 for ; Thu, 28 Jan 2021 05:07:09 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9807B326BB8A for ; Wed, 27 Jan 2021 23:07:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quacker.org; s=dkim; t=1611806827; h=from:subject:date:message-id:to:mime-version:content-type; bh=c4x8NUB6CP4muiVcStz1k50JBGk34QL5aMZNytkNLFk=; b=g7XDQVoIJnvpD+sJZxwUsnL++v+re8vXwy6jy/QvLUojZKthtuRwlEl8aigL1hHPEmH4SE ry9dLIAL2aUqAooOPEbVWuposWkSLbLqhWKPmgzHEZSUwCWRyBENK523MB1mW0CXmud6wW AnOI4dBgknz0oYrnlPSREprIyXVMFYWXIJK1xOyUzHoSO39VyCnlRBCHKgvo6sN+VjvUkr FmVo/x0H7RJIZIUr9pZ6lwlph8uH1z0l7RrBHlKA/UP/hOqS5OQZtowfLmHbg/Q/oOSYVG Y2u+3ZhAaVXrgIFuOciUOFfOdkpDNmEB4z5Z22Otpxz1ykckTUJjN9ODMSljaQ== MIME-Version: 1.0 Date: Thu, 28 Jan 2021 04:07:07 +0000 From: "Oscar Zhao" Message-ID: To: dev@dpdk.org X-Last-TLS-Session-Version: TLSv1.2 X-Mailman-Approved-At: Fri, 29 Jan 2021 10:45:28 +0100 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [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" Hello dpdk devs,=0A=0AI would like to discuss the feasibility of implemen= ting 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, ma= king NUMA-aware development impossible without resorting to external libr= aries or system APIs.=0A=0AThe CPU topology information is available via = sysct kern.sched.topology_spec. The only issue is that the return value i= s 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 insid= e DPDK.=0A=0AOn a side note, obtaining the physical NUMA node id of a cor= e is easy - sysctl dev.cpu.[cpu#].%domain returns the corresponding node = id but I have yet found a straightforward way to detect hyperthreads besi= des the XML thing.=0A=0AOscar