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 47EEDA0542; Wed, 5 Oct 2022 06:10:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 998E642B84; Wed, 5 Oct 2022 06:10:13 +0200 (CEST) Received: from out203-205-221-164.mail.qq.com (out203-205-221-164.mail.qq.com [203.205.221.164]) by mails.dpdk.org (Postfix) with ESMTP id F2B4C42B7B for ; Wed, 5 Oct 2022 06:10:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1664943009; bh=tZHTTODRm39GZCm6CBMuq76QhV8hAhOyaUCTYIXz/c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J/RevneQ0g93FcW1FysRu+R21JzpU/G/ZADbsdjF3uAQ4GwglapR+zquQAsGq/vLS w8UdsJSMONQMI3i0RLAI3eaOqQqfVUEPeuhPyL/sthUF9HkFbdTKrvOsLwtQtM3n7y NNToXcgJx2Qdc5+3mzpA01BHoqRrUxdPV84OlQB0= Received: from qq.com ([120.229.93.179]) by newxmesmtplogicsvrsza31.qq.com (NewEsmtp) with SMTP id 27598E97; Wed, 05 Oct 2022 12:09:53 +0800 X-QQ-mid: xmsmtpt1664943007tv7jmjpi3 Message-ID: X-QQ-XMAILINFO: NyRMGmFSr9jvUKiRmhABfPZF5uGZniyub3Jlsk0Mugi8ZOvpQqr7+wmssblQJ2 DWHFk9c2ZSwVbBIShqAZyfJIOQz8hWeJHDzDoSe7Hh6CrqbnXc+rs8UPrJrKoVe1tjrtjeTGnPfP PBaRF0H1Siy3gSwP0ZRmqlA3n56LW2IwCTJ9Xo3/NQkaVYjMmLMA9oifowtc/Hn2pZSUUL8XQ0Z8 F/jc6wbio7evD9PU4g8w6Mdoj4jXL5FRccZZai8Ha+Q1nQXzMknr7lBkr7vEKlrkKWojw4g3+BAS NleInJHIfDcm0sL2U2LDexCFdUByoHmI5HVQ3a7QbZOtr/qfzV6cZy4pabtukW5nW0pQdICYk4Da Yz8hfjpGbbf8fa0a2QypEdLFSw8PuHUmAlWCenw0On3sULje8qUlvPe+NVn+nQAN2IFNMPN8vSmP woQBvmtS+JLmDv46tqmMOoF+BYv+G3ekIU+pQDx/Lf92ZOiFUouRnMmj9kqR7W3OrMfwkulDEugW h/Nb7LvzOVvIJXqXqmxUA6152kjot4BFPj0zBa3lfuCUC4qwdcqIWOGb8VCNULkxI6gpZFRsbNlf LuD3XA8rnS7gIrjvKczy0YSUu5lPOdN9c7b4h4T7YLMi2kiSiinI2MYDnRop1m6hq93WHNDRn5lk np4MGIqvxTvhv32g/7p+r9wUcbFTsZD6MXSfDfdoxJ+XwmD2k3K5LqtVFJixmxlIg0fkAKtXWziY N3BXbdPftW7PDEaUIKlIVTnvzuDt89nMt4q1uN1FtUWCyq0GeGi+dHvdUlH4EEY8ceZzsYShIu8d HcPrr5dI7YFR7dEJzPwk4SsLv2Qofosy3DWmSkepgV63IqQUvxJrERrH/LgiM73YT8SPB39hkG/E o8398htO6vwMCo/yDaYDewnHqIjEq6d0FaheW6JqxxztgXeZKdQ0x5MA573I3vAQOPQEOqBjgRAr 5oSQF/om8Hf/Bt0lmeFER3YtMpMsLxDboxbH4kpQQQIR2OEtXCXACyOqwsVxwB/jsnmzZoLTYaaH FlLs3/rEQK55AOx/q/md3r31TKkQpPE9dZ9JuKHp2xPQCzMbAg 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 v5 10/10] test/memarea: support no MT-safe test Date: Wed, 5 Oct 2022 12:09:52 +0800 X-OQ-MSGID: <20221005040952.8166-11-datshan@qq.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221005040952.8166-1-datshan@qq.com> References: <20220721044648.6817-1-fengchengwen@huawei.com> <20221005040952.8166-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