From patchwork Wed Apr 12 16:21:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kal Cutter Conley X-Patchwork-Id: 13209326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FB45C7619A for ; Wed, 12 Apr 2023 16:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbjDLQWF (ORCPT ); Wed, 12 Apr 2023 12:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbjDLQVt (ORCPT ); Wed, 12 Apr 2023 12:21:49 -0400 Received: from mail-lj1-x263.google.com (mail-lj1-x263.google.com [IPv6:2a00:1450:4864:20::263]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 385834C32 for ; Wed, 12 Apr 2023 09:21:35 -0700 (PDT) Received: by mail-lj1-x263.google.com with SMTP id e9so41756737ljq.4 for ; Wed, 12 Apr 2023 09:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dectris.com; s=google; t=1681316493; x=1683908493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xsy5P1BFSd01HwRZSprmpkjXfSG/kvuR7yEFBLxIChw=; b=kiKTqQdjnb9Q3KCXeG88cm0N+JW61wRqiSgx2+fgx9iG+BD8yZKIQR54wwTLQRf0d7 3ll7YHX+7okVMZWDh0Ubllk7Aq/0axfCzSxJKy3PHfJQp07MNdKzF+KA/oxbCjwdcUbG Bmvl/uTo1R2SCuJsoPTel7CbFLAsQ8KUwkOEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681316493; x=1683908493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xsy5P1BFSd01HwRZSprmpkjXfSG/kvuR7yEFBLxIChw=; b=PD6b8HokVRfDbf5nW+hDrgA0akuzJJjjWeYZURkP4I0k8HO+pfdfV86rju2LT/fBzw aXTcCLFa2UUQIf8WiRBCofjw/QFWkDY9xqng6MDtndkYIPQhkFDRLwqwy3hOLcPDmvxu 20KoDSb0xpYIOl/55KFX8gBGayyBUcBE84cp9MG/PEsar0WpbfJYbKsKBhK5hJVAQZvO st09nqGA9sddFHpxjTE1xwsvSEn5xCE07ikJgpa158kBXhFCNJQhiTpWuFFoWC7wKJDa FFCuRl/gnRFiIbyvyLmgtbd86tLUtOsfVqWxGPO22JKE4sdA152Ro8ZmwM6An9IEZRJp 5p2w== X-Gm-Message-State: AAQBX9ej509yWw7XUO0+yhUmUny0Y2zTMopE5c5jDePycPP8rxfObwnE HcXLcU6W4CnCH0Sp1rD1T9fG5A7zDwrjO6D0FTD3/hd4xD/V X-Google-Smtp-Source: AKy350aEVWhrzNmJ+fgfBL5/m13X6W0SCZpEkb+Sk3T5iUyme2M85gnGSDWv06uZL745HN8sz+s3nWlgEdCp X-Received: by 2002:a2e:b2ce:0:b0:2a7:80ee:fa78 with SMTP id 14-20020a2eb2ce000000b002a780eefa78mr3156000ljz.51.1681316493244; Wed, 12 Apr 2023 09:21:33 -0700 (PDT) Received: from fedora.dectris.local (dect-ch-bad-pfw.cyberlink.ch. [62.12.151.50]) by smtp-relay.gmail.com with ESMTPS id t19-20020a2e8e73000000b002a77614d960sm2108109ljk.62.2023.04.12.09.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 09:21:33 -0700 (PDT) X-Relaying-Domain: dectris.com From: Kal Conley To: Magnus Karlsson , =?utf-8?b?QmrDtnJuIFTDtnBl?= =?utf-8?b?bA==?= , Maciej Fijalkowski , Jonathan Lemon , Andrii Nakryiko , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: Kal Conley , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v6 4/4] selftests: xsk: Add tests for 8K and 9K frame sizes Date: Wed, 12 Apr 2023 18:21:14 +0200 Message-Id: <20230412162114.19389-5-kal.conley@dectris.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230412162114.19389-1-kal.conley@dectris.com> References: <20230412162114.19389-1-kal.conley@dectris.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 Acked-by: Magnus Karlsson --- 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,