X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=lib%2Flibrte_net%2Frte_ether.h;h=e069dc7fe0227b467d8424fde133a658d45e37ba;hb=f3822eb6fb241bed1d92ad7749afa6b381810ec3;hp=13210f2fd07a925a74c1f43f7188bea88b14f037;hpb=512d873ff19939a9890f7b4e857bbf76d995db95;p=dpdk.git diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 13210f2fd0..e069dc7fe0 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -59,7 +59,7 @@ extern "C" { */ struct rte_ether_addr { uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */ -} __attribute__((__packed__)); +} __attribute__((aligned(2))); #define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */ #define RTE_ETHER_GROUP_ADDR 0x01 /**< Multicast or broadcast Eth. address. */ @@ -81,8 +81,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 +99,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 +146,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); @@ -273,7 +273,7 @@ struct rte_ether_hdr { struct rte_ether_addr d_addr; /**< Destination address. */ struct rte_ether_addr s_addr; /**< Source address. */ uint16_t ether_type; /**< Frame type. */ -} __attribute__((__packed__)); +} __attribute__((aligned(2))); /** * Ethernet VLAN Header.