From patchwork Tue May 28 11:07:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53727 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68B8A1B944; Tue, 28 May 2019 13:08:09 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 034BD137D; Tue, 28 May 2019 13:08:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 04:08:03 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:01 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Shreyansh Jain , Alejandro Lucero , Anatoly Burakov , stable@dpdk.org, Maxime Coquelin , Zhihong Wang , Luca Boccassi , Zhang XuemingX , Bruce Richardson Date: Tue, 28 May 2019 12:07:44 +0100 Message-Id: <20190528110748.10772-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com> References: <20190527161509.50252-1-bruce.richardson@intel.com> <20190528110748.10772-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/5] net/nfp: disable nfp for 32-bit meson builds 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 comment in the build config for the make build-system: "NFP PMD is not supported on 32-bit" Therefore disable NFP for 32-bit meson builds as well as for 32-bit make ones. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- drivers/net/nfp/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build index ea51ac3..8c87c5b 100644 --- a/drivers/net/nfp/meson.build +++ b/drivers/net/nfp/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -if not is_linux +if not is_linux or not dpdk_conf.get('RTE_ARCH_64') build = false endif sources = files('nfpcore/nfp_cpp_pcie_ops.c', From patchwork Tue May 28 11:07:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53728 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DC101B952; Tue, 28 May 2019 13:08:12 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0BEB64C8B; Tue, 28 May 2019 13:08:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 04:08:06 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:04 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Shreyansh Jain , Alejandro Lucero , Anatoly Burakov , stable@dpdk.org, Maxime Coquelin , Zhihong Wang , Luca Boccassi , Zhang XuemingX , Bruce Richardson Date: Tue, 28 May 2019 12:07:45 +0100 Message-Id: <20190528110748.10772-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com> References: <20190527161509.50252-1-bruce.richardson@intel.com> <20190528110748.10772-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/5] build: enable large file support on 32-bit 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" By default on 32-bit systems, file offsets are given as 32-bit values which prevents support for large files. While this is unlikely to be a problem, enabling large file support globally makes "make" and "meson" builds consistent, since meson always enables large file support, and without this change, the size of "struct stat" fields will be different between the two builds. The only location where this appears to be significant is in the dpaax common code, where a printf needs to be updated for 32-bit builds. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi Acked-by: Shreyansh Jain --- drivers/common/dpaax/dpaax_iova_table.c | 4 ++-- mk/arch/arm/rte.vars.mk | 2 +- mk/arch/i686/rte.vars.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 2dd38a9..ae0af09 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -99,7 +99,7 @@ read_memory_node(unsigned int *count) goto cleanup; } - DPAAX_DEBUG("Size of device-tree mem node: %lu", statbuf.st_size); + DPAAX_DEBUG("Size of device-tree mem node: %" PRIu64, statbuf.st_size); if (statbuf.st_size > MEM_NODE_FILE_LEN) { DPAAX_DEBUG("More memory nodes available than assumed."); DPAAX_DEBUG("System may not work properly!"); @@ -118,7 +118,7 @@ read_memory_node(unsigned int *count) */ *count = (statbuf.st_size / 16); if ((*count) <= 0 || (statbuf.st_size % 16 != 0)) { - DPAAX_DEBUG("Invalid memory node values or count. (size=%lu)", + DPAAX_DEBUG("Invalid memory node values or count. (size=%" PRIu64 ")", statbuf.st_size); goto cleanup; } diff --git a/mk/arch/arm/rte.vars.mk b/mk/arch/arm/rte.vars.mk index 27b1147..dc8c10a 100644 --- a/mk/arch/arm/rte.vars.mk +++ b/mk/arch/arm/rte.vars.mk @@ -4,7 +4,7 @@ ARCH ?= arm CROSS ?= -CPU_CFLAGS ?= -marm -munaligned-access +CPU_CFLAGS ?= -marm -munaligned-access -D_FILE_OFFSET_BITS=64 CPU_LDFLAGS ?= CPU_ASFLAGS ?= -felf diff --git a/mk/arch/i686/rte.vars.mk b/mk/arch/i686/rte.vars.mk index 3f48f67..c867883 100644 --- a/mk/arch/i686/rte.vars.mk +++ b/mk/arch/i686/rte.vars.mk @@ -24,7 +24,7 @@ ARCH ?= i386 ARCH_DIR := x86 CROSS ?= -CPU_CFLAGS ?= -m32 +CPU_CFLAGS ?= -m32 -D_FILE_OFFSET_BITS=64 CPU_LDFLAGS ?= -melf_i386 CPU_ASFLAGS ?= -felf From patchwork Tue May 28 11:07:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53729 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 522C61B964; Tue, 28 May 2019 13:08:15 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id C102A1B94A; Tue, 28 May 2019 13:08:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 04:08:09 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:07 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Shreyansh Jain , Alejandro Lucero , Anatoly Burakov , stable@dpdk.org, Maxime Coquelin , Zhihong Wang , Luca Boccassi , Zhang XuemingX , Bruce Richardson Date: Tue, 28 May 2019 12:07:46 +0100 Message-Id: <20190528110748.10772-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com> References: <20190527161509.50252-1-bruce.richardson@intel.com> <20190528110748.10772-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/5] build: remove unnecessary large file support defines 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" Since we now always use _FILE_OFFSET_BITS=64 flag when building DPDK, we can remove the Makefile and C-file #defines setting it individually for parts of the build. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- examples/vhost_crypto/meson.build | 1 - examples/vhost_scsi/meson.build | 1 - lib/librte_eal/linux/eal/eal_memalloc.c | 1 - lib/librte_eal/linux/eal/eal_memory.c | 1 - lib/librte_vhost/Makefile | 2 +- 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/vhost_crypto/meson.build b/examples/vhost_crypto/meson.build index 8e9860f..2485f3b 100644 --- a/examples/vhost_crypto/meson.build +++ b/examples/vhost_crypto/meson.build @@ -9,7 +9,6 @@ build = dpdk_conf.has('RTE_LIBRTE_VHOST') allow_experimental_apis = true deps += ['vhost', 'cryptodev'] -cflags += ['-D_FILE_OFFSET_BITS=64'] sources = files( 'main.c' ) diff --git a/examples/vhost_scsi/meson.build b/examples/vhost_scsi/meson.build index 2972e4d..77e5201 100644 --- a/examples/vhost_scsi/meson.build +++ b/examples/vhost_scsi/meson.build @@ -15,7 +15,6 @@ if not cc.has_header('linux/virtio_scsi.h') endif deps += 'vhost' -cflags += ['-D_FILE_OFFSET_BITS=64'] sources = files( 'scsi.c', 'vhost_scsi.c' ) diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c index 1e9ebb8..b1849a2 100644 --- a/lib/librte_eal/linux/eal/eal_memalloc.c +++ b/lib/librte_eal/linux/eal/eal_memalloc.c @@ -2,7 +2,6 @@ * Copyright(c) 2017-2018 Intel Corporation */ -#define _FILE_OFFSET_BITS 64 #include #include #include diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c index 416dad8..40a0f68 100644 --- a/lib/librte_eal/linux/eal/eal_memory.c +++ b/lib/librte_eal/linux/eal/eal_memory.c @@ -3,7 +3,6 @@ * Copyright(c) 2013 6WIND S.A. */ -#define _FILE_OFFSET_BITS 64 #include #include #include diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 5dd3189..8623e91 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -11,7 +11,7 @@ EXPORT_MAP := rte_vhost_version.map LIBABIVER := 4 CFLAGS += -DALLOW_EXPERIMENTAL_API -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 CFLAGS += -I vhost_user CFLAGS += -fno-strict-aliasing LDLIBS += -lpthread From patchwork Tue May 28 11:07:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53730 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 766F31B970; Tue, 28 May 2019 13:08:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id C71DD1B955; Tue, 28 May 2019 13:08:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 04:08:12 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:10 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Shreyansh Jain , Alejandro Lucero , Anatoly Burakov , stable@dpdk.org, Maxime Coquelin , Zhihong Wang , Luca Boccassi , Zhang XuemingX , Bruce Richardson Date: Tue, 28 May 2019 12:07:47 +0100 Message-Id: <20190528110748.10772-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com> References: <20190527161509.50252-1-bruce.richardson@intel.com> <20190528110748.10772-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 4/5] eal: mark unused function in 32-bit builds 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 get_socket_mem_size() function is only used in 64-bit builds, causing clang to warn about it for 32-bit builds. Add the __rte_unused attribute to the function to silence the warning. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- lib/librte_eal/linux/eal/eal_memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c index 40a0f68..1853ace 100644 --- a/lib/librte_eal/linux/eal/eal_memory.c +++ b/lib/librte_eal/linux/eal/eal_memory.c @@ -1088,6 +1088,7 @@ remap_needed_hugepages(struct hugepage_file *hugepages, int n_pages) return 0; } +__rte_unused /* function is unused on 32-bit builds */ static inline uint64_t get_socket_mem_size(int socket) { From patchwork Tue May 28 11:07:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53731 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C3C61B998; Tue, 28 May 2019 13:08:19 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D0DB91B94E; Tue, 28 May 2019 13:08:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 04:08:15 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:13 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Shreyansh Jain , Alejandro Lucero , Anatoly Burakov , stable@dpdk.org, Maxime Coquelin , Zhihong Wang , Luca Boccassi , Zhang XuemingX , Bruce Richardson Date: Tue, 28 May 2019 12:07:48 +0100 Message-Id: <20190528110748.10772-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com> References: <20190527161509.50252-1-bruce.richardson@intel.com> <20190528110748.10772-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 5/5] build: add libatomic dependency for 32-bit clang compile 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" When compiling with clang on 32-bit platforms, we are missing copies of 64-bit atomic functions. We can solve this by linking against libatomic for the drivers and libs which need those atomic ops. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- drivers/event/octeontx/meson.build | 5 +++++ drivers/event/opdl/meson.build | 5 +++++ lib/librte_rcu/meson.build | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/drivers/event/octeontx/meson.build b/drivers/event/octeontx/meson.build index 2b74bb6..3f83be6 100644 --- a/drivers/event/octeontx/meson.build +++ b/drivers/event/octeontx/meson.build @@ -11,3 +11,8 @@ sources = files('ssovf_worker.c', ) deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'pmd_octeontx'] + +# for clang 32-bit compiles we need libatomic for 64-bit atomic ops +if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false + ext_deps += cc.find_library('atomic') +endif diff --git a/drivers/event/opdl/meson.build b/drivers/event/opdl/meson.build index cc6029c..e1cfb2d 100644 --- a/drivers/event/opdl/meson.build +++ b/drivers/event/opdl/meson.build @@ -9,3 +9,8 @@ sources = files( 'opdl_test.c', ) deps += ['bus_vdev'] + +# for clang 32-bit compiles we need libatomic for 64-bit atomic ops +if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false + ext_deps += cc.find_library('atomic') +endif diff --git a/lib/librte_rcu/meson.build b/lib/librte_rcu/meson.build index 0c2d5a2..43edb87 100644 --- a/lib/librte_rcu/meson.build +++ b/lib/librte_rcu/meson.build @@ -5,3 +5,8 @@ allow_experimental_apis = true sources = files('rte_rcu_qsbr.c') headers = files('rte_rcu_qsbr.h') + +# for clang 32-bit compiles we need libatomic for 64-bit atomic ops +if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false + ext_deps += cc.find_library('atomic') +endif