DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC PATCH] net: TEST 2-byte align packed headers
@ 2024-10-11 13:19 Morten Brørup
  2024-10-11 16:06 ` [RFC PATCH v2] net: " Morten Brørup
  0 siblings, 1 reply; 8+ messages in thread
From: Morten Brørup @ 2024-10-11 13:19 UTC (permalink / raw)
  To: dev; +Cc: Morten Brørup

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-30 15:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-11 13:19 [RFC PATCH] net: TEST 2-byte align packed headers Morten Brørup
2024-10-11 16:06 ` [RFC PATCH v2] net: " Morten Brørup
2024-10-30 12:35   ` Morten Brørup
2024-10-30 12:52     ` David Marchand
2024-10-30 12:55       ` Morten Brørup
2024-10-30 15:10         ` David Marchand
2024-10-30 15:15           ` Morten Brørup
2024-10-30 12:42   ` Bruce Richardson

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