The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup
@ 2026-06-24  2:50 Yichong Chen
  2026-07-01 13:10 ` Quentin Monnet
  2026-07-01 18:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yichong Chen @ 2026-06-24  2:50 UTC (permalink / raw)
  To: emil, qmo, ast, daniel, andrii, eddyz87, memxor
  Cc: chenyichong, martin.lau, song, yonghong.song, jolsa, jiayuan.chen,
	bpf, linux-kernel

This series fixes stale vmlinux BTF state in bpftool batch mode.

Patch 1 resets the map command cached vmlinux BTF pointer when the
command releases it, and avoids freeing the cached object from the
map lookup path.

Patch 2 resets the struct_ops command cached vmlinux BTF pointer and
dependent cached map info state after each struct_ops command.

Changes in v4:
- Add Emil's Reviewed-by tag to patch 1.
- Inline the struct_ops cleanup instead of adding a helper.

Changes in v3:
- Add Fixes tags to both patches.

Changes in v2:
- Fold the map lookup path fix into patch 1.
- Update patch 1 subject and commit message to cover map commands
  rather than only map dump.

Yichong Chen (2):
  tools/bpf/bpftool: Reset vmlinux BTF after map commands
  tools/bpf/bpftool: Reset vmlinux BTF after struct_ops commands

 tools/bpf/bpftool/map.c        | 12 +++++++++---
 tools/bpf/bpftool/struct_ops.c |  4 ++++
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.51.0


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

* Re: [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup
  2026-06-24  2:50 [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup Yichong Chen
@ 2026-07-01 13:10 ` Quentin Monnet
  2026-07-01 18:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Quentin Monnet @ 2026-07-01 13:10 UTC (permalink / raw)
  To: Yichong Chen, emil, ast, daniel, andrii, eddyz87, memxor
  Cc: martin.lau, song, yonghong.song, jolsa, jiayuan.chen, bpf,
	linux-kernel

2026-06-24 10:50 UTC+0800 ~ Yichong Chen <chenyichong@uniontech.com>
> This series fixes stale vmlinux BTF state in bpftool batch mode.
> 
> Patch 1 resets the map command cached vmlinux BTF pointer when the
> command releases it, and avoids freeing the cached object from the
> map lookup path.
> 
> Patch 2 resets the struct_ops command cached vmlinux BTF pointer and
> dependent cached map info state after each struct_ops command.
> 
> Changes in v4:
> - Add Emil's Reviewed-by tag to patch 1.
> - Inline the struct_ops cleanup instead of adding a helper.
> 
> Changes in v3:
> - Add Fixes tags to both patches.
> 
> Changes in v2:
> - Fold the map lookup path fix into patch 1.
> - Update patch 1 subject and commit message to cover map commands
>   rather than only map dump.
> 
> Yichong Chen (2):
>   tools/bpf/bpftool: Reset vmlinux BTF after map commands
>   tools/bpf/bpftool: Reset vmlinux BTF after struct_ops commands
> 
>  tools/bpf/bpftool/map.c        | 12 +++++++++---
>  tools/bpf/bpftool/struct_ops.c |  4 ++++
>  2 files changed, 13 insertions(+), 3 deletions(-)
> 

Both patches look good, thank you for following up with these fixes!

Reviewed-by: Quentin Monnet <qmo@kernel.org>

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

* Re: [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup
  2026-06-24  2:50 [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup Yichong Chen
  2026-07-01 13:10 ` Quentin Monnet
@ 2026-07-01 18:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-01 18:20 UTC (permalink / raw)
  To: Yichong Chen
  Cc: emil, qmo, ast, daniel, andrii, eddyz87, memxor, martin.lau, song,
	yonghong.song, jolsa, jiayuan.chen, bpf, linux-kernel

Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Wed, 24 Jun 2026 10:50:53 +0800 you wrote:
> This series fixes stale vmlinux BTF state in bpftool batch mode.
> 
> Patch 1 resets the map command cached vmlinux BTF pointer when the
> command releases it, and avoids freeing the cached object from the
> map lookup path.
> 
> Patch 2 resets the struct_ops command cached vmlinux BTF pointer and
> dependent cached map info state after each struct_ops command.
> 
> [...]

Here is the summary with links:
  - [v4,1/2] tools/bpf/bpftool: Reset vmlinux BTF after map commands
    https://git.kernel.org/bpf/bpf-next/c/66d7e39e49b0
  - [v4,2/2] tools/bpf/bpftool: Reset vmlinux BTF after struct_ops commands
    https://git.kernel.org/bpf/bpf-next/c/f7f540e19751

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-07-01 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  2:50 [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup Yichong Chen
2026-07-01 13:10 ` Quentin Monnet
2026-07-01 18:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox