The Dataset Management command allows several operations to be specified
at once; the virtual controller only supports deallocate for now, but it
should just ignore the other bits in order to be spec compliant: "If the
Dataset Management command is supported, all combinations of attributes
[...] may be set".
The spec also explicitly states that it is acceptable for controllers to
choose to take no action based on information provided, so not
implementing the other attributes is fine.
Change-Id: Ia989dc1faa9c852660bf1299ea18fa8e7bdf4053
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Also add a diagnostic message if the requested log page ID is not
supported.
Change-Id: I7551b5905d5ebc29356839f0f9153dc86f237106
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Match the direct NVMe device backend by printing out each block device
that is added as a namespace to a virtual subsystem.
Change-Id: I5c2762ca1fbab3529c19c822c95c73b72e9dabbc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Rather than comparing the bdev name against "NVMe", use the new I/O type
supported API to query whether the unmap operation is supported.
Change-Id: I62c7a1ea5529366ff2ae4723b62f24ea78aa8193
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The scsi_bdev code now depends on lib/util, which needs additional
dependencies (libpciaccess or DPDK) to build beyond what is normally
installed on the Travis-CI system. Drop that test from the Travis-CI
unittest.sh script until this is resolved.
Change-Id: Ic2c90b765d2812f485553db77b7a433a50861f7b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Bdev modules need a separate interface than public
consumers of the blockdevs.
Change-Id: I581ee493570c114f7e96b31a425bc077a791c71e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This compilation unit depends on bdev.h definitions, but
was only getting them due to #include ordering elsewhere.
Change-Id: I4fcbdb2582a40836bcabc3539cc558614fbfacfd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Some block devices do not support the unmap operation, and we may add
other optional I/O types in the future. Add a method to check which I/O
types a specific block device supports.
Change-Id: I6e6414bf6b6482ea0224022d8326b252bd363c7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Dump both the MMIO region VS register and the Identify Controller VER
field, which should match.
Change-Id: I4c0eaa512424d85169a0f21ee86dbaedbfbc051f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Add bitfields for Optional Asynchronous Events Supported.
Also add it to the nvme/identify example.
Change-Id: Ifeb1cf8af94286a6cf437ec4b6f9e8b752c7d2f9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Print out the multi-path I/O features in a human-readable way.
Change-Id: If1302933eff7649c31e21188f71cc361cc90ff01
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Correctly calculate the maximum data transfer size as defined in the
spec - MDTS is a power of two in units of the minimum memory page size.
Change-Id: Ifd517d3051a28d404246c5a5d342147aa69ceedc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Switch from the non-portable <sys/endian.h> functions (htobeXX/beXXtoh)
to the SPDK endian conversion functions.
Change-Id: Id49b87f2e536c68f0d5d567e78e1990c0a37ef14
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Intel DC P3*** NVMe devices specify a desired stripe size, which was
used for splitting I/O. Not all devices, however, specify a desired
stripe size (such as the Intel DC D3*** line), and for only these
devices there was a logic mistake that overwrote the maximum I/O
size with a 2MB default. This patch corrects that error.
Change-Id: I94b72a3a3dd1dfa18bd638daf7e01a592eb6ed17
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Move the NQN validation into the subsytem creation function, and fix the
allowed size to match the spec.
The spec is not clear about the allowed NQN size; for now, interpret it
as 223 bytes, including the null terminator (222 bytes of actual NQN
plus one terminator byte).
Change-Id: If9743ab2fe009d9d852e8b03317d9b38d8af18dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
DPDK 16.07 introduced a new PCI ID field for matching by class code
instead of vendor/device ID. Use it to match all NVMe devices instead of
explicitly listing vendor and device ID pairs.
Change-Id: Ib2a5cc6833bf2b793d37d77caab97207f365df8f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This header will be used as the general NVMe over Fabrics target app
include file.
Change-Id: Ia26ff6d97fb3fd3f2c55b43c15abbb0e58998e30
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
SUBNQN is a UTF-8 null terminated string according to the NVMe base
spec, so pad it with zeroes using strncpy().
Change-Id: I486161b26d91f3ea1fd17428e220b9f20a874732
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
These are specified as "ASCII string", which means they should be
left-aligned and padded with spaces, according to the NVMe base
specification.
Change-Id: I25babe0ca417c2e16137b0bfc41fc7834277114e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This will be useful outside of the SCSI code, so put it in the common
string utility file.
Also reorder the parameters so they match the order used in strncpy().
Change-Id: I9e25a59b64e4bedf04e5a96de463b1d8aa0ddac3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Clean up the poller and only then free the associated subsystem's
memory. This prepares for future dynamic subsystem creation/deletion.
Change-Id: I9e56cbf8822814930fdbb662095c51b6ad40fbc4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Currently the NVMf target listens for new connections on any address.
Instead, listen only on the addresses specified by the user.
Change-Id: Idb6d37c422e442fc70a8673bd3fcfb9c27b57828
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Allow some time for the iscsiadm login command to finish before trying
to find the attached SCSI disk. This makes the reset test consistent
with other uses of iscsiadm.
Change-Id: I9521a41b51956643a437fcaccceefd256fb4b609
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
assert is part of the C standard library and is available
on any platform we'd consider porting to. Don't put a
wrapper around it.
Change-Id: I0acfdd6a8a269d6c37df38fb7ddf4f1227630223
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
pthreads are widely supported and are available on any
platform we currently foresee porting to. Use that API
instead of attempting to abstract it away to simplify
the code.
Change-Id: I822f9c10910020719e94cce6fca4e1600a2d9f2a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
pthreads are widely supported and are available on any
platform we currently foresee porting to. Use that API
instead of attempting to abstract it away to simplify
the code.
Change-Id: I28123d427ea8da07c6329b0233f0702f2d85c2a0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Comments are not allowed in the JSON RFC, but some JSON libraries accept
JavaScript-style comments.
Add a flag that enables non-spec-compliant comment parsing.
Change-Id: I9dfb66bb46ecff1a22d8af5a9c50620686a4707c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Build the now-generic nvmf_tgt app regardless of whether the RDMA
libraries are available.
The nvmf_tgt app Makefile still has to add the RDMA libraries to the
linker command, but otherwise it does not need to know anything about
the avilable transports.
Change-Id: Ibeeac5ed998be1eb12a673a1340893dbb53110b7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This allows live configuration of the target, much like
the iSCSI target. More function calls will be added
over time.
Also, make the tests wait until the target is listening
on the RPC port to determine that the target is ready.
Change-Id: I8f762e49511d482ef820f6b25a7d3ad9a8bb41f9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Use the event framework's new delay parameter to allow
for idle cores to sleep for up to 1ms at a time.
Change-Id: I665f38e590c07338418892afe0e75b0b2c79706e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
It is no longer needed, since the nvmf_tgt app handles initialization
and shutdown.
Change-Id: I051afe2b4fcbd09b32998386c63f591a0ab343c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>