Fix pinning devmaps
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 3 repliesIn review
- v12 patches 5 repliesSuperseded
Changes in v2 from the cover letter
- Fixed a broken import
- Fixed style issues
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | Ignore RDONLY_PROG for devmaps in libbpf to allow re-loading of pinned devmapstools/ | +7 | 0 replies | |
| 2/2 | Add a selftest for devmap pinning.tools/ tools/ | +37 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH net-next v2 0/2] Fix pinning devmaps
Fix devmap pinning and reloading. The kernel adds BPF_F_RDONLY_PROG to all devmaps when created, but libbpf checks that user flags match pinned map flags when using LIBBPF_PIN_BY_NAME, so reusing pinned devmaps doesn't work, failing with an error like:
libbpf: couldn't reuse pinned map at '/sys/fs/bpf/dev_map':
parameter mismatch
Work around this by ignoring RDONLY_PROG in the compat check in libbpf.
Changes since v1:
- Fixed a broken import
- Fixed style issues
Pramukh Naduthota (2):
Ignore RDONLY_PROG for devmaps in libbpf to allow re-loading of pinned
devmaps
Add a selftest for devmap pinning.
tools/lib/bpf/libbpf.c | 8 +++++++- .../testing/selftests/bpf/prog_tests/devmap.c | 20 +++++++++++++++++++ .../selftests/bpf/progs/test_pinned_devmap.c | 17 ++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/devmap.c create mode 100644 tools/testing/selftests/bpf/progs/test_pinned_devmap.c
Signature · 1 line
2.30.2