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 C87AE45B3A; Mon, 14 Oct 2024 19:31:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8876402C3; Mon, 14 Oct 2024 19:31:05 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 507D54026C for ; Mon, 14 Oct 2024 19:31:04 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20ceb8bd22fso9452115ad.3 for ; Mon, 14 Oct 2024 10:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728927063; x=1729531863; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=9HBR0IK4t7IIlyywPPaD/2gPu6KXkSi7EdXTKh5FbtQ=; b=GuaoR57WdiEekkZaTseX+5Y9nmFjz90UZS5pIDuu8EiHGoJxN+dP6k8AC+ag6zasVi nenwHKrtr8rbBUniIzXvbFjmOCzvMFOS83SLYmp7u4RbPvgyDCCBEa6yj+V48IzvmarJ bzafl4uMBkWZk03A5yH9NW38bdj22x7TBJxgfWNMK8GiBl61A0ze+ex34S0bo0IbhLOA 8NSH7w0kIdvAKpxQCjoIWLMOPg/WYp2X38ZdHC3Nq58J7dHx4LdPA9INqtlXp4FtD0im 4a89HQI3BMWlhVFABgjNzjfwGE/HIGaaFPWnUFdFHvsLPSPsr+jiwRvb631znOSrYtUP eqnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728927063; x=1729531863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9HBR0IK4t7IIlyywPPaD/2gPu6KXkSi7EdXTKh5FbtQ=; b=m+JXRtWO1TfaV/HCkX9bVdo6baNJlgbj5VjVtWV106TvncB+TwTguHk7sbfDsscyaw MFaGY76azdwDFlnVM8mS/rClOth2NHTF3wFRD+ZZY7iXYW9flcTMo2r0z33N82ODYsFu GeezfTYBc91Ne41AhsUylt4cgS+fRtD93eEiUhk6JTO9kc9sddbCGZFUKZWj+KqxCFwi RZ0OXBBczi/SvuqmEPg+sSNLeIKprGrL4hhtMa9XVf3Agd54ylKywpfRDTxfillsRmHT 6Utt8JORJRZasFvV1UMP56R2wLB9khfyR3ROYmEQU5SAjeHWAjj0/eFZ36Id1XxIAZA8 arqQ== X-Gm-Message-State: AOJu0YyTNg+xy6GmIuNUyUBxjo7QiucaLBlSS/T9ugGNp80McbQtaMu6 V333+wYNF31ZY4JmtgSaqHQevHb5yjej0ecEiXWCaf2/paQHEBkgxy5K2OW0xg4= X-Google-Smtp-Source: AGHT+IG4v6h8IYe040NSh06hXare6lphnSGvEPkmxu/CYUItCmp9SZEbppHPIP6/qdgPyiW/KLl5CA== X-Received: by 2002:a17:902:fb04:b0:20c:9d9e:9049 with SMTP id d9443c01a7336-20cbb1a9196mr106294755ad.22.1728927063471; Mon, 14 Oct 2024 10:31:03 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c0e74c0sm68828855ad.121.2024.10.14.10.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 10:31:03 -0700 (PDT) Date: Mon, 14 Oct 2024 10:31:01 -0700 From: Stephen Hemminger To: Anatoly Burakov Cc: dev@dpdk.org, Tyler Retzlaff , Bruce Richardson , Dmitry Kozlyuk , Pallavi Kadam Subject: Re: [RFC PATCH v1 5/5] lcore: store physical package ID internally Message-ID: <20241014103101.66876ce7@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 6 Sep 2024 12:47:31 +0100 Anatoly Burakov wrote: > +/* > + * Get CPU package ID for a logical core. > + * > + * This searches each nodeX directories in /sys for the symlink for the given > + * lcore_id and returns the numa node where the lcore is found. If lcore is not > + * found on any numa node, returns zero. > + */ > +unsigned > +eal_cpu_package_id(unsigned lcore_id) > +{ > + char path[PATH_MAX]; > + unsigned long id; > + > + int len = snprintf(path, sizeof(path), > + SYS_CPU_DIR "/%s", lcore_id, PACKAGE_ID_FILE); > + if (len <= 0 || (unsigned)len >= sizeof(path)) > + goto err; > + if (eal_parse_sysfs_value(path, &id) != 0) > + goto err; > + return (unsigned)id; > + > +err: > + EAL_LOG(ERR, "Error reading package id value from %s " > + "for lcore %u - assuming package 0", SYS_CPU_DIR, lcore_id); > + return 0; > +} This is wrong. Lcore Id is not always the same as the CPU number in the system. Also, it is not clear while package != numa node is something we want DPDK to start supporting. Adding yet another layer adds complexity.