From patchwork Tue Aug 11 06:24:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fady Bader X-Patchwork-Id: 75356 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 324C3A04D8; Tue, 11 Aug 2020 08:25:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBB891C025; Tue, 11 Aug 2020 08:25:17 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 35A131C025 for ; Tue, 11 Aug 2020 08:25:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 11 Aug 2020 09:25:11 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07B6P7ZQ029652; Tue, 11 Aug 2020 09:25:11 +0300 From: Fady Bader To: dev@dpdk.org Cc: thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com, navasile@linux.microsoft.com Date: Tue, 11 Aug 2020 09:24:20 +0300 Message-Id: <20200811062424.14248-2-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200811062424.14248-1-fady@mellanox.com> References: <20200625133038.25180-1-fady@mellanox.com> <20200811062424.14248-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v5 1/5] eal: added interrupts empty stubs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The ethdev lib uses interrupts. Interrupts are not implemented for Windows. To solve this, empty interrupt stubs were added under Windows. Signed-off-by: Fady Bader --- lib/librte_eal/windows/eal_interrupts.c | 18 ++++++++++++++++++ lib/librte_eal/windows/meson.build | 1 + 2 files changed, 19 insertions(+) create mode 100644 lib/librte_eal/windows/eal_interrupts.c diff --git a/lib/librte_eal/windows/eal_interrupts.c b/lib/librte_eal/windows/eal_interrupts.c new file mode 100644 index 0000000000..309e851493 --- /dev/null +++ b/lib/librte_eal/windows/eal_interrupts.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + */ + +#include + +int +rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, + int epfd, int op, unsigned int vec, void *data) +{ + RTE_SET_USED(intr_handle); + RTE_SET_USED(epfd); + RTE_SET_USED(op); + RTE_SET_USED(vec); + RTE_SET_USED(data); + + return -ENOTSUP; +} diff --git a/lib/librte_eal/windows/meson.build b/lib/librte_eal/windows/meson.build index 08c888e018..b690bc6b0a 100644 --- a/lib/librte_eal/windows/meson.build +++ b/lib/librte_eal/windows/meson.build @@ -8,6 +8,7 @@ sources += files( 'eal_debug.c', 'eal_file.c', 'eal_hugepages.c', + 'eal_interrupts.c', 'eal_lcore.c', 'eal_log.c', 'eal_memalloc.c', From patchwork Tue Aug 11 06:24:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fady Bader X-Patchwork-Id: 75357 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C827A04D8; Tue, 11 Aug 2020 08:25:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B14E1C044; Tue, 11 Aug 2020 08:25:19 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 307E11C023 for ; Tue, 11 Aug 2020 08:25:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 11 Aug 2020 09:25:11 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07B6P7ZR029652; Tue, 11 Aug 2020 09:25:11 +0300 From: Fady Bader To: dev@dpdk.org Cc: thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com, navasile@linux.microsoft.com Date: Tue, 11 Aug 2020 09:24:21 +0300 Message-Id: <20200811062424.14248-3-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200811062424.14248-1-fady@mellanox.com> References: <20200625133038.25180-1-fady@mellanox.com> <20200811062424.14248-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v5 2/5] eal: updated export list for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added eal functions used by ethdev lib to the export list under Windows. Signed-off-by: Fady Bader --- lib/librte_eal/rte_eal_exports.def | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def index 69204a92c6..782e6fc721 100644 --- a/lib/librte_eal/rte_eal_exports.def +++ b/lib/librte_eal/rte_eal_exports.def @@ -28,6 +28,7 @@ EXPORTS rte_eal_tailq_register rte_eal_using_phys_addrs rte_free + rte_get_tsc_hz rte_hexdump rte_malloc rte_malloc_dump_stats @@ -145,3 +146,13 @@ EXPORTS rte_mem_map rte_mem_page_size rte_mem_unmap + + rte_class_register + rte_devargs_parse + rte_class_find_by_name + rte_socket_id + rte_strerror + rte_intr_rx_ctl + rte_log_register + rte_log_set_level + rte_log_register_type_and_pick_level \ No newline at end of file From patchwork Tue Aug 11 06:24:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fady Bader X-Patchwork-Id: 75358 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C640DA04D8; Tue, 11 Aug 2020 08:25:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CD4D1C0AE; Tue, 11 Aug 2020 08:25:20 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 41AD61C026 for ; Tue, 11 Aug 2020 08:25:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 11 Aug 2020 09:25:12 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07B6P7ZS029652; Tue, 11 Aug 2020 09:25:11 +0300 From: Fady Bader To: dev@dpdk.org Cc: thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com, navasile@linux.microsoft.com Date: Tue, 11 Aug 2020 09:24:22 +0300 Message-Id: <20200811062424.14248-4-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200811062424.14248-1-fady@mellanox.com> References: <20200625133038.25180-1-fady@mellanox.com> <20200811062424.14248-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v5 3/5] ethdev: remove structs from export list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some ethdev structs were present in ethdev export list. There structs were removed from the export list. Signed-off-by: Fady Bader --- lib/librte_ethdev/rte_ethdev_version.map | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 1212a17d32..21a2177756 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -89,7 +89,6 @@ DPDK_20.0 { rte_eth_iterator_next; rte_eth_led_off; rte_eth_led_on; - rte_eth_link; rte_eth_link_get; rte_eth_link_get_nowait; rte_eth_macaddr_get; @@ -104,7 +103,6 @@ DPDK_20.0 { rte_eth_rx_queue_setup; rte_eth_set_queue_rate_limit; rte_eth_speed_bitflag; - rte_eth_stats; rte_eth_stats_get; rte_eth_stats_reset; rte_eth_timesync_adjust_time; From patchwork Tue Aug 11 06:24:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fady Bader X-Patchwork-Id: 75360 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87D6AA04D8; Tue, 11 Aug 2020 08:25:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D36171C0BC; Tue, 11 Aug 2020 08:25:22 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 481041C027 for ; Tue, 11 Aug 2020 08:25:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 11 Aug 2020 09:25:12 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07B6P7ZT029652; Tue, 11 Aug 2020 09:25:12 +0300 From: Fady Bader To: dev@dpdk.org Cc: thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com, navasile@linux.microsoft.com Date: Tue, 11 Aug 2020 09:24:23 +0300 Message-Id: <20200811062424.14248-5-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200811062424.14248-1-fady@mellanox.com> References: <20200625133038.25180-1-fady@mellanox.com> <20200811062424.14248-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v5 4/5] telemetry: implement empty stubs for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Telemetry didn't compile under Windows. Empty stubs implementation was added for Windows. Signed-off-by: Fady Bader --- lib/librte_telemetry/rte_telemetry.h | 4 +++ lib/librte_telemetry/telemetry.c | 50 +++++++++++++++++++++++++++++++++ lib/librte_telemetry/telemetry_legacy.c | 25 +++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h index d13010b8fb..c3c0e44599 100644 --- a/lib/librte_telemetry/rte_telemetry.h +++ b/lib/librte_telemetry/rte_telemetry.h @@ -5,6 +5,10 @@ #include #include +#ifdef RTE_EXEC_ENV_WINDOWS +#include +#endif + #ifndef _RTE_TELEMETRY_H_ #define _RTE_TELEMETRY_H_ diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c index 0252282735..59ad9cc7ec 100644 --- a/lib/librte_telemetry/telemetry.c +++ b/lib/librte_telemetry/telemetry.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include #include #include @@ -20,6 +21,20 @@ #include "telemetry_data.h" #include "rte_telemetry_legacy.h" +#else /* RTE_EXEC_ENV_WINDOWS */ + +/* includes for Windows */ +#include +#include + +#include "rte_telemetry.h" +#include "telemetry_json.h" +#include "telemetry_data.h" +#include "rte_telemetry_legacy.h" + +#endif + +#ifndef RTE_EXEC_ENV_WINDOWS #define MAX_CMD_LEN 56 #define MAX_HELP_LEN 64 #define MAX_OUTPUT_LEN (1024 * 16) @@ -42,17 +57,24 @@ struct socket { }; static struct socket v2_socket; /* socket for v2 telemetry */ static struct socket v1_socket; /* socket for v1 telemetry */ +#endif + static char telemetry_log_error[1024]; /* Will contain error on init failure */ + +#ifndef RTE_EXEC_ENV_WINDOWS /* list of command callbacks, with one command registered by default */ static struct cmd_callback callbacks[TELEMETRY_MAX_CALLBACKS]; static int num_callbacks; /* How many commands are registered */ /* Used when accessing or modifying list of command callbacks */ static rte_spinlock_t callback_sl = RTE_SPINLOCK_INITIALIZER; static uint16_t v2_clients; +#endif int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help) { +#ifndef RTE_EXEC_ENV_WINDOWS + int i = 0; if (strlen(cmd) >= MAX_CMD_LEN || fn == NULL || cmd[0] != '/' @@ -76,8 +98,19 @@ rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help) rte_spinlock_unlock(&callback_sl); return 0; + +#else /* RTE_EXEC_ENV_WINDOWS */ + + RTE_SET_USED(cmd); + RTE_SET_USED(fn); + RTE_SET_USED(help); + + return 0; + +#endif } +#ifndef RTE_EXEC_ENV_WINDOWS static int list_commands(const char *cmd __rte_unused, const char *params __rte_unused, struct rte_tel_data *d) @@ -411,11 +444,14 @@ telemetry_v2_init(const char *runtime_dir, rte_cpuset_t *cpuset) return 0; } +#endif int32_t rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset, const char **err_str) { +#ifndef RTE_EXEC_ENV_WINDOWS + if (telemetry_v2_init(runtime_dir, cpuset) != 0) { *err_str = telemetry_log_error; return -1; @@ -424,4 +460,18 @@ rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset, *err_str = telemetry_log_error; } return 0; + +#else /* RTE_EXEC_ENV_WINDOWS */ + + RTE_SET_USED(runtime_dir); + RTE_SET_USED(cpuset); + RTE_SET_USED(err_str); + + snprintf(telemetry_log_error, sizeof(telemetry_log_error), + "Telemetry is not supported on Windows."); + + return 0; + +#endif } + diff --git a/lib/librte_telemetry/telemetry_legacy.c b/lib/librte_telemetry/telemetry_legacy.c index a341fe4ebd..40e7bbe2f8 100644 --- a/lib/librte_telemetry/telemetry_legacy.c +++ b/lib/librte_telemetry/telemetry_legacy.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include #include #include @@ -15,6 +16,15 @@ #include "rte_telemetry_legacy.h" +#else /* RTE_EXEC_ENV_WINDOWS */ + +#include + +#include "rte_telemetry_legacy.h" + +#endif +#ifndef RTE_EXEC_ENV_WINDOWS + #define MAX_LEN 128 #define BUF_SIZE 1024 #define CLIENTS_UNREG_ACTION "\"action\":2" @@ -48,12 +58,15 @@ struct json_command callbacks[TELEMETRY_LEGACY_MAX_CALLBACKS] = { }; int num_legacy_callbacks = 1; static rte_spinlock_t callback_sl = RTE_SPINLOCK_INITIALIZER; +#endif int rte_telemetry_legacy_register(const char *cmd, enum rte_telemetry_legacy_data_req data_req, telemetry_legacy_cb fn) { +#ifndef RTE_EXEC_ENV_WINDOWS + if (fn == NULL) return -EINVAL; if (num_legacy_callbacks >= (int) RTE_DIM(callbacks)) @@ -71,8 +84,19 @@ rte_telemetry_legacy_register(const char *cmd, rte_spinlock_unlock(&callback_sl); return 0; + +#else /* RTE_EXEC_ENV_WINDOWS */ + + RTE_SET_USED(cmd); + RTE_SET_USED(data_req); + RTE_SET_USED(fn); + + return 0; + +#endif } +#ifndef RTE_EXEC_ENV_WINDOWS static int register_client(const char *cmd __rte_unused, const char *params, char *buffer __rte_unused, int buf_len __rte_unused) @@ -239,3 +263,4 @@ legacy_client_handler(void *sock_id) close(s); return NULL; } +#endif From patchwork Tue Aug 11 06:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fady Bader X-Patchwork-Id: 75359 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5939CA04D8; Tue, 11 Aug 2020 08:25:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 999361C0B5; Tue, 11 Aug 2020 08:25:21 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 4D3DA1C031 for ; Tue, 11 Aug 2020 08:25:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 11 Aug 2020 09:25:12 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07B6P7ZU029652; Tue, 11 Aug 2020 09:25:12 +0300 From: Fady Bader To: dev@dpdk.org Cc: thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, kevin.laatz@intel.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, ciara.power@intel.com, navasile@linux.microsoft.com Date: Tue, 11 Aug 2020 09:24:24 +0300 Message-Id: <20200811062424.14248-6-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200811062424.14248-1-fady@mellanox.com> References: <20200625133038.25180-1-fady@mellanox.com> <20200811062424.14248-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v5 5/5] ethdev: compiling ethdev under Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Compiling needed libraries for ethdev under Windows. Signed-off-by: Fady Bader --- lib/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/meson.build b/lib/meson.build index 6bbaf242a9..c145240eb9 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -38,9 +38,10 @@ libraries = [ if is_windows libraries = [ 'kvargs', + 'telemetry', 'eal', 'ring', - 'mempool', 'mbuf', 'pci', 'net', + 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core ] # only supported libraries for windows endif