From patchwork Mon Apr 12 10:06:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 91111 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6183FA0C47; Mon, 12 Apr 2021 12:07:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E27F614109D; Mon, 12 Apr 2021 12:06:59 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 24971141086 for ; Mon, 12 Apr 2021 12:06:58 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id w8so11925029lfr.0 for ; Mon, 12 Apr 2021 03:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JeSR0IAjH/UqeAAfOKeLhPENhYiIhpWv9/drxp7F4wA=; b=GylvM+xvSxvXB4WaxNTXrxo2/SK0VedGBFjzqwEGuuG98vNfEJt9wkpXSwr1rFQmSk COzVaTuzXDZv0YI4uOeJnyw3CGi2yzoYn6042oEjApL1yTeAypKExg2Ra7vyl2GBiws1 G2ORKBC4wMPWXR6SVTsCvuuYm2zZZhA5uU6GU/q4zToNvwpNHZctQuyRMC8J6yuNdfkz A5hGq40LQQNyqshMvzVDmvCmnPjq7iTf0ESDYavKhJVPauZ99f2kPVpJuWZnzVqGf8wl +8MTJ7dXoOo7bkARZp84tFmQX+kjK7AVK+j5uOtAQNmHkcDsMoQTnwcWF+mgYJ9tpZHw 9r/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JeSR0IAjH/UqeAAfOKeLhPENhYiIhpWv9/drxp7F4wA=; b=QxsTuC+ZfSasA1L4mwg+W8n4R7bAs66BYcoJpM6g+Cjm8MIlM+p5OyEGVfw81zFrP3 IBCZVlI0BCJWkWRFK6Drt5UcdPpe81jSZ1mpqoA45dnyU5ZpOF+Cyaeqk+ZIha2Q1xGa 8Jk0MBbDowx+HRuRvmNmKFQ7wl2CJujeJrK+fEnzqHHplt5LgEYl+Koe0cJVN+LUwMis yD/nKwu/hLBjPS6ikSLVtCFN+kTX1YWY8aBiYDB4Ui296rCO87sY5EwQwfXXc4EYBR8r CL9GW0ZhDgaYJmcajK2tj/rbUV8tWEVqnIMsGXjCbfTvJhW6G5u/+tBml+oxL+MsLenf n/Ww== X-Gm-Message-State: AOAM531+g1mPd/5jKMnvHDIx7X+xfQnPafzLFukDx47f5YvlioY4igzn FOQgletkjr7BOVkBADw8hfRE7w== X-Google-Smtp-Source: ABdhPJx+Y3EvND81P5taGebN1bJGbmRPjk5Ru/6VdC9kXgvegMcniOZJX2D1w15LKWbPB/AIfT+MHQ== X-Received: by 2002:ac2:515b:: with SMTP id q27mr5969893lfd.584.1618222017728; Mon, 12 Apr 2021 03:06:57 -0700 (PDT) Received: from toster.semihalf.com (host-193.106.246.139.static.3s.pl. [193.106.246.139]) by smtp.gmail.com with ESMTPSA id u9sm2781326ljj.0.2021.04.12.03.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 03:06:57 -0700 (PDT) From: Stanislaw Kardach To: Anatoly Burakov Cc: dev@dpdk.org, Stanislaw Kardach , stable@dpdk.org Date: Mon, 12 Apr 2021 12:06:43 +0200 Message-Id: <20210412100645.668395-2-kda@semihalf.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210412100645.668395-1-kda@semihalf.com> References: <20210412100645.668395-1-kda@semihalf.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/3] test: disable no-huge test with PA IOVA X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On linux systems without IOMMU support available (be it lack of supported IOMMU or lack of IOMMU support in kernel), the IOVA mapping will default to DMA with physical addresses. This implicitly requires hugepage support (most prominently for performance reasons). Therefore trying to run the eal_flags_no_huge_autotest in such scenario is not a valid requirement. To verify this even on x86 do (output from i5-10210U): $ ./app/test/dpdk-test -m 18 --iova-mode=pa --no-huge EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: FATAL: Cannot use IOVA as 'PA' since physical addresses are not available EAL: Cannot use IOVA as 'PA' since physical addresses are not available While doing: $ sudo ./app/test/dpdk-test --iova-mode=pa EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'PA' EAL: No available 1048576 kB hugepages reported EAL: Probing VFIO support... EAL: VFIO support initialized TELEMETRY: No legacy callbacks, legacy socket not created APP: HPET is not enabled, using TSC as default timer RTE>> This commit finishes the above test early with SKIP status to signify that no-huge support is simply not available. Signed-off-by: Stanislaw Kardach Cc: stable@dpdk.org --- app/test/test_eal_flags.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 932fbe3d0..462dc6384 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -756,6 +756,15 @@ test_no_huge_flag(void) #else const char * prefix = "--file-prefix=nohuge"; #endif +#ifdef RTE_EXEC_ENV_LINUX + /* EAL requires hugepages for RTE_IOVA_PA operation on linux. + * The test application is run with RTE_IOVA_DC, so if at this point we + * get RTE_IOVA_PA, it means that newly spawned process will also get + * it. + */ + if (rte_eal_iova_mode() == RTE_IOVA_PA) + return TEST_SKIPPED; +#endif /* With --no-huge */ const char *argv1[] = {prgname, prefix, no_huge}; From patchwork Mon Apr 12 10:06:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 91112 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72C50A0C44; Mon, 12 Apr 2021 12:07:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 771D91410B2; Mon, 12 Apr 2021 12:07:01 +0200 (CEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mails.dpdk.org (Postfix) with ESMTP id C57C4141087 for ; Mon, 12 Apr 2021 12:06:58 +0200 (CEST) Received: by mail-lj1-f170.google.com with SMTP id o16so14662256ljp.3 for ; Mon, 12 Apr 2021 03:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6RhF6StlcurmT9IGqNfvB2fWsNlOLKsrYoHnRe7TG6U=; b=nYN+vrb8FIRXew382bKx1e5KUT8NUqJra03B5INWqRo7AacrPL09eH4rrFJtHKUUEW E7F32EnQIUz0/Jf62BObY9KFdul5wsmmoVCT+R1APKSgtcOJfGlXfLrY0ebXcAYkyy7y L7XQXSy0Ynco5OmDwpIJYigHD/QxcZOfuQV0E4aB6AstkVXpd4x5HdHdHEDnUWpc0LGR HTmX2qzSysCi/qbJw0350YxM0wSssIY51SQKBslM3a4lyN8912vysjo4xu4nXBV1pAZN 007RPA1De4pZ67JB/8p2JoylRKj+Br6KL3WeR34fXrTkC8oqFWOHdQDKsk+OY7PsKuaR XKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6RhF6StlcurmT9IGqNfvB2fWsNlOLKsrYoHnRe7TG6U=; b=EjihqzJQHOW3InNk6ZBm3TOevGjYGpO9RgRgwMKeGhQR83Hv/uAMgU0BO/34hcF/Jo uKg9nLCKuHsXFQgShasrAHJUpTdQAheDORrr1OXwrXmXgnkYCVXvzQ297YwqXJWK4plr VxeL0cVEYPKiK04BygBS9lnkNqi7c2xAojbpm9u1M1afBUGqkuGZ4hOIdvFbDTjv8ic5 +GTH511hs2F6G7CZxoDJ/GVZpfH4bksKpic4hVhI3LH7MrfjaiAqG97/gfxbmpPT6U5H GPqYeuyFmzUTqgoht1XNRTOKp4GkK2UmN/KqQhZOqur+pTWeM11MeFkuNxXA3a4nbT6s mU8A== X-Gm-Message-State: AOAM532knGZZDo8bnuUYIBmeYphZx4uuLjNuoIDKtTQ12UskYA/0Breu D4DTEvJoHD/ndgb/mCpOf36K2g== X-Google-Smtp-Source: ABdhPJwTW232wRskdu0bE5wAhVRPjzlZ98VwtuleGzFUgPxhnQ8V1/Q9+73Y7Gn2CJENqNbluhAH6Q== X-Received: by 2002:a05:651c:513:: with SMTP id o19mr1891914ljp.291.1618222018321; Mon, 12 Apr 2021 03:06:58 -0700 (PDT) Received: from toster.semihalf.com (host-193.106.246.139.static.3s.pl. [193.106.246.139]) by smtp.gmail.com with ESMTPSA id u9sm2781326ljj.0.2021.04.12.03.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 03:06:58 -0700 (PDT) From: Stanislaw Kardach To: Anatoly Burakov Cc: dev@dpdk.org, Stanislaw Kardach , stable@dpdk.org Date: Mon, 12 Apr 2021 12:06:44 +0200 Message-Id: <20210412100645.668395-3-kda@semihalf.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210412100645.668395-1-kda@semihalf.com> References: <20210412100645.668395-1-kda@semihalf.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/3] test: disable no-huge where it's not necessary X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In tests where no-shconf flag is used, no-huge is also passed due to compatibility with FreeBSD system, as described in: b5d878e6d. However on Linux systems with RTE_IOVA_PA (lack of or an incompatible IOMMU) this causes issues since hugepages are required by EAL. Therefore replace all occurrences of no_huge which don't actually test the no-huge logic with a execution environment conditional no_huge_compat to indicate that it is passed as a compatibility flag, not as a requirement for a test itself. Note that checkpatch is complaining about argvX arrays not being static const. This patch doesn't change that to not add confusion. Signed-off-by: Stanislaw Kardach Fixes: b5d878e6db56 ("test: fix EAL flags autotest on FreeBSD") Cc: stable@dpdk.org --- app/test/test_eal_flags.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 462dc6384..cfc54684a 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -29,6 +29,17 @@ #define mp_flag "--proc-type=secondary" #define no_hpet "--no-hpet" #define no_huge "--no-huge" +/* FreeBSD does not support running multiple primary processes, hence for tests + * requiring no-shconf, no-huge is also required. + * On Linux on the other hand no-huge is not needed so don't pass it as it + * would break cases when IOMMU is not able to provide IOVA translation + * (rte_eal_iova_mode() == RTE_IOVA_PA). + */ +#ifdef RTE_EXEC_ENV_LINUX +#define no_huge_compat "" +#else +#define no_huge_compat no_huge +#endif #define no_shconf "--no-shconf" #define allow "--allow" #define vdev "--vdev" @@ -354,17 +365,17 @@ test_invalid_vdev_flag(void) #endif /* Test with invalid vdev option */ - const char *vdevinval[] = {prgname, prefix, no_huge, + const char *vdevinval[] = {prgname, prefix, no_huge_compat, vdev, "eth_dummy"}; /* Test with valid vdev option */ - const char *vdevval1[] = {prgname, prefix, no_huge, + const char *vdevval1[] = {prgname, prefix, no_huge_compat, vdev, "net_ring0"}; - const char *vdevval2[] = {prgname, prefix, no_huge, + const char *vdevval2[] = {prgname, prefix, no_huge_compat, vdev, "net_ring0,args=test"}; - const char *vdevval3[] = {prgname, prefix, no_huge, + const char *vdevval3[] = {prgname, prefix, no_huge_compat, vdev, "net_ring0,nodeaction=r1:0:CREATE"}; if (launch_proc(vdevinval) == 0) { @@ -674,19 +685,19 @@ test_invalid_n_flag(void) #endif /* -n flag but no value */ - const char *argv1[] = { prgname, prefix, no_huge, no_shconf, + const char *argv1[] = { prgname, prefix, no_huge_compat, no_shconf, "-n"}; /* bad numeric value */ - const char *argv2[] = { prgname, prefix, no_huge, no_shconf, + const char *argv2[] = { prgname, prefix, no_huge_compat, no_shconf, "-n", "e" }; /* zero is invalid */ - const char *argv3[] = { prgname, prefix, no_huge, no_shconf, + const char *argv3[] = { prgname, prefix, no_huge_compat, no_shconf, "-n", "0" }; /* sanity test - check with good value */ - const char *argv4[] = { prgname, prefix, no_huge, no_shconf, + const char *argv4[] = { prgname, prefix, no_huge_compat, no_shconf, "-n", "2" }; /* sanity test - check with no -n flag */ - const char *argv5[] = { prgname, prefix, no_huge, no_shconf}; + const char *argv5[] = { prgname, prefix, no_huge_compat, no_shconf}; if (launch_proc(argv1) == 0 || launch_proc(argv2) == 0 @@ -878,7 +889,7 @@ test_misc_flags(void) const char *argv5[] = {prgname, prefix, mp_flag, "--syslog", "error"}; /* With no-sh-conf, also use no-huge to ensure this test runs on BSD */ const char *argv6[] = {prgname, "-m", DEFAULT_MEM_SIZE, - no_shconf, nosh_prefix, no_huge}; + no_shconf, nosh_prefix, no_huge_compat}; /* With --huge-dir */ const char *argv7[] = {prgname, "-m", DEFAULT_MEM_SIZE, @@ -920,7 +931,7 @@ test_misc_flags(void) /* With process type as auto-detect with no-shconf */ const char * const argv17[] = {prgname, "--proc-type=auto", - no_shconf, nosh_prefix, no_huge}; + no_shconf, nosh_prefix, no_huge_compat}; /* With process type as --create-uio-dev flag */ const char * const argv18[] = {prgname, "--file-prefix=uiodev", From patchwork Mon Apr 12 10:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 91113 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E810A0C44; Mon, 12 Apr 2021 12:07:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDFB81410BB; Mon, 12 Apr 2021 12:07:02 +0200 (CEST) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mails.dpdk.org (Postfix) with ESMTP id 42C8D141096 for ; Mon, 12 Apr 2021 12:06:59 +0200 (CEST) Received: by mail-lj1-f179.google.com with SMTP id z8so14633245ljm.12 for ; Mon, 12 Apr 2021 03:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oSkUGtRTNN55g7hONGCvOMWJvZXlRljwfNHxbYce8xI=; b=2R85gecZUPNEXdoKdzalaCv6oqC8fpHt1gTV7QjeWpIQfT5UMsmNe9Z93a3gGuAhbC FacfKiXCR4xa9qFCllQo0eOmJNiZploXwC3MbLdVmXsJCQaj5ekAlRyFa7GXwzCu4qDd aG68c4lUBxDIP0ZWI5E+umChldpbUr25ZrBcAfO4FN03lCSuhqDkRPNyjMBbk6L8JGcQ ii4B6M2vvzLDcTmsYvWdYwn5TtlS61I2rmQZMGP3/kgGdb+/LwcBt/bdoNw/q6gFduSs 4Dya7iUPGZFKsh9K6NphG7cxWxlK6XdRxN0uRlfyzVO5mx42ziphtcJ+EXJzpDgu3A9z 10Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oSkUGtRTNN55g7hONGCvOMWJvZXlRljwfNHxbYce8xI=; b=GtkyZKBhAGTKq3VSMRqAXyimqrAG+3r4iE9flYTheKDpunNcl0rjWVf1MKXbIsSyQA SUO1R+i189F3bSNswX3BZnNvTTlcq18AIwa/Vxst0w1wUPCOTitWaI08lLohJO6zha5K egci8DW8VQ7tI2CAKeiieXWnJfsH1TwPBgWP8nBKgdGnmf5idnbh58onnPmWaedReMr4 tCwgd+M/VN6clXOxO6bcLQJE36l3jrnz+bAis46Grk3+rTTrq727M6XMSumdsPTRi6qD RDExbCyGJpqHWNCVW0tHTORdjhgHVRfLaCUJtY6dgEuBgXni1WtddD2TH0BcBmFAtr9B 5r+A== X-Gm-Message-State: AOAM530kc1L/ouQetcUj/BKKeQcIOv/Xa0uU6WDbMs2LGV9d2Yn12y/Y DJkcS5DygJP2rKwSXTO3TXB6rA== X-Google-Smtp-Source: ABdhPJxfgEV6I5bfkrgmGifb/tAat9ov2DATINiyqhTxUeHUgLpCFTLRD0bdv6AFooVT0COOHWRpQw== X-Received: by 2002:a05:651c:222:: with SMTP id z2mr6998375ljn.109.1618222018837; Mon, 12 Apr 2021 03:06:58 -0700 (PDT) Received: from toster.semihalf.com (host-193.106.246.139.static.3s.pl. [193.106.246.139]) by smtp.gmail.com with ESMTPSA id u9sm2781326ljj.0.2021.04.12.03.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 03:06:58 -0700 (PDT) From: Stanislaw Kardach To: Anatoly Burakov Cc: dev@dpdk.org, Stanislaw Kardach , stable@dpdk.org Date: Mon, 12 Apr 2021 12:06:45 +0200 Message-Id: <20210412100645.668395-4-kda@semihalf.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210412100645.668395-1-kda@semihalf.com> References: <20210412100645.668395-1-kda@semihalf.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/3] test: fix the -n unit test description X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When -n argument became optional, the test logic was fixed (by 1e0b51fd4) but the comment indicating why --no-huge and --no-shconf are used was not changed. Today those flags are used for compatibility with FreeBSD (see b5d878e6d), so change the comment to reflect that. Signed-off-by: Stanislaw Kardach Fixes: b5d878e6db56 ("test: fix EAL flags autotest on FreeBSD") Cc: stable@dpdk.org --- app/test/test_eal_flags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index cfc54684a..894e2e90c 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -666,8 +666,8 @@ test_main_lcore_flag(void) /* * Test that the app doesn't run with invalid -n flag option. * Final test ensures it does run with valid options as sanity check - * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf - * flags. + * For compatibility with BSD use --no-huge and --no-shconf flags as we need to + * run a primary process. */ static int test_invalid_n_flag(void)