All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Feng Tang" <feng.tang@linux.alibaba.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH] selftests: net: reuseport_bpf_numa: consider cpuless numa node
Date: Thu, 30 Jul 2026 11:37:37 +0000	[thread overview]
Message-ID: <20260730113738.41C901F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730113040.75718-1-feng.tang@linux.alibaba.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing NULL check for cpumask allocation in is_cpuless_node()
- [Medium] Missing return value check for numa_node_to_cpus() leading to masked errors
--

--- Patch [1]: [PATCH] selftests: net: reuseport_bpf_numa: consider cpuless numa node ---
commit 806931cbf2ad9438843e4d30f69b4887e641f7d2
Author: Feng Tang <feng.tang@linux.alibaba.com>

selftests: net: reuseport_bpf_numa: consider cpuless numa node

This patch addresses a failure in the 'reuseport_bpf_numa' selftest on
platforms with CXL memory where one node is cpuless. It introduces an
is_cpuless_node() check to skip memory-only NUMA nodes during the binding
test.

> diff --git a/tools/testing/selftests/net/reuseport_bpf_numa.c b/tools/testing/selftests/net/reuseport_bpf_numa.c
> index 8ec52fc5ef41b..197dbfc475f65 100644
> --- a/tools/testing/selftests/net/reuseport_bpf_numa.c
> +++ b/tools/testing/selftests/net/reuseport_bpf_numa.c
[ ... ]
> @@ -104,13 +104,35 @@ static void attach_bpf(int fd)
>  	close(bpf_fd);
>  }
>  
> -static void send_from_node(int node_id, int family, int proto)
> +static inline bool is_cpuless_node(int node_id)
> +{
> +	struct bitmask *cpumask;
> +	bool ret = false;
> +
> +	cpumask = numa_allocate_cpumask();
> +
> +	numa_node_to_cpus(node_id, cpumask);

[Severity: Medium]
Will this crash if numa_allocate_cpumask() fails to allocate memory?

It looks like cpumask could be NULL here, which is passed directly to
numa_node_to_cpus() and numa_bitmask_weight() without validation.

> +	if (!numa_bitmask_weight(cpumask))
> +		ret = true;

[Severity: Medium]
What happens if numa_node_to_cpus() fails?

It can return a negative error value, leaving the cpumask unmodified with
zero bits set. Because the return value is not checked,
numa_bitmask_weight(cpumask) will evaluate to 0. Does this cause the function
to return true and silently skip testing on nodes where an error occurs,
rather than reporting the infrastructure issue?

> +
> +	numa_bitmask_free(cpumask);
> +	return ret;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730113040.75718-1-feng.tang@linux.alibaba.com?part=1

      reply	other threads:[~2026-07-30 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 11:30 [PATCH] selftests: net: reuseport_bpf_numa: consider cpuless numa node Feng Tang
2026-07-30 11:37 ` sashiko-bot [this message]

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=20260730113738.41C901F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=feng.tang@linux.alibaba.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.