From patchwork Thu Dec 1 01:44:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120388 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9182FA00C2; Thu, 1 Dec 2022 02:44:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3BB6410FB; Thu, 1 Dec 2022 02:44:45 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 6A87E4021D for ; Thu, 1 Dec 2022 02:44:44 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so496981pjo.3 for ; Wed, 30 Nov 2022 17:44:44 -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=bK0oJ7N/lHyCm4fE9GnbtiHFJR6AxJWrBGP4+zcqD1c=; b=Tb/dTsWdpZT6P35S2bt9xWhyjD5jnGXItarla/9vnjLcqwNTywlt+Eap6+FdOPf0X5 478wVra3angwruOdYFaUYFqh231pDAjc8kbF9FBz3seoX5e400c1ZSloJq0TSYKg/5Mj VI/JvfAV6OWQmc9kiVuyXaOSTDipaRMq0TTTdyU553x674gYk1srD9YYspnbjIm0oDyJ LH+3ok2GNSyg7Zfv60Im7P+8hKkWe3BWeZZZJvLi91KIb5JqlsCYsoE2EBYtT79DY1tO WC6yBAxj/AnVcqwbOumLTY8cuC28fgr6JimNmGeT6xBy60qnAyIuReGMxeJRlPfrVmwx AivA== 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=bK0oJ7N/lHyCm4fE9GnbtiHFJR6AxJWrBGP4+zcqD1c=; b=PuJfjFwf/l0mbEqc2a/Uda/Vx5Y4m4irUcb3Z3a+jNd0Z1Iy+a9pAsKXyLJp6/c6hs goPWYxOWMiDw2ddp9CXfWnLpuPcZvxIf8Y9sbbOYafG5EQCfK8alwzy9dvtea8+dmsiq kooObOay4I64PkwZFlrGs6vMe406X6yLnCVdqLZ/g5MZnN+WOMANfanjMjf4FkQ1OJS5 m2nGGP/Qy8mJu0eIbY0GepDXnEkeMb79NYw1UWsnma1NU1E/d8NYUGnA7DUuhsQQQeBw bxDw7IZzvQ81Ixengj6qpECeY2/g5ncG/vguPSj+nst7th2UIk9RmmxsAwFRlrDhth8Q Hoaw== X-Gm-Message-State: ANoB5pkrjUeOUdC7vOBQ8h0klkHWapVFp6i3p/ta/s5XBao6eOcr0uq5 G/x1YYyP5IKoch5DaZxVhePrfkbRkFsSDpBa X-Google-Smtp-Source: AA0mqf637AP14tE7tjtX/U6bJDdieNoeHCMDZLcHeNAxE9Y4bdii44RoNGkyH19BtWQOrgh9/e6+1g== X-Received: by 2002:a17:90b:3802:b0:213:48b2:123d with SMTP id mq2-20020a17090b380200b0021348b2123dmr72346686pjb.200.1669859083469; Wed, 30 Nov 2022 17:44:43 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:42 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tetsuya Mukawa Subject: [PATCH 1/8] net/null: build null PMD on Windows Date: Wed, 30 Nov 2022 17:44:32 -0800 Message-Id: <20221201014440.11896-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 Builds fine with current code, no changes needed. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- drivers/net/null/meson.build | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/null/meson.build b/drivers/net/null/meson.build index 4a483955a7a9..a51f8f5211b0 100644 --- a/drivers/net/null/meson.build +++ b/drivers/net/null/meson.build @@ -1,11 +1,5 @@ # 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_eth_null.c') pmd_supports_disable_iova_as_pa = true From patchwork Thu Dec 1 01:44:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120389 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2ED97A00C2; Thu, 1 Dec 2022 02:44:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90E3C42D17; Thu, 1 Dec 2022 02:44:46 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 44010410D1 for ; Thu, 1 Dec 2022 02:44:45 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id mv18so515285pjb.0 for ; Wed, 30 Nov 2022 17:44:45 -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=Z8tApTgUABXksSHZHzhO2jmo76VKpMuwFW3w/HO8KN4=; b=2heFXs3aWrRQB07Q/mcq21yPzUkZDwD//drUut5oyh400t8zgGDxM+ZbO8jEntadKQ Cq9Bv+5eDjkJ1Iy6NHq/I64LVIBiQbYIPdPV/BTKbhRf4jucfvIWcuYgLZI3EAMIqTpj 5heuNJ2PbTHKyNRL2Lo4YUikcXcJFt7K5HQw4RAhGItLEbZvSan86WmjkTPtRjxmt+TD YcEf4tbiT0s7X0WZoc0la5GDDeOGRhh8XuYkpY74RPkhEsrShitAgt8dEv9av/Nv9eg6 FSKSMI3lwMeygffzmND/QLSRHf6VzQifoSdyu25VxJlPSyYULX2Bmo7bZZp1kmBUKOnQ i8fg== 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=Z8tApTgUABXksSHZHzhO2jmo76VKpMuwFW3w/HO8KN4=; b=q2O2Z8lGUSTuvg05rn6/7XKSj3mAgAQhg6pX6h4atD2bnWyAaMft+AiYfPUsXacTQT tI8qpgtYPm658nGYplJupp9i2Nlp7oKxtnNTU3hDZ37FzBlccL7BT33LCCeL5cx9hgLe XQW0DS/+YbyoYZZz3c9/pTGNOyAp5EX5EQzPJWX7AJ2I7jjyFQ14gCagrvNHUUCe8rN7 c9jn7JUaKDV+I7uUi/gpK6NugkX9KlZSIBYJrEkNRR3/bkdlt6ksGC4+qOWwXp02coQy UpR2y45xje3jjX/PNtPgDXFFgdO8y6si7EeRromzL7z8YMh7vwpl/d8pdmiQiurM5n1W nr9w== X-Gm-Message-State: ANoB5pnbiE4dji/HleherKz1NRh3P8eYS1QFZ86gVpHGVkvHV8Vfc7x0 off19xmjQ6yjmgWfkFfSxhDZVRwSDWaiiqoS X-Google-Smtp-Source: AA0mqf6sHMMlRe3mYYpnl/83wIOdjVFm+G/D6ibEQKZkbXcUSb39Nnka1pzbaTRiDT8hTC1AmH4GTg== X-Received: by 2002:a17:903:2055:b0:189:a880:99b7 with SMTP id q21-20020a170903205500b00189a88099b7mr6241976pla.5.1669859084428; Wed, 30 Nov 2022 17:44:44 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:44 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson Subject: [PATCH 2/8] net/ring: build on Windows Date: Wed, 30 Nov 2022 17:44:33 -0800 Message-Id: <20221201014440.11896-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 This driver builds ok on windows, but need to modify the test meson build to skip the eventdev test on Windows. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- app/test/meson.build | 2 +- drivers/net/ring/meson.build | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index f34d19e3c3cb..a713f0382280 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -390,7 +390,7 @@ if dpdk_conf.has('RTE_NET_BOND') driver_test_names += 'link_bonding_mode4_autotest' endif endif -if dpdk_conf.has('RTE_NET_RING') +if dpdk_conf.has('RTE_LIB_EVENTDEV') and dpdk_conf.has('RTE_NET_RING') test_deps += 'net_ring' test_sources += 'test_pmd_ring_perf.c' test_sources += 'test_pmd_ring.c' diff --git a/drivers/net/ring/meson.build b/drivers/net/ring/meson.build index 72792e26b05a..3534a3cc2287 100644 --- a/drivers/net/ring/meson.build +++ b/drivers/net/ring/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_eth_ring.c') headers = files('rte_eth_ring.h') pmd_supports_disable_iova_as_pa = true From patchwork Thu Dec 1 01:44:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120390 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9933BA00C2; Thu, 1 Dec 2022 02:45:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 849AD42D1D; Thu, 1 Dec 2022 02:44:47 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 619DE42D11 for ; Thu, 1 Dec 2022 02:44:46 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id b13-20020a17090a5a0d00b0021906102d05so489783pjd.5 for ; Wed, 30 Nov 2022 17:44: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=NzalnrKZG97h2kZ/mOSJt/OFXq6bnWhNFztfZj6ds1A=; b=HbnY6CY8NAkvCcPnTaKUGCNMOkTQajfv4R/xFRQDNEi3HKJIiT3nrZ3dBud8qJOPxb 5CDcF56nxrz6/i/yrX532kK1uhzl0WKZ18oW2rvC3VfwZAcYtEOQLHr8ZZVQB1/BTNVB YzcTYINQ57Q0VYEVB7jgD+aMUx5wMeSAF3aYan0jtmc+I+/ovp4MbMc4IlEmJllR45r5 8CN7akqeEBoTI6Dx3e/zjEyimckROFm2g4pKLSWl0Xf05epNrDDnWzknLqpwD9Fkvxuj 7jmMFKB69WZoAMYfmCxzQdqWWFfhAMd+/PgL/WqHSwcyPz3MphJ//6PG0tjpbhjlYf70 XfOQ== 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=NzalnrKZG97h2kZ/mOSJt/OFXq6bnWhNFztfZj6ds1A=; b=ruVw3Lw/20j4jrFH3aVCeErs0dyejwI/F1CN6r81lIhKzs35n+hTHQ2Te3q++hMLYL I6BJJJmIPkUiW9VFWP5xLo5judtLjE37gg0kR9L4kauPZRU9ibP7ikZ2lbEkk+7LvgIl ElFfLWWWEk2eGPe5/z4p/a5YZUmJgEnxm1LKsdl1UZByuB2fiH+AMAKHWQpSDnvczy5H aLUl08FCL2kwNnPMar9d8wmCLRWgl8xetfRgipy484B3ynpG83LXLSuw+TBeMHN+mpBM RcbskPmK5BcmATijXDQ3t2m9UM6OglXKQFkO56J8d3tltPb0X2Q7frGabkO1Vtwi7H4f BRHg== X-Gm-Message-State: ANoB5plrg/Sisw1Qu54hcNHTC7lCAdPyHLqa3uY2td/OIodC/I+LjKvp B/UKJHlUiTiE5xhco6mjO6cpA97IVWeAkdYM X-Google-Smtp-Source: AA0mqf73JShCZRPwwNalEDC8AQCHz+XWqY0K0mevliG3+qP706EoqWZhH9vNJ5VMrScaqudBbgT98A== X-Received: by 2002:a17:90a:fe05:b0:219:29eb:bc4b with SMTP id ck5-20020a17090afe0500b0021929ebbc4bmr21719291pjb.199.1669859085346; Wed, 30 Nov 2022 17:44:45 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH 3/8] lpm: enable on Windows Date: Wed, 30 Nov 2022 17:44:34 -0800 Message-Id: <20221201014440.11896-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 This builds on Windows without changes. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- app/test/test_lpm.c | 15 +-------------- app/test/test_lpm6.c | 12 ------------ app/test/test_lpm6_data.h | 3 ++- app/test/test_lpm6_perf.c | 14 +------------- app/test/test_lpm_perf.c | 39 ++++++++++++--------------------------- lib/lpm/meson.build | 6 ------ 6 files changed, 16 insertions(+), 73 deletions(-) diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index bceb9ae743d7..37b460af3a96 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -2,18 +2,6 @@ * Copyright(c) 2010-2014 Intel Corporation */ -#include "test.h" - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_lpm(void) -{ - printf("lpm not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -#else - #include #include #include @@ -22,6 +10,7 @@ test_lpm(void) #include #include +#include "test.h" #include "test_xmmt_ops.h" #define TEST_LPM_ASSERT(cond) do { \ @@ -1595,6 +1584,4 @@ test_lpm(void) return global_status; } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(lpm_autotest, test_lpm); diff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c index 1f44392db739..b6b6f8615ea5 100644 --- a/app/test/test_lpm6.c +++ b/app/test/test_lpm6.c @@ -10,16 +10,6 @@ #include #include -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_lpm6(void) -{ - printf("lpm6 not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -#else - #include #include "test_lpm6_data.h" @@ -1803,6 +1793,4 @@ test_lpm6(void) return global_status; } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(lpm6_autotest, test_lpm6); diff --git a/app/test/test_lpm6_data.h b/app/test/test_lpm6_data.h index da9b161f20e5..3a1fa25f8433 100644 --- a/app/test/test_lpm6_data.h +++ b/app/test/test_lpm6_data.h @@ -6,6 +6,7 @@ #include #include +#include struct rules_tbl_entry { uint8_t ip[16]; @@ -1129,7 +1130,7 @@ static void generate_large_ips_table(int gen_expected_next_hop) for (i = 0; i < NUM_IPS_ENTRIES; i++) { for (j = 0; j < 16; j++) - large_ips_table[i].ip[j] = lrand48(); + large_ips_table[i].ip[j] = rte_rand(); } for (k = j = 0, i = 0; i < NUM_IPS_ENTRIES; i++) { diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c index aaf2773b6fac..5b684686a687 100644 --- a/app/test/test_lpm6_perf.c +++ b/app/test/test_lpm6_perf.c @@ -2,17 +2,6 @@ * Copyright(c) 2010-2014 Intel Corporation */ -#include "test.h" - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_lpm6_perf(void) -{ - printf("lpm6_perf not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -#else #include #include @@ -24,6 +13,7 @@ test_lpm6_perf(void) #include #include +#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT(cond) do { \ @@ -171,6 +161,4 @@ test_lpm6_perf(void) return 0; } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(lpm6_perf_autotest, test_lpm6_perf); diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c index e858716f909b..e72437ba3850 100644 --- a/app/test/test_lpm_perf.c +++ b/app/test/test_lpm_perf.c @@ -3,17 +3,6 @@ * Copyright(c) 2020 Arm Limited */ -#include "test.h" - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_lpm_perf(void) -{ - printf("lpm_perf not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -#else #include #include #include @@ -25,7 +14,9 @@ test_lpm_perf(void) #include #include #include +#include +#include "test.h" #include "test_xmmt_ops.h" struct rte_lpm *lpm; @@ -34,8 +25,9 @@ static volatile uint8_t writer_done; static volatile uint32_t thr_id; static uint64_t gwrite_cycles; static uint32_t num_writers; -/* LPM APIs are not thread safe, use mutex to provide thread safety */ -static pthread_mutex_t lpm_mutex = PTHREAD_MUTEX_INITIALIZER; + +/* LPM APIs are not thread safe, use spinlock */ +static rte_spinlock_t lpm_lock = RTE_SPINLOCK_INITIALIZER; /* Report quiescent state interval every 1024 lookups. Larger critical * sections in reader will result in writer polling multiple times. @@ -267,7 +259,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]; ptr_ldepth_rule = &large_ldepth_route_table[num_ldepth_route_entries]; for (k = 0; k < rule_num; k++) { @@ -296,7 +288,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)); @@ -452,8 +444,7 @@ test_lpm_rcu_qsbr_writer(void *arg) for (i = 0; i < RCU_ITERATIONS; i++) { /* Add all the entries */ for (j = si; j < ei; j++) { - if (num_writers > 1) - pthread_mutex_lock(&lpm_mutex); + rte_spinlock_lock(&lpm_lock); if (rte_lpm_add(lpm, large_ldepth_route_table[j].ip, large_ldepth_route_table[j].depth, next_hop_add) != 0) { @@ -461,22 +452,19 @@ test_lpm_rcu_qsbr_writer(void *arg) i, j); goto error; } - if (num_writers > 1) - pthread_mutex_unlock(&lpm_mutex); + rte_spinlock_unlock(&lpm_lock); } /* Delete all the entries */ for (j = si; j < ei; j++) { - if (num_writers > 1) - pthread_mutex_lock(&lpm_mutex); + rte_spinlock_lock(&lpm_lock); if (rte_lpm_delete(lpm, large_ldepth_route_table[j].ip, large_ldepth_route_table[j].depth) != 0) { printf("Failed to delete iteration %d, route# %d\n", i, j); goto error; } - if (num_writers > 1) - pthread_mutex_unlock(&lpm_mutex); + rte_spinlock_unlock(&lpm_lock); } } @@ -487,8 +475,7 @@ test_lpm_rcu_qsbr_writer(void *arg) return 0; error: - if (num_writers > 1) - pthread_mutex_unlock(&lpm_mutex); + rte_spinlock_unlock(&lpm_lock); return -1; } @@ -773,6 +760,4 @@ test_lpm_perf(void) return 0; } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(lpm_perf_autotest, test_lpm_perf); diff --git a/lib/lpm/meson.build b/lib/lpm/meson.build index 6b47361fcec0..4cd48886fc41 100644 --- a/lib/lpm/meson.build +++ b/lib/lpm/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_lpm.c', 'rte_lpm6.c') headers = files('rte_lpm.h', 'rte_lpm6.h') # since header files have different names, we can install all vector headers From patchwork Thu Dec 1 01:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120391 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 32B1BA00C2; Thu, 1 Dec 2022 02:45:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4F1242D2C; Thu, 1 Dec 2022 02:44:48 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 8BD7342D1F for ; Thu, 1 Dec 2022 02:44:47 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d18so216153pls.4 for ; Wed, 30 Nov 2022 17:44:47 -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=m2wPMSAaAhSqIOGhMIzPKFTL52e61nazMOBS/uAu934=; b=H3MTH2+f58sF2YMgMtbBsEkrzY2Q3GB8n2O3Oag0i55qOAr/p1bNLfv5a1Z2aupIgr NrPkqUOHSSDFzfvn/ufVV1WNVcFWP4OFYAQO/YYAG/3qJXIFQFriQJYvvPyumMntqeIG rq8+VtXbE3RcAq2jlxErkBsbFmFlBJnASW83L4vhmKvvsljOcfPe/kNNLwTluhFIbDdc rewYo6cQKM1F6lxL/JRnW67eo1//jmHOHASYYQcFCOpJJNtB2FEeWaFxyR20WGX8gQ96 DOs2us3okiZ75TDvY5WOr2Huu1/e8bfZ0TUjWXNXruEf3QFbcFYCYQOELUXibJ4nREbg MX6w== 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=m2wPMSAaAhSqIOGhMIzPKFTL52e61nazMOBS/uAu934=; b=7koTDk148iRr34P80yXJWsAMvVAWYWtvJ5/8qaWDT/eQOxsIWq6L8+ii3xGZt6WIgL RYbl0w6ahc1+jveNibXh0NTppJst/SUO/N6a72Jbb3OXnkrzMGKwgTgNWrMerlAZTMhq SkrVkS655SLPGpr4zoVw5qWgOwbp6jTnDG5FAAG2i/hxhLzcoBjkJoURYaZF/KX3gs0l Dqf0pos36neQgxpL92QhyZSkoBWsSUN9UBef9MLPM3Hnh+4SQqeJbcojAr9eaie4tYpj qq10zFRXVi+D9k6AUd+acH6KnTA6IIlx1m94jhr8gpeQy8DQCJJ/e9YTVkrVaxI15cqX h4eg== X-Gm-Message-State: ANoB5pklvQIpVLXSZfON2uBdBWObJ7E9317vE+73A8iS2C9ULQK90uLa So2z3fuAjn2iLxV4YLlDAPDMf8Y61yPwtdZ1 X-Google-Smtp-Source: AA0mqf4qa8vCs9XC8FJSBHXwbb36/C7uUBFCBgHEwXlohw2RRTVUz1lQYhOd7MWFxdm/jNnJz4t3yg== X-Received: by 2002:a17:90b:4a46:b0:218:bdfa:1ef with SMTP id lb6-20020a17090b4a4600b00218bdfa01efmr48454231pjb.100.1669859086426; Wed, 30 Nov 2022 17:44:46 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Reshma Pattan Subject: [PATCH 4/8] reorder: build on Windows Date: Wed, 30 Nov 2022 17:44:35 -0800 Message-Id: <20221201014440.11896-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 This builds on Windows if sys/queue.h is included. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- app/test/test_reorder.c | 11 ----------- lib/reorder/meson.build | 6 ------ lib/reorder/rte_reorder.c | 1 + 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c index f0714a5c18a3..9ebd91477536 100644 --- a/app/test/test_reorder.c +++ b/app/test/test_reorder.c @@ -11,16 +11,6 @@ #include #include #include - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_reorder(void) -{ - printf("reorder not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} -#else - #include #include #include @@ -395,6 +385,5 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } -#endif /* !RTE_EXEC_ENV_WINDOWS */ REGISTER_TEST_COMMAND(reorder_autotest, test_reorder); diff --git a/lib/reorder/meson.build b/lib/reorder/meson.build index 621c1f350103..03aed53d9007 100644 --- a/lib/reorder/meson.build +++ b/lib/reorder/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_reorder.c') headers = files('rte_reorder.h') deps += ['mbuf'] diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c index 385ee479da42..00e2cf043e04 100644 --- a/lib/reorder/rte_reorder.c +++ b/lib/reorder/rte_reorder.c @@ -3,6 +3,7 @@ */ #include +#include #include #include From patchwork Thu Dec 1 01:44:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120392 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 952E6A00C2; Thu, 1 Dec 2022 02:45:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBA4C42D31; Thu, 1 Dec 2022 02:44:49 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 3725B410DC for ; Thu, 1 Dec 2022 02:44:48 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id mv18so515374pjb.0 for ; Wed, 30 Nov 2022 17:44:48 -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=+2PM1iTUkud1H+xo+a+WWokIIUeQGXc/jUtpofXLkVw=; b=teER8rq/UtvthaWpJLjcIRk9nLLL4iCmZMiAc0pbsRQW54S+3Y8pY3iq8qlrxranlM eYzVi7Aaq7nRQF2/k+Mcl3nNDk2ab95moO9XVPiKVttZCe++/XstmU/3DJaG/2BppHOp JCXjS1u6swyvxcWFnhP0BlCSj6MvkqAAjGCXgG6gQdOncA6jl+ml5cqd6hVcHY3ViSHj HaGNv/ju+OaFyJFenq2BIkiznNe3qq1NhEBdV8RRD1suuNzXjdBNIFftZr3kpSaBEnsK IZmeVAW+yMxYfPV1gzSL4YBbvVWWybT7SyYm/4rM1ZV2dj6Q2aikXM17W+EM6c+Szg6Y zdig== 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=+2PM1iTUkud1H+xo+a+WWokIIUeQGXc/jUtpofXLkVw=; b=3q08JSmO5O1qs6V4823g+HT+F9cY0HYjY4nsMVUuFeLjweX/7CN3AaTB3L+lxefZMs 0bEmTKHJJgNNMPB3EzR0az0k/ANuO+mt0SSUpINUD47mZ7pAD82efuuJw69vwyoTCRw+ gfuq0woYE3ZDWmdLOBIp38KptDCk1CmIv8BnraCVbG7OBVKRHbG4quYCCbd2qHbvqcDs ZGs8YDVHWvoD4Msbscrs1ysvRVTVb9bKG2mVff0gns1CulzZ6KrVoqU6/8GO/cUgzvjS jKSaVLrn/RAsjdc8N81jRBc17oW68dG2LvZjYzhCkGybZAa9EkwwJ8t6YWIMwyTBFhGk IEzw== X-Gm-Message-State: ANoB5pkg3AGz8upntYullVrBylrSegUk3zYo2evyXDGoUs5nxcUfP2Zv PtFHq2tqffb4DYOGBYieR8oG5s8lFm140k4v X-Google-Smtp-Source: AA0mqf7jDkEx39EhaFawneQfl10ZAJ+CVC41ZEJfTtvh09NuMuVaxAPsC3rn+hCnSYBhdL1AtNLYXg== X-Received: by 2002:a17:90b:507:b0:213:7030:f6c1 with SMTP id r7-20020a17090b050700b002137030f6c1mr72210172pjz.184.1669859087528; Wed, 30 Nov 2022 17:44:47 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:47 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH 5/8] ip_frag: enable build on Windows Date: Wed, 30 Nov 2022 17:44:36 -0800 Message-Id: <20221201014440.11896-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 This build works on Windows if sys/queue.h is included. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- 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(-) 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 #include #include - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_ipfrag(void) -{ - printf("ipfrag not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -#else - #include #include #include @@ -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 + /* 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', From patchwork Thu Dec 1 01:44:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120393 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C93FEA00C2; Thu, 1 Dec 2022 02:45:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D090A42D38; Thu, 1 Dec 2022 02:44:50 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 96AAB42D30 for ; Thu, 1 Dec 2022 02:44:49 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id q17-20020a17090aa01100b002194cba32e9so3780330pjp.1 for ; Wed, 30 Nov 2022 17:44:49 -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=HsymL2NRTdS11wClSJDvXnUdG1fbfU0UCnvx/TYgs8c=; b=Q2forgNoWSUG+xWMrtk9Feocxf5xpHZXza8f9KvFNfYmY8tSz1VIUUSPOXeAI3/pro vNxYnOvLSsT7y0FZ+WgTE5Uk7xtksS2FrPwB27RgyX217nvbTkspxkh6pnGLB+GlPaml HxVRttW+Zl6G46FoTe+IdFpVk81bWSvfqHePKM2gGXkTGc+HTWK7pWjSpL+bZP9btKia E1347Zug0mVM6fhkKviwa/pth3qyWbGpuMZ+pzAc3kV/re1KXspgKW9FhSEh9hwqxuCT PjvKLKrCw2Sdzwt5C69l1wMzq26P9gK3UrJJw8NGEHjWoibmLMpgDFcHFCvIbpBxZWQ5 n8Hw== 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=HsymL2NRTdS11wClSJDvXnUdG1fbfU0UCnvx/TYgs8c=; b=iis3CpHxX6fkETxRhaOgNEJd1EPZm4E23baCRfDWWnhn8PxpLYvEbLouRIIZYsBob+ UB6/5HFVp0KpS6RtPbF+tjcfII7bCEpTEhGG5P9IxbKdRZTjhJH8G/tcPXszTT4zSE3J nM1eKn72VZg3x0o8S3y72vuQ7Y81pX0bnaO5hXEvJkqPu/0QIM/qxcC4wOK0DUoNAGH0 Ka+vGsCNqde4TMmRIJPnyAkuiXEyE6JXTdfroeWhVnUMGV+UOazKVwoEc30FaCHRWH/3 vQ+lwCpa32wSoVdxj1Hery1OWYTKlZMoLR6yg2KNaet9VlXnYlAhCX7CRX3HnlSLBU4x i9GQ== X-Gm-Message-State: ANoB5pnUnz2/yenuYx00sb7AdJbgSo0gssj9RUPiUv5kee2aU/FlOicA KPqeat6P31g4J0DyCMDCR8pQEHEcPthBg308 X-Google-Smtp-Source: AA0mqf7oTihVFL/6lhWCYZrT0ptr5S70Clt4yRgg0lhVZruSfxstkjwIsOHTBLuJ0pfgCJFuxMQmUQ== X-Received: by 2002:a17:90b:3012:b0:219:63d9:516c with SMTP id hg18-20020a17090b301200b0021963d9516cmr6105619pjb.108.1669859088567; Wed, 30 Nov 2022 17:44:48 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin Subject: [PATCH 6/8] rib: enable on Windows Date: Wed, 30 Nov 2022 17:44:37 -0800 Message-Id: <20221201014440.11896-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 RIB library builds on Windows as long as sys/queue.h is included Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- app/test/test_rib.c | 19 ------------------- app/test/test_rib6.c | 24 ++---------------------- lib/rib/meson.build | 6 ------ lib/rib/rte_rib.c | 1 + lib/rib/rte_rib6.c | 1 + 5 files changed, 4 insertions(+), 47 deletions(-) diff --git a/app/test/test_rib.c b/app/test/test_rib.c index 06058f8f7c52..65b685641094 100644 --- a/app/test/test_rib.c +++ b/app/test/test_rib.c @@ -10,23 +10,6 @@ #include #include - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_rib(void) -{ - printf("rib not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -static int -test_slow_rib(void) -{ - printf("slow_rib not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} -#else - #include typedef int32_t (*rte_rib_test)(void); @@ -380,7 +363,5 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(rib_autotest, test_rib); REGISTER_TEST_COMMAND(rib_slow_autotest, test_slow_rib); diff --git a/app/test/test_rib6.c b/app/test/test_rib6.c index ba79aedea5f7..336b779d2e1e 100644 --- a/app/test/test_rib6.c +++ b/app/test/test_rib6.c @@ -3,32 +3,14 @@ * Copyright(c) 2019 Intel Corporation */ -#include "test.h" - #include #include #include - #include - -#ifdef RTE_EXEC_ENV_WINDOWS -static int -test_rib6(void) -{ - printf("rib6 not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} - -static int -test_slow_rib6(void) -{ - printf("slow_rib6 not supported on Windows, skipping test\n"); - return TEST_SKIPPED; -} -#else - #include +#include "test.h" + typedef int32_t (*rte_rib6_test)(void); static int32_t test_create_invalid(void); @@ -385,7 +367,5 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } -#endif /* !RTE_EXEC_ENV_WINDOWS */ - REGISTER_TEST_COMMAND(rib6_autotest, test_rib6); REGISTER_TEST_COMMAND(rib6_slow_autotest, test_slow_rib6); diff --git a/lib/rib/meson.build b/lib/rib/meson.build index bda7f576e976..7bacbb453592 100644 --- a/lib/rib/meson.build +++ b/lib/rib/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_rib.c', 'rte_rib6.c') headers = files('rte_rib.h', 'rte_rib6.h') deps += ['mempool'] diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index b0794edf66f5..812a2597d117 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index 19e4ff97c479..ae44281ae105 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -5,6 +5,7 @@ #include #include +#include #include #include From patchwork Thu Dec 1 01:44:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120394 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 34213A00C2; Thu, 1 Dec 2022 02:45:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE0C442D3C; Thu, 1 Dec 2022 02:44:51 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 2DE7542D35 for ; Thu, 1 Dec 2022 02:44:50 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d18so216244pls.4 for ; Wed, 30 Nov 2022 17:44:50 -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=5ilFhOxWp+/X5KKNGuDUG48ZbUGDR7imX4UDj5cSddk=; b=wW9TWs6uy6v5JdXHYDuAG31nMdCQVUPw1cpOl28uevRWXpQWkNGQvfDVGj87C3qaj0 mul3cKrf37tn7i7tuWcv2M34wYCrx00cyM67WhRV93+L1qURJogXgN6pedCkbUT87FLG JESaAimeu9CqP6zQ6ig78/DIvyjyr1qRXAL+hJVTw1HHr7/vVoaAnaj73ldfHioYb06E Db5JduR7+OI4iX0u8OUglBWBiRySJfMarmb/4gGRFYCWplwAtwrmv6yIY0wiRNIbbmdX 3DMrmpFp9KT4fdxES8GsthVxYPKvj4STNuGb+u0TogBJ0t1hyk/yozxcYixkmMYAO56g ntow== 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=5ilFhOxWp+/X5KKNGuDUG48ZbUGDR7imX4UDj5cSddk=; b=Jex+XukiiDaXmAZjyoCyUTnVbJKQYTOvuFF/aPdpOvCWDJ8KdUye+gtajtSqt5J/tx g27yGNbq0O/iqzVXKKtbXj+d0L/foF0ndHnCl3cRQggRGdiTiP6S6y0o91A67Cuv7Vef JbVDgdpewazEdcUvUN1a4RfiJmqtKNxPYQccnDwfnvX1aHOi7rSgwYAdRmG3qnHES3Uc J+oUhg8dli3OJsYcl4E2Jg3Xd8/3K7w+n3aXp8SRIX8ngjZZa4Jz0ZI7FWiG9lhwvkva /xGTEOrRRyZc2502TCWajMijwlDj6gzxKIwefgNoCLwam0TGxVMsTGoTshDhDV3bWGIf /poQ== X-Gm-Message-State: ANoB5pmi6nWQj+SPm7/aLI8XWBi7BqACZFFWAJzCECUKly1Ugqu6Ssc5 2Iky3huryaRR4CBVn9jkCuMz8FNclYCYEV11 X-Google-Smtp-Source: AA0mqf6crkCTiPQqNlTGMDqaQnWGbq5oBJST/iBD11Kpf5d2iL+g00C/mUpITSY5Vl0kCjmSn8WGHw== X-Received: by 2002:a17:902:c755:b0:189:58a8:862c with SMTP id q21-20020a170902c75500b0018958a8862cmr34755835plq.163.1669859089492; Wed, 30 Nov 2022 17:44:49 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin Subject: [PATCH 7/8] fib: enable on Windows Date: Wed, 30 Nov 2022 17:44:38 -0800 Message-Id: <20221201014440.11896-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 From patchwork Thu Dec 1 01:44:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 120395 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD35DA00C2; Thu, 1 Dec 2022 02:45:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C270242D3E; Thu, 1 Dec 2022 02:44:53 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 4B8D242D40 for ; Thu, 1 Dec 2022 02:44:51 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id w23so186190ply.12 for ; Wed, 30 Nov 2022 17:44:51 -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=vtPX6DEkBCCFh34jQLV2HQHEx3KM8jJIiQBAm4AxeF0=; b=7yndYfM7CYQuy1nQwjVEQbXc2amGHk0ils7F/R2lTuON4yTe4RHQAcfg2WjVfIRxLj KPZYec1DgOBTSKISEqVIuiDXhn4X6Vj3/JeSZCYBJhKqwKXSbj72i87uGpyR1N+5lTcT TI+bACaFBLdRyGHln4LXXRh11P/ybvSTbNlpsXDn68pD+9FYYAG706i0/XZ+I40hA6iy 1GBBtiUKSuoZVUPfs5ix34diM/EKVYKA3jUgE7dtj8RIhVK06vHjuDZhLQv4PcZqAYcn IKeWD7SfR5WpMNhvp/W/FnhxwF/5RnH/NswgxBc5lHQejE2UDxzggXEoQcidlGw5MtZi AK/A== 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=vtPX6DEkBCCFh34jQLV2HQHEx3KM8jJIiQBAm4AxeF0=; b=dPgxxGF8RWseLvkKussGjucO2WbH+xU3PMp1KR4gkshuX2GiFBbDUsiqdYNQu0gBq8 5tgpxWWYjVl3uh78cs8D+hse0aMaG8nO10XgUKxaNrwasrqrS0tJMKPGXinv18AZlRoJ DH9MGNLQHAJI1jcaT5rIx3nwMOtdWSGnzAvc6OvEYqVckBvOBpS3CkTZ8tyIdlWbs+dY +gUocnBacmRSrAxUsaZM/mAn50yjcg0cYQHjVcj66o3FOe3hjfNN+qszaZSy63zVGC1I 0ye7ONXb1560gefHGYPWRui/h2aRlBxAUS+If0b0bUlurMsJiRcD4SSsBRazsAvIr6qO VRGw== X-Gm-Message-State: ANoB5plH1L60cWTmbydG5pInsQY7SDQULIjf3XVFSOrALOGsyWSaQfBl iWCeaOgEDuJdZGS3Eg3fqORtrT5lYfaqoNH5 X-Google-Smtp-Source: AA0mqf7kUd7jz8qPESOXQNZ6iGH6seBqnwWpKHfPdgKBKfGPKNbtPCMfrjRcEbzSlll90RmlU9Xhuw== X-Received: by 2002:a17:90b:258:b0:219:396f:8a09 with SMTP id fz24-20020a17090b025800b00219396f8a09mr17747550pjb.20.1669859090446; Wed, 30 Nov 2022 17:44:50 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h14-20020a170902680e00b00186ffe62502sm2125014plk.254.2022.11.30.17.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 17:44:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Reshma Pattan Subject: [PATCH 8/8] pcapng: windows compatability Date: Wed, 30 Nov 2022 17:44:39 -0800 Message-Id: <20221201014440.11896-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221201014440.11896-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> MIME-Version: 1.0 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 Allow building on Windows, need to provide some compatability wrappers for writev() and if_nametoindex. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- lib/pcapng/meson.build | 6 ----- lib/pcapng/rte_pcapng.c | 59 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build index da938bbcb733..4549925d41b6 100644 --- a/lib/pcapng/meson.build +++ b/lib/pcapng/meson.build @@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Microsoft Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - sources = files('rte_pcapng.c') headers = files('rte_pcapng.h') diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index 80d08e1a3bde..888f8b84cd97 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -3,15 +3,18 @@ */ #include -#include #include #include #include #include -#include #include #include +#ifndef RTE_EXEC_ENV_WINDOWS +#include +#include +#endif + #include #include #include @@ -20,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +48,57 @@ static struct pcapng_time { struct rte_reciprocal_u64 tsc_hz_inverse; } pcapng_time; + +#ifdef RTE_EXEC_ENV_WINDOWS +/* + * Windows does not have writev() call. + * Emulate this by copying to a new buffer. + * The copy is necessary since pcapng needs to be thread-safe + * and do atomic write operations. + */ + +#define IOV_MAX 128 +struct iovec { + void *iov_base; + size_t iov_len; +}; + +static ssize_t writev(int fd, const struct iovec *iov, int iovcnt) +{ + size_t bytes = 0; + uint8_t *ptr; + void *tmp_buf; + ssize_t ret; + int i; + + for (i = 0; i < iovcnt; i++) + bytes += iov[i].iov_len; + + if (unlikely(bytes == 0)) + return 0; + + tmp_buf = malloc(bytes); + if (unlikely(tmp_buf == NULL)) { + errno = ENOMEM; + return -1; + } + + ptr = tmp_buf; + for (i = 0; i < iovcnt; i++) { + rte_memcpy(ptr, iov[i].iov_base, iov[i].iov_len); + ptr += iov[i].iov_len; + } + + ret = write(fd, tmp_buf, bytes); + free(tmp_buf); + return ret; +} + +#define IF_NAMESIZE 16 +/* compatiablity wrapper because name is optional */ +#define if_indextoname(ifindex, ifname) NULL +#endif + static inline void pcapng_init(void) {