[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y1wwngj8.fsf@toke.dk>
Date: Thu, 14 Jul 2022 12:18:51 +0200
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Kumar Kartikeya Dwivedi <memxor@...il.com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Freysteinn Alfredsson <freysteinn.alfredsson@....se>,
Cong Wang <xiyou.wangcong@...il.com>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>
Subject: Re: [RFC PATCH 16/17] selftests/bpf: Add test for XDP queueing
through PIFO maps
Andrii Nakryiko <andrii.nakryiko@...il.com> writes:
> On Wed, Jul 13, 2022 at 4:15 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>>
>> This adds selftests for both variants of the generic PIFO map type, and for
>> the dequeue program type. The XDP test uses bpf_prog_run() to run an XDP
>> program that puts packets into a PIFO map, and then adds tests that pull
>> them back out again through bpf_prog_run() of a dequeue program, as well as
>> by attaching a dequeue program to a veth device and scheduling transmission
>> there.
>>
>> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
>> ---
>> .../selftests/bpf/prog_tests/pifo_map.c | 125 ++++++++++++++
>> .../bpf/prog_tests/xdp_pifo_test_run.c | 154 ++++++++++++++++++
>> tools/testing/selftests/bpf/progs/pifo_map.c | 54 ++++++
>> .../selftests/bpf/progs/test_xdp_pifo.c | 110 +++++++++++++
>> 4 files changed, 443 insertions(+)
>> create mode 100644 tools/testing/selftests/bpf/prog_tests/pifo_map.c
>> create mode 100644 tools/testing/selftests/bpf/prog_tests/xdp_pifo_test_run.c
>> create mode 100644 tools/testing/selftests/bpf/progs/pifo_map.c
>> create mode 100644 tools/testing/selftests/bpf/progs/test_xdp_pifo.c
>>
>
> [...]
>
>> +__u16 pkt_count = 0;
>> +__u16 drop_above = 2;
>> +
>> +SEC("dequeue")
>
> "dequeue" seems like a way too generic term, why not "xdp_dequeue" or
> something like that? Isn't this XDP specific program?
Well, depending on how close the qdisc/xdp APIs end up being we may be
able to reuse the program type but have subtypes (so we could have
"dequeue/xdp" and "dequeue/skb" for instance). But if that doesn't pan
out I do see your point that "dequeue" is a bit too generic; will change
it to 'xdp_dequeue' in that case...
-Toke
Powered by blists - more mailing lists