This patch replaces the synchronous `spdk_nvme_detach()` calls with its
asynchronous counterparts in the controller unregister path.
An additional poller is introduced to periodically poll the NVMe driver
for detach completion. Once the detach is completed, the poller is
unregistered and the nvme_ctrlr is destroyed. The poller uses the same
period (1ms) as the async probe poller.
Since reset and detach cannot happen at the same time, reset_poller was
renamed to reset_detach_poller and it can now store the pointer either
to the reset or detach poller, depending on the circumstances.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5eb2dd6383d98d25d1f9748af08c1a13d18acb0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8729
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This is done in preparation for using the non-blocking versions of the
spdk_nvme_detach API, which will delay controller's delation until the
detach is completed asynchronously.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia785408c9a94427e60bf239e6036a5e89d589f61
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8727
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Detaching a controller with `no_shn_notification` flag set will follow
the regular detach path making it asynchronous too.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0b9c6c23626b4cc1cfaedb3268024776a07b9195
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9003
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
The controller detach had asynchronous API (with async/poll), but the
register operations were synchronous, so they would block on fabrics
controllers. In this patch, they're changed to their non-blocking
counterparts, making the detach fully asynchronous.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I74df12ab40a54f1d675639672e03755c89768bef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8726
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The test verifies that the NVMe driver initialization is asynchronous.
There are some error logs during shutdown, as the detach path isn't
asynchronous yet, but as long as the detach is performed implicitly,
the test completes successfully.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97483d8a8ba2487e279f7674514ad2cc2c54d504
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8625
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Previously we only use an assertion to address this sceanrio.
Fix issue #2173.
Change-Id: I7a6e715977218d2a3a08c48a9935880f3fe4ec63
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9604
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Andreas Economides <andreas.economides@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
According to the specification, we should also post an AER
error event for this error case.
Fix#2171.
Change-Id: Ifb2343453ea5e36ce244938a939537ee6ed1c4e1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9584
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ifdd1d02b466b6496469c9ea1f09633b6e368ab57
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9617
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This calls attention to some of the more advanced features
in setup.sh for users who may require them.
Fixes issue #2179.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0a9d1e20257768da0796ceb0360377c948f0e166
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9676
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a reference to %lu to remove the assumption
about the size of a long.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I622fd43e7acf2cb93d3ba4ba9e9367e6dd064a74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9663
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Current implementation allows to run bdevperf with --wait-for-rpc and
without -z option. As the result several statistics pollers will be
registered. Let's add guardian to prevent this.
In the case of multiple test running guardian also will be helpful.
Signed-off-by: Denis Nagorny <denisn@nvidia.com>
Change-Id: I885f9dba6fa324fe4fbaba104d3058bf9f686c19
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9613
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Added a definition of a parsed trace entry and a function allowing for
iterating over these objects. The difference between a parsed and a
regular trace entry is that it includes more information gathered while
processing the trace file (e.g. lcore, object statistics) and provides a
contigous buffer for trace arguments.
For now, only lcore and the pointer to the actual trace entry are
filled. Tracepoint arguments and object statistics will be added in
subsequent patches.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4d5e30a7abb4860a5ba9db46f64ceae8bd14646f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9433
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The trace file is now parsed and the entries are put in a map, sorted by
their timestamps. The code is directly copied from the spdk_trace app,
with very little modifications.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7929497ffd3079b6974f5423c82a6128db2cee98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9431
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
It gives user access to things like the tsc rate and tracepoint
definitions.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib50126b331faa4508174c7cb707643a3d8db6a01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9430
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
Copied code responsible for mapping/unmapping the trace file. The
only modifications were related with tying it to the spdk_trace_parser
object.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia575101532c612b185bd971c69157623b52b9e81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9429
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
The standard is now specified explicitly. The chosen standard, c++11,
is the latest supported by gcc-4.8.5, which is the oldest compiler still
in use on some systems (centos 7).
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7ba84278b28e6d96f43b52014c358a74902188b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9597
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This library will provide functions that parse traces recorded by an
SPDK application. This includes merging traces from multiple cores,
sorting them by their timestamp and constructing trace entries spanning
across multiple buffers. All of these tasks are currently implemented
in the spdk_trace app, so most of its code will be moved here (this is
the reason for using C++).
The motivation for extracting this code to a library is to be able to
use it from places other than the spdk_trace app, specifically the
`scripts/bpf/trace.py` script.
The main reason for creating a separate library instead of extending
libtrace is to avoid pulling in all of its dependencies. ISA-L is the
most problematic, as we only build it as a static library, which makes
it impossible to use with dlopen (making it unusable in scripts).
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If101ca3425d7404abd51b0da2031358d0be44766
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9428
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
We still don't support get log page with error
information LID.
Change-Id: I92db361dc956ea3ed4f6e7bdfdca763d0fea6886
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9583
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Similar is already done for json-rpc bdev_get_bdevs, it might be
useful for the upper layer which has no interest in all but only
in one specified.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ie1af1cb4778edd265914bbfdc2777f66c6c76572
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9362
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This is a rough first cut at an nvme_compliance test
application. Initial focus will be on testing
the SPDK vfio-user target, but over time many of the
tests here will apply to TCP and RDMA as well (or
even running the test against a virtual nvme device
backed by vfio-user in a VM).
Usage:
test/nvme/compliance/nvme_compliance -r <trid>
There is also a test/nvme/compliance/compliance.sh
script that starts the vfio-user target with a single
malloc namespace, and runs the nvme_compliance
app against that target.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2c19df07c9ad93a69420545ab825015f49957fc2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9599
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This test will expand with more ways to add second paths, so we need to
remove the ones we add right after they're added.
Change-Id: Ie95ba01176cdedd858a98306f876d2d253a1c8cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9454
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
It can match by any provided parameter to remove paths.
Change-Id: I5e7a87342bbb90943dc97fb52f142814fcf0acfa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9453
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Instead of storing an spdk_nvme_transport_id, store the object that
contains it. This will make a few later patches easier.
Change-Id: I36b74889fe39af3b7ab2b900fb3ea4b3f39e1f83
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9484
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Rename it to _is_core_at_limit(). This function
currently returns true if the core is at the limit
(instead of over the limit) which is really the semantics
that we want - so just change the name of the function
to make it more precise.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idf815f67c71463c3b98bc00211aafdc291abdbd2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9582
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
We have _is_core_over_limit() which determines if a core is
currently over its busy:total tsc ratio. We use this to determine
if we need to move threads off of a core that is too busy.
But when we pick a core to move a thread *to* we were allowing the
dst core to fill to 100%, rather than the SCHEDULER_CORE_LIMIT.
This patch fixes that, which has the nice effect of keeping
thread-to-core assignments much more stable when running
I/O workloads.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id98b08803939d2a25104082e6436bb8d4727d7c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9578
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This will lead the scheduler to be quicker to move
threads to an unused core - favoring performance over
power savings.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibaa5edc61a4bdca5550bd23a562c3645fded25e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9551
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
If a core has a very high busy percentage, we should
not assume that moving a thread will gain that
thread's busy tsc as newly idle cycles for the
current core.
So if the current core's percentage is above
SCHEDULER_CORE_BUSY (95%), do not adjust the
current core's busy/idle tsc when moving a thread
off of it. If moving the thread does actually
result in some newly idle tsc, it will get adjusted
next scheduling period.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I26a0282cd8f8e821809289b80c979cf94335353d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9581
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
For the src thread, add the busy_tsc of the thread
we are moving to the idle_tsc of the current core.
This is consistent with how are accounting for the
cycles in the target core too.
We will disable the load_balancing.sh script for now.
We will reenable it later in this patch set once
a few other changes are made, along with some updates
to the load_balancing.sh script based on the changes
made in this patch set.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8af82610804e97dabf62ccd90f75a0e6e37d276f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9550
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
The values 100 and 200 are used a lot in this part of the
unit tests, many times for different reasons. So add
some more variables and use some of the existing ones more
often to make some of this more clear to the reader.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2196bb6a1ac4b86ab0ddd9a3b88863664116cca5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9625
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Refactor this part of the unit tests to make it a bit
easier to maintain as the dynamic scheduler itself is
modified.
For example, depending on the simulated thread loads,
we may need to pass extra events to cores for
purposes of setting interrupt mode. The important
thing to test here isn't how many events it takes to
do that, but what is the end result.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iad2e861cfa0bfd16c853332650e3ab3a9727f490
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9624
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This will be useful in some upcoming patches where we will
be calculating these percentages in more places.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If7d84c00fe1b666988fe06537836ba7b9cb161aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9580
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
If a platform defines a syscall using a macro (e.g. #define open _open)
then wrapping it fails because DEFINE_RETURN_MOCK and MOCK_GET
will use the definition to name the ut_ variables, but DEFINE_WRAPPER
will use the original name. This result in an undefined reference when
linking.
Prevent macro expansion of the syscall name by avoiding nested macro
calls in DEFINE_WRAPPER. Include the contents of DEFINE_RETURN_MOCK
and MOCK_GET directly in DEFINE_WRAPPER.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I452857ec7df43f7a1a5f093439c7d5cf4683f8ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9618
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
spdk.mock.unittest.mk contains platform specific definitions to wrap
syscalls. Allow SPDK_MOCK_SYSCALLS to be predefined before it is
included to extend the list of syscalls to be wrapped. Update rpc
Makefile to use this mechanism so that the platform specific definitions
are used.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: If51c0e7a31cf0eda45a844cb8cfa579efe173c42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9621
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ifa8e80e0a25af7757181f480ab0405ec902a61ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9596
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I5c0fc5966d1ed9c78e83bd6772191d46bde1331c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9595
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Previously the Transport IDs would need to be an ini-style
config file that the nvme_fuzz app would then parse. Instead
just add a -F option that tells the nvme_fuzz app which
subsystem(s) to fuzz. This simplifies the fuzz_app code
a bit and makes it a bit easier to use.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I622f5173ff36e15d653155c4eb7eaaecb5564818
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9603
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Using the physical NIC interfaces is really designed more for
CI. Don't try to use the physical NIC interfaces when running
tests locally in --iso mode.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6e39663784e99f99fd1d0e7ed937fdc661ee2f44
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9602
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
IO commands with invalid OPCs are not freeing the
associated request object after handling the response.
This would eventually result in requests on the qpair
becoming exhausted which ends up failing the controller.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7c1c46265a38b31181cd5d9a98c528816ab482d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9601
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
When data digest is enabled for a nvme tcp qpair, we can use accel_fw
to calculate the data crc32c. Then if there are multiple
c2h pdus are coming, we can use both CPU resource directly
and accel_fw framework to caculate the checksum. Then the datao value compare
will not match since we will not update "datao" in the pdu coming order.
For example, if we receive 4 pdus, named as A, B, C, D.
offset data_len (in bytes)
A: 0 8192
B: 8192 4096
C: 12288 8192
D: 20480 4096
For receving the pdu, we hope that we can continue exeution even if
we use the offloading engine in accel_fw. Then in this situation,
if Pdu(C) is offloaded by accel_fw. Then our logic will continue receving
PDU(D). And according to the logic in our code, this time we leverage CPU
to calculate crc32c (Because we only have one active pdu to receive data).
Then we find the expected data offset is still 12288. Because "datao" in tcp_req will
only be updated after calling nvme_tcp_c2h_data_payload_handle function. So
while we enter nvme_tcp_c2h_data_hdr_handle function, we will find the
expected datao value is not as expected compared with the data offset value
contained in Pdu(D).
So the solution is that we create a new variable "expected_datao"
in tcp_req to do the comparation because we want to comply with the tp8000 spec
and do the offset check.
We still need use "datao" to count whether we receive the whole data or not.
So we cannot reuse "datao" variable in an early way. Otherwise, we will
release tcp_req structure early and cause another bug.
PS: This bug was not found early because previously the sw path in accel_fw
directly calculated the crc32c and called the user callback. Now we use a list and the
poller to handle, then it triggers this issue. Definitely, it will be much easier to
trigger this issue if we use real hardware engine.
Fixes#2098
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I10f5938a6342028d08d90820b2c14e4260134d77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9612
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit fixes a race condition when calling free_ctrlr(),
nvmf_vfio_user_close_qpair->free_qp will set controller `ctrlr->qp[qid] = NULL`
finally, when calling free_ctrlr() we also need to check `ctrlr->qp[qid]`
is NULL or not, when there are multiple IO queues, we need a lock to protect
`ctrlr->qp[qid]`. However, the call to free_qp() in free_ctrlr() is valid
only when killing SPDK target, for all other cases, e.g: VM disconnected,
the queue pairs are already freed, so here we can process these different
cases separately, and avoid extra lock.
Change-Id: I7ab71f08bf4d737843b2af42e27b1571be0b45e9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9351
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Ideally, SPDK should make sure no pending I/Os in this queue
pair are using the removed memory region. Currently we just
stop the submission path and leave a TODO comment here until
we have an asynchronous way to do this.
Also use the `<=` for the boundary check.
Change-Id: I63a2189022978811dc21f92f2599f28a5191ecd7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9352
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>