From: Kal Conley <kal.conley@dectris.com>
To: "Björn Töpel" <bjorn@kernel.org>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Mykola Lysenko" <mykolal@fb.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>, "Yonghong Song" <yhs@fb.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"KP Singh" <kpsingh@kernel.org>,
"Stanislav Fomichev" <sdf@google.com>,
"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
"Shuah Khan" <shuah@kernel.org>
Cc: Kal Conley <kal.conley@dectris.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH bpf-next v3 3/3] selftests: xsk: Add tests for 8K and 9K frame sizes
Date: Thu, 6 Apr 2023 15:02:05 +0200 [thread overview]
Message-ID: <20230406130205.49996-4-kal.conley@dectris.com> (raw)
In-Reply-To: <20230406130205.49996-1-kal.conley@dectris.com>
Add tests:
- RUN_TO_COMPLETION_8K_FRAME_SIZE: frame_size=8192 (aligned)
- UNALIGNED_9K_FRAME_SIZE: frame_size=9000 (unaligned)
Signed-off-by: Kal Conley <kal.conley@dectris.com>
---
tools/testing/selftests/bpf/xskxceiver.c | 25 ++++++++++++++++++++++++
tools/testing/selftests/bpf/xskxceiver.h | 2 ++
2 files changed, 27 insertions(+)
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 7eccf57a0ccc..86797de7fc50 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -1841,6 +1841,17 @@ static void run_pkt_test(struct test_spec *test, enum test_mode mode, enum test_
pkt_stream_replace(test, DEFAULT_PKT_CNT, PKT_SIZE);
testapp_validate_traffic(test);
break;
+ case TEST_TYPE_RUN_TO_COMPLETION_8K_FRAME:
+ if (!hugepages_present(test->ifobj_tx)) {
+ ksft_test_result_skip("No 2M huge pages present.\n");
+ return;
+ }
+ test_spec_set_name(test, "RUN_TO_COMPLETION_8K_FRAME_SIZE");
+ test->ifobj_tx->umem->frame_size = 8192;
+ test->ifobj_rx->umem->frame_size = 8192;
+ pkt_stream_replace(test, DEFAULT_PKT_CNT, PKT_SIZE);
+ testapp_validate_traffic(test);
+ break;
case TEST_TYPE_RX_POLL:
test->ifobj_rx->use_poll = true;
test_spec_set_name(test, "POLL_RX");
@@ -1904,6 +1915,20 @@ static void run_pkt_test(struct test_spec *test, enum test_mode mode, enum test_
if (!testapp_unaligned(test))
return;
break;
+ case TEST_TYPE_UNALIGNED_9K_FRAME:
+ if (!hugepages_present(test->ifobj_tx)) {
+ ksft_test_result_skip("No 2M huge pages present.\n");
+ return;
+ }
+ test_spec_set_name(test, "UNALIGNED_9K_FRAME_SIZE");
+ test->ifobj_tx->umem->frame_size = 9000;
+ test->ifobj_rx->umem->frame_size = 9000;
+ test->ifobj_tx->umem->unaligned_mode = true;
+ test->ifobj_rx->umem->unaligned_mode = true;
+ pkt_stream_replace(test, DEFAULT_PKT_CNT, PKT_SIZE);
+ test->ifobj_rx->pkt_stream->use_addr_for_fill = true;
+ testapp_validate_traffic(test);
+ break;
case TEST_TYPE_HEADROOM:
testapp_headroom(test);
break;
diff --git a/tools/testing/selftests/bpf/xskxceiver.h b/tools/testing/selftests/bpf/xskxceiver.h
index 919327807a4e..7f52f737f5e9 100644
--- a/tools/testing/selftests/bpf/xskxceiver.h
+++ b/tools/testing/selftests/bpf/xskxceiver.h
@@ -69,12 +69,14 @@ enum test_mode {
enum test_type {
TEST_TYPE_RUN_TO_COMPLETION,
TEST_TYPE_RUN_TO_COMPLETION_2K_FRAME,
+ TEST_TYPE_RUN_TO_COMPLETION_8K_FRAME,
TEST_TYPE_RUN_TO_COMPLETION_SINGLE_PKT,
TEST_TYPE_RX_POLL,
TEST_TYPE_TX_POLL,
TEST_TYPE_POLL_RXQ_TMOUT,
TEST_TYPE_POLL_TXQ_TMOUT,
TEST_TYPE_UNALIGNED,
+ TEST_TYPE_UNALIGNED_9K_FRAME,
TEST_TYPE_ALIGNED_INV_DESC,
TEST_TYPE_ALIGNED_INV_DESC_2K_FRAME,
TEST_TYPE_UNALIGNED_INV_DESC,
--
2.39.2
prev parent reply other threads:[~2023-04-06 13:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 13:02 [PATCH bpf-next v3 0/3] xsk: Support UMEM chunk_size > PAGE_SIZE Kal Conley
2023-04-06 13:02 ` [PATCH bpf-next v3 1/3] " Kal Conley
2023-04-06 18:38 ` Toke Høiland-Jørgensen
2023-04-07 16:28 ` Maciej Fijalkowski
2023-04-08 17:38 ` Kal Cutter Conley
2023-04-12 13:34 ` Toke Høiland-Jørgensen
2023-04-12 13:55 ` Magnus Karlsson
2023-04-12 22:49 ` Toke Høiland-Jørgensen
2023-04-13 10:56 ` Kal Cutter Conley
2023-04-13 11:08 ` Toke Høiland-Jørgensen
2023-04-13 12:43 ` Kal Cutter Conley
2023-04-13 20:49 ` Toke Høiland-Jørgensen
2023-04-13 22:06 ` Kal Cutter Conley
2023-04-13 22:28 ` Toke Høiland-Jørgensen
2023-04-14 9:08 ` Kal Cutter Conley
2023-04-17 12:13 ` Magnus Karlsson
2023-04-17 12:40 ` Toke Høiland-Jørgensen
2023-04-17 13:46 ` Kal Cutter Conley
2023-04-14 16:36 ` Kal Cutter Conley
2023-04-18 10:16 ` Toke Høiland-Jørgensen
2023-04-18 11:12 ` Kal Cutter Conley
2023-04-21 9:37 ` Maciej Fijalkowski
2023-04-21 9:54 ` Toke Høiland-Jørgensen
2023-04-21 12:27 ` Magnus Karlsson
2023-04-21 12:17 ` Magnus Karlsson
2023-04-21 15:27 ` Kal Cutter Conley
2023-04-06 13:02 ` [PATCH bpf-next v3 2/3] selftests: xsk: Use hugepages when umem->frame_size " Kal Conley
2023-04-06 13:02 ` Kal Conley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230406130205.49996-4-kal.conley@dectris.com \
--to=kal.conley@dectris.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=jonathan.lemon@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).