[v2,14/15] app/test: pack structures when building with MSVC

Message ID 1711580958-20808-15-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>
---
 app/test/test_efd.c    | 1 +
 app/test/test_hash.c   | 1 +
 app/test/test_member.c | 1 +
 3 files changed, 3 insertions(+)
  

Patch

diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index 1c0986b..df176a0 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -33,6 +33,7 @@ 
 static unsigned int test_socket_id;
 
 /* 5-tuple key type */
+__rte_msvc_pack
 struct flow_key {
 	uint32_t ip_src;
 	uint32_t ip_dst;
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index d586878..08c1773 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -79,6 +79,7 @@ 
  * Should be packed to avoid holes with potentially
  * undefined content in the middle.
  */
+__rte_msvc_pack
 struct flow_key {
 	uint32_t ip_src;
 	uint32_t ip_dst;
diff --git a/app/test/test_member.c b/app/test/test_member.c
index 5a4d275..ccd481a 100644
--- a/app/test/test_member.c
+++ b/app/test/test_member.c
@@ -32,6 +32,7 @@ 
 struct rte_member_setsum *setsum_sketch;
 
 /* 5-tuple key type */
+__rte_msvc_pack
 struct flow_key {
 	uint32_t ip_src;
 	uint32_t ip_dst;