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 E4E74A0C54; Mon, 23 Aug 2021 05:43:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BF3E40143; Mon, 23 Aug 2021 05:43:42 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 0EFF54003E for ; Mon, 23 Aug 2021 05:43:40 +0200 (CEST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GtJ036j8mzbdL8; Mon, 23 Aug 2021 11:39:47 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 23 Aug 2021 11:43:36 +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; Mon, 23 Aug 2021 11:43:35 +0800 To: Bruce Richardson CC: , , , , , , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1628845774-48339-1-git-send-email-fengchengwen@huawei.com> <1628845774-48339-2-git-send-email-fengchengwen@huawei.com> From: fengchengwen Message-ID: Date: Mon, 23 Aug 2021 11:43:35 +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: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v15 1/6] dmadev: introduce DMA device library public APIs 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" Hi Bruce and All, The v16 use following define, and it also include dma skeleton and ut. struct rte_dmadev_stats { uint64_t submitted; uint64_t completed; uint64_t errors; } Feedback welcome, thanks. On 2021/8/19 22:52, Bruce Richardson wrote: > On Fri, Aug 13, 2021 at 05:09:29PM +0800, Chengwen Feng wrote: >> The 'dmadevice' is a generic type of DMA device. >> >> This patch introduce the 'dmadevice' public APIs which expose generic >> operations that can enable configuration and I/O with the DMA devices. >> >> Signed-off-by: Chengwen Feng >> Acked-by: Bruce Richardson >> Acked-by: Morten Brørup >> Acked-by: Jerin Jacob >> --- > one minor comment for clarification > >> +/** >> + * rte_dmadev_stats - running statistics. >> + */ >> +struct rte_dmadev_stats { >> + uint64_t submitted_count; >> + /**< Count of operations which were submitted to hardware. */ >> + uint64_t completed_fail_count; >> + /**< Count of operations which failed to complete. */ >> + uint64_t completed_count; >> + /**< Count of operations which successfully complete. */ >> +}; > > The name of the last variable and the comment on it seem mismatched. The > name implies that it's all completed ops, i.e. to get successful only you > do "stats.completed_count - stats.completed_fail_count", while the comment > says that it's successful only. Therefore I suggest: > > * We rename the last two vars to "completed_fail" and "completed_success" > for clarity OR > * We redefine "completed_count" to be the full completed count of both > success and failure. > > I have a slight preference for the latter option, but either can work. > > /Bruce > > PS: We probably don't need "count" on any of these values, based on two > options above suggest structs as: > > struct rte_dmadev_stats { > uint64_t submitted; > uint64_t failed; > uint64_t successful; > }; > > OR: > > struct rte_dmadev_stats { > uint64_t submitted; > uint64_t completed; > uint64_t errors; > } > . >