From: sashiko-bot@kernel.org
To: "Gyutae Bae" <gyutae.opensource@navercorp.com>
Cc: bpf@vger.kernel.org
Subject: Re: [RFC bpf-next 3/3] selftests/bpf: test BPF_F_COMPARE compare-and-delete
Date: Mon, 22 Jun 2026 07:53:30 +0000 [thread overview]
Message-ID: <20260622075330.B34061F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260622071649.31541-4-gyutae.opensource@navercorp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Multi-line comments do not follow the mandatory BPF subsystem style.
--
commit d9d64a94ef921683b52276aed902be3aa7f68eed
Author: Gyutae Bae <gyutae.bae@navercorp.com>
selftests/bpf: test BPF_F_COMPARE compare-and-delete
This patch introduces a selftest for the compare-and-delete operation on a
hash map. Since there is no libbpf wrapper, it uses the raw bpf syscall to
verify the deletion behavior based on a revision field.
> diff --git a/tools/testing/selftests/bpf/prog_tests/map_cmp_delete.c b/tools/testing/selftests/bpf/prog_tests/map_cmp_delete.c
> new file mode 100644
> index 0000000000000..6d6df13adcc42
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/map_cmp_delete.c
[ ... ]
> +struct val {
> + __u64 revision; /* synchronization field we compare on */
> + __u64 payload;
> +};
> +
> +/* libbpf has no wrapper that passes the compare-and-delete fields, so
> + * issue bpf() directly. 'flags' is a parameter so tests can also
> + * exercise the no-BPF_F_COMPARE case.
> + */
[Severity: Low]
This isn't a bug, but does this multi-line comment follow the preferred BPF
subsystem style? The guidelines specify that the opening /* should be on its
own line, with the text starting on the following line.
> +static int cmp_delete_flags(int fd, const void *key, const void *compare,
> + __u32 off, __u32 size, __u64 flags)
[ ... ]
> +static void test_contract(void)
> +{
[ ... ]
> + /* mismatch -> -EBUSY, entry preserved */
> + snap.revision = 9;
> + ASSERT_EQ(cmp_delete(fd, &k, &snap, off, sz), -EBUSY, "mismatch_ebusy");
> + ASSERT_OK(bpf_map_lookup_elem(fd, &k, &v), "still_present");
> +
> + /* compare fields set but BPF_F_COMPARE omitted -> -EINVAL, entry preserved
> + * (a dropped flag must not silently become an unconditional delete)
> + */
[Severity: Low]
This isn't a bug, but is this multi-line comment using the preferred
formatting? Similar to the comment above, the opening /* should typically
be placed on its own empty line.
> + ASSERT_EQ(cmp_delete_flags(fd, &k, &snap, off, sz, 0), -EINVAL,
> + "cmp_fields_no_flag_einval");
> + ASSERT_OK(bpf_map_lookup_elem(fd, &k, &v), "preserved_no_flag");
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260622071649.31541-1-gyutae.opensource@navercorp.com?part=3
prev parent reply other threads:[~2026-06-22 7:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 7:16 [RFC bpf-next 0/3] bpf: compare-and-delete (BPF_F_COMPARE) for hash maps Gyutae Bae
2026-06-22 7:16 ` [RFC bpf-next 1/3] bpf: add BPF_F_COMPARE flag and compare fields to map elem UAPI Gyutae Bae
2026-06-22 7:16 ` [RFC bpf-next 2/3] bpf: implement compare-and-delete (BPF_F_COMPARE) for BPF_MAP_TYPE_HASH Gyutae Bae
2026-06-22 7:58 ` sashiko-bot
2026-06-22 7:16 ` [RFC bpf-next 3/3] selftests/bpf: test BPF_F_COMPARE compare-and-delete Gyutae Bae
2026-06-22 7:53 ` 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=20260622075330.B34061F00A3E@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=gyutae.opensource@navercorp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox