From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Kuniyuki Iwashima <kuniyu@google.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
Jakub Sitnicki <jakub@cloudflare.com>,
Jiayuan Chen <jiayuan.chen@linux.dev>,
bpf@vger.kernel.org
Subject: Re: [PATCH v1 net-next 2/4] selftests: bpf: sockmap: Remove AF_UNIX MSG_OOB test case.
Date: Wed, 18 Nov 2026 10:23:27 +0800 [thread overview]
Message-ID: <1e935f2f-5cbe-43ac-8d3e-a22d3b60f43e@linux.dev> (raw)
In-Reply-To: <20261116021845.2533130-3-kuniyu@google.com>
On 11/16/26 10:18 AM, Kuniyuki Iwashima wrote:
> We will drop MSG_OOB support from AF_UNIX.
>
> Let's remove the test case from sockmap_redir.
>
> Note that struct socket_spec.send_flags is no longer used so
> removed too.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> ---
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: Jakub Sitnicki <jakub@cloudflare.com>
> Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
> Cc: bpf@vger.kernel.org
> ---
> .../selftests/bpf/prog_tests/sockmap_redir.c | 45 +++++--------------
> 1 file changed, 11 insertions(+), 34 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c b/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c
> index 9c461d93113d..e73d3a674a74 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c
> @@ -103,7 +103,6 @@ struct redir_spec {
> struct socket_spec {
> int family;
> int sotype;
> - int send_flags;
> int in[2];
> int out[2];
> };
> @@ -197,12 +196,12 @@ static void handle_unsupported(int sd_send, int sd_peer, int sd_in, int sd_out,
> try_recv("bpf.recv(sd_recv)", sd_recv, MSG_DONTWAIT, false);
> }
>
> -static void test_send_redir_recv(int sd_send, int send_flags, int sd_peer,
> +static void test_send_redir_recv(int sd_send, int sd_peer,
> int sd_in, int sd_out, int sd_recv,
> struct maps *maps, int status)
> {
> unsigned int drop, pass;
> - char *send_buf = "ab";
> + char *send_buf = "a";
> char recv_buf = '\0';
> ssize_t n, len = 1;
>
> @@ -217,10 +216,7 @@ static void test_send_redir_recv(int sd_send, int send_flags, int sd_peer,
> if (xbpf_map_update_elem(maps->out, &u32(0), &u64(sd_out), BPF_NOEXIST))
> goto del_in;
>
> - /* Last byte is OOB data when send_flags has MSG_OOB bit set */
> - if (send_flags & MSG_OOB)
> - len++;
> - n = send(sd_send, send_buf, len, send_flags);
> + n = send(sd_send, send_buf, len, 0);
> if (n >= 0 && n < len)
> FAIL("incomplete send");
> if (n < 0) {
> @@ -255,20 +251,6 @@ static void test_send_redir_recv(int sd_send, int send_flags, int sd_peer,
> if (recv_buf != send_buf[0])
> FAIL("recv(): payload check, %02x != %02x", recv_buf, send_buf[0]);
>
> - if (send_flags & MSG_OOB) {
> - /* Fail reading OOB while in sockmap */
> - try_recv("bpf.recv(sd_out, MSG_OOB)", sd_out,
> - MSG_OOB | MSG_DONTWAIT, false);
> -
> - /* Remove sd_out from sockmap */
> - xbpf_map_delete_elem(maps->out, &u32(0));
> -
> - /* Check that OOB was dropped on redirect */
> - try_recv("recv(sd_out, MSG_OOB)", sd_out,
> - MSG_OOB | MSG_DONTWAIT, false);
> -
> - goto del_in;
> - }
> out:
> xbpf_map_delete_elem(maps->out, &u32(0));
> del_in:
> @@ -328,7 +310,7 @@ static void test_socket(enum bpf_map_type type, struct redir_spec *redir,
> struct maps *maps, struct socket_spec *s_in,
> struct socket_spec *s_out)
> {
> - int fd_in, fd_out, fd_send, fd_peer, fd_recv, flags, status;
> + int fd_in, fd_out, fd_send, fd_peer, fd_recv, status;
> const char *in_str, *out_str;
> char s[MAX_TEST_NAME];
>
> @@ -337,26 +319,24 @@ static void test_socket(enum bpf_map_type type, struct redir_spec *redir,
> fd_send = s_in->in[redir->idx_send];
> fd_peer = s_in->in[redir->idx_send ^ 1];
> fd_recv = s_out->out[redir->idx_recv];
> - flags = s_in->send_flags;
>
> in_str = socket_kind_to_str(fd_in);
> out_str = socket_kind_to_str(fd_out);
> status = get_support_status(redir->prog_type, in_str, out_str);
>
> snprintf(s, sizeof(s),
> - "%-4s %-17s %-5s %s %-5s%6s",
> - /* hash sk_skb-to-ingress u_str → v_str (OOB) */
> + "%-4s %-17s %-5s %s %-5s",
> + /* hash sk_skb-to-ingress u_str → v_str */
> type == BPF_MAP_TYPE_SOCKMAP ? "map" : "hash",
> redir->name,
> in_str,
> status & SUPPORTED ? "→" : " ",
> - out_str,
> - (flags & MSG_OOB) ? "(OOB)" : "");
> + out_str);
>
> if (!test__start_subtest(s))
> return;
>
> - test_send_redir_recv(fd_send, flags, fd_peer, fd_in, fd_out, fd_recv,
> + test_send_redir_recv(fd_send, fd_peer, fd_in, fd_out, fd_recv,
> maps, status);
> }
>
> @@ -365,12 +345,10 @@ static void test_redir(enum bpf_map_type type, struct redir_spec *redir,
> {
> struct socket_spec *s, sockets[] = {
> { AF_INET, SOCK_STREAM },
> - // { AF_INET, SOCK_STREAM, MSG_OOB }, /* Known to be broken */
> { AF_INET6, SOCK_STREAM },
> { AF_INET, SOCK_DGRAM },
> { AF_INET6, SOCK_DGRAM },
> { AF_UNIX, SOCK_STREAM },
> - { AF_UNIX, SOCK_STREAM, MSG_OOB },
> { AF_UNIX, SOCK_DGRAM },
> // { AF_UNIX, SOCK_SEQPACKET}, /* Unsupported BPF_MAP_UPDATE_ELEM */
> { AF_VSOCK, SOCK_STREAM },
> @@ -392,10 +370,9 @@ static void test_redir(enum bpf_map_type type, struct redir_spec *redir,
> struct socket_spec *out = &sockets[j];
> struct socket_spec *in = &sockets[i];
>
> - /* Skip intra-proto and between variants */
> - if (out->send_flags ||
> - (in->family == out->family &&
> - in->sotype == out->sotype))
> + /* Skip intra-proto */
> + if (in->family == out->family &&
> + in->sotype == out->sotype)
> continue;
>
> test_socket(type, redir, maps, in, out);
prev parent reply other threads:[~2026-11-18 2:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261116021845.2533130-1-kuniyu@google.com>
2026-11-16 2:18 ` [PATCH v1 net-next 2/4] selftests: bpf: sockmap: Remove AF_UNIX MSG_OOB test case Kuniyuki Iwashima
2026-11-18 2:23 ` Jiayuan Chen [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=1e935f2f-5cbe-43ac-8d3e-a22d3b60f43e@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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