[v4,5/8] net/ether: mark ethernet addresses as being 2-byte aligned

Message ID 20190605180948.22414-6-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Headers
Series net/ether: enhancements and optimizations |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Stephen Hemminger June 5, 2019, 6:09 p.m. UTC
  From: Bruce Richardson <bruce.richardson@intel.com>

When including the rte_ether.h header in applications with warnings
enabled, a warning was given because of the assumption of 2-byte alignment
of ethernet addresses when processing them.

.../include/rte_ether.h:149:2: warning: converting a packed ‘const
  struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
  {aka ‘const short unsigned int’} pointer (alignment 2) may result in
  an unaligned pointer value [-Waddress-of-packed-member]
149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
    |  ^~~~~

Since ethernet addresses should always be aligned on a two-byte boundary,
we can just inform the compiler of this assumption to remove the warnings
and allow us to always access the addresses using 16-bit operations.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_net/rte_ether.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
  

Comments

Ananyev, Konstantin June 7, 2019, 4:59 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Wednesday, June 5, 2019 7:10 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Andrew Rybchenko
> <arybchenko@solarflare.com>
> Subject: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses as being 2-byte aligned
> 
> From: Bruce Richardson <bruce.richardson@intel.com>
> 
> When including the rte_ether.h header in applications with warnings
> enabled, a warning was given because of the assumption of 2-byte alignment
> of ethernet addresses when processing them.
> 
> .../include/rte_ether.h:149:2: warning: converting a packed ‘const
>   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
>   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
>   an unaligned pointer value [-Waddress-of-packed-member]
> 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
>     |  ^~~~~
> 
> Since ethernet addresses should always be aligned on a two-byte boundary,
> we can just inform the compiler of this assumption to remove the warnings
> and allow us to always access the addresses using 16-bit operations.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  lib/librte_net/rte_ether.h | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> index feb35a33c94b..d7b76ddf63eb 100644
> --- a/lib/librte_net/rte_ether.h
> +++ b/lib/librte_net/rte_ether.h
> @@ -58,7 +58,8 @@ extern "C" {
>   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
>   */
>  struct rte_ether_addr {
> -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
> +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> +	/**< Addr bytes in tx order */
>  } __attribute__((__packed__));

Hmm, that would change layout of any struct/union that has struct rte_ether_addr inside.
So seems like implicit ABI breakage to me.
Konstantin


> 
>  #define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */
> @@ -81,8 +82,8 @@ struct rte_ether_addr {
>  static inline int rte_is_same_ether_addr(const struct rte_ether_addr *ea1,
>  				     const struct rte_ether_addr *ea2)
>  {
> -	const unaligned_uint16_t *w1 = (const uint16_t *)ea1;
> -	const unaligned_uint16_t *w2 = (const uint16_t *)ea2;
> +	const uint16_t *w1 = (const uint16_t *)ea1;
> +	const uint16_t *w2 = (const uint16_t *)ea2;
> 
>  	return ((w1[0] ^ w2[0]) | (w1[1] ^ w2[1]) | (w1[2] ^ w2[2])) == 0;
>  }
> @@ -99,7 +100,7 @@ static inline int rte_is_same_ether_addr(const struct rte_ether_addr *ea1,
>   */
>  static inline int rte_is_zero_ether_addr(const struct rte_ether_addr *ea)
>  {
> -	const unaligned_uint16_t *w = (const uint16_t *)ea;
> +	const uint16_t *w = (const uint16_t *)ea;
> 
>  	return (w[0] | w[1] | w[2]) == 0;
>  }
> @@ -146,7 +147,7 @@ static inline int rte_is_multicast_ether_addr(const struct rte_ether_addr *ea)
>   */
>  static inline int rte_is_broadcast_ether_addr(const struct rte_ether_addr *ea)
>  {
> -	const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
> +	const uint16_t *ea_words = (const uint16_t *)ea;
> 
>  	return (ea_words[0] == 0xFFFF && ea_words[1] == 0xFFFF &&
>  		ea_words[2] == 0xFFFF);
> --
> 2.20.1
  
Stephen Hemminger June 7, 2019, 6:35 p.m. UTC | #2
On Fri, 7 Jun 2019 16:59:32 +0000
"Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote:

> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> > Sent: Wednesday, June 5, 2019 7:10 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Andrew Rybchenko
> > <arybchenko@solarflare.com>
> > Subject: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses as being 2-byte aligned
> > 
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > 
> > When including the rte_ether.h header in applications with warnings
> > enabled, a warning was given because of the assumption of 2-byte alignment
> > of ethernet addresses when processing them.
> > 
> > .../include/rte_ether.h:149:2: warning: converting a packed ‘const
> >   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
> >   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
> >   an unaligned pointer value [-Waddress-of-packed-member]
> > 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
> >     |  ^~~~~
> > 
> > Since ethernet addresses should always be aligned on a two-byte boundary,
> > we can just inform the compiler of this assumption to remove the warnings
> > and allow us to always access the addresses using 16-bit operations.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> >  lib/librte_net/rte_ether.h | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > index feb35a33c94b..d7b76ddf63eb 100644
> > --- a/lib/librte_net/rte_ether.h
> > +++ b/lib/librte_net/rte_ether.h
> > @@ -58,7 +58,8 @@ extern "C" {
> >   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
> >   */
> >  struct rte_ether_addr {
> > -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
> > +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> > +	/**< Addr bytes in tx order */
> >  } __attribute__((__packed__));  
> 
> Hmm, that would change layout of any struct/union that has struct rte_ether_addr inside.
> So seems like implicit ABI breakage to me.
> Konstantin

There was no rte_ether_addr in previous releases.
  
Bruce Richardson June 7, 2019, 8:39 p.m. UTC | #3
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, June 7, 2019 6:00 PM
> To: Stephen Hemminger <stephen@networkplumber.org>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>
> Subject: RE: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses
> as being 2-byte aligned
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> > Sent: Wednesday, June 5, 2019 7:10 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Stephen Hemminger
> > <stephen@networkplumber.org>; Andrew Rybchenko
> > <arybchenko@solarflare.com>
> > Subject: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses
> > as being 2-byte aligned
> >
> > From: Bruce Richardson <bruce.richardson@intel.com>
> >
> > When including the rte_ether.h header in applications with warnings
> > enabled, a warning was given because of the assumption of 2-byte
> > alignment of ethernet addresses when processing them.
> >
> > .../include/rte_ether.h:149:2: warning: converting a packed ‘const
> >   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
> >   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
> >   an unaligned pointer value [-Waddress-of-packed-member]
> > 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t
> *)ea;
> >     |  ^~~~~
> >
> > Since ethernet addresses should always be aligned on a two-byte
> > boundary, we can just inform the compiler of this assumption to remove
> > the warnings and allow us to always access the addresses using 16-bit
> operations.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> >  lib/librte_net/rte_ether.h | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > index feb35a33c94b..d7b76ddf63eb 100644
> > --- a/lib/librte_net/rte_ether.h
> > +++ b/lib/librte_net/rte_ether.h
> > @@ -58,7 +58,8 @@ extern "C" {
> >   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
> >   */
> >  struct rte_ether_addr {
> > -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order
> */
> > +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> > +	/**< Addr bytes in tx order */
> >  } __attribute__((__packed__));
> 
> Hmm, that would change layout of any struct/union that has struct
> rte_ether_addr inside.
> So seems like implicit ABI breakage to me.
> Konstantin
> 

I suppose it could, though only if you had the structure starting at an odd byte
inside the larger structure. Personally, I'd think it should be ok in just about
all cases, as I'd find it hard to imagine when you wouldn't have this, but 
technically I suppose it's a break. For real packet heads the fields will always be
two-byte aligned so there is no issue.

/Bruce
  
Bruce Richardson June 7, 2019, 8:40 p.m. UTC | #4
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, June 7, 2019 7:35 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Subject: Re: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses
> as being 2-byte aligned
> 
> On Fri, 7 Jun 2019 16:59:32 +0000
> "Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote:
> 
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen
> > > Hemminger
> > > Sent: Wednesday, June 5, 2019 7:10 PM
> > > To: dev@dpdk.org
> > > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Stephen
> > > Hemminger <stephen@networkplumber.org>; Andrew Rybchenko
> > > <arybchenko@solarflare.com>
> > > Subject: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet
> > > addresses as being 2-byte aligned
> > >
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > >
> > > When including the rte_ether.h header in applications with warnings
> > > enabled, a warning was given because of the assumption of 2-byte
> > > alignment of ethernet addresses when processing them.
> > >
> > > .../include/rte_ether.h:149:2: warning: converting a packed ‘const
> > >   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
> > >   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
> > >   an unaligned pointer value [-Waddress-of-packed-member]
> > > 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t
> *)ea;
> > >     |  ^~~~~
> > >
> > > Since ethernet addresses should always be aligned on a two-byte
> > > boundary, we can just inform the compiler of this assumption to
> > > remove the warnings and allow us to always access the addresses using
> 16-bit operations.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > ---
> > >  lib/librte_net/rte_ether.h | 11 ++++++-----
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > > index feb35a33c94b..d7b76ddf63eb 100644
> > > --- a/lib/librte_net/rte_ether.h
> > > +++ b/lib/librte_net/rte_ether.h
> > > @@ -58,7 +58,8 @@ extern "C" {
> > >   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
> > >   */
> > >  struct rte_ether_addr {
> > > -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order
> */
> > > +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> > > +	/**< Addr bytes in tx order */
> > >  } __attribute__((__packed__));
> >
> > Hmm, that would change layout of any struct/union that has struct
> rte_ether_addr inside.
> > So seems like implicit ABI breakage to me.
> > Konstantin
> 
> There was no rte_ether_addr in previous releases.

Good point. Thanks for remembering...
  
Ananyev, Konstantin June 8, 2019, 11:51 a.m. UTC | #5
> > >
> > > When including the rte_ether.h header in applications with warnings
> > > enabled, a warning was given because of the assumption of 2-byte alignment
> > > of ethernet addresses when processing them.
> > >
> > > .../include/rte_ether.h:149:2: warning: converting a packed ‘const
> > >   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
> > >   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
> > >   an unaligned pointer value [-Waddress-of-packed-member]
> > > 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
> > >     |  ^~~~~
> > >
> > > Since ethernet addresses should always be aligned on a two-byte boundary,
> > > we can just inform the compiler of this assumption to remove the warnings
> > > and allow us to always access the addresses using 16-bit operations.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > ---
> > >  lib/librte_net/rte_ether.h | 11 ++++++-----
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > > index feb35a33c94b..d7b76ddf63eb 100644
> > > --- a/lib/librte_net/rte_ether.h
> > > +++ b/lib/librte_net/rte_ether.h
> > > @@ -58,7 +58,8 @@ extern "C" {
> > >   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
> > >   */
> > >  struct rte_ether_addr {
> > > -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
> > > +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> > > +	/**< Addr bytes in tx order */
> > >  } __attribute__((__packed__));
> >
> > Hmm, that would change layout of any struct/union that has struct rte_ether_addr inside.
> > So seems like implicit ABI breakage to me.
> > Konstantin
> 
> There was no rte_ether_addr in previous releases.

I suppose you refer to the fact that struct ether_addr was renamed to rte_ether_addr by:
https://git.dpdk.org/dpdk/commit/?id=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1 
As I understand, Olivier patches in that rework introduce API change only,  keeping ABI unchanged.
While your patch makes ABI breakage possible.
Konstantin
  
Ananyev, Konstantin June 8, 2019, 12:15 p.m. UTC | #6
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> > > Sent: Wednesday, June 5, 2019 7:10 PM
> > > To: dev@dpdk.org
> > > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Stephen Hemminger
> > > <stephen@networkplumber.org>; Andrew Rybchenko
> > > <arybchenko@solarflare.com>
> > > Subject: [dpdk-dev] [PATCH v4 5/8] net/ether: mark ethernet addresses
> > > as being 2-byte aligned
> > >
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > >
> > > When including the rte_ether.h header in applications with warnings
> > > enabled, a warning was given because of the assumption of 2-byte
> > > alignment of ethernet addresses when processing them.
> > >
> > > .../include/rte_ether.h:149:2: warning: converting a packed ‘const
> > >   struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’
> > >   {aka ‘const short unsigned int’} pointer (alignment 2) may result in
> > >   an unaligned pointer value [-Waddress-of-packed-member]
> > > 149 |  const unaligned_uint16_t *ea_words = (const unaligned_uint16_t
> > *)ea;
> > >     |  ^~~~~
> > >
> > > Since ethernet addresses should always be aligned on a two-byte
> > > boundary, we can just inform the compiler of this assumption to remove
> > > the warnings and allow us to always access the addresses using 16-bit
> > operations.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > ---
> > >  lib/librte_net/rte_ether.h | 11 ++++++-----
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > > index feb35a33c94b..d7b76ddf63eb 100644
> > > --- a/lib/librte_net/rte_ether.h
> > > +++ b/lib/librte_net/rte_ether.h
> > > @@ -58,7 +58,8 @@ extern "C" {
> > >   * See http://standards.ieee.org/regauth/groupmac/tutorial.html
> > >   */
> > >  struct rte_ether_addr {
> > > -	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order
> > */
> > > +	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
> > > +	/**< Addr bytes in tx order */
> > >  } __attribute__((__packed__));
> >
> > Hmm, that would change layout of any struct/union that has struct
> > rte_ether_addr inside.
> > So seems like implicit ABI breakage to me.
> > Konstantin
> >
> 
> I suppose it could, though only if you had the structure starting at an odd byte
> inside the larger structure.

Yes.

>  Personally, I'd think it should be ok in just about
> all cases, as I'd find it hard to imagine when you wouldn't have this, but
> technically I suppose it's a break.

I also don't expect it to be a common case, but it is not totally impossible.
So I still think it qualifies as ABI change and we need to follow our own ABI
breakage policy here. 

> For real packet heads the fields will always be
> two-byte aligned so there is no issue.
>
  

Patch

diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index feb35a33c94b..d7b76ddf63eb 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -58,7 +58,8 @@  extern "C" {
  * See http://standards.ieee.org/regauth/groupmac/tutorial.html
  */
 struct rte_ether_addr {
-	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
+	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN] __rte_aligned(2);
+	/**< Addr bytes in tx order */
 } __attribute__((__packed__));
 
 #define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */
@@ -81,8 +82,8 @@  struct rte_ether_addr {
 static inline int rte_is_same_ether_addr(const struct rte_ether_addr *ea1,
 				     const struct rte_ether_addr *ea2)
 {
-	const unaligned_uint16_t *w1 = (const uint16_t *)ea1;
-	const unaligned_uint16_t *w2 = (const uint16_t *)ea2;
+	const uint16_t *w1 = (const uint16_t *)ea1;
+	const uint16_t *w2 = (const uint16_t *)ea2;
 
 	return ((w1[0] ^ w2[0]) | (w1[1] ^ w2[1]) | (w1[2] ^ w2[2])) == 0;
 }
@@ -99,7 +100,7 @@  static inline int rte_is_same_ether_addr(const struct rte_ether_addr *ea1,
  */
 static inline int rte_is_zero_ether_addr(const struct rte_ether_addr *ea)
 {
-	const unaligned_uint16_t *w = (const uint16_t *)ea;
+	const uint16_t *w = (const uint16_t *)ea;
 
 	return (w[0] | w[1] | w[2]) == 0;
 }
@@ -146,7 +147,7 @@  static inline int rte_is_multicast_ether_addr(const struct rte_ether_addr *ea)
  */
 static inline int rte_is_broadcast_ether_addr(const struct rte_ether_addr *ea)
 {
-	const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
+	const uint16_t *ea_words = (const uint16_t *)ea;
 
 	return (ea_words[0] == 0xFFFF && ea_words[1] == 0xFFFF &&
 		ea_words[2] == 0xFFFF);