From patchwork Wed Apr 12 16:21:13 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: 13209325 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 99769C77B6E for ; Wed, 12 Apr 2023 16:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbjDLQWA (ORCPT ); Wed, 12 Apr 2023 12:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjDLQVr (ORCPT ); Wed, 12 Apr 2023 12:21:47 -0400 Received: from mail-lj1-x261.google.com (mail-lj1-x261.google.com [IPv6:2a00:1450:4864:20::261]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 778A3900B for ; Wed, 12 Apr 2023 09:21:33 -0700 (PDT) Received: by mail-lj1-x261.google.com with SMTP id e3so3729873ljn.1 for ; Wed, 12 Apr 2023 09:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dectris.com; s=google; t=1681316491; x=1683908491; 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=CyAv2dean73hIsFLt2c4UWD/sKWcl5Pwsn2aihE0NA4=; b=OEBbkab5p2o9hwNukLgtXQ10pDTQGN6E/NQ6CLxGSLRcOZIcse9gSl42k864+87Lbc Lw3C/jm5yWY69rPJ6ugZycACRrpIjaPN4iJksV7AsV3ke4CZD0FEvmYqivLrV+SdnOI2 GOSelxvcS6d+oBM14LB4gLmsYsg8oxUUqyiho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681316491; x=1683908491; 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=CyAv2dean73hIsFLt2c4UWD/sKWcl5Pwsn2aihE0NA4=; b=MXHrdxLtK1521VMDVWORWbJy0cVE16tAveGyyHYxhWaHuqkALLLcMQwepheg5K7Gob d78IILFCKk/3lgbXUfncnkWxDxMqXSN9zlapy9Hsx/PZt2y1mYCD/ZmypuC14u7e6mms kCt/y7HKJIOaCL9UOtGiZ0Mz54LND/6+LYX6DeC8ENC2DcxDsaci5iY9piZZOdnL5xXQ 1wU85MnCbEUEEltWxJ7fjGiQ5NNzL9EE3lgvSD9AXzuKWWDdcHvZh5KhNdLDcIud1Sv6 N7pUzJCALAR4L7giVB42l84+MPXeqYCdCRBxApnd7/p3rFs9J7sVx6yBBOzIGXQCU6gq TqzA== X-Gm-Message-State: AAQBX9d/gFrhFFvH2gKyMWb0v6hSi/+7asBSqQJmTh5/ssPciV/O8CpT ohUVL+qqOjgCynjvrywyP4XZXY3f7Rp12hdvWoAWTyoTsVG3 X-Google-Smtp-Source: AKy350Y62+xWGMlvwfPyJzRmQBZ3FmHXJICDKDqOKLASxBsPsbir+GWE2/0SgcsAlObTzzCN5cfuJfG4MSDT X-Received: by 2002:a2e:9ed6:0:b0:2a7:9c57:dcab with SMTP id h22-20020a2e9ed6000000b002a79c57dcabmr827151ljk.6.1681316491516; Wed, 12 Apr 2023 09:21:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 09:21:31 -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 , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , 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 3/4] selftests: xsk: Use hugepages when umem->frame_size > PAGE_SIZE Date: Wed, 12 Apr 2023 18:21:13 +0200 Message-Id: <20230412162114.19389-4-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 HugeTLB UMEMs now support chunk_size > PAGE_SIZE. Set MAP_HUGETLB when frame_size > PAGE_SIZE for future tests. Signed-off-by: Kal Conley Acked-by: Magnus Karlsson --- tools/testing/selftests/bpf/xskxceiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index 5a9691e942de..7eccf57a0ccc 100644 --- a/tools/testing/selftests/bpf/xskxceiver.c +++ b/tools/testing/selftests/bpf/xskxceiver.c @@ -1289,7 +1289,7 @@ static void thread_common_ops(struct test_spec *test, struct ifobject *ifobject) void *bufs; int ret; - if (ifobject->umem->unaligned_mode) + if (ifobject->umem->frame_size > sysconf(_SC_PAGESIZE) || ifobject->umem->unaligned_mode) mmap_flags |= MAP_HUGETLB; if (ifobject->shared_umem)