[dpdk-dev] [PATCH v3 18/29] net/cxgbe: use eal I/O device memory read/write API

Ferruh Yigit ferruh.yigit at intel.com
Fri Jan 13 12:41:30 CET 2017


On 1/13/2017 8:37 AM, Jerin Jacob wrote:
> 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.

Fair enough.

> 
>>
>> As a similar example, dpdk ether_addr_copy(src, dst) function argument
>> order is revers according common usage, and keeps confusing people.
>>
>> <...>
>>



More information about the dev mailing list