From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7DFCB41C26; Tue, 7 Feb 2023 01:20:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A77542D4B; Tue, 7 Feb 2023 01:19:52 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id E6AE242D13 for ; Tue, 7 Feb 2023 01:19:46 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id j1so7425187pjd.0 for ; Mon, 06 Feb 2023 16:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XpjjUg+XGIk8i8zqgDx2zb0AHCW+0KwDkb6IUa23Ft8=; b=WtQCicxNzJrXEc6e0sePislsNirUnOmI5J8shXiCVcGVzEsBqub/tRuU0hJTGgk2HO bU3FadFlCFe6yn+R29qfp86cHSZp37zeaXmooyQA1TnWwU1QaqQVJuI1QU2hTb7OtCqI pEMVRe5KDFRcLsSM+S8ort/L6ypNp2EYdt4EVkL5mfcnXrChlFXQumZ1jyAfIltxow9S O1TuXlapx+V4LyY10EoNMpdzfRPIq0Zj/OmFKASc7Tm0NKHNKUtOorRYTuZWqGmRF/0t 6g1bxkirRfp57XMKgb66WeXu+bbDRdOKtDzQHdXWBe24e1YqgNGFTEJ3Tdh64fwvF3RQ /fkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XpjjUg+XGIk8i8zqgDx2zb0AHCW+0KwDkb6IUa23Ft8=; b=3Fh9yKpcL0y+MMTmeBCZN+TUa+ZnuXvPK3cRRgOaDlHXyPXYSTat9e9na/QVt7eIub cp93bU9gP1WQwg12l9uKL7OI7QqtT56jZtPcNdioR9Cs07qY+4Hk8FOWRVkL2z3cOX5/ 7ghbe7NQ7oXx2oJgH1mj274QEEh6dCS2cUVBCM7phg/PUXerjLg1cOoPqk4AJBXBbuov rbX3+gPZP5KKD1RHAXAWuZG4Zij4iuh5fUsYO2zURE8pqo4A4pMF2koJLtU8PGYxhuUa e+fOtJFuADEMK37pDdLxMoUjIaUlVNp3hu6X1fMkzinX3Ttx6Oyz/v3v/du3B1H1l3oy ltXQ== X-Gm-Message-State: AO0yUKWR6dxRUmN8aVKOU19JvkP1zTVhlW+H9luMU3lcweEsdgJi6h5y g/S7LDZPaxKjF7K6GUQa9J0q8dl/plP2maL3LJ0= X-Google-Smtp-Source: AK7set+zQ8VrTYloAyBmZtIeYCPwMuAo4poMkvDkvvAmBruzYrrKxxJMLb3J+I34qAR7Unv//7YNyQ== X-Received: by 2002:a05:6a21:7893:b0:be:39b0:42de with SMTP id bf19-20020a056a21789300b000be39b042demr1432673pzc.20.1675729186182; Mon, 06 Feb 2023 16:19:46 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id o11-20020a637e4b000000b0046ff3634a78sm6617393pgn.71.2023.02.06.16.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 16:19:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Vladimir Medvedkin Subject: [PATCH v2 7/8] fib: enable on Windows Date: Mon, 6 Feb 2023 16:19:36 -0800 Message-Id: <20230207001937.875608-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207001937.875608-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230207001937.875608-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The FIB library builds on Windows as long as sys/queue.h is defined. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- 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 #include +#include #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 - 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 #include - -#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 #include +#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 #include #include +#include #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 - #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 #include #include +#include #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 - #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 # 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 #include +#include #include #include 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 #include +#include #include #include -- 2.39.1