[dpdk-dev] [PATCH] doc: announce renaming of rte_ether_hdr fields
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Thu Mar 4 08:09:29 CET 2021
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.
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.
> 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