Commit Graph

1313 Commits

Author SHA1 Message Date
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
Daniel Verkamp
7d5bcb4893 nvme: remove spdk_nvme_transport_type from API
Use the NVMe over Fabrics spec definitions for TRTYPE rather than the
internal library transport type.

Change-Id: Idead559a8f8d95274fc580d10e82033822e6eda8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:42:00 -07:00
Daniel Verkamp
9a40113a19 nvme: convert probe strings into char arrays
These need to be available for the lifetime of the probe_info structure,
so they can't be pointing at e.g. temporary buffers on the stack.

Change-Id: I5aaa898acf9314aab51600dd756f966965d37fd0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:42:00 -07:00
Daniel Verkamp
16ae39419d nvme: untangle internal enum_cb complexity
Change-Id: I73ddb996a652b78534ce49e5d4e43b269940ec4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:41:38 -07:00
Daniel Verkamp
b4bd76bc63 util: add vsprintf version of spdk_sprintf_alloc
-Wformat-nonliteral needs to be disabled since clang triggers it on the
call to vsnprintf() now that it is nested two calls deep.

Change-Id: I228b9d099cfc2b65181941cbb4798b7f8eae3baa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 11:52:00 -07:00
Jim Harris
407b550ff4 build: define SPDK_LIB_LIST to simplify building dependencies and linker args
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia969f9e5ed01f4b58cec2559133347d836118131
2016-11-22 11:45:48 -07:00
Jim Harris
2655503ff7 build: make a common mk file for nvmf unit tests
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7adcb863f991a8a9939430a7f15009b971ec937b
2016-11-22 11:45:48 -07:00
Jim Harris
5616e0880d build: create a common mk file for nvme library tests and examples
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ief0f99b7f014cf905d08e2c0cd9dc99653bd0bb8
2016-11-22 11:45:47 -07:00
Jim Harris
bb155377c3 examples/nvme: rename reservation.c to reserve.c
This enables some future Makefile simplifications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I071b32fbb695b74880c9659558d9653d3a904c10
2016-11-22 11:45:47 -07:00
Jim Harris
afa8cfbc88 test/nvme: rename nvme_sgl.c to sgl.c
This enables some future Makefile simplifications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I28e001e0e261d6c9f556cf53585e223f64cf0ae0
2016-11-22 11:45:47 -07:00
Daniel Verkamp
ae6fbf1d2d util: add spdk_strlen_pad() function
This is a counterpart to spdk_strcpy_pad() which determines the length
of a string in a fixed-size buffer that may be right-padded with a
specific character.

Change-Id: I2dab8d218ee9d55f7c264daa3956c2752d9fc7f7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 11:36:34 -07:00
Daniel Verkamp
5c146a19f6 nvme/identify: print NVMe over Fabrics probe info
Also clean up the PCI address output to be consistent with tools like
lspci.

Change-Id: I41f704943a1297379a7ad71cdc9ee9508b5235f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 11:36:34 -07:00
Daniel Verkamp
635602718b nvme: clean up Doxygen comments in API header
Change-Id: I16548628fa4eebc7ebd1d24f2775d38135d26822
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Daniel Verkamp
b3e46acfe9 examples/nvme/identify: clean up arguments
- Make the usage columns line up
- Fix the wording of the usage messages
- Fix the getopt() string for -x, which has no argument
- Use the default discovery NQN if none specified
- Use the nvmf_spec.h #define for max NQN length

Change-Id: I88608ead57d1bee46738ba05dc2074230d22be0d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Daniel Verkamp
1910c552f7 nvme/rdma: remove pointless nvme_rdma_ctrlr::cb
It always points to the same internal RDMA request complete function, so
just call that function directly.

Change-Id: Ic1fb6236bf43eaad62413df77d43be9ab855e5c7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Daniel Verkamp
d75b2f6c6f nvme/rdma: use max BB size as max_xfer_size
We can't transfer more than the bounce buffer in a single command, so
report that rather than some bogus value.

Change-Id: I39b147916dcc2ee478470917298763a239a6a35a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Daniel Verkamp
fd36d11e17 nvmf_tgt: stub out Async Event Config feature
Record the user-provided asynchronous event configuration set via Set
Features, and return it in Get Features.

This value is not actually used, since AER is not implemented yet in the
virtual controller model, but it at least implements the mandatory
Set/Get Features.

This allows the hack in the NVMe host code that ignored the Set Features
failure to be reverted.

Change-Id: I2ac639eb8b069ef8e87230a21fa77225f32aedde
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Daniel Verkamp
be54ddb05c nvme/rdma: retrieve CAP during ctrlr_construct
Fill in the cached copy of CAP in the generic NVMe controller to match
the PCIe transport.

This is not really early enough, since CAP is used during the reset
process to determine the reset timeout, but that will have to be fixed
separately by rearranging some of the transport callbacks.

Change-Id: Ia8e20dbb8f21c2871afb9e00db56d0730e597331
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:11 -07:00
Daniel Verkamp
4544a8b2ee nvme/rdma: fix incorrect NQN strncpy() usage
Make sure the entire NQN field is zero-padded, rather than using
strlen() on the input.

Change-Id: Icee68bd033feed057813beeb30cec102ed90840e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:11 -07:00
Daniel Verkamp
cf3fb7bb7d bdev/rpc: add driver-specific data to get_bdevs
Change-Id: Ieb37c9fdb55b36b62adcb421ab1d0426052d23a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 12:35:57 -07:00
GangCao
9ec380ba90 nvme: check whether the process is already added at the probe phase
Change-Id: I556c0fd993998a291bff227365102b9985e6d7ec
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-21 12:35:47 -07:00
Pawel Wodkowski
a1948352a3 lib/scsi: handle scattered input/output buffers for non IO commands
Fix buffer overflow/underflow for commands with alloc length scattered
into multiple preallocated buffers (eg. INQUIRY)

Change-Id: If6f7cabc7a6a7fb384bb015e14dc38548f484d0f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-21 10:52:35 -07:00
Daniel Verkamp
8c5738ec5c nvme: stub out RDMA transport when not enabled
This fixes a compiler warning about unhandled enum cases in a switch.

Change-Id: Icecb56b47a05c13f390f03b877f8eae243b481a6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-18 14:44:17 -07:00
Ziye Yang
246c39a7ee nvme: Add nvme over fabrics support
Change-Id: I6f6259e77baa5dc5861f31ec4a9034e15297d333
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-18 13:58:44 -07:00
GangCao
af9eca84d6 nvme: rename struct spdk_nvme_controller_process
Change-Id: If8f29409b86281532eae6d87d056a2f02f6609d4
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-18 12:53:52 -07:00