[5/8] ip_frag: enable build on Windows

Message ID 20221201014440.11896-6-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Enable building more on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Dec. 1, 2022, 1:44 a.m. UTC
  This build works on Windows if sys/queue.h is included.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_ipfrag.c       | 12 ------------
 lib/ip_frag/ip_frag_common.h |  2 ++
 lib/ip_frag/meson.build      |  6 ------
 3 files changed, 2 insertions(+), 18 deletions(-)
  

Comments

Tyler Retzlaff Dec. 1, 2022, 11:54 p.m. UTC | #1
On Wed, Nov 30, 2022 at 05:44:36PM -0800, Stephen Hemminger wrote:
> This build works on Windows if sys/queue.h is included.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  

Patch

diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c
index 88cc4cdeea8d..402ce361c1a2 100644
--- a/app/test/test_ipfrag.c
+++ b/app/test/test_ipfrag.c
@@ -10,17 +10,6 @@ 
 #include <rte_cycles.h>
 #include <rte_hexdump.h>
 #include <rte_ip.h>
-
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_ipfrag(void)
-{
-	printf("ipfrag not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-#else
-
 #include <rte_ip_frag.h>
 #include <rte_mbuf.h>
 #include <rte_random.h>
@@ -520,6 +509,5 @@  test_ipfrag(void)
 	return unit_test_suite_runner(&ipfrag_testsuite);
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
 
 REGISTER_TEST_COMMAND(ipfrag_autotest, test_ipfrag);
diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h
index 9c0dbdeb6eb9..0f4ad72a90d9 100644
--- a/lib/ip_frag/ip_frag_common.h
+++ b/lib/ip_frag/ip_frag_common.h
@@ -8,6 +8,8 @@ 
 #include "rte_ip_frag.h"
 #include "ip_reassembly.h"
 
+#include <sys/queue.h>
+
 /* logging macros. */
 #ifdef RTE_LIBRTE_IP_FRAG_DEBUG
 #define	IP_FRAG_LOG(lvl, fmt, args...)	RTE_LOG(lvl, USER1, fmt, ##args)
diff --git a/lib/ip_frag/meson.build b/lib/ip_frag/meson.build
index 3a252bdaf6a4..ea2de09f7528 100644
--- a/lib/ip_frag/meson.build
+++ b/lib/ip_frag/meson.build
@@ -1,12 +1,6 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 sources = files(
         'rte_ipv4_fragmentation.c',
         'rte_ipv6_fragmentation.c',