From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9215345B12; Fri, 11 Oct 2024 15:19:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5673F402A1; Fri, 11 Oct 2024 15:19:40 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id CAFE34028B for ; Fri, 11 Oct 2024 15:19:38 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A638D206C2 for ; Fri, 11 Oct 2024 15:19:38 +0200 (CEST) Received: from dkrd4.smartsharesys.local ([192.168.4.26]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 Oct 2024 15:19:38 +0200 From: =?UTF-8?q?Morten=20Br=C3=B8rup?= To: dev@dpdk.org Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [RFC PATCH] net: TEST 2-byte align packed headers Date: Fri, 11 Oct 2024 13:19:29 +0000 Message-ID: <20241011131930.1855-1-mb@smartsharesystems.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 11 Oct 2024 13:19:38.0327 (UTC) FILETIME=[392A7670:01DB1BE0] X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Testing idea discussed in: https://inbox.dpdk.org/dev/20240821162516.610624-17-rjarry@redhat.com/T/#mc598fde6ba5d540cde5096575cc3b6e27d9640cd Signed-off-by: Morten Brørup --- lib/net/rte_ether.h | 2 +- lib/net/rte_ip.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h index 403e84f50b..e759c51a65 100644 --- a/lib/net/rte_ether.h +++ b/lib/net/rte_ether.h @@ -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; diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index 0d103d4127..88bfb6a44d 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -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 */ -- 2.43.0