mbox series

[bpf-next,v2,0/3] introduce bpf_dynptr_copy kfunc

Message ID 20250221221400.672980-1-mykyta.yatsenko5@gmail.com (mailing list archive)
Headers show
Series introduce bpf_dynptr_copy kfunc | expand

Message

Mykyta Yatsenko Feb. 21, 2025, 10:13 p.m. UTC
From: Mykyta Yatsenko <yatsenko@meta.com>

Introduce a new kfunc, bpf_dynptr_copy, which enables copying of
data from one dynptr to another. This functionality may be useful in
scenarios such as capturing XDP data to a ring buffer.
The patch set is split into 3 patches:
1. Refactor bpf_dynptr_read and bpf_dynptr_write by extracting code into
static functions, that allows calling them with no compiler warnings
2. Introduce bpf_dynptr_copy
3. Add tests for bpf_dynptr_copy

Mykyta Yatsenko (3):
  bpf/helpers: refactor bpf_dynptr_read and bpf_dynptr_write
  bpf/helpers: introduce bpf_dynptr_copy kfunc
  selftests/bpf: add tests for bpf_dynptr_copy

 kernel/bpf/helpers.c                          |  75 +++++++++++-
 .../testing/selftests/bpf/prog_tests/dynptr.c |  21 ++++
 .../selftests/bpf/progs/dynptr_success.c      | 112 +++++++++++++++++-
 3 files changed, 199 insertions(+), 9 deletions(-)