On Thu, Oct 10, 2024 at 2:50 PM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > On Tue, Oct 8, 2024 at 2:02 AM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: > > > > From: Hou Tao <houtao1@xxxxxxxxxx> > > > > For bpf map with dynptr key support, the userspace application will use > > bpf_dynptr_user to represent the bpf_dynptr in the map key and pass it > > to bpf syscall. The bpf syscall will copy from bpf_dynptr_user to > > construct a corresponding bpf_dynptr_kern object when the map key is an > > input argument, and copy to bpf_dynptr_user from a bpf_dynptr_kern > > object when the map key is an output argument. > > > > For now the size of bpf_dynptr_user must be the same as bpf_dynptr, but > > the last u32 field is not used, so make it a reserved field. > > > > Signed-off-by: Hou Tao <houtao1@xxxxxxxxxx> > > --- > > include/uapi/linux/bpf.h | 6 ++++++ > > tools/include/uapi/linux/bpf.h | 6 ++++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > > index 07f7df308a01..72fe6a96b54c 100644 > > --- a/include/uapi/linux/bpf.h > > +++ b/include/uapi/linux/bpf.h > > @@ -7329,6 +7329,12 @@ struct bpf_dynptr { > > __u64 __opaque[2]; > > } __attribute__((aligned(8))); > > > > +struct bpf_dynptr_user { > > bikeshedding: maybe just bpf_udynptr? I don't like it. Looks too similar and easy to misread. I think bpf_dynptr_user is better.