From patchwork Sun Feb 19 17:50:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124146 X-Patchwork-Delegate: ferruh.yigit@amd.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 0490341CE2; Sun, 19 Feb 2023 18:50:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C002442D37; Sun, 19 Feb 2023 18:50:19 +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 867DF40698 for ; Sun, 19 Feb 2023 18:50:17 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id k2so1141212plh.12 for ; Sun, 19 Feb 2023 09:50:17 -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=8vkx4D7WoD5+b78AAgKqRNMDP/IrxIJyNO6H7pNU8jE=; b=B0BgYFJ2A12yZLfRV0hVOkHX+X2SP2lO2UCZt32wsYuXTgfm1u8NML6Gu6FJ45HyNV Iee8hLW3Lh5QBBfiTt3iyY8rLki8k4x/IEvORA4BEXPOaJi5bq28gD074ubRjfoG1AZt pMuoMNZkgY6SBwI5vyQ00X3/EyeUl/jnrdM7gt2CDMJXAwot2pDqOnL/zDO59DgHvj4n 50nOwq/OXIsyJw2/peo47IyiW4gwa04NIoE4Za0TxuzF7Pw0DPFbKH72K3sXCKDdHqxl AJpDY3InBZVwvCw4tLAp9G75N2gI2oOt6So/PiaHaZV+mYN7ekr7sSRwWgCzMdvPdL02 1qbg== 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=8vkx4D7WoD5+b78AAgKqRNMDP/IrxIJyNO6H7pNU8jE=; b=72DkmV2jnSdCZgZKQLi/igYPaTQ/X0ksXb3IpMMa+b0xFMvUfcRN2OA2B5iq2N9eMo rhmGxyAW+qVNcynhRDRM87OVwG3V3nwIiK9Dek8n6HGFwpqEun6Hpa197N04wLORamlT edjH8SSI3la+pp9K0sd7XFc/5rjTBzAbXrpTGRwKhwj5xVSX/Zu+eRU9m1hc3a53b7vd SwuUbGsZNZkOQoxzuxX6dfBbd+Wof5jCY1ftkXR/gjBNuhFDdg083u2EBKZu5R03r3uA qOMoRE/NIitawciWzwDi2rAZMaXmWTecWwiXi4fjHCaH95oO8z4VCJ8JusXkUqOfs2Yk Hj2w== X-Gm-Message-State: AO0yUKV6/pg6zQZYn4Y/9YU/jYQHsibKkOJwVLqsRczAAW0FUHfltwMS PwCLNbHyS/dM4LbtCJG69ZgZ0bSghrZ4Oyr9MBQ= X-Google-Smtp-Source: AK7set/yueNCZPmLpVywmQa1Tp8vISg3dBrHMYTDalWS4osirmcsNrEhcwN+F8gOoMJIylwE4yGTEA== X-Received: by 2002:a17:902:f54a:b0:19a:a647:1891 with SMTP id h10-20020a170902f54a00b0019aa6471891mr312739plf.67.1676829016509; Sun, 19 Feb 2023 09:50:16 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Tetsuya Mukawa Subject: [PATCH v3 1/8] net/null: build null PMD on Windows Date: Sun, 19 Feb 2023 09:50:06 -0800 Message-Id: <20230219175013.10057-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124147 X-Patchwork-Delegate: ferruh.yigit@amd.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 F13A341CE2; Sun, 19 Feb 2023 18:50:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16E4842D3B; Sun, 19 Feb 2023 18:50:24 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 57E5440698 for ; Sun, 19 Feb 2023 18:50:18 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id cp9so211383pjb.0 for ; Sun, 19 Feb 2023 09:50:18 -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=YlQk95R+o2GZ1yE7eW56Qjn3lhaJLbMjvt10+rGFfQY=; b=06RHnDzcv2r6Amldvj40fyghKPt1vAIVr1lon7pHMvrq8myxP0WIIlz7eADC9mqDdD Y7c8PAFmHvVOCUQVWE7H5DiNrxT07j04Qn/SuqBlLb3x7qQgsb02z2yhTQ6RszVVmtmA wFs66sOpcaBquCFHs8X3ObSo6qckc0rlywGA51JpXkDtMiYaOLZ789G+j+QbkPMNZHo9 A9u/iLqEtYAZ5dtkPVkbhhiBHJ/las1Ec3lXW663Q2wOV2/5yULEnK2sF7+8kdDkXoOg SZWRcWybChIBNZVRE9uEnIzAU5EvLIIzEi225S/+szCK1RHwvtOdB26HftC4TCfmsPnf lpAQ== 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=YlQk95R+o2GZ1yE7eW56Qjn3lhaJLbMjvt10+rGFfQY=; b=BokexdOFWmmZZLnERxPkFKtZX7VwMOyULX8vQX0gHNd1gRc0GO37DXTS1jffZGWfhO yP16aJH+scvldIHXdrTpRotXoqlW+dgTsR6chPcr7jzWCXemw/7oTr7HS4oxWWysmMAJ 33YIALMs6YhdM8NtD07uB18jU/mQitylv0dI0oLtSHmTC4qySQJerVDdYFUpCSqnGyIP bxBsi8Kdir/YcwbR9XsQcAiAbG/whXTtnKTGh+r4lnjX8iJFrHuoxeQ+gvzXE/L5IDl0 EDN/G4Ewh6Bt4Xdh5BhtU+aY7X+3TB3LxBOk68S1zAo4z8r7MUjHdhjOJp9kzpKUfZ4i Hmjg== X-Gm-Message-State: AO0yUKWXauT0SQKG8m4E8IOHCEYfV+rOCtmuRWqqU9h+7FLsWiTERUrF +dkKDwLH8bm3nfqkmSYrXjy1b4KnZA+1uOMwfeY= X-Google-Smtp-Source: AK7set9cGysENj7MjiOl1H0d2qKRpuPqoYQL5HBQLq7rFLje1OHtDuM9q0G42kYggEdc1VlQTN69KQ== X-Received: by 2002:a17:902:da91:b0:19a:f02c:a05b with SMTP id j17-20020a170902da9100b0019af02ca05bmr2238943plx.3.1676829017548; Sun, 19 Feb 2023 09:50:17 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:17 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Bruce Richardson Subject: [PATCH v3 2/8] net/ring: build on Windows Date: Sun, 19 Feb 2023 09:50:07 -0800 Message-Id: <20230219175013.10057-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 | 4 +++- 3 files changed, 4 insertions(+), 8 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 diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index bd5a47dd9017..e8bc9b627102 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,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 +541,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 Sun Feb 19 17:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124148 X-Patchwork-Delegate: ferruh.yigit@amd.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 5409441CE2; Sun, 19 Feb 2023 18:50:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FAB342D40; Sun, 19 Feb 2023 18:50:25 +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 BEA4442D36 for ; Sun, 19 Feb 2023 18:50:19 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id ky4so118331plb.3 for ; Sun, 19 Feb 2023 09:50:19 -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=1XH+YIdS2J0+gUtw3hNcVseB7jI92w+W7yJ531/tnpU=; b=ZkkySHaY8dTouUjfygSKfaR8ef2gcYDAZFCGqvm4j9m2a86fi2pvUvGl1AJ5aKqE5b QudgWC/rjOxRVhq7crilMCZFlhH3oeAQs+qoZs/TIm4kSqu7D9xTjhdRpnkxs5ysoVFI NECe7RU9iUul9dou3N7q4NaPNd59h4ljn/qCmW9qPAC9ztgL36VDJAdjO8l90sewlfb7 GlPlwA/xMilOcmZIexupXu+UWgFEubTXIpl7RkP4U/1A72A1JaJeaESuHrfMvs/czi6t q4Ci6RIlPRxMfOESWEikUAsL9n7AYHc4QWJ5L5okSr9o/SOtU1UTOEzHQUIH2far7WhO YMwA== 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=1XH+YIdS2J0+gUtw3hNcVseB7jI92w+W7yJ531/tnpU=; b=ljWuclyw7qEqiSfYP1ULR4xmca7PSyogVPSb2us0R+/Ji+lYjZPo3wvxXTz6mOBBHZ NZNb90hrqUZt4z/lq3NY9mE+i6eVoOlxX4uR0NeEM6E4NGrIalSvDj08pUCICFq6uXud S1T2aMdaAaR1y1rTkNySeLvcNMsFMZeQBy7WsANCMpQ9FdOG/lKgwvn2QTuchk69/RN5 y9VuBuvQ9hoE9YwxCFkKVGWBfbz3m1fnu3C49kZVpuGNy/YhkbZ+OMDcZEyBXnn+QFEP 4fS2i8zr0g1axgea4q9+5OA8mqXBl/jKVvwqNbHYwC/Es990T7aOjTnC9OJBq4tIbSEB 6vAA== X-Gm-Message-State: AO0yUKUKX2UrevVxqSW3WG5xHhfEGXbfhauu28DyZggjcBbirFmT8/1u +FV2rRbsQofdBq9hSBdix8itbRiSwYI/ENLUAWQ= X-Google-Smtp-Source: AK7set8wbJixwoTpDJXsVuLGmTDewrp4CLU7IljiMpUJTN7Y29IyHvnPviR/yqStyzLPhbMEzFiC5A== X-Received: by 2002:a17:903:88d:b0:19b:370:c77e with SMTP id kt13-20020a170903088d00b0019b0370c77emr719308plb.7.1676829018605; Sun, 19 Feb 2023 09:50:18 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v3 3/8] lpm: enable on Windows Date: Sun, 19 Feb 2023 09:50:08 -0800 Message-Id: <20230219175013.10057-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124149 X-Patchwork-Delegate: ferruh.yigit@amd.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 479BF41CE2; Sun, 19 Feb 2023 18:50:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E39B42D47; Sun, 19 Feb 2023 18:50:26 +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 A71EF42D39 for ; Sun, 19 Feb 2023 18:50:20 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id e4so1478410plj.13 for ; Sun, 19 Feb 2023 09:50:20 -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=Wthpt1yMKg88TFmLv0DjkbVFCCmdOum/X/tb28k3SBw=; b=LE4eAZE24c4KMnIcKr+v0Wc0QMt/EsBJf+GNC0uXGMe3O9Jxzq5+ykZgGGaEKO4Kj5 UNHgKEkKHU9NrwgUUukmmJeMWHgmzIgMJ36BCR/pzR0t5vocINMccWS59Q1Qx0UjamjA IgRJ+ptfYrzddtrSUDO/37VZ2hxOb415I09uM1MgYWxP5NBHz1vF6BC9LscmoCZRkr3W JaPggyTtF7buDh4Nj12LhgNmnT/EpLGECjl973tON919x3ZmjSFHPedLPvOBCOuTzjOQ /ImkOuIUqpXHa/w94Qe84QPQICkWRjLVUf3KPtHKRNYoEg1LcxfxdjI6EV7llCQtfKFr cnDA== 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=Wthpt1yMKg88TFmLv0DjkbVFCCmdOum/X/tb28k3SBw=; b=Kgz2CiBL3KGpd4OGnZrsExlgyAtUB2IlxGb+IF6uixUIW8pFUDdCS16YbcLf3jhG8h j5mibflU3hbWElMKmhXs56s7mmCQ9We4oMNcLl/ZkSAtS8CdQiWLz2e8v4A71SfcBa4I idVfvQi6gnxwMYu4P9j6Ph+kzE0Q3vaeXA6QAGy2tZGu1XCrp1cwCB8OpskyskndS92/ j04+lgfYlpm5KdTWSJ4bSMVBlR/5RhD6hIHPCxyHPJL6rix4Dtfta+M6yPjDESZcoCPy uvQ8EV8ME3xDokIs5a9rEcHzdHEdyN0lHU3xnpevNfW+9MrONKkBsJ/OdrpbKeBAwQio I/Uw== X-Gm-Message-State: AO0yUKWJtewZQ56308g8sLGxF6+/xQM4tLaqhrp431+w31ONkyqRTpoD WawyDBX5aShm2tYFyrUUC6sjImemEtrEdoIb5uY= X-Google-Smtp-Source: AK7set+vSovMHWRIZUFj/pXySP1ghhXvaAhliaW/anHAMC7d94cvrnMMQ6pf6cIpIdGa7rU+ryYVqQ== X-Received: by 2002:a17:903:2805:b0:19c:190d:a55e with SMTP id kp5-20020a170903280500b0019c190da55emr735751plb.65.1676829019690; Sun, 19 Feb 2023 09:50:19 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Reshma Pattan Subject: [PATCH v3 4/8] reorder: build on Windows Date: Sun, 19 Feb 2023 09:50:09 -0800 Message-Id: <20230219175013.10057-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124150 X-Patchwork-Delegate: ferruh.yigit@amd.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 D5C1C41CE2; Sun, 19 Feb 2023 18:50:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A97042D51; Sun, 19 Feb 2023 18:50:27 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id C08E942D39 for ; Sun, 19 Feb 2023 18:50:21 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id a5-20020a17090a70c500b00236679bc70cso1452675pjm.4 for ; Sun, 19 Feb 2023 09:50:21 -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=WGyFr6jmzcgM1aDdQp/EBErjnXov/ZmiUN0fVa/gzjE=; b=rPOmrWNR8RsYVm/iYms+qdvTa1NzkQXHkzdjmQQi7OJKks0K7HxSbYXznsIMgBEySy tQRjbcJwXkDw8tEzTz3TgLq1aZE8/5WAL1FrWfmQH/Ov7OAJyzRhxRX7Bb5sYbS2r3HY zPlMgRLVt2fTfXktyVEnQ9BGrnZ2b6O2zvK0BqY95myom/NFM8/HyGUj6SSfXE7+knbT zh9U6LQ/MsiPiEuKXq+dt+LucLymBG4lf4tklgAvFN2BOr40u2khe5xBqtWWW/173slj ajat/UfgRz67TXTereRcNY7HIi9k2aiYX0nx0caNwh9JOpCUfq4DfzDcEXvglvdKi9mm v5Ww== 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=WGyFr6jmzcgM1aDdQp/EBErjnXov/ZmiUN0fVa/gzjE=; b=V1nI6gLKzBPC3JttQXL3sAPuygCpsEwIKcCIqFaQqQdwzCs+NbRBJgrpJuODHVFqbK KpLjYOSjcIOV1wBsJsgX8k6UjmwHhrg11lw1CYpfqKKBG1qpijcwZzaIi6BOStAZfBqz d6zvKCKJLSH4fbrdSFkAidrUbXlL/7FZvTVJ83iRCAJK/STueXvs6q05+wLoQQJqsoMw D7AqqKoY369uH0MBZ+296KsCMSyQL3ul/dSncCSQrWN0LAiSYeN3rsJjCPyXU8xV4Wuk onWRYgQJbO4EhQgHUNRQAwaW5AJIvjdKmA/6ORC6OLmAYa938BNgF0hxFn8oTDot9oey FfAw== X-Gm-Message-State: AO0yUKWiYSehqaRoJBIOK+jqhn2WTH0/A5xw3jmk1aoiSZ1QNrspwVX4 Iqi2n/cxyRbXfwVixzX+zNGERRta+WvjPnqL4FI= X-Google-Smtp-Source: AK7set9SpT/Dmb4esqwOJtcx0fZKfDkq9Wul+ZBIsgFpyLVOYQcXjqjF8ByyUwQDDix4Badbh+N/dg== X-Received: by 2002:a17:903:2289:b0:19b:33c0:4091 with SMTP id b9-20020a170903228900b0019b33c04091mr1593457plh.52.1676829020625; Sun, 19 Feb 2023 09:50:20 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:20 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Konstantin Ananyev Subject: [PATCH v3 5/8] ip_frag: enable build on Windows Date: Sun, 19 Feb 2023 09:50:10 -0800 Message-Id: <20230219175013.10057-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124151 X-Patchwork-Delegate: ferruh.yigit@amd.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 9E03841CE2; Sun, 19 Feb 2023 18:50:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A4B642D56; Sun, 19 Feb 2023 18:50:28 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 8DC6742D39 for ; Sun, 19 Feb 2023 18:50:22 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id d4so989919pjc.5 for ; Sun, 19 Feb 2023 09:50:22 -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=6zL2xjbD1mmWRggd1/eVrleId77cdCaSbEqFDtttXyo=; b=gIn+W4zHH9tB2K9xWGA/MnytUIyu0Fh/qvdLzzBjiRYKOXfmSVqpijLcq/4qq7kAOG rYDBx2HtRl0LYbVdAgNTP/mdkim/wBt3AT+/fiR4vZrYsC496NICjsQY2A6MJ6ed1CoI +t+4GIh3hjtJDSl8rGwC2K4+wQ6f3RIpdPegm1VyeS2R/FvSBk2FBjkj0K/7TkNGPoOl G+laO8g+BdqArBOyjcSj1rfNAfsTgmnBI1CfAZouGRXnkEU/5EEQsxH/A/Oh0kw9Yad5 8RH2KnUuRMhb3hR8IrIoO9Rm+3xBIOmsCgLM6wXPAWQhIGSPp5mkURrB0bfcZT1zMdFF FFqw== 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=6zL2xjbD1mmWRggd1/eVrleId77cdCaSbEqFDtttXyo=; b=fHIC3w+CW1Hj+q0F19Vq7qCC3009UV0ZPUsyfrENMdy2hTLzynDgVO6oWoFXt5cKF2 RWDkTXTFKN/BlyGaTUWSKDCbgaOtlrYDWGrdwdlEX7u5yZHrHswji6AmnUnaeMJeX0uz gvqEbn4voKq/2tU96W0Gak1P0fgJTp3nZU6T+OGUW2Rt3EiWNZTZgNKDlWQZjJVNXVO4 ORC2PrqUSNuJe45D5P7j28maQA43j2pW4Kk80HdlTu8KO8jnwRwpLGpzB2dpidfIJeOV 0y7Um3afYSRsTWH8IgWl3NNvpiwXccUhFTr2Fylt5Di3pkbDmHqjwAbJuk7cIyV2PzCy wg8g== X-Gm-Message-State: AO0yUKWSj+hSSEJoM3T9kOgvRzC6LpItivydCL9uzu5v3zAeJ8JQWYPK 92RTq+ekAd7De5EzMhyQe/X+t0nFydi1QpG1tvM= X-Google-Smtp-Source: AK7set+Ljp1M7Po2AhFN3Mw9HphArTr/+Z5OMEVnsQcLbpUhXxnTJ99Bu5Q10/VUWlLnoQSZrjOJAw== X-Received: by 2002:a17:903:40cf:b0:19b:c29:a74b with SMTP id t15-20020a17090340cf00b0019b0c29a74bmr266652pld.34.1676829021528; Sun, 19 Feb 2023 09:50:21 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:21 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Vladimir Medvedkin Subject: [PATCH v3 6/8] rib: enable on Windows Date: Sun, 19 Feb 2023 09:50:11 -0800 Message-Id: <20230219175013.10057-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124153 X-Patchwork-Delegate: ferruh.yigit@amd.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 7BCB141CE2; Sun, 19 Feb 2023 18:51:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C1A842D5F; Sun, 19 Feb 2023 18:50:36 +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 A035042D39 for ; Sun, 19 Feb 2023 18:50:23 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id q9so1093200plh.6 for ; Sun, 19 Feb 2023 09:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XpjjUg+XGIk8i8zqgDx2zb0AHCW+0KwDkb6IUa23Ft8=; b=wAxyzGU69bVO45KLAzZm1pnmYI5i7hTXwKLUQegbQxS5nFj/iJWh+4av1PCeT1d885 QByUW5ZldjOugBHCFqafT1L3+8TKaqizrvxVbgg0zr4rQhywhAgdy1EevLwenUbvTRSX 6jAHKA1i8hVgaDeTLylS5XQVaOpLl2xP7D5eWW1mN+tdRXS2yAoUOSa05RGs6jRbewX7 CCxOfxgb+UB/F1drjDTSR67b/FBwKHR2+IXx2RHOaXUXjtEXdVQUkqsXfKgGaozKMnVv cCHkdcT/kSNhmZdtLzf6qkBzCpOLOjlC5qLwHmqQJ9XPb8xtYl7fAYcFKpKbuV23OMqp Ml9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XpjjUg+XGIk8i8zqgDx2zb0AHCW+0KwDkb6IUa23Ft8=; b=jjz2RaayzYQL7dT59JjU2wa3nWWo+DPT6rvS82wUt70N9GMMXwb/jgYCP58mOe1pfE qFsJRE4lAWKqrbO9rGy1XB8RZfesizRgCC7u1cJiZKYu+/YbMGMvQmg+Gn+ddSrb0C59 rarlC/4MhnAOuJqCGnBDrjWQ6D7o5f5JN60Cwv7K1sTwvPLZsjBdF3SOBMz0rtxQuQqH SvA0/VFpHAXhiFuzNY07hGOoLdTqIGToDkt94legqHIVUaHc9LwFKmbkbl0sXAj9Sc90 cQRmgx/HSztpIFDrTxMHrFZvLmD5pOvk8uwZz7OQpkUBtcroz5PJjo9Qo4ee5kCZ4PX6 fV2w== X-Gm-Message-State: AO0yUKWPS/DCRaNX5VQBfuUAFEEKPxYPmSEvyajxIa7J48zJB2NFWk1T Ha4K4Tv7eVWj1hnf18T4q1JPENmJS3M7sJzqnYw= X-Google-Smtp-Source: AK7set8o67C8EvM2UuUScJNOVO6dVsxVed8fnGdwewm2brOs/cQsZDJ9HSpNMhWpf2Vdwddig8H8qA== X-Received: by 2002:a17:902:eccb:b0:19b:3549:53fc with SMTP id a11-20020a170902eccb00b0019b354953fcmr1032656plh.27.1676829022462; Sun, 19 Feb 2023 09:50:22 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:22 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Vladimir Medvedkin Subject: [PATCH v3 7/8] fib: enable on Windows Date: Sun, 19 Feb 2023 09:50:12 -0800 Message-Id: <20230219175013.10057-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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 Sun Feb 19 17:50:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124152 X-Patchwork-Delegate: ferruh.yigit@amd.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 EC15241CE2; Sun, 19 Feb 2023 18:51:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1889842D46; Sun, 19 Feb 2023 18:50:35 +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 5457E42D3F for ; Sun, 19 Feb 2023 18:50:24 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id w12-20020a17090a4f4c00b00236a0d55d3aso1294477pjl.3 for ; Sun, 19 Feb 2023 09:50:24 -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=LFUwQiMZBZSXVoc57R5sltggKpaWcIsy0laqAgGpQ34=; b=rk0xjQDkKurTZOaePUKr/ZsSc38GDMySfpBFQiGNgH4bU8KEpMqmia2JLQ6uuFajlk F3ikUnOfadcCeEVeCoNRIPeKGBQXevREnP4H7Wn4SpVsEguxwnTXJTVrfjDOMzbV7Sff 2jqC6o/3q66sLrl+7VBHuZ8jydBpgF56O7UDXVkRhD8Ani0FBdJX1OX2eHUnRxQHCvId XDSboLcON/1Vi+do0inKroaktFgNrJ0HMcgzaNEFw4dC3rC4A4aHkG71rig4F289tmr8 b4hrlWNzhGv8Hb2a+POWzMJJNZ3WolLTIsLOJEZ7ji8fSG1TnbajCN7yi1IArsezamUI HJug== 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=LFUwQiMZBZSXVoc57R5sltggKpaWcIsy0laqAgGpQ34=; b=zrKN0H/vi4qn/jXpNrvzTbB4hBVzdJLw/6EU3GHc27zwD6AtyPISzfS9pVAdXzEv0I RaxizlS3ASJJhKgxerxoi16trx2e/VJfsnM3Bxa172jhKkQFOpQghBSb8EA6V9Lh4Q68 Zp504oxdrpo3XpvPlYlVBCU67qGYH+jism/s9VB1EfhvCGsT6iqYkhNKP7wP5JqWqVh0 eFTEFFD37pgI2Qn7CtZ/FBAfKkJrgUEF16/BDJsqYsUdlavItIWN6/I8BModhNnxQj98 7IBwzK1AFEBpc82lJE7FqdZbDDUpsUHtIQGHy2H5AFtL9w74/iZ9nFsbysOEAl84kW61 /n0w== X-Gm-Message-State: AO0yUKUKu46eJNAZEHIBb34mgbzcGrjgezztMPq1I5GrD7ut8bEymaBE DUyz3tBFSVyIBb/c0k8BDRaKsr+1VUlSfEweAqs= X-Google-Smtp-Source: AK7set8haFM0G/kNaDohxElCjs9C3DIcSAdPcEXnMix+8DlY4sNcVRHWv60IZnZkQGZYFOsIa/vXLg== X-Received: by 2002:a17:902:f691:b0:19a:59a5:e88e with SMTP id l17-20020a170902f69100b0019a59a5e88emr89786plg.59.1676829023304; Sun, 19 Feb 2023 09:50:23 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a13-20020a170902b58d00b001991e4e0bdcsm6238408pls.233.2023.02.19.09.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 09:50:22 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Reshma Pattan Subject: [PATCH v3 8/8] pcapng: windows compatibility Date: Sun, 19 Feb 2023 09:50:13 -0800 Message-Id: <20230219175013.10057-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219175013.10057-1-stephen@networkplumber.org> References: <20230207001937.875608-1-stephen@networkplumber.org> <20230219175013.10057-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..d4b2db773160 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 +/* compatiablity wrapper because name is optional */ +#define if_indextoname(ifindex, ifname) NULL +#endif + static inline void pcapng_init(void) {