-pthread is what SPDK in-tree Makefiles use, so use that
in the external_code Makefile too. -pthread can be
used both on the compilation and link stages.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8ef702b8fbde825a4191d961738ebc605b0aa4c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5675
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The "external" module that we link against is essentially
a copy of the passthru bdev module in the modules/bdev
directory. But let's not use the same names for the
externally visible functions from this "external" module,
so that we don't get link errors if we happen to link
in both modules into one application.
This will help in a future patch where we use pkg-config
files to generate the list of the bdev modules.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I835c7e7ee8902f6829657ec6a3cf40cd802a1357
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5674
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Our examples here show how to link in the DPDK environment
into an SPDK application. That includes both spdk_env_dpdk
library and the DPDK libraries. So put spdk_env_dpdk in
the DPDK_LIB variable in the Makefile.
This will also simplify a future patch where we will
use pkg-config in this Makefile instead.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2c389eaa9900dbe5f77ccee536bd4edc0a54cccc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5673
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
test/external_make wants to always default to
the autotest_common.sh HUGEMEM default which is
8192MB on Linux. But it is useful to be able to
override this to run this test in VMs with less
memory.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I23a40c6c14e35cffefbaf4fa993ebd28d1b0054c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5672
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Similarly replace PCI_BLACKLIST with PCI_BLOCKED.
Use of ALLOWED/BLOCKED matches similar changes made
in DPDK.
While here, replace use of term "blacklist" with "blocked"
in one of the nvme perf scripts. The usage there was
associated with how devices are blocked by using the
environment variables that are changed by this patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I720d99118ba5e050f436612c9fd415db44294a63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5275
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
There are many duplicated codes about sending response for writing bool result.
That we need a function to do this.
Then we can reduce many codes.
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ic439111b1e9ca1013f8c657ab925f0c27a7be699
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5033
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This test script is based around only a strict
subset of the SPDK configuration options. If we don't
clean before building, we could still have libraries
in build/lib from previous tests that the external_code
Makefiles do not account for when linking libspdk.so,
which will include *all* libraries in build/lib.
Fixes issue #1662.
Fixes issue #1665.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I525ea1740313048fc44f26b5b0db9ab38161725e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4970
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
rte_hash depends on rte_rcu starting in upcoming
DPDK 20.11 release. rte_rcu was only added in
DPDK 19.05 release, so we need to check if it
exists before linking it.
Fixes issue #1661.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7e343c6f964b03cc62484b57803a3bad00f80288
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4947
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ide0ac38497bc500886e26fd219cb120113896966
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4152
Tested-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
The files for external_code tests were copies of the same files
in SPDK. Intention of external_code tests is to verify
that nothing breaks in regards to building process.
The copies were getting out of sync with functional changes.
So to address this:
- hello_bdev app is now symlinked
- vbdev_passthrough is copied from respective files
- RPC and name of the module were changed to not conflict with
the original passthrough module
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idb83b8a06dea7143505d2062b23bfb35c86e3274
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4804
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Get rid of WITH_DPDK_DIR and SPDK_RUN_INSTALLED_DPDK,
introduce SPDK_RUN_EXTERNAL_DPDK which can point to
a DPDK dir. It's an empty string by default.
Change-Id: Iff2b3773a4614db07f4196165087a79472e02b9a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/867
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Makefile support in DPDK was deprecated and will be removed soon,
so switch to the officially supported way of building DPDK -
with meson and ninja. Two new tools. Basically, our Makefiles
will invoke meson+ninja for DPDK, no other SPDK components are
affected.
Apparently DPDK wanted to move away from an octopus-like config
system and the ideology behind meson configuration is simple now:
build everything by default. Some PMDs can be explicitly disabled
with meson command line, but all libraries (both static and shared
versions) and test apps are built unconditionally.
How long does it take to build minimal DPDK with meson? Too much.
On my machine half of the total build time is spent on libraries
we don't need at all. (I have some hacks up my sleeve to disable
building those libraries - see the subsequent patch.) As for the
official way of building a minimal DPDK, there was a patch [1]
on dpdk mailing list to introduce more specific configuration,
but it was rejected:
> We talked about this a few times in the past, and it was actually one
> of the design goals to _avoid_ replicating the octopus-like config
> system of the makefiles. That's because it makes the test matrix
> insanely complicated, not to mention the harm to user friendliness,
> among other things.
>
> If someone doesn't want to use a PMD, they can just avoid installing it
> - it's simple enough.
>
> Sorry, but from me it's a very strong NACK.
Let's not follow that direction, hack the DPDK build system instead.
As for advantages of meson+ninja over Makefiles? I can't find any.
It's another build system that does a lot for you with some functions,
magic options, and a built-in dependency system. It seems nice if you know
the syntax, but it's another component that you need to learn, debug,
and possibly find bugs in (there's a lot of github issues open for meson).
I would compare it to CMake.
As for changes in this patch: rather that explicitly disabling
PMDs we don't need, specify a list of PMDs we do need and disable
everything else found in ./dpdk/drivers/*. This way we won't have
to disable the new PMDs as they're added to DPDK.
Meson configuration also sets RTE_EAL_PMD_PATH #define to a valid directory
with built PMD shared libs. When it's set, DPDK dynamically loads all shared
libraries inside. The drivers there depend on DPDK shared libs and fail to
load in static SPDK builds, so we disable them altogether by unsetting
RTE_EAL_PMD_PATH in the meson-generated config file - just like
DPDK Makefiles did. EAL checks for RTE_EAL_PMD_PATH being empty and skips
loading any external PMDs then. We do it for both static and shared libs.
We specify all PMDs at build time for now, so there's just no need to load
them dynamically.
We have three more hacks in our submodule:
* disable building dpdk apps by commenting-out a line in dpdk/meson.build
* disable building unnecessary libs (build everything that spdk *may*
need)
* build isa-l compress pmd with `-L[...] -lisal`. DPDK expects to find
libisal with pkg-config. We don't want to prepare a pkg-config file,
so comment-out a failing check in another meson.build file and provide
isa-l through CFLAGS and LDFLAGS.
We also need to make some changes to our test/external_code. First of
all, -ldpdk is no more. Meson build generates a pkg-config file with all
libs, but we'll switch to it in a separate patch - for now just specify
all -lrte_ libs one by one. -Wl,--no-as-needed has to be added to some
test cases, otherwise rte_mempool_ring isn't loaded. We don't use any
APIs from this library, it only has a static constructor that provides
a few callbacks used by rte_mempool_create(). Also, since DPDK now builds
both static and shared libraries, we need to add -Wl,-Bstatic to force
using static libswhere required. It's only needed for DPDK libs, but we
use it for SPDK libs as well since there's no harm.
As for performance:
$ ./configure --enable-debug --with-crypto --with-reduce
$ time make -j40 -C dpdkbuild all
with meson:
real 0m8.287s
user 1m7.983s
sys 0m10.548s
before, with the old DPDK makefiles:
real 0m20.232s
user 0m55.921s
sys 0m16.491s
The subsequent builds are much faster too:
$ time make -j40 -C dpdkbuild all
meson:
real 0m0.876s
user 0m0.663s
sys 0m0.217s
makefiles:
real 0m10.150s
user 0m11.740s
sys 0m6.772s
[1] http://inbox.dpdk.org/dev/1a07d1cd59d84dce84e56c10fdabf5e5504560a6.camel@debian.org/
Change-Id: Ic65db563014100bafb12e61ee0530cc2ae64401d
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1440
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
With update to DPDK 20.05 EAL requires rte_telemetry,
external make tests were missing specifying this lib.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9f5eaea46b47da48fc81b4fff0199cd75ff6af78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3483
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Just set it once instead of doing it over and over.
This cleans up the code a lot.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I91c6ea8c02d964693909b9c53795b0f1ee09c90f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2979
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Fixes#1382
System memory gets fragmented over time and repeated hugepage
allocations fail, giving us intermittent failures on CI. Linux
allocates those pages only when requested hugepage count is bigger
than current hugepage count, so in order to prevent any additional
allocations just stick to a single count all the time.
autotest_common.sh already exports HUGEMEM=8G for Linux systems
and 2G for BSD ones. `setup.sh reset` doesn't touch the hugepages,
so practically only the first `setup.sh` will allocate memory now.
The two setup.sh calls are run with sudo, so they need
HUGEMEM="$HUGEMEM" to work.
Change-Id: I48b4a720bad4e1da14e78313b4db0eb60a177c38
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2374
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
This makes sure that we will have the hugepages we need
even on systems that don't have them configured by default.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I9a0d82e0abf6363c1c037732b543c05e8931f97e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2141
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This test helps ensure that nothing about the way we build our shared
objects changes in a way that breaks external applications or bdev
modules trying to link to SPDK.
Change-Id: I45ac36a2afc873b04eb237f4e633a9d84066737c
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/435
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI