From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 18/29] net/cxgbe: use eal I/O device memory read/write API Date: Fri, 13 Jan 2017 14:07:16 +0530 Message-ID: <20170113083715.GC19741@localhost.localdomain> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-19-git-send-email-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , , , , , , , Rahul Lakkireddy To: Ferruh Yigit Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0065.outbound.protection.outlook.com [104.47.32.65]) by dpdk.org (Postfix) with ESMTP id 7D77E2BF3 for ; Fri, 13 Jan 2017 09:37:43 +0100 (CET) Content-Disposition: inline In-Reply-To: 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 Thu, Jan 12, 2017 at 07:12:33PM +0000, Ferruh Yigit wrote: > On 1/12/2017 9:17 AM, Jerin Jacob wrote: > <...> > > > > > -#define CXGBE_PCI_REG_WRITE(reg, value) ({ \ > > - CXGBE_PCI_REG((reg)) = (value); }) > > +#define CXGBE_PCI_REG_WRITE(reg, value) rte_write32((value), (reg)) > > Almost all (if not all) PMD write macros' argument order is like > write(address, value), but rte_writeX has rte_writex(value, address) > > What is the common usage for this kind of function? Arguments order has been taken from Linux kernel readl/writel syntax. > What do you think reverting argument order? OMG :-). If it worth it then we can consider. IMHO, let it be in kernel syntax so that it will easy to port drivers from Linux kernel. > > As a similar example, dpdk ether_addr_copy(src, dst) function argument > order is revers according common usage, and keeps confusing people. > > <...> >