From: KP Singh <kpsingh@chromium.org>
To: Song Liu <songliubraving@fb.com>
Cc: Anton Protopopov <a.s.protopopov@gmail.com>,
Andrii Nakryiko <andriin@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, Martin Lau <kafai@fb.com>,
Yonghong Song <yhs@fb.com>, Networking <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next] tools: libbpf: update extended attributes version of bpf_object__open()
Date: Fri, 27 Sep 2019 15:12:02 +0200 [thread overview]
Message-ID: <20190927131202.GA18934@chromium.org> (raw)
In-Reply-To: <9EC54605-1911-48B0-B33A-02EC46DEF3DD@fb.com>
On 30-Aug 19:24, Song Liu wrote:
>
>
> > On Aug 30, 2019, at 11:53 AM, Anton Protopopov <a.s.protopopov@gmail.com> wrote:
> >
> > чт, 29 авг. 2019 г. в 16:02, Song Liu <songliubraving@fb.com>:
> >>
> >>
> >>
> >>> On Aug 14, 2019, at 5:03 PM, Anton Protopopov <a.s.protopopov@gmail.com> wrote:
> >>>
> >>
> >> [...]
> >>
> >>>
> >>>
> >>> int bpf_object__unload(struct bpf_object *obj)
> >>> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> >>> index e8f70977d137..634f278578dd 100644
> >>> --- a/tools/lib/bpf/libbpf.h
> >>> +++ b/tools/lib/bpf/libbpf.h
> >>> @@ -63,8 +63,13 @@ LIBBPF_API libbpf_print_fn_t libbpf_set_print(libbpf_print_fn_t fn);
> >>> struct bpf_object;
> >>>
> >>> struct bpf_object_open_attr {
> >>> - const char *file;
> >>> + union {
> >>> + const char *file;
> >>> + const char *obj_name;
> >>> + };
> >>> enum bpf_prog_type prog_type;
> >>> + void *obj_buf;
> >>> + size_t obj_buf_sz;
> >>> };
> >>
> >> I think this would break dynamically linked libbpf. No?
> >
> > Ah, yes, sure. What is the right way to make changes which break ABI in libbpf?
>
> I don't have a good idea here on the top of my head.
>
> Maybe we need a new struct and/or function for this.
I incorporated the suggested fixes and sent a new patch for this as we
ran into pretty much the same issue. (i.e. not being able to set
needs_kver / flags).
https://lore.kernel.org/bpf/20190927130834.18829-1-kpsingh@chromium.org/T/#u
- KP
>
> >
> > BTW, does the commit ddc7c3042614 ("libbpf: implement BPF CO-RE offset
> > relocation algorithm") which adds a new field to the struct
> > bpf_object_load_attr also break ABI?
>
> I think this change was in the same release, so it is OK.
>
> Thanks,
> Song
prev parent reply other threads:[~2019-09-27 13:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 0:03 [PATCH bpf-next] tools: libbpf: update extended attributes version of bpf_object__open() Anton Protopopov
2019-08-29 20:02 ` Song Liu
2019-08-30 18:53 ` Anton Protopopov
2019-08-30 19:24 ` Song Liu
2019-09-27 13:12 ` KP Singh [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=20190927131202.GA18934@chromium.org \
--to=kpsingh@chromium.org \
--cc=a.s.protopopov@gmail.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).