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 B94FC42EA1; Tue, 18 Jul 2023 04:49:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1633406B3; Tue, 18 Jul 2023 04:49:38 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 6A25C40223 for ; Tue, 18 Jul 2023 04:49:37 +0200 (CEST) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R4jy046KyzNmSy; Tue, 18 Jul 2023 10:46:16 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 10:49:28 +0800 Subject: Re: [PATCH v16 4/6] test/memarea: support alloc and free API test To: "Burakov, Anatoly" , , CC: , , , , , References: <20220721044648.6817-1-fengchengwen@huawei.com> <20230710064923.19849-1-fengchengwen@huawei.com> <20230710064923.19849-5-fengchengwen@huawei.com> <2c75b8f8-d8d9-a396-fd52-90d251e86bae@intel.com> From: fengchengwen Message-ID: Date: Tue, 18 Jul 2023 10:49:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <2c75b8f8-d8d9-a396-fd52-90d251e86bae@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected 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 Hi Anatoly, Thanks for your review, both fix in v17. Thanks. On 2023/7/17 21:57, Burakov, Anatoly wrote: > On 7/10/2023 7:49 AM, Chengwen Feng wrote: >> This patch supports rte_memarea_alloc() and rte_memarea_free() API >> test. >> >> Signed-off-by: Chengwen Feng >> Reviewed-by: Dongdong Liu >> Acked-by: Morten Brørup >> --- > >> +static int >> +test_memarea_free_fail(void) >> +{ >> +    struct rte_memarea_param init; >> +    struct rte_memarea *ma; >> +    void *ptr; >> + >> +    test_memarea_init_param(&init); >> +    init.source = RTE_MEMAREA_SOURCE_LIBC; >> +    init.total_sz = MEMAREA_TEST_DEFAULT_SIZE; >> +    ma = rte_memarea_create(&init); >> +    TEST_ASSERT(ma != NULL, "Expected Non-NULL"); >> + >> +    /* test repeat free */ >> +    rte_errno = 0; >> +    ptr = rte_memarea_alloc(ma, MEMAREA_TEST_DEFAULT_SIZE >> 1); >> +    TEST_ASSERT(ptr != NULL, "Expected Non-NULL"); >> +    test_memarea_fill_region(ptr, MEMAREA_TEST_DEFAULT_SIZE >> 1); >> +    rte_memarea_free(ma, ptr); >> +    TEST_ASSERT(rte_errno == 0, "Expected Zero"); >> +    rte_memarea_free(ma, ptr); >> +    TEST_ASSERT(rte_errno == EFAULT, "Expected EFAULT"); >> + >> +    rte_memarea_destroy(ma); >> + >> +    return 0; > > Same as in other, I think TEST_SUCCESS would be more correct (even though DPDK codebase doesn't always follow that convention). > > Acked-by: Anatoly Burakov