On Sat, Sep 19, 2020 at 4:50 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: > > From: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > > This adds a selftest for attaching an freplace program to multiple targets > simultaneously. > > Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > --- > .../selftests/bpf/prog_tests/fexit_bpf2bpf.c | 157 ++++++++++++++++---- > .../selftests/bpf/progs/freplace_get_constant.c | 15 ++ > 2 files changed, 140 insertions(+), 32 deletions(-) > create mode 100644 tools/testing/selftests/bpf/progs/freplace_get_constant.c > LGTM. Acked-by: Andrii Nakryiko <andriin@xxxxxx> > + err = bpf_prog_test_run(tgt_fd, 1, &pkt_v6, sizeof(pkt_v6), > + NULL, NULL, &retval, &duration); > + if (CHECK(err || retval, "ipv6", > + "err %d errno %d retval %d duration %d\n", > + err, errno, retval, duration)) > + goto out; > + > + err = check_data_map(obj, 1, true); > + if (err) > + goto out; > + > +out: > + if (!IS_ERR_OR_NULL(link)) > + bpf_link__destroy(link); fyi, you don't need to check ERR_OR_NULL anymore, all destructors are now handling that implicitly > + bpf_object__close(tgt_obj); > + return err; > +} > + [...]