All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: Remove deprecated bpf_object__find_map_by_offset
@ 2021-07-22 16:25 Tal Lossos
  2021-07-23  3:12 ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Tal Lossos @ 2021-07-22 16:25 UTC (permalink / raw)
  To: bpf; +Cc: andrii, Tal Lossos

Removing bpf_object__find_map_by_offset as part of the effort to move
towards a v1.0 for libbpf: https://github.com/libbpf/libbpf/issues/302.

Signed-off-by: Tal Lossos <tallossos@gmail.com>
---
 tools/lib/bpf/libbpf.c   | 6 ------
 tools/lib/bpf/libbpf.h   | 7 -------
 tools/lib/bpf/libbpf.map | 1 -
 3 files changed, 14 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 4c153c379989..6b021b893579 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -9956,12 +9956,6 @@ bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name)
 	return bpf_map__fd(bpf_object__find_map_by_name(obj, name));
 }
 
-struct bpf_map *
-bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset)
-{
-	return libbpf_err_ptr(-ENOTSUP);
-}
-
 long libbpf_get_error(const void *ptr)
 {
 	if (!IS_ERR_OR_NULL(ptr))
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 6b08c1023609..1de34b315277 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -422,13 +422,6 @@ bpf_object__find_map_by_name(const struct bpf_object *obj, const char *name);
 LIBBPF_API int
 bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name);
 
-/*
- * Get bpf_map through the offset of corresponding struct bpf_map_def
- * in the BPF object file.
- */
-LIBBPF_API struct bpf_map *
-bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset);
-
 LIBBPF_API struct bpf_map *
 bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj);
 #define bpf_object__for_each_map(pos, obj)		\
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
index 5bfc10722647..220d22b73b9c 100644
--- a/tools/lib/bpf/libbpf.map
+++ b/tools/lib/bpf/libbpf.map
@@ -38,7 +38,6 @@ LIBBPF_0.0.1 {
 		bpf_object__btf_fd;
 		bpf_object__close;
 		bpf_object__find_map_by_name;
-		bpf_object__find_map_by_offset;
 		bpf_object__find_program_by_title;
 		bpf_object__kversion;
 		bpf_object__load;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: Remove deprecated bpf_object__find_map_by_offset
  2021-07-22 16:25 [PATCH bpf-next] libbpf: Remove deprecated bpf_object__find_map_by_offset Tal Lossos
@ 2021-07-23  3:12 ` Andrii Nakryiko
  2021-07-23  7:49   ` Tal Lossos
  0 siblings, 1 reply; 3+ messages in thread
From: Andrii Nakryiko @ 2021-07-23  3:12 UTC (permalink / raw)
  To: Tal Lossos; +Cc: bpf, Andrii Nakryiko

On Thu, Jul 22, 2021 at 9:26 AM Tal Lossos <tallossos@gmail.com> wrote:
>
> Removing bpf_object__find_map_by_offset as part of the effort to move
> towards a v1.0 for libbpf: https://github.com/libbpf/libbpf/issues/302.
>
> Signed-off-by: Tal Lossos <tallossos@gmail.com>
> ---

Thanks for helping with the libbpf 1.0 effort! But we shouldn't be
removing APIs until right before 1.0 release, otherwise we are
breaking backwards compatibility guarantees. So this will have to wait
until then (even though I don't believe anyone is using
bpf_object__find_map_by_offset() in the wild).

>  tools/lib/bpf/libbpf.c   | 6 ------
>  tools/lib/bpf/libbpf.h   | 7 -------
>  tools/lib/bpf/libbpf.map | 1 -
>  3 files changed, 14 deletions(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 4c153c379989..6b021b893579 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -9956,12 +9956,6 @@ bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name)
>         return bpf_map__fd(bpf_object__find_map_by_name(obj, name));
>  }
>
> -struct bpf_map *
> -bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset)
> -{
> -       return libbpf_err_ptr(-ENOTSUP);
> -}
> -
>  long libbpf_get_error(const void *ptr)
>  {
>         if (!IS_ERR_OR_NULL(ptr))
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index 6b08c1023609..1de34b315277 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -422,13 +422,6 @@ bpf_object__find_map_by_name(const struct bpf_object *obj, const char *name);
>  LIBBPF_API int
>  bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name);
>
> -/*
> - * Get bpf_map through the offset of corresponding struct bpf_map_def
> - * in the BPF object file.
> - */
> -LIBBPF_API struct bpf_map *
> -bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset);
> -
>  LIBBPF_API struct bpf_map *
>  bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj);
>  #define bpf_object__for_each_map(pos, obj)             \
> diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
> index 5bfc10722647..220d22b73b9c 100644
> --- a/tools/lib/bpf/libbpf.map
> +++ b/tools/lib/bpf/libbpf.map
> @@ -38,7 +38,6 @@ LIBBPF_0.0.1 {
>                 bpf_object__btf_fd;
>                 bpf_object__close;
>                 bpf_object__find_map_by_name;
> -               bpf_object__find_map_by_offset;

we can't retroactively modify libbpf.map for already released
versions. I think once we are ready for libbpf 1.0 we'll just dump all
the non-deleted APIs into a LIBBPF_1.0.0 section without inheriting
from the last 0.x version.

>                 bpf_object__find_program_by_title;
>                 bpf_object__kversion;
>                 bpf_object__load;
> --
> 2.27.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: Remove deprecated bpf_object__find_map_by_offset
  2021-07-23  3:12 ` Andrii Nakryiko
@ 2021-07-23  7:49   ` Tal Lossos
  0 siblings, 0 replies; 3+ messages in thread
From: Tal Lossos @ 2021-07-23  7:49 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: bpf, Tal Lossos

Hi no worries!
I've submitted a fix for the patch which re-adds the deleted API in libbpf.map.
Since we want to do it only when we're about to release libbpf 1.0 we
can just wait with it until then :)


‫בתאריך יום ו׳, 23 ביולי 2021 ב-6:12 מאת ‪Andrii Nakryiko‬‏
<‪andrii.nakryiko@gmail.com‬‏>:‬
>
> On Thu, Jul 22, 2021 at 9:26 AM Tal Lossos <tallossos@gmail.com> wrote:
> >
> > Removing bpf_object__find_map_by_offset as part of the effort to move
> > towards a v1.0 for libbpf: https://github.com/libbpf/libbpf/issues/302.
> >
> > Signed-off-by: Tal Lossos <tallossos@gmail.com>
> > ---
>
> Thanks for helping with the libbpf 1.0 effort! But we shouldn't be
> removing APIs until right before 1.0 release, otherwise we are
> breaking backwards compatibility guarantees. So this will have to wait
> until then (even though I don't believe anyone is using
> bpf_object__find_map_by_offset() in the wild).
>
> >  tools/lib/bpf/libbpf.c   | 6 ------
> >  tools/lib/bpf/libbpf.h   | 7 -------
> >  tools/lib/bpf/libbpf.map | 1 -
> >  3 files changed, 14 deletions(-)
> >
> > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> > index 4c153c379989..6b021b893579 100644
> > --- a/tools/lib/bpf/libbpf.c
> > +++ b/tools/lib/bpf/libbpf.c
> > @@ -9956,12 +9956,6 @@ bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name)
> >         return bpf_map__fd(bpf_object__find_map_by_name(obj, name));
> >  }
> >
> > -struct bpf_map *
> > -bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset)
> > -{
> > -       return libbpf_err_ptr(-ENOTSUP);
> > -}
> > -
> >  long libbpf_get_error(const void *ptr)
> >  {
> >         if (!IS_ERR_OR_NULL(ptr))
> > diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> > index 6b08c1023609..1de34b315277 100644
> > --- a/tools/lib/bpf/libbpf.h
> > +++ b/tools/lib/bpf/libbpf.h
> > @@ -422,13 +422,6 @@ bpf_object__find_map_by_name(const struct bpf_object *obj, const char *name);
> >  LIBBPF_API int
> >  bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name);
> >
> > -/*
> > - * Get bpf_map through the offset of corresponding struct bpf_map_def
> > - * in the BPF object file.
> > - */
> > -LIBBPF_API struct bpf_map *
> > -bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset);
> > -
> >  LIBBPF_API struct bpf_map *
> >  bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj);
> >  #define bpf_object__for_each_map(pos, obj)             \
> > diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
> > index 5bfc10722647..220d22b73b9c 100644
> > --- a/tools/lib/bpf/libbpf.map
> > +++ b/tools/lib/bpf/libbpf.map
> > @@ -38,7 +38,6 @@ LIBBPF_0.0.1 {
> >                 bpf_object__btf_fd;
> >                 bpf_object__close;
> >                 bpf_object__find_map_by_name;
> > -               bpf_object__find_map_by_offset;
>
> we can't retroactively modify libbpf.map for already released
> versions. I think once we are ready for libbpf 1.0 we'll just dump all
> the non-deleted APIs into a LIBBPF_1.0.0 section without inheriting
> from the last 0.x version.
>
> >                 bpf_object__find_program_by_title;
> >                 bpf_object__kversion;
> >                 bpf_object__load;
> > --
> > 2.27.0
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-23  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 16:25 [PATCH bpf-next] libbpf: Remove deprecated bpf_object__find_map_by_offset Tal Lossos
2021-07-23  3:12 ` Andrii Nakryiko
2021-07-23  7:49   ` Tal Lossos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.