Commit Graph

1463 Commits

Author SHA1 Message Date
Ziye Yang
4a0c1021fc nvme: update nvme perf program to test nvmf target
1 update nvme_rdma.c to fix the I/O queue creation bug.
2 update examples/nvme/perf/perf.c
3 add perf.sh

Change-Id: Ic7d4845219deb93bc042e34abbb7b2e05793ccd8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-02 08:41:12 -07:00
Daniel Verkamp
94c2dd8bdf nvme/hotplug: print message when a device is removed
Change-Id: If9c116d72bd889196331567542920c3ca818c68e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-02 08:39:52 -07:00
John Kariuki
64fc291291 nvmf_tgt: add socket ID to NUMA warning message
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>
2016-12-01 16:12:23 -07:00
Daniel Verkamp
49369134cf genconfig: add special case for DPDK_DIR shorthand
Change-Id: Iaf7195316c757b22cb601318c38762b3fd6f7c0e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
0ee75c5fc4 genconfig: pick up defaults from the environment
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>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
1e9c049638 genconfig: simplify argument parsing
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>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
051b059e26 examples/nvme/hotplug: return 0 on success
Change-Id: Id19bef766fa2366208aced87ca3433e6ab05ff9b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 09:12:26 -07:00
Daniel Verkamp
9d025383eb nvme: rename nqn fields in public API to subnqn
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>
2016-12-01 08:08:19 -07:00
Daniel Verkamp
89136259ec nvme/rdma: add hostnqn to spdk_nvme_ctrlr_opts
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>
2016-12-01 08:08:19 -07:00
Cunyin Chang
038236949f example: Add example for nvme hotplug.
Change-Id: I7e0bbf48798b77365c4dc968427c8834e0b05a44
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:23:10 +08:00
Cunyin Chang
e8c63cdde0 nvme: Add support for hotplug.
Change-Id: Iac504ce15e4ea3100e5afa31764fcfff7f979dbb
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:21:59 +08:00
Cunyin Chang
d1a37e98e6 nvme: Make the nvme_transport_ctrlr_scan() could scan a specific device.
Change-Id: I74f7582f5175742e96268dc9c0cc83db2e1eaea0
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:17:41 +08:00
Daniel Verkamp
6ab28a201b nvme/rdma: register responses as a single ibv_mr
Change-Id: I55ec9275142584768543e3a6de6eb5c675f6a063
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 17:10:39 -07:00
Daniel Verkamp
1712d1b7a2 nvme/rdma: convert SGL trace helper into a macro
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>
2016-11-30 17:10:39 -07:00
Daniel Verkamp
a9e436911f nvme: remove transport qpair_destroy() function
Each transport should handle its own qpair cleanup internally.

Change-Id: I7dd737be820ea6bad686f4aad7d74044fad58a47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 17:10:39 -07:00
Daniel Verkamp
ba16e46349 nvme: pass opts and probe_info to nvme_attach()
Let the transport access the controller options during
ctrlr_construct().

Change-Id: I83590c111e75c843685dd9315f0f08416168356d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 17:10:39 -07:00
GangCao
02a142abee nvme: move callback check only for the owning process
Change-Id: I05b5540fe8b1e22e8aebe23598b8cd44c8990861
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-30 17:04:48 -07:00
Ziye Yang
2e6ec373bf nvme/rdma: fix the I/O qpair creation issue
Change-Id: I357f4a83736977d319175445b4d65443f57b2c6f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-30 16:57:18 -07:00
Cunyin Chang
bdbea32857 test: Add autotest for ip migration.
Change-Id: Ic62badb272655b68883d3fe3484b2e67e01837e4
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-11-30 16:57:00 -07:00
Daniel Verkamp
11a2f1cf47 nvme/rdma: simplify nvme_rdma_req_get()
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
9c2186ea65 nvme/rdma: make nvme_rdma_pre_copy_mem() return void
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
5660dfde83 nvme/rdma: simplify nvme_rdma_req_put()
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
de8b8712f8 nvme/rdma: remove unused outstanding_reqs counter
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
e343a735e0 nvme/rdma: inline and simplify send WR init
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
22d8acbcf1 nvme/rdma: check discovery entry subtype
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>
2016-11-30 16:38:48 -07:00
Daniel Verkamp
4ea7938965 test/iscsi_tgt/fio: remove FIO job state file
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>
2016-11-30 16:37:58 -07:00
Cunyin Chang
51b15b93e7 nvme: Make sure the driver not exit when aer not supported.
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>
2016-11-30 16:37:46 -07:00
Daniel Verkamp
8a6b62c9ec env/pci: fix compilation with DPDK < 16.07
Change-Id: Ibac6d3132ad7cfa66b9ad3d3a933492acfa1b25e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 16:33:07 -07:00
Cunyin Chang
06c6d16cf8 nvme: Monitor uevent for device insert and remove
Change-Id: Ib47226d11a77eaa17a4e8a5e3e2c1a02c890f6ae
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-11-30 14:27:43 -07:00
Cunyin Chang
0e807fae27 nvme: Handle SIGBUS generated when a device is hot removed
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>
2016-11-30 14:25:04 -07:00
Cunyin Chang
56765aa39f env_dpdk: Add spdk_pci_device_[attach|detach]
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>
2016-11-30 14:10:52 -07:00
Cunyin Chang
1c6cd96ee4 env_dpdk: NVMe and IOAT drivers are always registered.
Change-Id: I46ea311e9d8972641c4c4c6d764955847b1f9786
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-11-30 13:22:12 -07:00
Daniel Verkamp
56306a468f scripts/setup.sh: add logname fallback
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>
2016-11-30 10:51:49 -07:00
Daniel Verkamp
8b45a830c4 test/nvmf: put host tests into a timing group
Change-Id: I4efecdd273a8a83ee9f2bb249141129a0ba82ee3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 09:56:51 -07:00
Daniel Verkamp
9589f0371a test/nvmf/host/identify: remove unrelated cruft
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>
2016-11-30 09:56:51 -07:00
Ziye Yang
88ae5a7629 nvme: move devhandle from spdk_nvme_ctrlr to nvme_pcie_ctrlr
This variable is only for nvme_pcie

Change-Id: I2bb8e65c3e6c26ef5919915b95d006bc92ebe750
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-29 16:13:10 -07:00
Cunyin Chang
7a17d4e249 iscsi: Check the connection state in function spdk_iscsi_conn_execute().
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>
2016-11-29 16:10:23 -07:00
GangCao
73e926f087 nvme: add thread safety comment for spdk_nvme_probe()
Change-Id: I8460a6fddcf383781c520f36a08df1b0a802a709
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-29 12:52:50 -07:00
John Kariuki
ec71fa1aa5 reactor: fix lcore type and add socket in NUMA notice
Change-Id: Ib0afc9415338c6c7aa11f55513c552c484b61cbd
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
2016-11-29 12:50:19 -07:00
Daniel Verkamp
c0b0afd44e eofnl: check for DOS-style newlines
Change-Id: Iaaf03848a9187ede3cffd0851291300b2f6c007e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-29 11:15:18 -07:00
GangCao
494b0c32c2 nvme: update the handling of pending admin requests
Change-Id: I035c59b6c4e4fdbbc8665c74541274e9d86ca8af
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-28 15:11:14 -07:00
Daniel Verkamp
c454900960 log: print trace flag names in SPDK_TRACELOG()
Change-Id: I962ee098818f48563e67f9b4214bc3519eee48b4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-28 13:15:08 -07:00
Ziye Yang
5f3761cf7e nvmf: change default AcceptorPollRate from 1 ms to 10 ms
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>
2016-11-28 12:17:17 -07:00
Jim Harris
fae782b66f ext4test: add ISCSI_APP and NO_NVME parameters
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
2016-11-28 11:37:37 -07:00
Tsuyoshi Uchida
438064c925 bdev/nvme: change name of variables to lower case (#77)
LunSizeInMB -> lun_size_in_mb
LunSizeInsector -> lun_size_in_sector
2016-11-28 11:08:26 -07:00
Tsuyoshi Uchida
d7d7add855 nvme: fix ctrlr free issue (#74)
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.
2016-11-28 10:58:26 -07:00
Tsuyoshi Uchida
b573c3a9ef nvme: fix keep alive interval ticks (#76) 2016-11-28 10:52:44 -07:00
Daniel Verkamp
263cd7944b env: remove return statements in void functions
Change-Id: I846a411a33a1f31c1a3ce28409a165ef6c449551
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-28 10:08:35 -07:00
Daniel Verkamp
efca92b85b nvme/rdma: partly remove CC.EN = 1 hack
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>
2016-11-23 16:34:41 -07:00
Daniel Verkamp
bdf982302e nvme: add trace logs for initialization process
Change-Id: Iba26bf9264dc6c72d84ecba96787efe141ba53fc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00