Thread (13 messages) 13 messages, 2 authors, 2020-09-24

Re: [PATCH v2 bpf-next 2/3] libbpf: introduce bpf_prog_test_run_xattr_opts

From: Song Liu <hidden>
Date: 2020-09-23 22:05:17
Also in: bpf

On Sep 23, 2020, at 12:31 PM, Andrii Nakryiko [off-list ref] wrote:

On Wed, Sep 23, 2020 at 9:55 AM Song Liu [off-list ref] wrote:
quoted
This API supports new field cpu_plus in bpf_attr.test.

Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Song Liu <redacted>
---
tools/lib/bpf/bpf.c      | 13 ++++++++++++-
tools/lib/bpf/bpf.h      | 11 +++++++++++
tools/lib/bpf/libbpf.map |  1 +
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 2baa1308737c8..3228dd60fa32f 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -684,7 +684,8 @@ int bpf_prog_test_run(int prog_fd, int repeat, void *data, __u32 size,
       return ret;
}

-int bpf_prog_test_run_xattr(struct bpf_prog_test_run_attr *test_attr)
+int bpf_prog_test_run_xattr_opts(struct bpf_prog_test_run_attr *test_attr,
+                                const struct bpf_prog_test_run_opts *opts)
opts are replacement for test_attr, not an addition to it. We chose to
use _xattr suffix for low-level APIs previously, but it's already
"taken". So I'd suggest to go with just  bpf_prog_test_run_ops and
have prog_fd as a first argument and then put all the rest of
test_run_attr into opts.
Sounds good. I will update it this way. 

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help