From patchwork Thu May 2 16:51:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53229 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 2223C1B1A0; Thu, 2 May 2019 18:52:06 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CD0EB1B192 for ; Thu, 2 May 2019 18:52:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 09:52:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="154194126" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by FMSMGA003.fm.intel.com with ESMTP; 02 May 2019 09:52:03 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, bluca@debian.org, Bruce Richardson Date: Thu, 2 May 2019 17:51:51 +0100 Message-Id: <20190502165154.21746-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502165154.21746-1-bruce.richardson@intel.com> References: <20190426165043.17268-1-bruce.richardson@intel.com> <20190502165154.21746-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 1/4] examples/l3fwd: fix compile on FreeBSD 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" On freebsd we need to include sys/socket.h to get the definition of AF_INET in order to compile. Fixes: d5ceea4ab160 ("examples/l3fwd: format IP addresses for printing") Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- examples/l3fwd/l3fwd_lpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index 172a036b2..60a00639e 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include From patchwork Thu May 2 16:51:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53230 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 DE04A1B1E9; Thu, 2 May 2019 18:52:10 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A7C5F1B1DD for ; Thu, 2 May 2019 18:52:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 09:52:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="154194135" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by FMSMGA003.fm.intel.com with ESMTP; 02 May 2019 09:52:05 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, bluca@debian.org, Bruce Richardson Date: Thu, 2 May 2019 17:51:52 +0100 Message-Id: <20190502165154.21746-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502165154.21746-1-bruce.richardson@intel.com> References: <20190426165043.17268-1-bruce.richardson@intel.com> <20190502165154.21746-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 2/4] examples: install examples as part of ninja install 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 we install dpdk onto a system, we want to put the examples into the /usr/share/dpdk (or /usr/local/share) directory for reference. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- examples/meson.build | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index e4babf6bf..1a6134f12 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -8,12 +8,20 @@ endif execinfo = cc.find_library('execinfo', required: false) -allow_skips = true # don't flag an error if we can't build an app +all_examples = run_command('sh', '-c', + 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done' + ).stdout().split() +# install all example code on install - irrespective of whether the example in +# question is to be built as part of this build or not. +foreach ex:all_examples + install_subdir(ex, + install_dir: get_option('datadir') + '/dpdk/examples', + exclude_files: 'meson.build') +endforeach if get_option('examples').to_lower() == 'all' - dirs = run_command('sh', '-c', - 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done') - examples = dirs.stdout().split() + examples = all_examples + allow_skips = true # don't flag an error if we can't build an app else examples = get_option('examples').split(',') allow_skips = false # error out if we can't build a requested app From patchwork Thu May 2 16:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53231 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 C9A061B1F1; Thu, 2 May 2019 18:52:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AFCB61B1DD for ; Thu, 2 May 2019 18:52:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 09:52:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="154194145" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by FMSMGA003.fm.intel.com with ESMTP; 02 May 2019 09:52:08 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, bluca@debian.org, Bruce Richardson Date: Thu, 2 May 2019 17:51:53 +0100 Message-Id: <20190502165154.21746-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502165154.21746-1-bruce.richardson@intel.com> References: <20190426165043.17268-1-bruce.richardson@intel.com> <20190502165154.21746-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 3/4] build: fix ninja install on FreeBSD 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 post-install script to symlink the PMDs from their own PMD directory to the regular lib directory (so they would be found by ld at runtime) was using the "-r" flag to ln to create relative symlinks. This flag is unsupported by ln on FreeBSD causing the ninja install step to fail. Reworking the script to take the relative driver path as parameter removes the need for ln to calculate the relative path ensuring compatibility with FreeBSD. As part of the fix, we move the registration of the install script to the config/meson.build file, from the top level one. This improves readability as the script takes as parameters the variables set in that file. Fixes: ed4d43d73e2b ("build: symlink drivers to library directory") Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- buildtools/symlink-drivers-solibs.sh | 7 ++++--- config/meson.build | 7 +++++++ meson.build | 7 ------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/buildtools/symlink-drivers-solibs.sh b/buildtools/symlink-drivers-solibs.sh index 9826c6ae3..42985e855 100644 --- a/buildtools/symlink-drivers-solibs.sh +++ b/buildtools/symlink-drivers-solibs.sh @@ -7,6 +7,7 @@ # others, e.g. PCI device PMDs depending on the PCI bus driver. # parameters to script are paths relative to install prefix: -# 1. directory containing driver files e.g. lib64/dpdk/drivers -# 2. directory for installed regular libs e.g. lib64 -ln -rsf ${DESTDIR}/${MESON_INSTALL_PREFIX}/$1/* ${DESTDIR}/${MESON_INSTALL_PREFIX}/$2 +# 1. directory for installed regular libs e.g. lib64 +# 2. subdirectory of libdir where the pmds are + +cd ${MESON_INSTALL_DESTDIR_PREFIX}/$1 && ln -sfv $2/librte_*.so* . diff --git a/config/meson.build b/config/meson.build index f8aded6ed..3678348de 100644 --- a/config/meson.build +++ b/config/meson.build @@ -42,6 +42,13 @@ endif driver_install_path = join_paths(get_option('libdir'), pmd_subdir_opt) eal_pmd_path = join_paths(get_option('prefix'), driver_install_path) +# driver .so files often depend upon the bus drivers for their connect bus, +# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need +# to be in the library path, so symlink the drivers from the main lib directory. +meson.add_install_script('../buildtools/symlink-drivers-solibs.sh', + get_option('libdir'), + pmd_subdir_opt) + # set the machine type and cflags for it if meson.is_cross_build() machine = host_machine.cpu() diff --git a/meson.build b/meson.build index a96486597..d1e8e5239 100644 --- a/meson.build +++ b/meson.build @@ -63,13 +63,6 @@ configure_file(output: build_cfg, # them. dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] -# driver .so files often depend upon the bus drivers for their connect bus, -# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need -# to be in the library path, so symlink the drivers from the main lib directory. -meson.add_install_script('buildtools/symlink-drivers-solibs.sh', - driver_install_path, - get_option('libdir')) - pkg = import('pkgconfig') pkg.generate(name: meson.project_name(), filebase: 'lib' + meson.project_name().to_lower(), From patchwork Thu May 2 16:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53232 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 2D99B1B1F7; Thu, 2 May 2019 18:52:18 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AD80D1B1EE for ; Thu, 2 May 2019 18:52:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 09:52:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,422,1549958400"; d="scan'208";a="154194157" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by FMSMGA003.fm.intel.com with ESMTP; 02 May 2019 09:52:10 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, bluca@debian.org, Bruce Richardson Date: Thu, 2 May 2019 17:51:54 +0100 Message-Id: <20190502165154.21746-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502165154.21746-1-bruce.richardson@intel.com> References: <20190426165043.17268-1-bruce.richardson@intel.com> <20190502165154.21746-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 4/4] build: add libbsd to pkg-config file if enabled 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" If libbsd is enabled in DPDK, the strlcpy and strlcat functions in rte_string_fns.h redirect to the varients in libbsd, only using the fallbacks if it is not enabled. Therefore, if libbsd is enabled, it needs to be called out as a DPDK dependency in the pkgconfig file. To ensure that we don't have undefined variables on non-Linux platforms, we can remove the linux condition around the libbsd check - no harm comes in looking for it on other OS, since it's an optional dependency. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- config/meson.build | 10 ++++------ meson.build | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/meson.build b/config/meson.build index 3678348de..0d25646f5 100644 --- a/config/meson.build +++ b/config/meson.build @@ -132,12 +132,10 @@ if numa_dep.found() and cc.has_header('numaif.h') dpdk_extra_ldflags += '-lnuma' endif -# check for strlcpy -if is_linux - libbsd = dependency('libbsd', required: false) - if libbsd.found() - dpdk_conf.set('RTE_USE_LIBBSD', 1) - endif +# check for libbsd +libbsd = dependency('libbsd', required: false) +if libbsd.found() + dpdk_conf.set('RTE_USE_LIBBSD', 1) endif # add -include rte_config to cflags diff --git a/meson.build b/meson.build index d1e8e5239..46f9c5683 100644 --- a/meson.build +++ b/meson.build @@ -70,6 +70,8 @@ pkg.generate(name: meson.project_name(), libraries: dpdk_libraries, libraries_private: dpdk_drivers + dpdk_static_libraries + ['-Wl,-Bdynamic'] + dpdk_extra_ldflags, + requires: libbsd, # apps using rte_string_fns.h may need this if enabled + # if libbsd is not enabled, then this is blank description: '''The Data Plane Development Kit (DPDK). Note that CFLAGS might contain an -march flag higher than typical baseline. This is required for a number of static inline functions in the public headers.''',