[v6,05/30] doc/guides: replace packed attributes
Checks
Commit Message
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@linux.microsoft.com>
---
doc/guides/nics/ark.rst | 3 ++-
doc/guides/prog_guide/packet_classif_access_ctrl.rst | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
Comments
On Tue, Nov 26, 2024 at 04:52:16PM -0800, Andre Muezerie wrote:
> 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@linux.microsoft.com>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
@@ -172,10 +172,11 @@ during RX from user meta data coming from FPGA hardware.
};
/* RX tuser field based on user's hardware */
+ __rte_packed_begin
struct 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,
@@ -154,6 +154,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
.. code-block:: c
+ __rte_packed_begin
struct rte_ipv6_hdr {
uint32_t vtc_flow; /* IP version, traffic class & flow label. */
uint16_t payload_len; /* IP packet length - includes sizeof(ip_header). */
@@ -161,7 +162,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
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: