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 68D8A45C88; Tue, 5 Nov 2024 13:25:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C076402B3; Tue, 5 Nov 2024 13:25:27 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 28D5340151 for ; Tue, 5 Nov 2024 13:25:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730809525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3w4QXZOcC2T2yx4Le4yhhMe6Xbm0OqD7BATgay3lmn0=; b=jJkf8fqutmtMM/m+j+EmV/ik77cA+3hq/orgF7tFHh/j/dMb/nGnyXZIxs7zFA2/wPyOFL A5F13PhDBffm8zhqLjZmZQONfmJOMH6m5DiegAz0PmNYzxYMe1faypEcKYzoNjLohK1Aqu E4mMNjjckJ1FxdeGqyr7EWrl8YXBj7M= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-599-yeg3E1icM6WwWCch6XBUXQ-1; Tue, 05 Nov 2024 07:25:22 -0500 X-MC-Unique: yeg3E1icM6WwWCch6XBUXQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A069C195608A; Tue, 5 Nov 2024 12:25:21 +0000 (UTC) Received: from ringo.home (unknown [10.39.208.47]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B8027300019D; Tue, 5 Nov 2024 12:25:19 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , David Marchand Subject: [PATCH dpdk] net: enforce 2-bytes alignment on IPv6 headers Date: Tue, 5 Nov 2024 13:25:09 +0100 Message-ID: <20241105122508.425470-2-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 IPv6 headers are always aligned on a 2-bytes grid. Reflect this in the structure definition. Signed-off-by: Robin Jarry --- lib/net/rte_ip6.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/net/rte_ip6.h b/lib/net/rte_ip6.h index 3ae38811b27c..fea7d7b0cd73 100644 --- a/lib/net/rte_ip6.h +++ b/lib/net/rte_ip6.h @@ -460,7 +460,7 @@ rte_ether_mcast_from_ipv6(struct rte_ether_addr *mac, const struct rte_ipv6_addr /** * IPv6 Header */ -struct rte_ipv6_hdr { +struct __rte_aligned(2) rte_ipv6_hdr { union { rte_be32_t vtc_flow; /**< IP version, traffic class & flow label. */ __extension__ @@ -507,7 +507,7 @@ static inline int rte_ipv6_check_version(const struct rte_ipv6_hdr *ip) /** * 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. */ @@ -751,7 +751,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.47.0