From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9933C8E90 for ; Mon, 14 Dec 2015 17:00:31 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 14 Dec 2015 08:00:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,427,1444719600"; d="scan'208";a="873316439" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by fmsmga002.fm.intel.com with SMTP; 14 Dec 2015 08:00:26 -0800 Received: by (sSMTP sendmail emulation); Mon, 14 Dec 2015 16:00:25 +0025 Date: Mon, 14 Dec 2015 16:00:25 +0000 From: Bruce Richardson To: Thomas Monjalon Message-ID: <20151214160025.GA37212@bricha3-MOBL3> References: <1449790022-24126-1-git-send-email-stephen@networkplumber.org> <2618453.kF8WIUB5uB@xps13> <20151214153055.GA37304@bricha3-MOBL3> <3122170.KpSg9jKaig@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3122170.KpSg9jKaig@xps13> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 16:00:32 -0000 On Mon, Dec 14, 2015 at 04:41:28PM +0100, Thomas Monjalon wrote: > 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 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 . 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 > > > > > > 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; > Unfortunate. While the idea seems good, I think the structures being different on the different OS's is a problem that need to be solved before we make such a change. /Bruce