[RFC] net: TEST 2-byte align packed headers
Checks
Commit Message
Testing idea discussed in:
https://inbox.dpdk.org/dev/20240821162516.610624-17-rjarry@redhat.com/T/#mc598fde6ba5d540cde5096575cc3b6e27d9640cd
Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
---
lib/net/rte_ether.h | 2 +-
lib/net/rte_ip.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
@@ -301,7 +301,7 @@ struct __rte_aligned(2) rte_ether_hdr {
* Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type
* of the encapsulated frame.
*/
-struct rte_vlan_hdr {
+struct __rte_aligned(2) rte_vlan_hdr {
rte_be16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */
rte_be16_t eth_proto; /**< Ethernet type of encapsulated frame. */
} __rte_packed;
@@ -38,7 +38,7 @@ extern "C" {
/**
* IPv4 Header
*/
-struct rte_ipv4_hdr {
+struct __rte_aligned(2) rte_ipv4_hdr {
__extension__
union {
uint8_t version_ihl; /**< version and header length */
@@ -523,7 +523,7 @@ rte_ipv4_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m,
/**
* IPv6 Header
*/
-struct rte_ipv6_hdr {
+struct __rte_aligned(2) rte_ipv6_hdr {
rte_be32_t vtc_flow; /**< IP version, traffic class & flow label. */
rte_be16_t payload_len; /**< IP payload size, including ext. headers */
uint8_t proto; /**< Protocol, next header. */
@@ -538,7 +538,7 @@ struct rte_ipv6_hdr {
/**
* IPv6 Routing Extension Header
*/
-struct rte_ipv6_routing_ext {
+struct __rte_aligned(2) rte_ipv6_routing_ext {
uint8_t next_hdr; /**< Protocol, next header. */
uint8_t hdr_len; /**< Header length. */
uint8_t type; /**< Extension header type. */
@@ -783,7 +783,7 @@ rte_ipv6_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m,
#define RTE_IPV6_SET_FRAG_DATA(fo, mf) \
(((fo) & RTE_IPV6_EHDR_FO_MASK) | ((mf) & RTE_IPV6_EHDR_MF_MASK))
-struct rte_ipv6_fragment_ext {
+struct __rte_aligned(2) rte_ipv6_fragment_ext {
uint8_t next_header; /**< Next header type */
uint8_t reserved; /**< Reserved */
rte_be16_t frag_data; /**< All fragmentation data */