[dpdk-dev] [PATCH] doc: announce API change for rte_ether.h

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Dec 14 16:41:28 CET 2015


2015-12-14 15:30, Bruce Richardson:
> On Mon, Dec 14, 2015 at 03:54:06PM +0100, Thomas Monjalon wrote:
> > 2015-12-10 15:27, Stephen Hemminger:
> > > Plan to change to <net/ethernet.h> version of struct ether_addr in
> > > DPDK 2.3. The change in DPDK source is trivial but it will impact
> > > source compatablilty therefore notification is necessary.
> > [...]
> > > +* librte_ether: The structure ether_addr in DPDK will be replaced
> > > +  by using the standard header file <net/ethernet.h>. The structure
> > > +  size will be the same (no ABI impact), but the structure field name
> > > +  will change from addr_bytes[] to ether_addr_octet[].
> > 
> > 
> > Acked-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > 
> > Any other votes for this API cleanup?
> > 
> Are the structures and contents of net/ethernet.h the same on both Linux and
> FreeBSD?

Good question. I'm afraid the answer is no.
In FreeBSD, it is ether_addr.octet[].

Linux
-----

struct ether_addr
{
  u_int8_t ether_addr_octet[ETH_ALEN];
} __attribute__ ((__packed__));

struct ether_header
{
  u_int8_t  ether_dhost[ETH_ALEN];  /* destination eth addr */
  u_int8_t  ether_shost[ETH_ALEN];  /* source ether addr */
  u_int16_t ether_type;            /* packet type ID field  */
} __attribute__ ((__packed__));

FreeBSD
-------

struct ether_addr {                                                                                              
  u_char octet[ETHER_ADDR_LEN];
} __packed;

struct ether_header {
  u_char  ether_dhost[ETHER_ADDR_LEN];
  u_char  ether_shost[ETHER_ADDR_LEN];
  u_short ether_type;
} __packed;



More information about the dev mailing list