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 AD3ADA0542; Wed, 5 Oct 2022 05:40:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D343742B8B; Wed, 5 Oct 2022 05:39:14 +0200 (CEST) Received: from out203-205-221-245.mail.qq.com (out203-205-221-245.mail.qq.com [203.205.221.245]) by mails.dpdk.org (Postfix) with ESMTP id 8CAD042802 for ; Wed, 5 Oct 2022 05:39:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1664941148; bh=tZHTTODRm39GZCm6CBMuq76QhV8hAhOyaUCTYIXz/c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PVTidTOOWymLWvq9RUxD2W2dEFcgOP4Rirmcp5NLtQP5FeXGyLRIx7nJDqKHbLN5v wKfGuQNP9D+6JQpUUsHGq3dOs6BTlf/akXgb0VlrBxaTRoyxWgRxyWatkElq8t2u5a fIZce1vBsxUpQi5uIoeIn4/cAwLKxKStdBXl7JGg= Received: from qq.com ([120.229.93.179]) by newxmesmtplogicsvrszc13.qq.com (NewEsmtp) with SMTP id 9B40FA58; Wed, 05 Oct 2022 11:38:52 +0800 X-QQ-mid: xmsmtpt1664941147t4ql077a3 Message-ID: X-QQ-XMAILINFO: MyHh0PQai9Fpizo/+wK4OrZbcwLze3mMHLI1epS3chhxe5Ap3dVWLicezHuvB4 OOhqChEPnLdSW/F7qQRlstXQCoZn5AxOyV/CMU+Wf/XJrBKlevcownj0cGqQS24PG7M6FR/KPfzU oEKHE0+kt/dOylnAo5o/Ay/YtnG6rzs08YJwIOw6/ANURXZLZAllojxpSBFUr4zR50vOOeV22mmO iVQlkvXugFoZA6BJfmwLOOiHeFy4SCrGXqsmIaZUQaZglAJluVACJvD++SHAOUWcPkSNkxn1VVwl bRLL2U2Kha8NDdIGSXYsRkKK6lNeT6m8Q96AMPv8KKxn0DJGfbjaCr6YiziJNm1AnWvgA/JZ5Nok F2cduBtj4L24WtqbjoL0Yf6DSb0FmMjgvOwXhPD8673fE8p/DcAaViksFLrNyCmvyL8E6+zZmQHe FkHjko12gY68s7ZN+Of4lC3UrgRwU2EjEP0px6pH+Etq2aI2MqFFuUJM0xOrZ5dkuGi3dKReSPpF z/H2ALvLZL8vHMHbffOhf/lMLhV/CTK8h8pzMSKo8H5CrPoayTPTp8v7scRobN7O7b34qJpC6Aq7 YGZ/D3q+QDZGG0NN8mM1QXRbQjX04NQL/0z5RTx82XjfotUipAgZG4q4GQ/iTYn1bJb/nqzuRQyJ 8qHhivDo297kjvajdBt/lb+RGH+EJgoolc7fs0eC86Wxv8BYHLtHaelfXpiO+VKhav2bLs3uQUqF 09ChCgeabd0pPCZ57rMuzKI0E/TfZXrN3ZP3MU2q5l0OgLd51a1agxvtHmedQ+AixyCKpu7o2vus kXffPn4rImJtiH8h81RZaLR9o8OfTFKbaIVTgSW4ZFaynSuFJzUh+6FUtTAB6Tfg226xch139fFJ E49fWFslSvv4XENUyxVE5Jxi/HzdONuGHZXXb46Kupusx5fuTgETMI8H5cyqJnT8BxA+7bWW5yCo phG3xaurTejoG0wQieC5A8YDlz5+1FOkVroDo6tc53SiDAxyCxRR9Zji27r5Z+M6mCUQaAGsQ= From: datshan To: david.marchand@redhat.com, mb@smartsharesystems.com, anatoly.burakov@intel.com, dmitry.kozliuk@gmail.com, jerinjacobk@gmail.com Cc: thomas@monjalon.net, dev@dpdk.org, Chengwen Feng Subject: [PATCH v4 10/10] test/memarea: support no MT-safe test Date: Wed, 5 Oct 2022 11:38:48 +0800 X-OQ-MSGID: <20221005033848.2241-11-datshan@qq.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221005033848.2241-1-datshan@qq.com> References: <20220721044648.6817-1-fengchengwen@huawei.com> <20221005033848.2241-1-datshan@qq.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Chengwen Feng MT-safe is enabled by default in previous test, this patch adds no MT-safe test. Signed-off-by: Chengwen Feng --- app/test/test_memarea.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/test/test_memarea.c b/app/test/test_memarea.c index ec3475c354..b4012086fc 100644 --- a/app/test/test_memarea.c +++ b/app/test/test_memarea.c @@ -353,6 +353,35 @@ test_memarea_backup(void) return 0; } +static int +test_memarea_no_mt_safe(void) +{ + struct rte_memarea_param init; + struct rte_memarea *ma; + int ret; + + /* prepare env */ + test_memarea_init_def_param(&init); + init.source = RTE_MEMAREA_SOURCE_SYSTEM_API; + init.total_sz = MEMAREA_TEST_DEFAULT_SIZE; + init.mt_safe = false; + ma = rte_memarea_create(&init); + RTE_TEST_ASSERT(ma != NULL, "Expected Non-NULL"); + + /* test for all API */ + (void)rte_memarea_alloc(ma, 1, 0); + (void)rte_memarea_alloc(ma, 1, 0); + rte_memarea_free(ma, rte_memarea_alloc(ma, 1, 0)); + rte_memarea_update_refcnt(ma, rte_memarea_alloc(ma, 1, 0), 1); + rte_memarea_update_refcnt(ma, rte_memarea_alloc(ma, 1, 0), -1); + ret = rte_memarea_dump(ma, stderr, true); + RTE_TEST_ASSERT(ret == 0, "Expected ZERO"); + + rte_memarea_destroy(ma); + + return 0; +} + static int test_memarea(void) { @@ -363,6 +392,7 @@ test_memarea(void) MEMAREA_TEST_API_RUN(test_memarea_alloc_free); MEMAREA_TEST_API_RUN(test_memarea_dump); MEMAREA_TEST_API_RUN(test_memarea_backup); + MEMAREA_TEST_API_RUN(test_memarea_no_mt_safe); return 0; } -- 2.34.1