DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: dev@dpdk.org
Cc: "Morten Brørup" <mb@smartsharesystems.com>
Subject: [RFC PATCH] net: TEST 2-byte align packed headers
Date: Fri, 11 Oct 2024 13:19:29 +0000	[thread overview]
Message-ID: <20241011131930.1855-1-mb@smartsharesystems.com> (raw)

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(-)

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


             reply	other threads:[~2024-10-11 13:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 13:19 Morten Brørup [this message]
2024-10-11 16:06 ` [RFC PATCH v2] net: " Morten Brørup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241011131930.1855-1-mb@smartsharesystems.com \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).