Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf 1.0: deprecate bpf_object__unload #290

Closed
anakryiko opened this issue Jun 1, 2021 · 0 comments
Closed

libbpf 1.0: deprecate bpf_object__unload #290

anakryiko opened this issue Jun 1, 2021 · 0 comments
Labels
good first issue Good for newcomers libbpf-1.0 Tasks related to libbpf-1.0 release
Milestone

Comments

@anakryiko
Copy link
Member

Details: https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#libbpfh-high-level-apis

@anakryiko anakryiko added this to the libbpf-1.0 milestone Jun 1, 2021
@anakryiko anakryiko added good first issue Good for newcomers libbpf-1.0 Tasks related to libbpf-1.0 release labels Jun 2, 2021
fengguang pushed a commit to 0day-ci/linux that referenced this issue Sep 8, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Remove bpf_object__unload() inside bpf_object__load_xattr(), it is the
caller's responsibility to free up resources, otherwise, the following
code path will cause double-free problem when loading failed:

    bpf_prog_load
        bpf_prog_load_xattr
            bpf_object__load
                bpf_object__load_xattr

Replace bpf_object__unload() inside bpf_object__close() with the necessary
cleanup operations to avoid compilation error.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Sep 8, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Remove bpf_object__unload() inside bpf_object__load_xattr(), it is the
caller's responsibility to free up resources, otherwise, the following
code path will cause double-free problem when loading failed:

    bpf_prog_load
        bpf_prog_load_xattr
            bpf_object__load
                bpf_object__load_xattr

Replace bpf_object__unload() inside bpf_object__close() with the necessary
cleanup operations to avoid compilation error.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Sep 8, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Remove bpf_object__unload() inside bpf_object__load_xattr(), it is the
caller's responsibility to free up resources, otherwise, the following
code path will cause double-free problem when loading failed:

    bpf_prog_load
        bpf_prog_load_xattr
            bpf_object__load
                bpf_object__load_xattr

Replace bpf_object__unload() inside bpf_object__close() with the necessary
cleanup operations to avoid compilation error.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 2, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 2, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 4, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 4, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
tsipa pushed a commit to tsipa/bpf-next that referenced this issue Oct 6, 2021
BPF objects are not reloadable after unload. Users are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it
([0]).  Add bpf_object__unload() as an alias to internal
bpf_object_unload() and replace all bpf_object__unload() uses to avoid
compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211002161000.3854559-1-hengqi.chen@gmail.com
anakryiko pushed a commit to anakryiko/libbpf that referenced this issue Oct 6, 2021
BPF objects are not reloadable after unload. Users are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it
([0]).  Add bpf_object__unload() as an alias to internal
bpf_object_unload() and replace all bpf_object__unload() uses to avoid
compilation errors.

  [0] Closes: libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211002161000.3854559-1-hengqi.chen@gmail.com
kernel-patches-bot pushed a commit to kernel-patches/bpf that referenced this issue Oct 6, 2021
BPF objects are not reloadable after unload. Users are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it
([0]).  Add bpf_object__unload() as an alias to internal
bpf_object_unload() and replace all bpf_object__unload() uses to avoid
compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211002161000.3854559-1-hengqi.chen@gmail.com
fengguang pushed a commit to 0day-ci/linux that referenced this issue Oct 9, 2021
BPF objects are not re-loadable after unload. User are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it.[0]
Add bpf_object_unload() as an alias to bpf_object__unload() and replace
all bpf_object__unload() to avoid compilation errors.

  [0] Closes: libbpf/libbpf#290

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers libbpf-1.0 Tasks related to libbpf-1.0 release
Projects
None yet
Development

No branches or pull requests

1 participant