[PATCH v11 05/30] doc/guides: replace packed attributes
Andre Muezerie
andremue at linux.microsoft.com
Fri Jan 10 23:16:26 CET 2025
MSVC struct packing is not compatible with GCC. Replace macro
__rte_packed with __rte_packed_begin to push existing pack value
and set packing to 1-byte and macro __rte_packed_end to restore
the pack value prior to the push.
Macro __rte_packed_end is deliberately utilized to trigger a
MSVC compiler warning if no existing packing has been pushed allowing
easy identification of locations where the __rte_packed_begin is
missing.
Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
doc/guides/nics/ark.rst | 4 ++--
doc/guides/prog_guide/packet_classif_access_ctrl.rst | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index a9f6d4cdb8..6aabde2ed5 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -172,10 +172,10 @@ during RX from user meta data coming from FPGA hardware.
};
/* RX tuser field based on user's hardware */
- struct user_rx_meta {
+ struct __rte_packed_begin user_rx_meta {
uint64_t timestamp;
uint32_t rss;
- } __rte_packed;
+ } __rte_packed_end;
/* Create ark_user_extension object for use in other hook functions */
void *rte_pmd_ark_dev_init(struct rte_eth_dev * dev,
diff --git a/doc/guides/prog_guide/packet_classif_access_ctrl.rst b/doc/guides/prog_guide/packet_classif_access_ctrl.rst
index c8844d0616..e2cd60fb47 100644
--- a/doc/guides/prog_guide/packet_classif_access_ctrl.rst
+++ b/doc/guides/prog_guide/packet_classif_access_ctrl.rst
@@ -154,14 +154,14 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
.. code-block:: c
- struct rte_ipv6_hdr {
+ struct __rte_packed_begin rte_ipv6_hdr {
uint32_t vtc_flow; /* IP version, traffic class & flow label. */
uint16_t payload_len; /* IP packet length - includes sizeof(ip_header). */
uint8_t proto; /* Protocol, next header. */
uint8_t hop_limits; /* Hop limits. */
uint8_t src_addr[16]; /* IP address of source host. */
uint8_t dst_addr[16]; /* IP address of destination host(s). */
- } __rte_packed;
+ } __rte_packed_end;
The following array of field definitions can be used:
--
2.47.0.vfs.0.3
More information about the dev
mailing list