From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: bpf@vger.kernel.org
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Jakub Sitnicki <jakub@cloudflare.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Neal Cardwell <ncardwell@google.com>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
Shuah Khan <shuah@kernel.org>, Sechang Lim <rhkrqnwk98@gmail.com>,
Mattia Meleleo <mattia.meleleo@coralogix.com>,
Michal Luczaj <mhal@rbox.co>,
Zijian Zhang <zijianzhang@bytedance.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: [PATCH bpf v3 8/9] selftests/bpf: Fix errno expected by the wait send mem test of test_sockmap
Date: Wed, 2 Dec 2026 22:30:47 +0800 [thread overview]
Message-ID: <20261202143337.400831-9-jiayuan.chen@linux.dev> (raw)
In-Reply-To: <20261202143337.400831-1-jiayuan.chen@linux.dev>
The test closes the redirect target while the sender waits for its send
memory. A part of the data has gone out, so sendmsg() returns that part
and the test calls sendmsg() again.
With apply_bytes, the previous patch keeps the verdict for the bytes that
were not sent. The next sendmsg() sends to the same target and returns
-EPIPE, instead of running the prog again, which no longer finds the
target in the map and returns SK_DROP, -EACCES.
Accept -EPIPE as well.
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
---
tools/testing/selftests/bpf/test_sockmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index aaf2050e8845..771146268df7 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -566,7 +566,8 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
sent = sendmsg(fd, &msg, flags);
if (!drop && sent < 0) {
- if (opt->tx_wait_mem && errno == EACCES) {
+ if (opt->tx_wait_mem &&
+ (errno == EACCES || errno == EPIPE)) {
errno = 0;
goto out_errno;
}
--
2.43.0
next prev parent reply other threads:[~2026-12-02 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 14:30 [PATCH bpf v3 0/9] fix misc sockmap issues Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 1/9] bpf, sockmap: Fix copied_seq updates with strparser Jiayuan Chen
2026-12-02 15:00 ` sashiko-bot
2026-12-02 14:30 ` [PATCH bpf v3 2/9] selftests/bpf: Add test for unread SK_PASS data " Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 3/9] bpf, sockmap: Fix empty sk_msg queued by ingress redirect Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 4/9] bpf, sockmap: Fix concurrent senders on one psock Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 5/9] bpf, sockmap: Fix reconnect with a psock by rejecting connect Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 6/9] bpf, sockmap: Fix socket lock taken on a child before accept() Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 7/9] bpf, sockmap: Fix apply_bytes when a redirect sends only a part Jiayuan Chen
2026-12-02 14:30 ` Jiayuan Chen [this message]
2026-12-02 14:30 ` [PATCH bpf v3 9/9] selftests/bpf: Add test for apply_bytes when a redirect sends " Jiayuan Chen
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=20261202143337.400831-9-jiayuan.chen@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@kernel.org \
--cc=emil@etsalapatis.com \
--cc=horms@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mattia.meleleo@coralogix.com \
--cc=memxor@gmail.com \
--cc=mhal@rbox.co \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rhkrqnwk98@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=willemb@google.com \
--cc=yonghong.song@linux.dev \
--cc=zijianzhang@bytedance.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 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.