Added the socket ID to the NVMe over fabrics target warning messages.
This will help during troubleshooting to check that the NVMe device, Subsystem and NIC are on the same NUMA node
Change-Id: Id750a5a7694c898bb61ea26089ea3098611d530a
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
This matches the behavior of Make and ensures that we rebuild correctly
when the configuration is only modified in the environment.
Change-Id: Iaf63c488b7c817d6c74a89da2d1de8e4c01be045
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Split the arguments into var=val once at startup and put them in a dict.
Change-Id: Ic6b337e010a185448c1dab20659575081f03a645
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The discover and probe 'nqn' fields are subsystem NQNs, so name them
subnqn to be consistent with the spec and the rest of the code and to
distinguish them from host NQNs.
Change-Id: I4a80fbc1f4b037c8a4f91c8f28d2a96e47c66c47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Allow the host NQN to be overriden when connecting to NVMe over Fabrics
controllers.
Change-Id: I8fcf2e89ae7d9722677e834f76a8fe805c52f91b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This makes the function and file/line info actually useful (instead of
pointing to the helper function itself).
Change-Id: I22bac68827115880a49d456706a7eaecdc12e9b5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Each transport should handle its own qpair cleanup internally.
Change-Id: I7dd737be820ea6bad686f4aad7d74044fad58a47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Let the transport access the controller options during
ctrlr_construct().
Change-Id: I83590c111e75c843685dd9315f0f08416168356d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
nvme_rdma_req_get() is an internal function, and its only caller already
checks for a valid rqpair, so the NULL check is unnecessary.
Also clean up the redundant STAILQ_EMPTY/STAILQ_FIRST logic and use
STAILQ_REMOVE_HEAD.
Change-Id: Ic3828e8b5e881879173cb59350e39c5fac90e6ef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
nvme_rdma_pre_copy_mem() does not have any failure cases, so remove its
return value and remove the never-taken branch in its only caller,
nvme_rdma_qpair_submit_request().
Change-Id: I91011734ed0c20f8db691d62172fe1a3021dd3a1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
nvme_rdma_req_put() is an internal nvme_rdma.c function, and all of the
callers already have the rqpair, so pass it directly. We also already
verify that all of the callers have a valid rqpair and req before
calling nvme_rdma_req_put(), so it doesn't need to check for NULL
pointers.
This also means that spdk_nvme_rdma_req doesn't need to hold a pointer
to its rqpair anymore.
Change-Id: I893a46a9074f0a843e379d10c123f9292eb3b1a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The only place where outstanding_reqs was checked was in
nvme_rdma_req_put(), but the error case there could only happen if some
kind of internal programming error occurred (e.g. calling
nvme_rdma_req_put() on an invalid request).
Change-Id: I71e40ce562a8720dfaf70437ffd4c6493327c091
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
nvme_rdma_ibv_send_wr_init() was only called in one place, so just move
its contents into nvme_rdma_qpair_submit_request() since it allows
simplification of the code:
- req was always NULL, so remove the code that used req entirely.
- wr and sg_list are never NULL, so remove the checks for those.
Change-Id: I12a4f3502219d3681607686945e343f6808c0d2f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
We currently don't handle discovery service referrals, so skip those, as
well as any other unknown subsystem type.
Change-Id: I64f889e9272fb57b5cf9bb5467b3abca3955baf5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The information in this file is not useful after the test has finished,
so rather than copying it to the build output directory, just delete it
like all of the other tests using FIO.
Change-Id: I8495a2956b03f376b391ed501aaa61a857bfa490
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
QEMU's virtual NVMe controller device does not support the AER Set
Feature, so ignore its failure and continue.
Change-Id: I8b5c217a3112edabb6f76ec3e5f4ef774981a1d7
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Catch SIGBUS and handle it by remapping new memory into the
location where the BAR previously was.
Change-Id: Ie8d00a60a0bbe7f7ec57a5c39c0a63c5d9443206
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
These functions will attach or detach from a PCI device. Attaching
typically means mapping the BAR.
Change-Id: Iaaf59010b8a0366d32ec80bb90c1c277ada7cfe7
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
In some circumstances, no utmp entry is available, so logname fails.
In particular, gnome-terminal no longer creates a utmp entry:
https://bugzilla.gnome.org/show_bug.cgi?id=747046
As a workaround, try $SUDO_USER - the use case here is to determine
the (unprivileged) user name so we can give them ownership of
certain files, so this is usually the right thing to use anyway.
If we are not running under sudo, the caller should have passed the
username as a parameter to scripts/setup.sh anyway, since we can't
reliably determine which user is intended.
Also check if username is actually set before using it to run chmod - it
is possible that the scripts/setup.sh caller does not want to provide
access to an unprivilieged user and just wants to run everything as
root.
Change-Id: I20631c325b52884a378029dcf38568a2b311b457
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This script is testing the SPDK NVMe-oF host and target code, so the
kernel nvme-rdma driver should not need to be loaded.
It is also not running FIO, so it doesn't need to clean up the FIO
job state files.
Change-Id: I3cfe619abf36885df4bdc6eecebf0e197fb869be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This patch make sure the connection in normal state before any further
operation on this connection.
Change-Id: I776740b5b33b1de6707990c09d9131c385adf556
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
If AcceptorPollRate is configured in configuration
file, the default value used will be given by
ACCEPT_TIMEOUT_US. So change the default value, it
can solve the performance degradation issue of
nvmf target.
Change-Id: I867bb03dd8b2b81b86911130babd0334d9857de8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This allows this test script to be used with different
iSCSI target binaries, as well as optionally turning off
configuration of an NVMe-based target node.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6841e71d7842117756346cfd0fe1853a1ea5c6a
spdk_nvme_probe frees ctrlr when nvme_ctrlr_process_init is failed. But
ctrlr has already been freed while calling nvme_ctrlr_destruct. So
spdk_nvme_probe doen't need to free ctrlr.
The generic NVMe library controller initialization process already
handles enabling the controller; the RDMA transport should not need to
set EN itself.
For now, the discovery controller is cheating and not using the normal
initialization process, so move the EN = 1 hack to the discovery
controller bringup until it is overhauled to use the full
nvme_ctrlr_process_init() path.
The previous code where CC.EN was set to 1 before going through the
controller init process would cause an EN = 1 to EN = 0 transition,
which triggers a controller level reset.
This change stops us from causing a reset during the controller
startup sequence, which is defined by the NVMe over Fabrics spec as
terminating the host/controller association (breaking the connection).
Our NVMe over Fabrics target does not yet implement this correctly, but
we should still do the right thing in preparation for a full reset
implementation.
This patch also reverts the NVMe over Fabrics target reset
handling hack that was added as part of the NVMe over Fabrics host
commit to its previous state of just printing an error message.
Change-Id: I0aedd73dfd2dd1168e7b13b79575cc387737d4f0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>