Commit Graph

1687 Commits

Author SHA1 Message Date
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
Daniel Verkamp
ed598ee066 nvme/rdma: fix log level for debug messages
Most of the NOTICE level messages should have been TRACE.

Change-Id: Icbc4d398ab2580cf3a2349be11441b7a09603020
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Daniel Verkamp
e2a2165550 nvme/rdma: use getaddrinfo() to parse service ID
Also remove unreachable code handling addr == NULL.

Change-Id: Ia6b5639853bbb6f4193a1b4352d465829b1293d1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Daniel Verkamp
e15a704e2f nvme/rdma: fix nvme_rdma_qpair_destroy() NULL check
Verify that qpair is not NULL before doing pointer math on it.
The NULL check after calling nvme_rdma_qpair(qpair) would not
trigger if qpair was NULL.

Fixes a crash if the Connect command failed, causing
nvme_rdma_ctrlr_create_qpair() to return NULL.

Change-Id: I158a5b1752892a7d5a72a9ac20c0c5b2cd781a81
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Daniel Verkamp
648c15d1b9 nvme/rdma: fix connect error message
Change-Id: I21c4cc98fb5b1bd9c7714898599496def265ff83
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Daniel Verkamp
6ca517d460 nvmf: split subsystem lookup from host check
This allows us to print better error messages when connecting to a
subsystem that exists but does not allow a specific host.

Additionally, we can now return the correct error code for a host that
is not allowed.

Change-Id: I16cd4ac2745cf50bb54601b464b0d23954f86fda
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Ben Walker
aa3d7381cc nvme: Don't add discovery controller to attached_ctrlrs list.
Change-Id: I214b9291cc8f54928bdeb6f078d473661edfebfc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-23 13:37:29 -07:00
Ben Walker
03f84b5bbf env: Detect correct DPDK header install location
Official installs of DPDK place headers in a 'dpdk'
subdirectory under include, so detect that.

Change-Id: If64421c84c91cae31688994484c22fce398dc622
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-23 13:37:29 -07:00
Pawel Wodkowski
7dce704c20 scrips/rpc.py: add vhost scsi RPC commands
Add new commands:
get_vhost_scsi_controllers
construct_vhost_scsi_controller
add_vhost_scsi_lun

These RPC commands are in preparation for an upcoming SPDK vhost-scsi
target.

Change-Id: I8dc3045f832df76a34c55f41dba213d480a3e5fe
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-23 12:42:10 -07:00
Jim Harris
f7504f8ad5 test/util: add pci unit test
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia893503c1d8a65c9fc73ef6a09fa3a1302d08767
2016-11-23 11:29:43 -07:00
Jim Harris
076fb28427 test/env: move vtophys to subdirectory
This prepares for some additional env tests.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I577faad44fb9ae5c83785b406728224b16396f26
2016-11-23 11:29:42 -07:00
Jim Harris
4db2eb4053 test/iscsi: add pdu test
As part of this commit, stop building the iscsi
tests on FreeBSD.  This new pdu test links in
object files from the iscsi library, some of which
do not build currently on FreeBSD with our default
error/warning levels.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icb6a3dc17aa62882d0477f7734d2701ea09a3f36
2016-11-23 11:29:41 -07:00
Daniel Verkamp
97cc39e1ef nvme: clear status.done flag in keep-alive config
The status.done flag polled by nvme_ctrlr_set_keep_alive_timeout()
was never initialized.

Change-Id: I323fae5f4ce12209a9699965ce07894bc3c6205a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 10:28:25 -07:00
Changpeng Liu
a3ed1795cd nvmf: add subsystem check on creation and cleanup for nvmf rpc
Change-Id: I85826c99c450426c26870ae261a7b7c8daeba031
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-11-23 10:27:54 -07:00
Changpeng Liu
277ca8ddd0 nvme: free associated memory when deleting the IO queue pair
Change-Id: Ibc139c5fd2e0ef72b6dbd5a8416aec916759430f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-11-23 10:27:44 -07:00
Daniel Verkamp
2bfb991e42 nvmf: share Get/Set Features - Number of Queues
The code in virtual.c and direct.c was identical - move it to session.c
to share it.

Change-Id: Ic6e4e9238e8ffacb212e76293c440109aa839f8c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 09:46:31 -07:00
Daniel Verkamp
48631ef2b9 nvmf: add Set Features - Keep Alive Timer to Direct mode
Move the current Virtual mode implementation to session.c and use it for
Direct as well.

Change-Id: I3f0ac93b4247b93d158b0dcb77e257b4b91be129
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 09:46:22 -07:00
Daniel Verkamp
4be1cd85f0 nvmf: use bdev_io NVMe status code if available
Change-Id: If7003bf5c6a6fa0a4d1c6b8fda4cc19b6dc77482
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 09:46:09 -07:00
Daniel Verkamp
ff898d9e9a nvmf: implement Get/Set Features - Host ID
Store the host identifier from the Connect command and report it via Get
Features.

Change-Id: I79bc27e05c5944549e7986aadb919c19748e7474
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 09:13:02 -07:00
Daniel Verkamp
b2678a5246 nvmf: return Invalid Log Page for unsupported pages
Change-Id: I27cbdf06caf66e5a23ec2b7e836915f2e386cea2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 08:50:49 -07:00
Daniel Verkamp
7a06e80143 nvmf: report unsupported Get/Set feature IDs
Also return Invalid Field rather than Invalid Opcode to be more
accurate.  The spec doesn't seem to define any more specific error code
for this case.

Change-Id: I992c6cca3020ff80b8495c71170222bc75316800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 08:50:30 -07:00
GangCao
3c11422403 nvme: acquire ctrlr_lock when submitting and completing admin IOs
Change-Id: I19f395d1859f75a665a1a0cd7bef1d88ebb15631
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-22 16:56:38 -07:00
Jim Harris
c61bd850f0 build: add copyright header where missing
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7908bbd58038d0a79087a03641f671e3f18e2a82
2016-11-22 16:41:47 -07:00
Daniel Verkamp
5e5a3851c3 nvmf: zero out Get Log Page buffer
None of the log pages are actually implemented yet, but at the very
least, we don't want to leak random bits of uninitialized data.

Change-Id: Ic889260eb18d49122f2f250b645bdc5be3561dc5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:33:56 -07:00
Daniel Verkamp
72054c70f6 nvmf/rpc: use spdk_json_write_string_fmt()
Change-Id: I7cf36201125a59637b43d4966d8f63e17947bc68
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:32:35 -07:00
Daniel Verkamp
1cb7e396a7 json: add printf-style spdk_json_write_string_fmt()
Change-Id: I9ea18072d4e54344f145a0b2d16aa6ab7f4d5e03
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:32:35 -07:00
GangCao
022b8a6df4 nvme: increase number of NVME_ADMIN_TRACKERS
Change-Id: I9f5ef187b70a61eda8f0d16677dd5cbe4e4fa3c2
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-22 14:38:05 -07:00