From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <martin.lau@linux.dev>
Cc: <bpf@vger.kernel.org>, <daan.j.demeyer@gmail.com>,
<kernel-team@meta.com>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH bpf-next v9 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to allow writing unix sockaddr from bpf
Date: Tue, 10 Oct 2023 13:20:30 -0700 [thread overview]
Message-ID: <20231010202030.32676-1-kuniyu@amazon.com> (raw)
In-Reply-To: <bdffefed-8945-e5ac-052d-0f0b49a30d39@linux.dev>
From: Martin KaFai Lau <martin.lau@linux.dev>
Date: Tue, 10 Oct 2023 13:07:54 -0700
> On 10/10/23 10:00 AM, Kuniyuki Iwashima wrote:
> >> +__bpf_kfunc int bpf_sock_addr_set_unix_addr(struct bpf_sock_addr_kern *sa_kern,
> >> + const u8 *addr, u32 addrlen__sz)
> > I'd rename addrlen__sz to sun_path_len or something else because the
> > conventional addrlen for AF_UNIX contains offsetof(struct sockaddr_un,
> > sun_path).
>
> The "__sz" suffix is required by the verifier. It is the size of the preceding
> argument "addr". While at it, addrlen__sz should be just "addr__sz" (or
> sun_path__sz, depending on what name is decided here) for consistency with other
> kfunc.
I didn't know that, thank you!
>
> I don't have strong preference on the argument name. However, if it is
> sun_path__sz, then the preceding argument should be renamed to "sun_path" also
> for consistency reason and then the kfunc should probably be renamed to
> bpf_sock_addr_set_sun_path.
I prefer sun_path, sun_path__sz, and bpf_sock_addr_set_sun_path() that are
clearer and consistent with uAPI, sockaddr_un.sun_path.
next prev parent reply other threads:[~2023-10-10 20:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 7:44 [PATCH bpf-next v9 0/9] Add cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-06 7:44 ` [PATCH bpf-next v9 1/9] selftests/bpf: Add missing section name tests for getpeername/getsockname Daan De Meyer
2023-10-06 7:44 ` [PATCH bpf-next v9 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs Daan De Meyer
2023-10-10 16:50 ` Kuniyuki Iwashima
2023-10-11 16:34 ` Daan De Meyer
2023-10-06 7:44 ` [PATCH bpf-next v9 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to allow writing unix sockaddr from bpf Daan De Meyer
2023-10-10 17:00 ` Kuniyuki Iwashima
2023-10-10 20:07 ` Martin KaFai Lau
2023-10-10 20:20 ` Kuniyuki Iwashima [this message]
2023-10-06 7:44 ` [PATCH bpf-next v9 4/9] bpf: Implement cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-10 17:17 ` Kuniyuki Iwashima
2023-10-06 7:44 ` [PATCH bpf-next v9 5/9] libbpf: Add support for cgroup unix socket address hooks Daan De Meyer
2023-10-06 7:45 ` [PATCH bpf-next v9 6/9] bpftool: " Daan De Meyer
2023-10-06 7:45 ` [PATCH bpf-next v9 7/9] documentation/bpf: Document " Daan De Meyer
2023-10-06 7:45 ` [PATCH bpf-next v9 8/9] selftests/bpf: Make sure mount directory exists Daan De Meyer
2023-10-06 7:45 ` [PATCH bpf-next v9 9/9] selftests/bpf: Add tests for cgroup unix socket address hooks Daan De Meyer
-- strict thread matches above, loose matches on Subject: below --
2023-10-11 17:03 [PATCH bpf-next v10 0/9] Add cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-11 17:03 ` [PATCH bpf-next v9 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to allow writing unix sockaddr from bpf Daan De Meyer
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=20231010202030.32676-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=bpf@vger.kernel.org \
--cc=daan.j.demeyer@gmail.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).