All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH 7/8] fib: enable on Windows
Date: Wed, 30 Nov 2022 17:44:38 -0800	[thread overview]
Message-ID: <20221201014440.11896-8-stephen@networkplumber.org> (raw)
In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org>

The FIB library builds on Windows as long as sys/queue.h is defined.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_fib.c       | 22 +---------------------
 app/test/test_fib6.c      | 24 ++----------------------
 app/test/test_fib6_perf.c | 15 +--------------
 app/test/test_fib_perf.c  | 19 +++----------------
 lib/fib/meson.build       |  6 ------
 lib/fib/rte_fib.c         |  1 +
 lib/fib/rte_fib6.c        |  1 +
 7 files changed, 9 insertions(+), 79 deletions(-)

diff --git a/app/test/test_fib.c b/app/test/test_fib.c
index a2d1ea8f3abc..eb69d6e2fd4c 100644
--- a/app/test/test_fib.c
+++ b/app/test/test_fib.c
@@ -9,28 +9,10 @@
 
 #include <rte_ip.h>
 #include <rte_log.h>
+#include <rte_fib.h>
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_fib(void)
-{
-	printf("fib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-static int
-test_slow_fib(void)
-{
-	printf("slow_fib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-#else
-
-#include <rte_fib.h>
-
 typedef int32_t (*rte_fib_test)(void);
 
 static int32_t test_create_invalid(void);
@@ -433,7 +415,5 @@ test_slow_fib(void)
 	return unit_test_suite_runner(&fib_slow_tests);
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
-
 REGISTER_TEST_COMMAND(fib_autotest, test_fib);
 REGISTER_TEST_COMMAND(fib_slow_autotest, test_slow_fib);
diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c
index cd971e6ecdfb..15ad09178ae2 100644
--- a/app/test/test_fib6.c
+++ b/app/test/test_fib6.c
@@ -9,29 +9,11 @@
 
 #include <rte_memory.h>
 #include <rte_log.h>
-
-#include "test.h"
-
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_fib6(void)
-{
-	printf("fib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-static int
-test_slow_fib6(void)
-{
-	printf("slow_fib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-#else
-
 #include <rte_rib6.h>
 #include <rte_fib6.h>
 
+#include "test.h"
+
 typedef int32_t (*rte_fib6_test)(void);
 
 static int32_t test_create_invalid(void);
@@ -442,7 +424,5 @@ test_slow_fib6(void)
 	return unit_test_suite_runner(&fib6_slow_tests);
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
-
 REGISTER_TEST_COMMAND(fib6_autotest, test_fib6);
 REGISTER_TEST_COMMAND(fib6_slow_autotest, test_slow_fib6);
diff --git a/app/test/test_fib6_perf.c b/app/test/test_fib6_perf.c
index 21d2b65318e9..add20c2331b1 100644
--- a/app/test/test_fib6_perf.c
+++ b/app/test/test_fib6_perf.c
@@ -10,21 +10,10 @@
 #include <rte_cycles.h>
 #include <rte_random.h>
 #include <rte_memory.h>
+#include <rte_fib6.h>
 
 #include "test.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_fib6_perf(void)
-{
-	printf("fib6_perf not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-#else
-
-#include <rte_fib6.h>
-
 #include "test_lpm6_data.h"
 
 #define TEST_FIB_ASSERT(cond) do {				\
@@ -167,6 +156,4 @@ test_fib6_perf(void)
 	return 0;
 }
 
-#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/
-
 REGISTER_TEST_COMMAND(fib6_perf_autotest, test_fib6_perf);
diff --git a/app/test/test_fib_perf.c b/app/test/test_fib_perf.c
index 9787874cc9b7..b56293e64f41 100644
--- a/app/test/test_fib_perf.c
+++ b/app/test/test_fib_perf.c
@@ -12,22 +12,11 @@
 #include <rte_random.h>
 #include <rte_branch_prediction.h>
 #include <rte_ip.h>
+#include <rte_fib.h>
 
 #include "test.h"
 #include "test_xmmt_ops.h"
 
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_fib_perf(void)
-{
-	printf("fib_perf not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-#else
-
-#include <rte_fib.h>
-
 #define TEST_FIB_ASSERT(cond) do {				\
 	if (!(cond)) {						\
 		printf("Error at line %d:\n", __LINE__);	\
@@ -246,7 +235,7 @@ static void generate_random_rule_prefix(uint32_t ip_class, uint8_t depth)
 	/* Only generate rest bits except the most significant
 	 * fixed bits for IP address class
 	 */
-	start = lrand48() & mask;
+	start = rte_rand() & mask;
 	ptr_rule = &large_route_table[num_route_entries];
 	for (k = 0; k < rule_num; k++) {
 		ptr_rule->ip = (start << (RTE_FIB_MAX_DEPTH - depth))
@@ -265,7 +254,7 @@ static void insert_rule_in_random_pos(uint32_t ip, uint8_t depth)
 	struct route_rule tmp;
 
 	do {
-		pos = lrand48();
+		pos = rte_rand();
 		try_count++;
 	} while ((try_count < 10) && (pos > num_route_entries));
 
@@ -420,6 +409,4 @@ test_fib_perf(void)
 	return 0;
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
-
 REGISTER_TEST_COMMAND(fib_perf_autotest, test_fib_perf);
diff --git a/lib/fib/meson.build b/lib/fib/meson.build
index 9b848d08417c..ddcae0617a73 100644
--- a/lib/fib/meson.build
+++ b/lib/fib/meson.build
@@ -2,12 +2,6 @@
 # Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>
 # Copyright(c) 2019 Intel Corporation
 
-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
 headers = files('rte_fib.h', 'rte_fib6.h')
 deps += ['rib']
diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c
index 8af4c4091908..0c3b20e00a5a 100644
--- a/lib/fib/rte_fib.c
+++ b/lib/fib/rte_fib.c
@@ -5,6 +5,7 @@
 
 #include <stdint.h>
 #include <string.h>
+#include <sys/queue.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c
index 4b8e22b142b9..28c69b38999f 100644
--- a/lib/fib/rte_fib6.c
+++ b/lib/fib/rte_fib6.c
@@ -5,6 +5,7 @@
 
 #include <stdint.h>
 #include <string.h>
+#include <sys/queue.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_tailq.h>
-- 
2.35.1


  parent reply	other threads:[~2022-12-01  1:45 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  1:44 [PATCH 0/8] Enable building more on Windows Stephen Hemminger
2022-12-01  1:44 ` [PATCH 1/8] net/null: build null PMD " Stephen Hemminger
2022-12-01 23:51   ` Tyler Retzlaff
2022-12-01  1:44 ` [PATCH 2/8] net/ring: build " Stephen Hemminger
2022-12-01 23:52   ` Tyler Retzlaff
2022-12-14 23:18   ` Kadam, Pallavi
2022-12-15  3:22     ` Stephen Hemminger
2022-12-15 17:48       ` Tyler Retzlaff
2022-12-15 18:09         ` Dmitry Kozlyuk
2022-12-01  1:44 ` [PATCH 3/8] lpm: enable " Stephen Hemminger
2022-12-01 23:53   ` Tyler Retzlaff
2022-12-01  1:44 ` [PATCH 4/8] reorder: build " Stephen Hemminger
2022-12-01 23:53   ` Tyler Retzlaff
2022-12-01  1:44 ` [PATCH 5/8] ip_frag: enable " Stephen Hemminger
2022-12-01 23:54   ` Tyler Retzlaff
2022-12-01  1:44 ` [PATCH 6/8] rib: enable " Stephen Hemminger
2022-12-01 23:54   ` Tyler Retzlaff
2022-12-01  1:44 ` Stephen Hemminger [this message]
2022-12-01 23:54   ` [PATCH 7/8] fib: " Tyler Retzlaff
2022-12-01  1:44 ` [PATCH 8/8] pcapng: windows compatability Stephen Hemminger
2022-12-01 23:55   ` Tyler Retzlaff
2023-02-07  0:19 ` [PATCH v2 0/8] Enable building more libraries on Windows Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 1/8] net/null: build null PMD " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 2/8] net/ring: build " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 3/8] lpm: enable " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 4/8] reorder: build " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 5/8] ip_frag: enable " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 6/8] rib: enable " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 7/8] fib: " Stephen Hemminger
2023-02-07  0:19   ` [PATCH v2 8/8] pcapng: windows compatibility Stephen Hemminger
2023-02-07 22:13   ` [PATCH v2 0/8] Enable building more libraries on Windows Dmitry Kozlyuk
2023-02-09  9:16     ` David Marchand
2023-02-19 17:50   ` [PATCH v3 " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 1/8] net/null: build null PMD " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 2/8] net/ring: build " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 3/8] lpm: enable " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 4/8] reorder: build " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 5/8] ip_frag: enable " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 6/8] rib: enable " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 7/8] fib: " Stephen Hemminger
2023-02-19 17:50     ` [PATCH v3 8/8] pcapng: windows compatibility Stephen Hemminger
2023-02-19 23:14   ` [PATCH v4 0/9] Enable building more libraries on Windows Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 1/9] net/null: build null PMD " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 2/9] net/ring: build " Stephen Hemminger
2023-03-09 21:10       ` David Marchand
2023-03-09 21:21         ` Stephen Hemminger
2023-03-10  9:34           ` David Marchand
2023-02-19 23:14     ` [PATCH v4 3/9] lpm: enable " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 4/9] reorder: build " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 5/9] ip_frag: enable " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 6/9] rib: enable " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 7/9] fib: " Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 8/9] pcapng: windows compatibility Stephen Hemminger
2023-02-19 23:14     ` [PATCH v4 9/9] table: enable build on Windows Stephen Hemminger
2023-03-06 21:07       ` Tyler Retzlaff
2023-03-10 14:06     ` [PATCH v4 0/9] Enable building more libraries " David Marchand
2023-03-09 21:31 ` [PATCH v5 " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 1/9] net/null: build null PMD " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 2/9] net/ring: build " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 3/9] lpm: enable " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 4/9] reorder: build " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 5/9] ip_frag: enable " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 6/9] rib: enable " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 7/9] fib: " Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 8/9] pcapng: windows compatibility Stephen Hemminger
2023-03-09 21:31   ` [PATCH v5 9/9] table: enable build on Windows Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221201014440.11896-8-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.