From patchwork Mon Jun 29 12:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tal Shnaiderman X-Patchwork-Id: 72411 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 6466CA0523; Mon, 29 Jun 2020 14:38:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA7B21BEE3; Mon, 29 Jun 2020 14:38:17 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C1C2E1BEC7 for ; Mon, 29 Jun 2020 14:38:00 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@mellanox.com) with SMTP; 29 Jun 2020 15:37:55 +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 05TCbrhP016264; Mon, 29 Jun 2020 15:37:55 +0300 From: talshn@mellanox.com To: dev@dpdk.org Cc: thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com, grive@u256.net, ranjit.menon@intel.com, navasile@linux.microsoft.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anatoly.burakov@intel.com, fady@mellanox.com, bruce.richardson@intel.com, Tal Shnaiderman Date: Mon, 29 Jun 2020 15:37:35 +0300 Message-Id: <20200629123741.20716-5-talshn@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200629123741.20716-1-talshn@mellanox.com> References: <20200624082847.21344-1-talshn@mellanox.com> <20200629123741.20716-1-talshn@mellanox.com> Subject: [dpdk-dev] [PATCH v10 04/10] pci: build on 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" From: Tal Shnaiderman Added in rte_pci header file to include off_t type since it is missing for Windows. Define the implementation of the Linux function rte_pci_get_sysfs_path in pci_common.c for Linux OS only as it is unneeded for other OSs and to avoid the warning on deprecated call to getenv() on Windows: "warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead." Signed-off-by: Tal Shnaiderman --- drivers/bus/pci/pci_common.c | 3 ++- lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_pci/rte_pci.h | 1 + lib/meson.build | 5 ++++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 245d94f59c..200c9bfea7 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -35,10 +35,11 @@ const char *rte_pci_get_sysfs_path(void) { const char *path = NULL; +#ifdef RTE_EXEC_ENV_LINUX path = getenv("SYSFS_PCI_DEVICES"); if (path == NULL) return SYSFS_PCI_DEVICES; - +#endif return path; } diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def index 7f0c8f5376..61bcb8aca7 100644 --- a/lib/librte_eal/rte_eal_exports.def +++ b/lib/librte_eal/rte_eal_exports.def @@ -1,5 +1,6 @@ EXPORTS __rte_panic + per_lcore__rte_errno rte_calloc rte_calloc_socket rte_eal_get_configuration diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h index b721bbf580..9337079178 100644 --- a/lib/librte_pci/rte_pci.h +++ b/lib/librte_pci/rte_pci.h @@ -20,6 +20,7 @@ extern "C" { #include #include #include +#include /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */ #define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 diff --git a/lib/meson.build b/lib/meson.build index d190d84eff..a8fd317a18 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -36,7 +36,10 @@ libraries = [ 'flow_classify', 'bpf', 'graph', 'node'] if is_windows - libraries = ['kvargs','eal'] # only supported libraries for windows + libraries = [ + 'kvargs','eal', + 'pci', + ] # only supported libraries for windows endif default_cflags = machine_args