From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38ED4A0032; Fri, 29 Oct 2021 10:41:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6509410E0; Fri, 29 Oct 2021 10:41:18 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id A2E5240688 for ; Fri, 29 Oct 2021 10:41:17 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.43) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Fri, 29 Oct 2021 01:41:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QBL/gqLck7a8gGilej+snk2tbdq0o5vzpMwUBENvKCjcUXUUjLnB7BxhY4J4VFYJoJroD7PcBvkOSjuShu+vJnLvwZAk2P/8XeevCxuaeLWoJY+R9fiCO9ajF5shdBMtv3IKcSl+RpbbvKTPzTTkSS+aSxafL1yUwQ7sBglAkYTDzwkj1j/U0lbh0jf1hTiiikbSYvLSL3QPZ8Loo15J/O4iSrEHZVJsObr78XvjcQp5jWFtEJdKriJSK3HB9l49ReVMk+wYGr7amjIPtc4O3VabdoTyHd0YxSAKXKJKBMKDNzaMa7RpxqyCTTWieF+eET0L8e9bLb6I/Dwhhuys+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qB+BO1+gXrdnpgAl/ICNZLf8Hj9lhieuf4g0aabhsJI=; b=TtuMS2sEMOzEcHaDzMc9mGmYnK0h3NVRpuaVtwchv2OI6sszDxed21FWrThaWlc4MpTa9e9WE1bRcWNkRP47zMc5WsNDAl0iN3qN5MontbW6yMNyhpjtXl4/zW7ji8KHeVzFV/8+Vp4DeSS8ZSWCYZfbQEzirARxNT8mj52Oxvw4X0mk24utBcPSqNhQf11tYre4FeanETI6yDCsVfBdl5rRvaUxsu4CQ4v884PVOlBXU5a2FEyLImxmqC/Z7dJIJKYEMEf+1lCFJP8GkuGR7qW/LjzJycDGKY/XO9hV8jJKOP7+eai8XOKn6NYAJV5K2CNX51g2d9IE55ir7SspgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=6wind.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qB+BO1+gXrdnpgAl/ICNZLf8Hj9lhieuf4g0aabhsJI=; b=bDWqk8mShOrdP9PWxtHJ43mu7bqd02m/nL8H47nmiUYhdfLp2wmk7dWPAXolKyQ4b7s+vhuIfUdhQctkjGA+KRq22R183Dv9goHwac4m2XDKLasARpVYKuTOyAdtNkSvJJ10UBmir5BTcEEyqtJKSfC6tYr2Pi3dSIZUm4AcNnLv7zgydro0GRrIhv2FTWuPSisgxUtRaDM1y7lVhxO9C+/pMuBpXvNzEU1UY1jnLMqks0JorUT9fal5RO54tzZ/j+pOo+mfEVk4F5JbcMIn2TP3kuHg2ESApiWs4Q48vbyJ0NIG/xHPR49sn6EAH2Pd2/AYqotFtCJnGqof0Y3moQ== Received: from MW4P221CA0003.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::8) by BY5PR12MB4147.namprd12.prod.outlook.com (2603:10b6:a03:205::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Fri, 29 Oct 2021 08:41:15 +0000 Received: from CO1NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::c2) by MW4P221CA0003.outlook.office365.com (2603:10b6:303:8b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Fri, 29 Oct 2021 08:41:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT063.mail.protection.outlook.com (10.13.175.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Fri, 29 Oct 2021 08:41:15 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 29 Oct 2021 08:41:05 +0000 From: Dmitry Kozlyuk To: CC: YuX Jiang , Olivier Matz , Andrew Rybchenko Date: Fri, 29 Oct 2021 11:40:50 +0300 Message-ID: <20211029084051.679233-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a4d142e-4762-4f53-b2fd-08d99ab7de90 X-MS-TrafficTypeDiagnostic: BY5PR12MB4147: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yKRsWrqrHcQJOcPMa3umGLtI1zu8sTarG4j1JSP/GJNldoErbpy1gWJL+OXHML5EImSOqQXF9vhllYGO2MdycyyV+JXs3WDSBSqe0l+o9UCTJwuRkuyT3fm/6AKtP59j1+BUWn5aVJcFxQ3QdJDRF5HMYNY4qYPksVwbW5H6xRyMHMlvfvAN3AvTy2JjJjBxb7y+Ibk4BY0ico4Y57N0/WM35B4fjgxHrgQMUdfsXtd1h5jSP6ccgPbS72oBymVpNywwAB/7oIePZBunLGfLs1F66cHtI9iJIldhMAIBjAKau1LBkG7qnBOM1Vxeksg/4B1AG62Pzz+bFC83qxTxZf3RBpsfj2TOHEkV+hYoPpJAH+ygGiX5WUmoBZP3w/AzhOv5/MJARNPM/ugWG3gxOyXv+lY40oARbq4U3E+P7w5vho5Et6BtHWFW/tWsdb4I1t87MgafPvVnkiykaxrCAElAVIxEH7LyfHune0vHWBfjYV5CMxPqgM+oqACl9DEIAuNaS6J7Q2A5eerGcsNS7CPYvJvfSyCJru7bijGI8wMVr0v/KbZJv8gnHb/NQd5Np2zDJL72g/5j5RDeTAd+g9PgzonccckorKBmgvIAV+jc82UWWuKRfMG4vtWZE6WdV9OVIOC76HOZ73GFf2I8Ke4TGelsPfewQ8wNfr6Rfm60ZFRrFkxrgaG4rElVTkrnZSjrH8FaMDEWs+BJVMxssg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(2906002)(107886003)(70206006)(70586007)(426003)(2616005)(8676002)(47076005)(5660300002)(316002)(36860700001)(6666004)(55016002)(6286002)(36906005)(54906003)(4326008)(508600001)(1076003)(8936002)(82310400003)(6916009)(36756003)(83380400001)(86362001)(356005)(7636003)(26005)(186003)(7696005)(16526019)(336012); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2021 08:41:15.1734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a4d142e-4762-4f53-b2fd-08d99ab7de90 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4147 Subject: [dpdk-dev] [PATCH] app/test: fix mempool test failure on FreeBSD 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" FreeBSD EAL does not implement rte_mem_virt2iova() that was used in mempool_autotest, causing it to fail: EAL: Test assert test_mempool_flag_non_io_unset_when_populated_with_valid_iova line 781 failed: Cannot get IOVA test failed at test_mempool():1030 Test Failed Change unit test to use rte_memzone_reserve() to allocate memory, which allows to obtain IOVA directly. Bugzilla ID: 863 Fixes: 11541c5c81dd ("mempool: add non-IO flag") Reported-by: YuX Jiang Signed-off-by: Dmitry Kozlyuk --- app/test/test_mempool.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 4b0f6b0e7f..bce073064a 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -740,16 +740,17 @@ test_mempool_events_safety(void) static int test_mempool_flag_non_io_set_when_no_iova_contig_set(void) { - void *virt = NULL; + const struct rte_memzone *mz = NULL; + void *virt; rte_iova_t iova; size_t size = MEMPOOL_ELT_SIZE * 16; struct rte_mempool *mp = NULL; int ret; - virt = rte_malloc("test_mempool", size, rte_mem_page_size()); - RTE_TEST_ASSERT_NOT_NULL(virt, "Cannot allocate memory"); - iova = rte_mem_virt2iova(virt); - RTE_TEST_ASSERT_NOT_EQUAL(iova, RTE_BAD_IOVA, "Cannot get IOVA"); + mz = rte_memzone_reserve("test_mempool", size, SOCKET_ID_ANY, 0); + RTE_TEST_ASSERT_NOT_NULL(mz, "Cannot allocate memory"); + virt = mz->addr; + iova = mz->iova; mp = rte_mempool_create_empty("empty", MEMPOOL_SIZE, MEMPOOL_ELT_SIZE, 0, 0, SOCKET_ID_ANY, RTE_MEMPOOL_F_NO_IOVA_CONTIG); @@ -772,14 +773,15 @@ test_mempool_flag_non_io_set_when_no_iova_contig_set(void) ret = TEST_SUCCESS; exit: rte_mempool_free(mp); - rte_free(virt); + rte_memzone_free(mz); return ret; } static int test_mempool_flag_non_io_unset_when_populated_with_valid_iova(void) { - void *virt = NULL; + const struct rte_memzone *mz = NULL; + void *virt; rte_iova_t iova; size_t total_size = MEMPOOL_ELT_SIZE * MEMPOOL_SIZE; size_t block_size = total_size / 3; @@ -789,12 +791,12 @@ test_mempool_flag_non_io_unset_when_populated_with_valid_iova(void) /* * Since objects from the pool are never used in the test, * we don't care for contiguous IOVA, on the other hand, - * reiuring it could cause spurious test failures. + * reqiuring it could cause spurious test failures. */ - virt = rte_malloc("test_mempool", total_size, rte_mem_page_size()); - RTE_TEST_ASSERT_NOT_NULL(virt, "Cannot allocate memory"); - iova = rte_mem_virt2iova(virt); - RTE_TEST_ASSERT_NOT_EQUAL(iova, RTE_BAD_IOVA, "Cannot get IOVA"); + mz = rte_memzone_reserve("test_mempool", total_size, SOCKET_ID_ANY, 0); + RTE_TEST_ASSERT_NOT_NULL(mz, "Cannot allocate memory"); + virt = mz->addr; + iova = mz->iova; mp = rte_mempool_create_empty("empty", MEMPOOL_SIZE, MEMPOOL_ELT_SIZE, 0, 0, SOCKET_ID_ANY, 0); @@ -827,7 +829,7 @@ test_mempool_flag_non_io_unset_when_populated_with_valid_iova(void) exit: rte_mempool_free(mp); - rte_free(virt); + rte_memzone_free(mz); return ret; } -- 2.25.1