[v2,08/15] net/i40e: pack structures when building with MSVC

Message ID 1711580958-20808-9-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series fix packing of structs when building with MSVC |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 27, 2024, 11:09 p.m. UTC
  Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing
when building with MSVC.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/net/i40e/base/i40e_osdep.h | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
index aa5dc61..28439e3 100644
--- a/drivers/net/i40e/base/i40e_osdep.h
+++ b/drivers/net/i40e/base/i40e_osdep.h
@@ -177,6 +177,7 @@  static inline uint64_t i40e_read64_addr(volatile void *addr)
 #define ARRAY_SIZE(arr) RTE_DIM(arr)
 
 /* memory allocation tracking */
+__rte_msvc_pack
 struct i40e_dma_mem {
 	void *va;
 	u64 pa;
@@ -188,6 +189,7 @@  struct i40e_dma_mem {
 			i40e_allocate_dma_mem_d(h, m, s, a)
 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
 
+__rte_msvc_pack
 struct i40e_virt_mem {
 	void *va;
 	u32 size;