DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, Tyler Retzlaff <roretzla@linux.microsoft.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>
Subject: Re: [RFC PATCH v1 5/5] lcore: store physical package ID internally
Date: Mon, 14 Oct 2024 10:31:01 -0700	[thread overview]
Message-ID: <20241014103101.66876ce7@hermes.local> (raw)
In-Reply-To: <f68d303116b86fd1df004c43941c72444a697c9d.1725622420.git.anatoly.burakov@intel.com>

On Fri,  6 Sep 2024 12:47:31 +0100
Anatoly Burakov <anatoly.burakov@intel.com> 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.

  parent reply	other threads:[~2024-10-14 17:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 11:47 [RFC PATCH v1 0/5] Adjust wording for NUMA vs. socket ID in DPDK Anatoly Burakov
2024-09-06 11:47 ` [RFC PATCH v1 1/5] eal: update socket ID API documentation Anatoly Burakov
2024-09-06 11:47 ` [RFC PATCH v1 2/5] lcore: rename socket ID to NUMA ID Anatoly Burakov
2024-09-06 11:47 ` [RFC PATCH v1 3/5] eal: rename socket ID to NUMA ID in internal config Anatoly Burakov
2024-09-06 11:47 ` [RFC PATCH v1 4/5] eal: rename --socket-mem/--socket-limit Anatoly Burakov
2024-09-09  7:42   ` fengchengwen
2024-09-06 11:47 ` [RFC PATCH v1 5/5] lcore: store physical package ID internally Anatoly Burakov
2024-09-09  7:49   ` fengchengwen
2024-10-14 17:31   ` Stephen Hemminger [this message]
2024-09-06 12:37 ` [RFC PATCH v1 0/5] Adjust wording for NUMA vs. socket ID in DPDK Morten Brørup
2024-09-06 12:46   ` Burakov, Anatoly
2024-09-06 13:02     ` Morten Brørup
2024-09-06 13:07       ` Bruce Richardson
2024-09-06 13:17         ` Burakov, Anatoly
2024-09-06 13:58           ` Morten Brørup
2024-09-09  7:51 ` fengchengwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241014103101.66876ce7@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=pallavi.kadam@intel.com \
    --cc=roretzla@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).