From patchwork Thu Mar 9 21:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124914 X-Patchwork-Delegate: david.marchand@redhat.com 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 0553F41E23; Thu, 9 Mar 2023 22:31:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 125CA4113C; Thu, 9 Mar 2023 22:31:34 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 73C9040695 for ; Thu, 9 Mar 2023 22:31:32 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id u5so3441001plq.7 for ; Thu, 09 Mar 2023 13:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397491; 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=AkwR5r2FDOohf1KXTmazmGxq9xM8o6NS2mS+x72wx4k=; b=BYQCGL7HWOtqDeuAXAmI9/ka+LU11RgqjjtwMIhYaH9Yn+o4hY5vjSVf/4FGqAUHQo Bu3uLOVkP7dkwUelwYxo4k+zrbKWJ+Cx5eyZwpyFLHyro1xqAAbQwuD+upS5zkqozMEd t4yNJQuggS7sFem12eCmllkdO0zCF82UEMgWyA7y5FAJ8a0Z5cyhWUT5itnvqaHQYwDR ERjQ1H5p8ePnuqU1lEbuakOhwcrO9k4S1xkQLLoYbCQrkkoviE31lFrBBZRZzEuDb5JS sjDbxJNUBJdKVVIFZG66LeOGvJYu4SYWpoGrVZfl23a+3oynvGITXi+lsoUk9iMPps70 j1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397491; 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=AkwR5r2FDOohf1KXTmazmGxq9xM8o6NS2mS+x72wx4k=; b=U/PlQ1IsdjMDyYR3gWXpJmb8goOt7e6VfAG44FVGAhW33UBBcq4ppld+7t7FSZRKWG TJ+nKBWHNUT1+k3CRvYcdQcicS5uaXnG3i4buvo/UXZHji6jCYqWHhGpJSyNXP82r4bs 0fSRRUYZ2BOGyW4tauLx4dpKyBKKDfAifwkvGN3Whc8CxPCzdp0Kr1k1XNLxJm6xKl24 NWFppZjzA7s0r6nhuFVbISqlHtZVhHW1MIaFpMeK4rHuvdJL/gffFeZOu14fFGBs2a2a cfiPa5/NbcfxFCBi3dbCz3V7K5BC09WI5UhGiVvYFl3FCToEpsW2/AE38S6YEdlxUC+b LwbQ== X-Gm-Message-State: AO0yUKWYczlMZbkCeWlU3foUiOj6Z3ntVOFqIRQQlhduNWkmb1nW5IvJ YNjga312WRD5FHzQ878hrJNXiwVyciyRagBkDpbOPA== X-Google-Smtp-Source: AK7set+xm4ja/wLO0qm+Nq+upljI8tViJhQF/U4X8zcBW0QPm1bzMfjIk+qWlJvTyXR7a7VEYYZe9g== X-Received: by 2002:a17:90b:314b:b0:232:cdb6:c4ad with SMTP id ip11-20020a17090b314b00b00232cdb6c4admr23990967pjb.0.1678397491349; Thu, 09 Mar 2023 13:31:31 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 1/9] net/null: build null PMD on Windows Date: Thu, 9 Mar 2023 13:31:20 -0800 Message-Id: <20230309213128.34146-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 Mar 9 21:31:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124915 X-Patchwork-Delegate: david.marchand@redhat.com 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 4D0FE41E23; Thu, 9 Mar 2023 22:31:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3220C41149; Thu, 9 Mar 2023 22:31:35 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 5F6E3410EE for ; Thu, 9 Mar 2023 22:31:33 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id h11-20020a17090a2ecb00b00237c740335cso3196742pjs.3 for ; Thu, 09 Mar 2023 13:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397492; 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=NhrZ+VhDHiXiSSR1Uk//MLVLNkzGgUFaHv+b3V7eLNw=; b=f9fd3n+FIUIhf2wmyNBfSJacHpaCQoH8q5YdU7mO+d+fMqh469C+aEQjQUDk1E6j+6 277/7lWXTePS7AThA+WE524gos46v7DWyrUX7EcMZERJ+k1AwG59mWpRdL97dxr3bbgu rGGNIyXL9Shnzq+PUzvVuJX/OCqZfHu82ZnO27p5Dciz2NzogYOZenC+X7NdPFx2TvEv cvExS2VQmrekEJLeeVtkREgwSrkVGLCl4y4cIurUBcoCc2ZlsxbvabWbFJT2H/6Z66DB GVRdzlkKBsPRmdCIf7J3ElTsqulgd2yuNgHvNkuXkkIzE+k/H9XPyMlK6uOByljSUz+i 4M3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397492; 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=NhrZ+VhDHiXiSSR1Uk//MLVLNkzGgUFaHv+b3V7eLNw=; b=K611NRWkcq/GSo3n3thniHPwOrO4ti8QvlOBIQSlbt+YR+NT07uhbG8GZnGCDb6TMR ZwRcjG5Hqqhex5NkGdT2hdLYmUhfuwPaGskeA2iyMqN2itR1uY7OIylvkxs4shpk16eo TDS76lMQ3VFaHDO1vADG8XCEIMVPrBu0Fn3AywlSMCvaZh2HYHiNuXAy/QXa1J5rNKeN TjQ4XqZ7gZkvYe3hMVEjpZP+jy3BlzjreK3xhivlxRaFaj/xTLSFDj+VM80fSCbT3zVP 3kYQgjOejgm94rqDi5N5VhW8KoWAwnjYTXGQxstD3Bg2qX/d0qoV2Y6IjFEVux3B+7++ WREA== X-Gm-Message-State: AO0yUKUEglKYzBWAfaIcd5BY1a/h4rRHp5O2RdbhBcROP/B9eqTuzFkW QK+S/5re72U7HE42rmJEpyzYJj5OEbFaQG1F6mptnw== X-Google-Smtp-Source: AK7set9eWiMuta1dsLCBJhhuivp0pGXpIM7v40BV0XMKWnyo8w8s1gvmQaq2se9P0mQzzydMecbCWQ== X-Received: by 2002:a05:6a20:8e07:b0:cd:d13:8a6e with SMTP id y7-20020a056a208e0700b000cd0d138a6emr27908254pzj.21.1678397492262; Thu, 09 Mar 2023 13:31:32 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:31 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 2/9] net/ring: build on Windows Date: Thu, 9 Mar 2023 13:31:21 -0800 Message-Id: <20230309213128.34146-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 command line arguments are stored in node_action_pair and the name[] was sized to PATH_MAX which does not exist on Windows. Since the name is either "CREATE" or "ATTACH" it is not related to PATH_MAX (4096). With this fix 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 ------ drivers/net/ring/rte_eth_ring.c | 3 ++- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 2db5ccf4ff93..5d788148780c 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -391,7 +391,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 diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index bd5a47dd9017..564d6a726403 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -17,6 +17,7 @@ #define ETH_RING_NUMA_NODE_ACTION_ARG "nodeaction" #define ETH_RING_ACTION_CREATE "CREATE" #define ETH_RING_ACTION_ATTACH "ATTACH" +#define ETH_RING_ACTION_MAX_LEN 8 /* CREATE | ACTION */ #define ETH_RING_INTERNAL_ARG "internal" #define ETH_RING_INTERNAL_ARG_MAX_LEN 19 /* "0x..16chars..\0" */ @@ -539,7 +540,7 @@ eth_dev_ring_create(const char *name, } struct node_action_pair { - char name[PATH_MAX]; + char name[ETH_RING_ACTION_MAX_LEN]; unsigned int node; enum dev_action action; }; From patchwork Thu Mar 9 21:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124916 X-Patchwork-Delegate: david.marchand@redhat.com 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 501DB41E23; Thu, 9 Mar 2023 22:31:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CA8C427E9; Thu, 9 Mar 2023 22:31:37 +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 4BFB241140 for ; Thu, 9 Mar 2023 22:31:34 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id y2so3355624pjg.3 for ; Thu, 09 Mar 2023 13:31:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397493; 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=ax5mZInRB4fc1yOT3KLLkfHkCQkB6zmILq1uP29xQS0=; b=GuCU8yZlQDED8xab6zW5Vx8PbQkApf1Vnmk8H+2n6bQnpqTsawWUbWO718/CPdnL+X qzZx2MBjmS6kaZjra+6FjfzGb0Ump3RxjRoJcjZtkDk1h+GJAVyLAsBBijEY9zWUw3Gp 5+5MvVz/0U3VT9tp7GEfB1lSvGFgfHy7r/f24JSAp2KDCR0W28RCvulThGmXjpoZXFo/ sqFmQcBQYCXjGG0fU31XfmPCM4jRd+LXEt9UKbb10CbzPYxnqmHSlJSmaXECZYGjdTWl mzn1cOwwq8ORRTWlRYRuqWOfeWH+PvcyMGNtfPgRx+XsRZFW1a2U38APSXWED+SoXkKi o8rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397493; 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=ax5mZInRB4fc1yOT3KLLkfHkCQkB6zmILq1uP29xQS0=; b=04jzh3HoSLUaHy2jp32GWbDxi8+H1xZamCWBiAgIKjOTfrPHPsVasGRrio2omi+ViJ EU11EmwernXGvGluWq03gfKf0PqitfzHatzxUJqyaxM8Lo9Wnck7ED/gPHdMPkDLcg1P GVWsSCmQup9HX/vWnaOwxJN6pomD3QveeQLyGR67F4ilCT0rUngdAlh94EbYzejRNkSq qp4rX5vhLdwaLmGzEWr/l5MgEkTEHQ/M/sYEumMJ97JzuGz+VVo7DQ5sUJpPy3Tmwjux Tb7g9IsNKNBa5kB5Pp3sdVnL5jSv45DTG2Mez6BuyiOC6klQGKxhm/LRTW57gaWiSKP1 SDZw== X-Gm-Message-State: AO0yUKUGVV3o+ho84lCyEVk8D5OuFtshj7ELhek3ZKU5Zx4Iwqu2RYww +2g/IA+jBzY2bqt2CspIO8BMmhXrKCU0QMzPM3I8gg== X-Google-Smtp-Source: AK7set+GECYX71U8To4CqaHT/eeZBBuAgDHO+Osko4FBcn7vxK+rxxL+iQ9O1fn9fny9Cy75jOmCkg== X-Received: by 2002:a17:903:41c6:b0:19d:181f:511 with SMTP id u6-20020a17090341c600b0019d181f0511mr27479487ple.30.1678397493132; Thu, 09 Mar 2023 13:31:33 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 3/9] lpm: enable on Windows Date: Thu, 9 Mar 2023 13:31:22 -0800 Message-Id: <20230309213128.34146-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 Mar 9 21:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124917 X-Patchwork-Delegate: david.marchand@redhat.com 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 1203441E23; Thu, 9 Mar 2023 22:31:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3525942B8E; Thu, 9 Mar 2023 22:31:38 +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 35C184114B for ; Thu, 9 Mar 2023 22:31:35 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id v11so3435089plz.8 for ; Thu, 09 Mar 2023 13:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397494; 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=4yMezFaBr8eQRUu+h200FOJGM7bDTZB/VOiX+GPdUb8=; b=RBiuY3AiLqdxEf/BRl7rMWNiblwTGa5ULpYlsLRckxcn3FmXpA+7u/PYNAfzsHS2dS FeJ6z2YtJ1vUAZQJj986MwQx4jqTdyYD3X2FF42b6/EnhOBEKd+1VbtVuoJACtJ+FxqW 6XJl/l1K13u+ZM+e6G/UJ0SbOUNuNT3l8iYz12vNe1ovjKWj/EWccfWn51VqAJyg5RTB Tk0Z/scRTsWTlVX0DDhyWqmI5+Zs+aQTV0JZitHn+D9+DuIL7QyDhavKdaqhxqjIdECc agzz3rRxIlEeIbx4xmqGtw01tM0ryhZNVLbRHaK9TUqGarUqHqG5V6V9+neZKtIvykep rZ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397494; 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=4yMezFaBr8eQRUu+h200FOJGM7bDTZB/VOiX+GPdUb8=; b=IkTPuQ8ourRXXZ/iBssDrsVd4WMgORLAC6uc8VxYOA9aMwboiqos4Iz0iBrOxAuJuG 9U2/jWHjAMo+3xfMMRCzaclYDA8sRqlrH3uJYfD080b3bkyA6K69V2NIHj9ncPx4S/UA mGag4MnlBR8TJbM6bHmKiqAvJd0k/b41BHGNCzPavkjxyKHFs7ZrljIV8xs1AmThTE0d QyXdAm/3+ToP95P4InpkGxBO7ia2OGpygLRTRZlS4xZpoUaJCw6L6bT6XAqn8kArg8sr utu7LVaFckXWE1QQ24qlh1PoRDf4sgdRI8b8bQDS7s/rtplKo+gU+ZwrrD3kqi9ILoeD TSEw== X-Gm-Message-State: AO0yUKVOopj63Bq5PHRaD50vGww9zVLW5CB8x0MvLzCgCF8VxHQ8tDHE ylO2VxYi422ZUYjTdSaRsKsRddXHA7W2Qm/g12bJ1A== X-Google-Smtp-Source: AK7set8fLWXygwVS6USJOKlMDGe81cjx8wiIeie34ALGRnVLdULMnhzW9PD/1hFcQQ4e/2cYki7WNA== X-Received: by 2002:a17:902:8a90:b0:19b:33c0:4097 with SMTP id p16-20020a1709028a9000b0019b33c04097mr20473700plo.27.1678397494129; Thu, 09 Mar 2023 13:31:34 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 4/9] reorder: build on Windows Date: Thu, 9 Mar 2023 13:31:23 -0800 Message-Id: <20230309213128.34146-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 f391597a7836..39e48c3df1fa 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 @@ -557,6 +547,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 6e029c9e02fd..9026403ea675 100644 --- a/lib/reorder/rte_reorder.c +++ b/lib/reorder/rte_reorder.c @@ -3,6 +3,7 @@ */ #include +#include #include #include From patchwork Thu Mar 9 21:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124918 X-Patchwork-Delegate: david.marchand@redhat.com 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 A6E2D41E23; Thu, 9 Mar 2023 22:32:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35BB642C24; Thu, 9 Mar 2023 22:31:39 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 1228C41611 for ; Thu, 9 Mar 2023 22:31:36 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id i3so3448578plg.6 for ; Thu, 09 Mar 2023 13:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397495; 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=v/dt36NPWWZZ4AlnDFouurL11CojFt/zfwF15tmsEHY=; b=EPes2OcRmR5A9zrPV4VXyvwX0YEF1D9WXAiMXa0y0Xb8XIyfV7eCQGrjzYV6WHl0NN yVh8LiXtFLEulIT3rbhu6sqxgWaoxuhisxRLxhkOpADWR/ishyB0JhnWaMOcPjCYcVId lQm87CDZ6ZEU4Nn7le14XANmgdRKz/TQ9PlrHULnliUrFPIUIOw2cfq3ZfB1UpRSknko RwFQlT5pzeQ2oCLSOfkYgCbbadIlG7sWLqA4Bqo51Wrxx/Lq0th8R3C0vWUxpjNb58G2 reBcLfY+8Dh4nQSwiFnTfJBhYcNHFyz/nOIEwsYv0v68SrKx5QplnG0K0ly5F0KTHJpy xNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397495; 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=v/dt36NPWWZZ4AlnDFouurL11CojFt/zfwF15tmsEHY=; b=BQbOdFqlw5ELYvEVSerjP/j/Os7EX5JiHQMrATysuzuBlmphVyZl7HPiBy0iwMUSAB qI7uTIvYl0Ydwl5e/hsyxVzpnFsBS7pZtIU2wLAwK0sI+yaRAIhQlAbVRbYW49UQCvRg 4mKkUPWIImz/4O2VW1mJqvL06W3ZiIGDc4i6zv5mRHoOqRSk0a8EVf9AwK0LLwX+uAl0 xVNBlyE9IjIg6UgSBciJv2dk7n5M4G99v+8v3Fmbi9ReBDNUEoLLTLurf8FVkCGJTdyq +GqNqonvyjmmAjizJK0sLIbWfVXEIzoqC1x1RsSEpg/QgTe0hFgA5Y9f/owTMyfh2y1S QWHQ== X-Gm-Message-State: AO0yUKVK9jp5HKpbDyNFxFVF5n7fNOfFCxY9QPsVj5SpA4thE5qIRpyq c3844BQX0d89Meo49AqJpzVmERgTXsNopdnYE8iiVw== X-Google-Smtp-Source: AK7set9RRIV+wgEkb8nYbDlqQ5e9ddl7EJBSo4+9z8fxLN4fJ4WED/yQgr3WmmYCUbnnFs4RMGzjOA== X-Received: by 2002:a05:6a20:6d86:b0:cc:add4:1b60 with SMTP id gl6-20020a056a206d8600b000ccadd41b60mr20414390pzb.53.1678397495015; Thu, 09 Mar 2023 13:31:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 5/9] ip_frag: enable build on Windows Date: Thu, 9 Mar 2023 13:31:24 -0800 Message-Id: <20230309213128.34146-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 Mar 9 21:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124919 X-Patchwork-Delegate: david.marchand@redhat.com 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 574DD41E23; Thu, 9 Mar 2023 22:32:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72ECE42D1A; Thu, 9 Mar 2023 22:31:40 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id E24F141611 for ; Thu, 9 Mar 2023 22:31:36 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id y11so3475750plg.1 for ; Thu, 09 Mar 2023 13:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397496; 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=BlyxtV1vfP9B5qLyBX3G4A/Bc0oRxe7qGluVua0afRo=; b=CIDRpK1md2mM7Yo0liJy0ezddmmX2uVv5O2Okb1RckRuNms/PzHOe2C2Ubpxi30qrq KOn+ZsQN6LIEg898C/mKw+TGo9XQ17kL58sfFFGhjjhwgm5RGGIIH/Dr3r9VQAdAHDb8 rYG63ZB/C1LVzkxw+t1SqcAd5eiODrD4vkRykIoNSQCyT/bmWl1FYGfkATkIr+ypTcSn FKqe2gqfcYqbtFftVG6ksK2bDUeYxH1LUTUwT326q6R2jiLFLz6S/LcMC1fvJughunIU ZTNYuoCOa0hd9kqz74Z16HAkROWyyIElFBVzJlo/LKU+pUmgc47+CFmaxKnt6UcUP46b 2eKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397496; 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=BlyxtV1vfP9B5qLyBX3G4A/Bc0oRxe7qGluVua0afRo=; b=3LeoEIJRla6VOwh9h2cPcr12ecReaHXDHsky8tQ+SxvXUmA/Myjp57KRxJdVxNn1QV BQrCblOSaCiVwCnNkEOaUUD89OdVAfVagOjpXrUW1WPep18fkPcHv6oJLpCpaHHYBf5s o6/vV2Jt3zXp6dUtmAWebaXM5+mzaM3c+zYlyGY/snfyJaqlCKImXC9vetFX7gbLFsTK mkl5shwPQafNYBKONmmAaoJJ/7+AcpX++fmpNqYEzAPAtX9gWjj0zlcSMAmhrJzHHr2n BZ1rMM9xLTFlWZ/E9JN5Ii8f9S/prt7nzw/Fe++gjQ9RA6JKE3yowg3IT1TtbMyJ1cZT uXgQ== X-Gm-Message-State: AO0yUKUX4jZ2toqbMqCrHVtkMkA3sn6KOW3KWEsUHOwvblYgOqykIi0I Jyn6+hrlg2V5m434HfoS0esh4s58slqAQ3KBh1UmMg== X-Google-Smtp-Source: AK7set8/docFzY8MBjziqGcCXIeN8j7nXBaAemYCFJtaRVfHFPdkJ7TludjRq0k8KuVgK+t4l/cpSg== X-Received: by 2002:a05:6a21:788b:b0:cb:77f0:9a27 with SMTP id bf11-20020a056a21788b00b000cb77f09a27mr25958846pzc.24.1678397495890; Thu, 09 Mar 2023 13:31:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 6/9] rib: enable on Windows Date: Thu, 9 Mar 2023 13:31:25 -0800 Message-Id: <20230309213128.34146-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 Mar 9 21:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124920 X-Patchwork-Delegate: david.marchand@redhat.com 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 2CE1E41E23; Thu, 9 Mar 2023 22:32:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7085042B8B; Thu, 9 Mar 2023 22:31:41 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id C5BC242B71 for ; Thu, 9 Mar 2023 22:31:37 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id a9so3427478plh.11 for ; Thu, 09 Mar 2023 13:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397497; 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=Q+2LMm2qM2K/Ta11c8MBPFxaHrlAUusvY9Oj5YBBCfQ=; b=kVhusxfQw//FK8cS4f2FU9yP0q33n6ZDx1TBLuGWzZ4ClHON9OBaKks4kL0Ah2f6Wm 7cclbvyWLRwi7fIGJeOzJhpuroGSLz5F7euslK4XVjvSIQ0CkK+CMJV7QrynWgO6vGeD Rm0ua0iQ7J4D4Gg8NIYvrPA/KBIQNzNCwnP1DAY/kW7JdqnnBSGV0kYvjz6mBMHvJi/G 161MS4u2SfGsB3NlgboTmRZVs1d/LwsjBpnoyvh+q6alb8V/y9HUGs3qTYE9HOBKOEZp cc1LzinAn++aHCo2lcovenylwwXXma8ghcGMOae2s4OIft28biJ0IvK9LoB63pPL0I9A hfpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397497; 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=Q+2LMm2qM2K/Ta11c8MBPFxaHrlAUusvY9Oj5YBBCfQ=; b=mGjn2QrcGXcCrL66pxUkDbFsnavkksR+WyMtNQNaiuQShCeFAytBqu8mFIx4r1HgbV zqktiP7TzQ7dHeKqMZdwZ3UhaQMrod7Wj3CplFEyrTIKGY1ZKimwRTQDCPeGWnn1RTbF XVhvgLHSLFhQ+hNEvKz81458EEqnrJA4mL8KgdY9jXehSFEAQo28cC62+YmchBqc+wCj S/zFBKcW01QlOcdvbMPncJEmUQYS6OwCxs/ePaDTMNpTUqLuE0AcLbXvMcBZ9pVhI5sr dBIJbYTMFuL2k8j83K6vPeDtaH/q96wzz1+y51TnWeVijEwdTVxpFgGbKhxMR/RZEW6s gvmA== X-Gm-Message-State: AO0yUKWFRHQJcxpITwooMomt8iDCNAPSHydZguG8RXwYTWotn/8E1OxH KnEY3hRbGpOJvbDSRW8jgOtg2bWFn62CdkDXmc73GQ== X-Google-Smtp-Source: AK7set9bvadhzDQKaCr6Zpy8LRBvODHlZQxrs0w3aYSqUYZxYVokpnanqbqrQWKPpcsjl0+c+mVrhQ== X-Received: by 2002:a05:6a20:4283:b0:c6:bb08:a7ab with SMTP id o3-20020a056a20428300b000c6bb08a7abmr32699pzj.28.1678397496698; Thu, 09 Mar 2023 13:31:36 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 7/9] fib: enable on Windows Date: Thu, 9 Mar 2023 13:31:26 -0800 Message-Id: <20230309213128.34146-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 Mar 9 21:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124921 X-Patchwork-Delegate: david.marchand@redhat.com 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 684AF41E23; Thu, 9 Mar 2023 22:32:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77DFF42D29; Thu, 9 Mar 2023 22:31:42 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id A427742BC9 for ; Thu, 9 Mar 2023 22:31:38 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id x34so3406602pjj.0 for ; Thu, 09 Mar 2023 13:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397497; 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=4/y2OL0bfLf9p3FbQAar27dqsROXQlTkEYW6xvg/tFE=; b=f5DAfUnakofER2c4AwNCd0xX1+QAk6y82fAfZS3fBMbppz7OXMXO0e3I+DZlezfBp8 vQKpHAgIm1dRyQqDjxogLiYOd3/GTWpD4glygVlhoa1N26J5gG0WGYuyY1jGtg/9IXLp aq9HX4v4oTpu09Ah2WT+TJcGjD/O57U9zfIEa5z1Bedsa5+OZAnb5FWpk6FuTvDwUjAF XfRnAVl0uUdux2fIlAJwGR6LnEI0Y+SqxA0xy2k7I4aODWXFhfctKKx6WAFJqsamwgjX vL2g1umH5IV8b4LQPsIsXLa2N0yQo5HNszHWGkGZf382I8J+Lh+tQ3bKmuIVrD1/UgvC mUIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397497; 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=4/y2OL0bfLf9p3FbQAar27dqsROXQlTkEYW6xvg/tFE=; b=ZBx+HS38p97+nAYWWISDA/wGlEbQSoBeI1bATQF3XTRHuKOo4WprQ/OACdnN7q2kwN ORzhtROH2k0CHKXB3qk3zsmW00NI73WYIBCnK9Lx2+JIAI4MCfRI5VubTIYOztu2AM3Y 5GlM2KRjRhq2Pq/c6VdWUdGFEi7aBt1darSvMIUl/GBCJpRBjd+rpijLWw/07uVG42e0 ehxHhn3kG6dvS4jD5IL2eX+CPq43x30Wh5HFZoFbJQkPuS3Reiea2U18eUq795sTcsH0 gLPw2JCToH3n4mNZmlcuDsa6ib2D9jFWSkah/XXQjJmVR4vqP0b6ZBfEMV0MOIwYumJE uM9g== X-Gm-Message-State: AO0yUKU0qj/dA0JulSseymZ4hDnMeAj13USmcJsW22NUcSz/D7glpbkN QPELDjxUC1+1iScIzTqO/eTEAzc6PiAjJwTPgSCwuw== X-Google-Smtp-Source: AK7set8sL3O1fUS6dmzrWorLxioIaDwbzO98eReHtnVdlZt5RdDxbHC+pmf0nIZDETXpD5hbHTImaA== X-Received: by 2002:a05:6a20:548b:b0:be:e450:69b3 with SMTP id i11-20020a056a20548b00b000bee45069b3mr29493934pzk.0.1678397497651; Thu, 09 Mar 2023 13:31:37 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:37 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v5 8/9] pcapng: windows compatibility Date: Thu, 9 Mar 2023 13:31:27 -0800 Message-Id: <20230309213128.34146-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 comparability 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 65c8c77fa405..3c91fc77644a 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 @@ -47,6 +51,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 +/* compatibility wrapper because name is optional */ +#define if_indextoname(ifindex, ifname) NULL +#endif + static inline void pcapng_init(void) { From patchwork Thu Mar 9 21:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124922 X-Patchwork-Delegate: david.marchand@redhat.com 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 AE84941E23; Thu, 9 Mar 2023 22:32:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC21242D3A; Thu, 9 Mar 2023 22:31:43 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 3A72A42C4D for ; Thu, 9 Mar 2023 22:31:39 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id p20so3417635plw.13 for ; Thu, 09 Mar 2023 13:31:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678397498; 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=DaGUVsAQ5dlBc6v5e4IR4gRUOzNf2ucOzNPbAHHTi4Y=; b=qae4el2eAV3jDOxycmhe639DHYWwZYJr4FGLee71/nU0+AIT42fZRbnsgeqglqYlM5 N8RDyZA6wEdsezgCnx+tf55chJ1BerOr83kcK1fcvE8sBbgk/YT3RbnLV8JIn2U6NVY6 mB70mv9KnSUcG184IYRC80JvWoXvHjr4Q//+eOakz1Y9boAM2qMZe3i1ZOzFOebnAHP3 zj6rNp/vnBtzPsdmQ8NtFIIRhSy/eNCYuo/LRX4z+KlsTRjiB33wEce9gQnVPf2SeKQ7 VoHgmjEZ+XpAYEk6uU2GxcKHHydnAWuFETGCn1UG7YTn84PoN/G3QzNaE/eWzLTQfuYV ZvdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678397498; 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=DaGUVsAQ5dlBc6v5e4IR4gRUOzNf2ucOzNPbAHHTi4Y=; b=wvIDZ/g/CLafqtW4bBiQ3C5iItmzDtpl3A0/TdLBEn52MfA/ccMYEltLWwV0DfraV2 GKyJEvQoVkYTm5kpSUcPoFMwlgYd5ySBut/kAoolle79xZfj3+RHMeB0JbuPxfzSQAra 0mvH8FaKAJqfUku74jyx4g5OgpyU8QSoxAlOx27BCMEboxpKrZlulFfWVSe6/Pv+2Ave TbsbirAiC0QthH5EZxb/SHAFzgQeJqv/N8Wp6gUx0A5eC6ZjYE8tCwimB/XG87ZvgNUu 32UJvmyqe6+UE8WeVCn1UdwDVqn8Djib7sne/f4k3Yba9TbMXGbuDB8D8U0pXhofLjMO 9y2Q== X-Gm-Message-State: AO0yUKUUV6W1J/aL1PO3c5yccDGVu8JxdeuP3z0TkwHpo2DCuWnCMyiw mkDCT4rAVDPz1qWjRLHFLLbq3OrGFkSViO1ebnYwVQ== X-Google-Smtp-Source: AK7set8BKV8wfF4j4Z5ZBiTRk0aHBsGd0FxuxHAirQYWJUYOlVxNjHDGVXkC/uu+aN5Z9NyHA8Rg7g== X-Received: by 2002:a05:6a20:7d83:b0:cc:32a8:323d with SMTP id v3-20020a056a207d8300b000cc32a8323dmr43516pzj.28.1678397498464; Thu, 09 Mar 2023 13:31:38 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q3-20020a63cc43000000b00502e4015ff7sm64225pgi.23.2023.03.09.13.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 13:31:37 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v5 9/9] table: enable build on Windows Date: Thu, 9 Mar 2023 13:31:28 -0800 Message-Id: <20230309213128.34146-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309213128.34146-1-stephen@networkplumber.org> References: <20221201014440.11896-1-stephen@networkplumber.org> <20230309213128.34146-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 There doesn't seem to be anything keeping this from building on Windows. Signed-off-by: Stephen Hemminger --- lib/table/meson.build | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/table/meson.build b/lib/table/meson.build index 4f826b4b27e8..f8cef24b5918 100644 --- a/lib/table/meson.build +++ b/lib/table/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_swx_keycmp.c', 'rte_swx_table_em.c',