From: sashiko-bot@kernel.org
To: "Jason Xing" <kerneljasonxing@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 6/6] selftests/bpf: Add RX latency tests for bpf timestamping
Date: Tue, 19 May 2026 08:25:15 +0000 [thread overview]
Message-ID: <20260519082515.AF651C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260518082344.96647-7-kerneljasonxing@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The return values of `ASSERT_TRUE` are ignored in `recv_verify_rx_timestamp`, causing it to unconditionally return `true` on successful `recvmsg`.
- [Medium] Using a fixed `usleep(10000)` to wait for a workqueue to run is prone to test flakiness on heavily loaded CI systems.
--
commit 3f1fdeab36943dce908082eb563628a5f8ca353b
Author: Jason Xing <kerneljasonxing@gmail.com>
selftests/bpf: Add RX latency tests for bpf timestamping
This commit extends the test_tcp() selftest to cover the new BPF RX
timestamping path. It tests a mixed mode where SO TX/RX and BPF TX/RX
timestamping operate simultaneously, verifying they do not conflict.
> diff --git a/tools/testing/selftests/bpf/prog_tests/net_timestamping.c b/tools/testing/selftests/bpf/prog_tests/net_timestamping.c
> index dbfd87499b6b5..3cc52b670e74b 100644
> --- a/tools/testing/selftests/bpf/prog_tests/net_timestamping.c
> +++ b/tools/testing/selftests/bpf/prog_tests/net_timestamping.c
[ ... ]
> @@ -143,11 +143,45 @@ static void test_socket_timestamping(int fd)
> SK_TS_ACK = 0;
> }
>
> +static bool recv_verify_rx_timestamp(int fd, char *buf, int len)
> +{
[ ... ]
> + for (cm = CMSG_FIRSTHDR(&msg); cm; cm = CMSG_NXTHDR(&msg, cm)) {
> + if (cm->cmsg_level == SOL_SOCKET &&
> + cm->cmsg_type == SCM_TIMESTAMPING) {
> + tss = (void *)CMSG_DATA(cm);
> + break;
> + }
> + }
> +
> + ASSERT_TRUE(tss != NULL, "SCM_TIMESTAMPING cmsg present");
> + ASSERT_TRUE(tss && (tss->ts[0].tv_sec || tss->ts[0].tv_nsec),
> + "rx sw timestamp non-zero");
> + return true;
> +}
Since the return values of ASSERT_TRUE() are ignored here, will this
function unconditionally return true even if the assertions fail?
If the caller expects a false return to abort early, this could cause the
test to proceed regardless of the assertion results.
[ ... ]
> @@ -187,7 +221,27 @@ static void test_tcp(int family, bool enable_socket_timestamping)
[ ... ]
> + afd = accept(sfd, NULL, NULL);
> + if (!ASSERT_OK_FD(afd, "accept"))
> + goto out;
> +
> + /* net_enable_timestamp() defers the static key update via
> + * schedule_work() when CONFIG_JUMP_LABEL is set. Give the
> + * workqueue a chance to run so that netstamp_needed_key is
> + * active and skb->tstamp gets populated in the receive path.
> + */
> + usleep(10000);
Could this fixed 10ms sleep cause test flakiness on heavily loaded CI
systems?
If the workqueue is delayed for longer than 10ms, the static key might not
be active in time, which would leave skb->tstamp unpopulated and cause the
test to fail intermittently.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260518082344.96647-1-kerneljasonxing@gmail.com?part=6
next prev parent reply other threads:[~2026-05-19 8:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 8:23 [PATCH net-next 0/6] bpf-timetamp: support rx side Jason Xing
2026-05-18 8:23 ` [PATCH net-next 1/6] bpf: Add bpf_ktime_get_real_ns() kfunc Jason Xing
2026-05-18 11:57 ` Jesper Dangaard Brouer
2026-05-18 12:35 ` Jason Xing
2026-05-18 8:23 ` [PATCH net-next 2/6] net: export sock_disable_timestamp() declaration Jason Xing
2026-05-19 8:25 ` sashiko-bot
2026-05-19 11:50 ` Jason Xing
2026-05-18 8:23 ` [PATCH net-next 3/6] bpf: support bpf_setsockopt for bpf timestamping rx feature Jason Xing
2026-05-18 8:23 ` [PATCH net-next 4/6] bpf: add BPF_SOCK_OPS_TSTAMP_RCV_CB callback Jason Xing
2026-05-18 8:23 ` [PATCH net-next 5/6] bpf: enable bpf timestamping rx in TCP layer Jason Xing
2026-05-18 13:01 ` Jesper Dangaard Brouer
2026-05-18 13:53 ` Jason Xing
2026-05-18 16:40 ` Jesper Dangaard Brouer
2026-05-18 23:16 ` Jason Xing
2026-05-18 23:24 ` Jason Xing
2026-05-19 9:57 ` Toke Høiland-Jørgensen
2026-06-03 11:07 ` Toke Høiland-Jørgensen
2026-05-18 15:34 ` Stanislav Fomichev
2026-05-18 23:56 ` Jason Xing
2026-05-19 8:25 ` sashiko-bot
2026-05-19 10:31 ` Jiayuan Chen
2026-05-19 12:26 ` Jason Xing
2026-05-18 8:23 ` [PATCH net-next 6/6] selftests/bpf: Add RX latency tests for bpf timestamping Jason Xing
2026-05-19 8:25 ` sashiko-bot [this message]
2026-05-19 12:05 ` Jason Xing
2026-05-18 11:46 ` [PATCH net-next 0/6] bpf-timetamp: support rx side Jesper Dangaard Brouer
2026-05-18 12:32 ` Jason Xing
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=20260519082515.AF651C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=kerneljasonxing@gmail.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