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 CDAE9A0C47; Tue, 6 Jul 2021 05:56:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4102040688; Tue, 6 Jul 2021 05:56:11 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 88D184067E for ; Tue, 6 Jul 2021 05:56:09 +0200 (CEST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GJpY43jHnz78Fr; Tue, 6 Jul 2021 11:52:40 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 6 Jul 2021 11:56:04 +0800 Received: from [127.0.0.1] (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; Tue, 6 Jul 2021 11:56:04 +0800 To: Andrew Rybchenko , , , , , CC: , , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> From: fengchengwen Message-ID: <9b771d4d-5b63-4cc5-f063-27995ff33de3@huawei.com> Date: Tue, 6 Jul 2021 11:56: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: 7bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH] dmadev: introduce DMA device library 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" Many thanks, mostly OK, a few comment inline On 2021/7/4 22:57, Andrew Rybchenko wrote: > On 7/2/21 4:18 PM, Chengwen Feng wrote: >> This patch introduces 'dmadevice' which is a generic type of DMA >> device. [snip] >> +#ifndef _RTE_DMADEV_CORE_H_ >> +#define _RTE_DMADEV_CORE_H_ >> + >> +/** >> + * @file >> + * >> + * RTE DMA Device internal header. >> + * >> + * This header contains internal data types. But they are still part of the >> + * public API because they are used by inline public functions. > > Do we really want it? Anyway rte_dmadev must not be here. > Some sub-structure could be, but not entire rte_dmadev. > struct rte_dmadev should expose to public for device probe and etc. and because the public dataplane function use static inline to embellish, should put the rte_dmadevices to public file too. PS: it widely used in eth/regexdev... >> + >> +extern struct rte_dmadev rte_dmadevices[]; >> + >> +#endif /* _RTE_DMADEV_CORE_H_ */ >> diff --git a/lib/dmadev/rte_dmadev_pmd.h b/lib/dmadev/rte_dmadev_pmd.h > > Let's remove rte_ prefix from DPDK internal headers. as above explained, it's public header file. >> + >> +#define RTE_DMADEV_LOG(level, fmt, args...) \ > > Do we need RTE_ prefix for internal API? > >> + rte_log(RTE_LOG_ ## level, libdmadev_logtype, "%s(): " fmt "\n", \ >> + __func__, ##args) >> + >> +/* Macros to check for valid device */ >> +#define RTE_DMADEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ >> + if (!rte_dmadev_pmd_is_valid_dev((dev_id))) { \ >> + RTE_DMADEV_LOG(ERR, "Invalid dev_id=%d", dev_id); \ >> + return retval; \ >> + } \ >> +} while (0) >> + >> +#define RTE_DMADEV_VALID_DEVID_OR_RET(dev_id) do { \ >> + if (!rte_dmadev_pmd_is_valid_dev((dev_id))) { \ >> + RTE_DMADEV_LOG(ERR, "Invalid dev_id=%d", dev_id); \ >> + return; \ >> + } \ >> +} while (0) >> + >> +#define RTE_DMADEV_DETACHED 0 >> +#define RTE_DMADEV_ATTACHED 1 > > Do we really need RTE_ prefix for interlal defines? with RTE_ prefix will reduce namespace conflicts. it's same as it lib/eth or regexdev... >> +typedef int (*dmadev_xstats_reset_t)(struct rte_dmadev *dev, >> + const uint32_t ids[], uint32_t nb_ids); >> +/**< @internal Function used to reset extended stats. */ > > Do we really need both stats and xstats from the very > beginning? I think it is better to start from just > generic stats and add xstats when it is really required. OK, but I think we should add one dump ops, which could be useful to find the problem. > . >