DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
@ 2015-12-10 23:27 Stephen Hemminger
  2015-12-11  9:28 ` Panu Matilainen
  2015-12-14 14:54 ` Thomas Monjalon
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Hemminger @ 2015-12-10 23:27 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 1c7ab01..8ecb990 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -19,3 +19,8 @@ Deprecation Notices
   and table action handlers will be updated:
   the pipeline parameter will be added, the packets mask parameter will be
   either removed (for input port action handler) or made input-only.
+
+* 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[].
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-10 23:27 [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h Stephen Hemminger
@ 2015-12-11  9:28 ` Panu Matilainen
  2015-12-11 16:33   ` Stephen Hemminger
  2015-12-14 14:54 ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Panu Matilainen @ 2015-12-11  9:28 UTC (permalink / raw)
  To: Stephen Hemminger, dev

On 12/11/2015 01:27 AM, Stephen Hemminger wrote:
> 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.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   doc/guides/rel_notes/deprecation.rst | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 1c7ab01..8ecb990 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -19,3 +19,8 @@ Deprecation Notices
>     and table action handlers will be updated:
>     the pipeline parameter will be added, the packets mask parameter will be
>     either removed (for input port action handler) or made input-only.
> +
> +* 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[].
>

I hope there is some other reason/benefit besides getting rid of a 
three-line custom struct definition. It may be a trivial 
s/addr_bytes/ether_addr_octet/ change but it touches a lot of places all 
over the DPDK codebase alone, and for 3rd party developers such (at 
least seemingly) gratuitous renames are really irritating.

	- Panu -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-11  9:28 ` Panu Matilainen
@ 2015-12-11 16:33   ` Stephen Hemminger
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2015-12-11 16:33 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

On Fri, 11 Dec 2015 11:28:48 +0200
Panu Matilainen <pmatilai@redhat.com> wrote:

> On 12/11/2015 01:27 AM, Stephen Hemminger wrote:
> > 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.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >   doc/guides/rel_notes/deprecation.rst | 5 +++++
> >   1 file changed, 5 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > index 1c7ab01..8ecb990 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -19,3 +19,8 @@ Deprecation Notices
> >     and table action handlers will be updated:
> >     the pipeline parameter will be added, the packets mask parameter will be
> >     either removed (for input port action handler) or made input-only.
> > +
> > +* 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[].
> >
> 
> I hope there is some other reason/benefit besides getting rid of a 
> three-line custom struct definition. It may be a trivial 
> s/addr_bytes/ether_addr_octet/ change but it touches a lot of places all 
> over the DPDK codebase alone, and for 3rd party developers such (at 
> least seemingly) gratuitous renames are really irritating.
> 
> 	- Panu -
> 

It allows dropping dependency on cmdline in several places in code (by using ether_ntoa instead).
The problem was a day 0 choice in DPDK to define their own struct's everywhere.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-10 23:27 [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h Stephen Hemminger
  2015-12-11  9:28 ` Panu Matilainen
@ 2015-12-14 14:54 ` Thomas Monjalon
  2015-12-14 15:30   ` Bruce Richardson
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2015-12-14 14:54 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

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@6wind.com>

Any other votes for this API cleanup?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-14 14:54 ` Thomas Monjalon
@ 2015-12-14 15:30   ` Bruce Richardson
  2015-12-14 15:41     ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2015-12-14 15:30 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

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@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?

/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-14 15:30   ` Bruce Richardson
@ 2015-12-14 15:41     ` Thomas Monjalon
  2015-12-14 16:00       ` Bruce Richardson
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2015-12-14 15:41 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

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@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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-14 15:41     ` Thomas Monjalon
@ 2015-12-14 16:00       ` Bruce Richardson
  2015-12-14 17:30         ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2015-12-14 16:00 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

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 <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@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;
> 

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h
  2015-12-14 16:00       ` Bruce Richardson
@ 2015-12-14 17:30         ` Stephen Hemminger
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2015-12-14 17:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev


> > 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.

The different BSD variants have different definitions (ie NetBSD different than FreeBSD)

Since the data structures are conformant, the other possiblity
is adding ether_ntoa family prototypes to rte_ether.h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-14 17:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 23:27 [dpdk-dev] [PATCH] doc: announce API change for rte_ether.h Stephen Hemminger
2015-12-11  9:28 ` Panu Matilainen
2015-12-11 16:33   ` Stephen Hemminger
2015-12-14 14:54 ` Thomas Monjalon
2015-12-14 15:30   ` Bruce Richardson
2015-12-14 15:41     ` Thomas Monjalon
2015-12-14 16:00       ` Bruce Richardson
2015-12-14 17:30         ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).