[dpdk-dev] [PATCH] doc: announce renaming of rte_ether_hdr fields

Ferruh Yigit ferruh.yigit at intel.com
Thu May 20 16:28:44 CEST 2021


On 3/4/2021 7:09 AM, Dmitry Kozlyuk wrote:
> 2021-03-03 15:54, Stephen Hemminger:
>>> +
>>> +* net: ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure
>>> +  will be renamed to ``src_addr`` and ``dst_addr`` respectively in DPDK 20.11
>>> +  in order to avoid conflict with Windows Sockets headers.  
>>
>> If those fields were a problem now, there might be others in future.
> 
> One I can think of is `min` and `max` macros from `windows.h`: they are used
> as field names in `rte_compressdev.h` and `rte_cryptodev.h` (and more than
> once have they been worked around in PMD code, see i40e and ice patches).
> Do you prefer a single notice for all such conflicts we can identify now?
> 
>> Don't use src_addr and dst_addr because those are already used in rte_ipv4_hdr.
> 

Why src_addr being used in rte_ipv4_hdr is a problem?

> Not sure what DPDK policy is: `rte_ipv4/6_hdr` use completely custom names,
> while `rte_arp_hdr` uses traditional names with `arp_` prefix.
> Coming from C++, I chose the former approach, but it's not a strong opinion.
> 

I am now aware of a DPDK policy for it, but +1 to former approach.

>> Linux and FreeBSD use:
>>
>> struct ether_header
>> {
>>   uint8_t  ether_dhost[ETH_ALEN];	/* destination eth addr	*/
>>   uint8_t  ether_shost[ETH_ALEN];	/* source ether addr	*/
>>   uint16_t ether_type;		        /* packet type ID field	*/
>> } __attribute__ ((__packed__));
>>
>> So why not ether_dhost/ether_shost?
> 
> Works for me, let's see what others think.
> 



More information about the dev mailing list