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 F028EA0C45; Sat, 4 Sep 2021 10:52:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 773D840E3C; Sat, 4 Sep 2021 10:52:09 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D78B140DDD for ; Sat, 4 Sep 2021 10:52:07 +0200 (CEST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4H1pGH2tt0zQj6x; Sat, 4 Sep 2021 16:48:07 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 4 Sep 2021 16:52:05 +0800 Received: from [10.40.190.165] (10.40.190.165) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 4 Sep 2021 16:52:04 +0800 To: Conor Walsh , , , , , , CC: , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-5-git-send-email-fengchengwen@huawei.com> From: fengchengwen Message-ID: <0951e203-28f7-5adb-2fe1-4c6baf24f0c9@huawei.com> Date: Sat, 4 Sep 2021 16:52:03 +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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v19 4/7] dmadev: introduce DMA device library implementation 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" On 2021/9/3 23:35, Conor Walsh wrote: > >> This patch introduce DMA device library implementation which includes >> configuration and I/O with the DMA devices. >> >> Signed-off-by: Chengwen Feng >> Acked-by: Bruce Richardson >> Acked-by: Morten Brørup >> --- > >> + >> +static int >> +dmadev_shared_data_prepare(void) >> +{ >> +    const struct rte_memzone *mz; >> + >> +    if (dmadev_shared_data == NULL) { >> +        if (rte_eal_process_type() == RTE_PROC_PRIMARY) { >> +            /* Allocate port data and ownership shared memory. */ >> +            mz = rte_memzone_reserve(mz_rte_dmadev_data, >> +                     sizeof(*dmadev_shared_data), >> +                     rte_socket_id(), 0); >> +        } else >> +            mz = rte_memzone_lookup(mz_rte_dmadev_data); >> +        if (mz == NULL) >> +            return -ENOMEM; > > This memzone is not free'd anywhere in the library, I would suggest freeing as part of the release pmd function. All dmadevs data is in a contiguous area. When you release a pmd, you can't release some of it. This is more common in other libs, so I recommend keeping it as it is. Thanks > > > > Reviewed-by: Conor Walsh > > .