mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
libbpf: add support for ctx_{size, }_{in, out} in BPF_PROG_TEST_RUN
Support recently introduced input/output context for test runs. We extend only bpf_prog_test_run_xattr. bpf_prog_test_run is unextendable and left as is. Signed-off-by: Stanislav Fomichev <sdf@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
b0b9395d86
commit
5e903c656b
3 changed files with 17 additions and 0 deletions
|
@ -554,10 +554,15 @@ int bpf_prog_test_run_xattr(struct bpf_prog_test_run_attr *test_attr)
|
|||
attr.test.data_out = ptr_to_u64(test_attr->data_out);
|
||||
attr.test.data_size_in = test_attr->data_size_in;
|
||||
attr.test.data_size_out = test_attr->data_size_out;
|
||||
attr.test.ctx_in = ptr_to_u64(test_attr->ctx_in);
|
||||
attr.test.ctx_out = ptr_to_u64(test_attr->ctx_out);
|
||||
attr.test.ctx_size_in = test_attr->ctx_size_in;
|
||||
attr.test.ctx_size_out = test_attr->ctx_size_out;
|
||||
attr.test.repeat = test_attr->repeat;
|
||||
|
||||
ret = sys_bpf(BPF_PROG_TEST_RUN, &attr, sizeof(attr));
|
||||
test_attr->data_size_out = attr.test.data_size_out;
|
||||
test_attr->ctx_size_out = attr.test.ctx_size_out;
|
||||
test_attr->retval = attr.test.retval;
|
||||
test_attr->duration = attr.test.duration;
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue