Re: [PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-28 Thread David Ahern
On 5/28/20 4:25 AM, Jesper Dangaard Brouer wrote: > That said, you should use the new SEC(".maps") definitions, but you > need to use some tricks to avoid a BTF-ID getting generated. Let me > help you with something that should work: > > /* DEVMAP values */ > struct devmap_val { > __u32 ifi

Re: [PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-28 Thread David Ahern
On 5/28/20 1:08 AM, Andrii Nakryiko wrote: >> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c >> b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c >> new file mode 100644 >> index ..d81b2b366f39 >> --- /dev/null >> +++ b/tools/testing/selftests/bpf/pr

Re: [PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-28 Thread Jesper Dangaard Brouer
On Thu, 28 May 2020 00:08:34 -0700 Andrii Nakryiko wrote: > > diff --git a/tools/testing/selftests/bpf/progs/test_xdp_with_devmap.c > > b/tools/testing/selftests/bpf/progs/test_xdp_with_devmap.c > > new file mode 100644 > > index ..815cd59b4866 > > --- /dev/null > > +++ b/tools/testi

Re: [PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-28 Thread Andrii Nakryiko
On Wed, May 27, 2020 at 5:15 PM David Ahern wrote: > > Add tests to verify ability to add an XDP program to a > entry in a DEVMAP. > > Add negative tests to show DEVMAP programs can not be > attached to devices as a normal XDP program, and accesses > to egress_ifindex require BPF_XDP_DEVMAP attach

[PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-27 Thread David Ahern
Add tests to verify ability to add an XDP program to a entry in a DEVMAP. Add negative tests to show DEVMAP programs can not be attached to devices as a normal XDP program, and accesses to egress_ifindex require BPF_XDP_DEVMAP attach type. Signed-off-by: David Ahern --- .../bpf/prog_tests/xdp_d