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 D9230A0C4E; Tue, 2 Nov 2021 11:08:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F2F14111D; Tue, 2 Nov 2021 11:08:39 +0100 (CET) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id D655341104 for ; Tue, 2 Nov 2021 11:08:38 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) 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; Tue, 2 Nov 2021 03:08:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KPM9563N0QubpX/O6xHXfZ93B6W7Rgby3b6law/HpZlmFndgRodPISO+sJWw8bwae1xqWj4GOr2pe84gct5FiSqj1B9QjHTGm/YX3ukZOljSMfaVNaSeyoDCTDBCmrxv2iwIEZNE/qsxMKUmquanuIEpLaErFjnowkb2ZLAPEer0lkLTsteeQUM3yUlkHkTjIMum2roWwmwvCvL4jQJEyJCCUNU/4wTf9sEodka7l/dvJYkJJg3hHQREMgccVWqhG7/bK2JonGYf7uW0lT37XnVmP/Yf8zJetI8Nlwo2ijpEV/crfjBQ5wInKQZYvceeX/46whe2LwRIa2OvM5tAlw== 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=DBXtWhzUHH7DcP/aQovzJsaJaipgjplM8P7R2r8aa1I=; b=UsiO/sqTVzwt6TZdDPNmsYpoToM4p54nRY0oVu44cV6jfSixWsElKr5MoZlsGTIEJGFDprRpIYqhsv1Hvkz2Gpyef+WwIg8oxFJ99jywh8r3tsT04hn1XK4QOKUi+PPRi43O8MYOJrFJkZpKBRrGWocFvGjnujnWrek4R9DDHub01DICACM58U2wHizkYM19KPjnkXAJx1g0R1MnXMmuLj4jd/O/ZmymWIy2DdnunXrgRZvAjlMLAyiNvH8AchTr0jl0v4EnZDAEuRoV4K/S8MauiGwIqFDdGjuUKKIAc45GdMlb8pQHhqGjbIe/GEiltLbc+o2LbFlCWBCQnsQPuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 216.228.112.34) smtp.rcpttodomain=6wind.com smtp.mailfrom=nvidia.com; dmarc=temperror 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=DBXtWhzUHH7DcP/aQovzJsaJaipgjplM8P7R2r8aa1I=; b=K3ypeJTH9DGkJYiyqxpEIYydkz6GthCqQYrh9zN5hO8chV5UUOsmkGa6ktCKkPI/IHQCn/OnYtsJsKF1LxpcyqnNptp+Yf0K0m189tO3rIsu1kxAouZ7zhFychmHBTJYZ6m6crjGBbx4G6tEfYCn3ck20ufi8wb4gS+7EoJ2mp4qwjWhLCM5UJfbNUwUlwS31n0BFzj4LXVK2yda9VTP14j1RlrHn40NbnWMQv5OAoXaUYm9viFzkMyC5vI+GVtTFdTzhQm3yQ5Eh+p5J9BJG8LJURrzeKWsSXTRHVFxNrSYDDOQvPVBmJgtZFlnwrxBhEyffHRQVhJ/UxDpOokZCw== Received: from BN9PR03CA0234.namprd03.prod.outlook.com (2603:10b6:408:f8::29) by MWHPR12MB1853.namprd12.prod.outlook.com (2603:10b6:300:113::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.19; Tue, 2 Nov 2021 10:08:36 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::2d) by BN9PR03CA0234.outlook.office365.com (2603:10b6:408:f8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Tue, 2 Nov 2021 10:08:36 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=temperror action=none header.from=nvidia.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nvidia.com: DNS Timeout) Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Tue, 2 Nov 2021 10:08:35 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 2 Nov 2021 10:08:33 +0000 From: Dmitry Kozlyuk To: CC: Yu Jiang , Olivier Matz , Andrew Rybchenko Date: Tue, 2 Nov 2021 12:08:16 +0200 Message-ID: <20211102100817.916303-3-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102100817.916303-1-dkozlyuk@nvidia.com> References: <20211101073701.825389-1-dkozlyuk@nvidia.com> <20211102100817.916303-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81450897-bde1-4769-f55e-08d99de8bb7b X-MS-TrafficTypeDiagnostic: MWHPR12MB1853: 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: Fse8O3PejfegkUJXMK5gB7WnEvEGnFf0Asie4A0Xe3AqTU6Do7mC9y8fxhe12F8CXnro/RAS3kWFOpb7JOxBpMxhQ9ifix5VXIsA3G0H1xbQUluPbqAh7+bb7KBseCZMTsiSXKrsuHhmvHoCBYzenwobdpfvLFslXhiVnlhHeOxhATKiq3mHSlcFQID1SW3fuxi+joEkFchVhVb6cz7CYN494rGZwUABSsJ+MAVUdd5uULDd3ioORefbLchgmtHL4MpAjFMq397/kNmX1Egz/QhdyCuc78Sv9bZWILI2RMm6iWJfP+Q/aX93abI+C+6tvcl6n5LSweRGVkaZQCDaFILjoubRLnGLHxSCdAAfwlMNpt0tQ/EMjv7IR6vmpBYUxbludVChQLPdJqSidNzZPUGm78KKlEs3OQQQu6yez7GudoYkp4L1Xe9wESLktSLMwbWSuJh1gVC8dlI2LvXPvyADPLfbs7y4g4roiczLhT6xaxyqZdSK/XXTUJQd+ZQAUzrPQoCASR6U9fH4qWEixLfFT0Saqx8k+JJZt6ZuungdN4809wdEmftvLMYXTGVtIaYCsTTg5LbgNgZ/Vd7TI/+DvHm3gmw2xyzCgRS/LD+KFJXjX1IjvZOhbjuFXdSFsGIDILS+iRJ1waKX527VXcAUOYRHFn8lPRwU42zT3PU/nWvLOdfrQP1HEI8Myms4KdQ6J3tI3STG4MtGENtwKA== 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)(36840700001)(46966006)(4326008)(7696005)(70206006)(6666004)(107886003)(6286002)(70586007)(82310400003)(6916009)(508600001)(26005)(2616005)(336012)(54906003)(55016002)(186003)(63350400001)(36860700001)(356005)(16526019)(63370400001)(8676002)(7636003)(47076005)(83380400001)(1076003)(426003)(5660300002)(36756003)(86362001)(2906002)(8936002)(36906005)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2021 10:08:35.1223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81450897-bde1-4769-f55e-08d99de8bb7b 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: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1853 Subject: [dpdk-dev] [PATCH v3 2/3] app/test: fix mempool test 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() causing an error: 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: Yu 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..ced20dcdc3 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. + * requiring 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