[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALOAHbCMz2cCS6Pv4vH60u-ZWeZzfpzW_suc-gsSVK9hfndgkw@mail.gmail.com>
Date: Sun, 13 Feb 2022 19:28:29 +0800
From: Yafang Shao <laoar.shao@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>, Martin Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
john fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, netdev <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux
On Fri, Feb 11, 2022 at 8:44 PM Daniel Borkmann <daniel@...earbox.net> wrote:
>
> On 2/11/22 1:43 PM, Daniel Borkmann wrote:
> > On 2/11/22 1:11 PM, Yafang Shao wrote:
> >> A new member pin_name is added into struct bpf_prog_aux, which will be
> >> set when the prog is set and cleared when the pinned file is removed.
> >>
> >> Signed-off-by: Yafang Shao <laoar.shao@...il.com>
> >> ---
> >> include/linux/bpf.h | 2 ++
> >> include/uapi/linux/bpf.h | 1 +
> >> kernel/bpf/inode.c | 20 +++++++++++++++++++-
> >> 3 files changed, 22 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> >> index 0ceb25b..9cf8055 100644
> >> --- a/include/linux/bpf.h
> >> +++ b/include/linux/bpf.h
> >> @@ -933,6 +933,8 @@ struct bpf_prog_aux {
> >> struct work_struct work;
> >> struct rcu_head rcu;
> >> };
> >> +
> >> + char pin_name[BPF_PIN_NAME_LEN];
> >> };
> >
> > I'm afraid this is not possible. You are assuming a 1:1 relationship between prog
> > and pin location, but it's really a 1:n (prog can be pinned in multiple locations
> > and also across multiple mount instances). Also, you can create hard links of pins
> > which are not handled via bpf_obj_do_pin().
>
> (Same is also true for BPF maps wrt patch 2.)
Thanks again for the reminder.
--
Thanks
Yafang
Powered by blists - more mailing lists