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 C044DA0C52; Mon, 1 Nov 2021 08:37:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADDBA410FE; Mon, 1 Nov 2021 08:37:25 +0100 (CET) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id A9BB4410FD for ; Mon, 1 Nov 2021 08:37:24 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by mxs.oss.nvidia.com (10.13.234.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Mon, 1 Nov 2021 00:37:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQycDqxQ8FALeAf/x9tYljUH9SE/zHi4m/5PNk9Z9jNrfCUJvN5yMk66eYOWo5ll9gTm5sj9Cnxkh+A2zGHNliPGDf5v+5DjS5PGWHcR/gMmV1M3Q+dYKfQDxGPNT3IESGJVkFvBhUbJXBpR4pHDOFgINBIRKaDuqjCLvNXBFxf1E2QJZ1NP+z8NWxBo8Y6SbzqI/PyPR+TGTolzR0BZyiMzy66v+54XBAU37pa4ALP8zgALXY+iHFh5EMKaAXdZFrWaADaogv0Eo1XfBiXRa0XRBlcg6cjYRE5hzHT8jl74/SAFhiOOq4fBvAMbwUEhNm1JTldiL/HUCXoANKd/3g== 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=UyKXX4aqJ0V9Qc/15ooMA66b1BLgcrZ5neiJX0pfHYSe3sfWjsu0QV/56ISr/EpdYB2KIe0T9PZoei0zYhCbqGfkencaS8Nj5zpP2/L8D/axYlUZnKhW4xRfRXnFHHQKdCPqDjUUvBLELHpVew5yRyh53InwBWuy+gkGZVlYA52DR1fNfn2WU53yXml72dLasZM40OOZ95OMKKqViuV7Oa25MVeJ6oFMJl2NVCgUdhj0KHJCOX7yaLCrNTKA1PKW+wB6xgbFQnNYbLwjqvpRjcbXgNvozSv75yA3p+We1TyQqxHvFY5UqS7VuTgeLluF6qlBL3/IUXW3zKqeLlN0SA== 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=DBXtWhzUHH7DcP/aQovzJsaJaipgjplM8P7R2r8aa1I=; b=dYfEjUMvQEnk+LRH/Ygv4U79omXRbzJJb10g0u3yfS7X0aQKvMYtdZsAhfv79dA/p85BfpU6rbdEXCD5OS6g6CgFJ3wMzOLHZ+ryn67wPLaUgxsAURjrLRIBx9qNmCT28k78H5tb7kmndfGNmIYj7wsREzctOodUfZiVSYynX0lhry6l8y4/wnEOSe6FKejcfULEP+3UlFQVr4JRlYL+zNnN6Iih3s7S94N8/xKqzFcdeCKRx9cqtKgaZv88+wSSTuq+4qGL/J2tBl016dtsu0lKpKGKN9j6SI+4reg2cOh1Cwxw2ICE/kcAMyMsp0s1H0y08ZuGoUTPY7YlRsbhew== Received: from MW4PR04CA0351.namprd04.prod.outlook.com (2603:10b6:303:8a::26) by BYAPR12MB4984.namprd12.prod.outlook.com (2603:10b6:a03:105::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 07:37:21 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::33) by MW4PR04CA0351.outlook.office365.com (2603:10b6:303:8a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 07:37:21 +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 CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 07:37:21 +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; Mon, 1 Nov 2021 07:37:18 +0000 From: Dmitry Kozlyuk To: CC: Yu Jiang , Olivier Matz , Andrew Rybchenko Date: Mon, 1 Nov 2021 09:37:00 +0200 Message-ID: <20211101073701.825389-3-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211101073701.825389-1-dkozlyuk@nvidia.com> References: <20211029084051.679233-1-dkozlyuk@nvidia.com> <20211101073701.825389-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: 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: 7d0ab5dc-6087-4723-405b-08d99d0a707f X-MS-TrafficTypeDiagnostic: BYAPR12MB4984: 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: s+j1vwFNwSiBQbp6jT7e/nX+HqXICR2ne2PNPNiF0xxGzlZT82ur3GtCgFGHU9tSnk6NcjYg+x4Ga/SzTCfstOViB+qwTrVeG50vndw0DT7cTYwAY6SbNuMCSSX5nXdlDLJTQr4XovkIe7/qJI1WDWnzkJfRQ5FACikPQzu9N8Byg3FbuIt0kHZ4pbS2om/r8nAgPuO0oE/eX2N485ZjkCU5Y++HRSfCqLDbvZ8hUuiA4OQoJUTocsPUE7HUztHd9oS5DVb5cbOnnIHhymLho7xzC5qX8OIZBiOzPsoqoXDNBr9nfRtfUdXO9sADL29zcA2Jua1ouT7W7Xz0QuW7nJ+ZL8sEjAmR4G4uwbYg1tn3I/m2vh/D/LDTfQvUTTTDRgdVl+AmT6kA1Vro5SW/64NDds+IJ+Lj40RYfgGD7wUtoVEgpn3xhvX2mkhW7c2vB+wmqN8zFjejDQGmpAAmMZTfwx1eQQB38Etdhkwp6N3pHjSSBlvraVVpHIVG23E4icgHrsxDsZJ935fMkKcqm229AB8FmyFoyJKfCqNcl7gwAFfYXXyXeo6TJANLQOvfqjYaJwARSCII1TkfV0HpVC2rBEVElh9qYx/cMAolmnqieV2F7dAUirCl+5qmLT3DMSZWEMb1bpCYHXDTIH2MvQLm37aRbOXtawuUc9KdfHoUZXXIYKfl6vQGTc6StX4U8WVLJrwbfRQ0wubE+lQDVQ== 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)(8936002)(107886003)(186003)(7636003)(508600001)(16526019)(336012)(36906005)(426003)(55016002)(5660300002)(6916009)(2616005)(316002)(2906002)(70206006)(1076003)(86362001)(356005)(54906003)(4326008)(26005)(6666004)(70586007)(6286002)(8676002)(36756003)(82310400003)(83380400001)(7696005)(36860700001)(47076005); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 07:37:21.1118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d0ab5dc-6087-4723-405b-08d99d0a707f 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: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4984 Subject: [dpdk-dev] [PATCH v2 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