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 <andre...@linux.microsoft.com>
---
 drivers/mempool/octeontx/octeontx_fpavf.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c 
b/drivers/mempool/octeontx/octeontx_fpavf.c
index 966fee8bfe..d2eb837c17 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -46,20 +46,20 @@ struct octeontx_mbox_fpa_cfg {
        uint64_t        aura_cfg;
 };
 
-struct __rte_packed gen_req {
+__rte_packed_begin struct gen_req {
        uint32_t        value;
-};
+} __rte_packed_end;
 
-struct __rte_packed idn_req {
+__rte_packed_begin struct idn_req {
        uint8_t domain_id;
-};
+} __rte_packed_end;
 
-struct __rte_packed gen_resp {
+__rte_packed_begin struct gen_resp {
        uint16_t        domain_id;
        uint16_t        vfid;
-};
+} __rte_packed_end;
 
-struct __rte_packed dcfg_resp {
+__rte_packed_begin struct dcfg_resp {
        uint8_t sso_count;
        uint8_t ssow_count;
        uint8_t fpa_count;
@@ -67,7 +67,7 @@ struct __rte_packed dcfg_resp {
        uint8_t tim_count;
        uint8_t net_port_count;
        uint8_t virt_port_count;
-};
+} __rte_packed_end;
 
 #define FPA_MAX_POOL   32
 #define FPA_PF_PAGE_SZ 4096
-- 
2.34.1

Reply via email to