This requires a couple of related changes:
- I/O queue IDs are now allocated by using a bit array of free queue IDs
instead of keeping an array of pre-initialized qpair structures.
- The "create I/O qpair" function has been split into two: one to create
the queue pair at startup, and one to reinitialize an existing qpair
structure after a reset.
Change-Id: I4ff3bf79b40130044428516f233b07c839d1b548
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Also continue checking for errors after a problem has been found.
Change-Id: Iea37311e54f68fb6ba8c804ad4b2fb92d5238f36
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Make the transport ctrlr_construct callback responsible for allocating
its own controller.
Change-Id: I5102ee233df23e27349410ed063cde8bfdce4c67
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
These are specific to local NVMe PCIe devices, so move them out of the
generic NVMe code into the PCIe transport.
Change-Id: Iea2056a4c438b7d3a303b4b5e977ce7aa9e58c05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This changes as little code as possible while still creating
a single public API header. This enables future clean up
of the public API and clarification of the exposed
concepts.
Change-Id: I780e7a5a9afd27acf0276516bd71b896ad301c50
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This will allow factoring out PCIe-specific code into a swappable
transport so that NVMe over Fabrics host support can be added.
Change-Id: I4df74dd268d655e3b36e8d6114ebe7d79a24844d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Mounting with sync to do more IO during test.
Print dev stats after umounting.
Do not change directory to mounted system, as this is preventing cleanup
trap to umount used path in case of failure.
Change-Id: I2f444b67b1f293c9d7c939f8f94aa5756e20aa26
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Change tests to use read/write vector and non-vector versions.
Change-Id: I5a97568d3dc2f61d44721f4b0c75331baad417bb
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This patch enables vector operation for bdev drivers aio, malloc and
nvme.
The rbd driver still handle only one vector.
Change-Id: Ie2c1f6853bfd54ebd8039df9a0305854ca3297b9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This patch makes lun_name:lun_id pair as one object,
the same for the pg_tag:ig_tag.
Change-Id: Ib08450d12bde9b8388d4ae41e214cc0ba64c8b1e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Instead of a magical "All" value for allowing all hosts, allow the
caller of construct_nvmf_subsystem to omit the "hosts" parameter.
Change-Id: I97c7ae806a0be7142fb59708d47023e42e127fcc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
For the nvme readv/writev APIs, the PRP checking logic was
incorrectly failing single SGE payloads that were larger
than 4KB. This patch adds a test case for this scenario,
and fixes the PRP checking logic.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6357d620599666046d2cb74d7923dac1f75418c5
This test will create a malloc and NVMe iSCSI target node,
perform an iSCSI login, create and mount a filesystem, then
copy the SPDK contents to the mount and do a build.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I00291e6ca768dd4b685086cf1479098558b9329f
Explicitly include the pthread header after removing some headers that
implicitly included it.
Change-Id: I39fe272acfcc63d3888d2430137de2c3426f1af6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Use standard GCC style atomic operations instead of
the DPDK calls. The DPDK calls end up translating
to the gcc standard inline calls in the generic
case anyway.
Change-Id: I0ea760c4e23c3660b082a803bbc174de7250f365
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Remove #includes for all DPDK headers that weren't
necessary.
Change-Id: Ib02522e0f04e64a1c98afceb7508cc0e8d931a9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This was only used for debugging. Everywhere else
used the spdk_memzone abstraction.
Change-Id: I8a828ea3c7abccb66c8a027cb13de43c560ff7a1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This converts some, but not all, usage of rte_mempool
to spdk_mempool. The remaining rte_mempools use features
we elected not to expose through spdk_mempool such as
constructors, so that will need to be revisited.
Change-Id: I6528809a864ab466b8d19431789bf0f976b648b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change the type from int to bool and change the name
from data_ref to data_from_mempool.
Change-Id: If1fc11761e63561443ed44d6a0860e416e424df8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This is required since pollers are now directly removed
(rather than scheduling an event) when the unregister call
is made on the poller's lcore.
Without this change, if a poller is registered then
immediately unregistered, the unregistration will seg
fault since the event adding the poller has not executed
yet.
Also add a test case that exhibits the sequence of events
described in this commit message.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5c6ba0ee224ac1f8f3ebb8e7571714e718bd42db
Use the env library to perform all memory allocations
that previously called DPDK directly.
Change-Id: I6d33e85bde99796e0c85277d6d4880521c34f10d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Also stop submitting new I/O for any target that reports
an I/O failure by setting its is_draining flag when the I/O
failure is detected.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I89c9d19b22a164caf5aef20d63b509d33b7aeef7
Enforce exactly one trailing \n, and fix all of the existing cases.
Change-Id: I6218e4700e90aeb647eaee78089530c79993c8c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This patch enables vector operation for bdev drivers aio, malloc and
nvme.
The rbd driver still handle only one vector.
Change-Id: I5f401527c2717011ecc21116363bbb722e804112
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This allows users to swap their PCI library from
libpciaccess/dpdk to another mechanism using the standard
method for swapping out the env library.
Change-Id: Ib2248f8b43754a540de2ec01897e571f0302b667
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.
Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The new env library will wrap all third-party library
calls and be easily swappable with alternate implementations
at build time. For now, it's just the memory library
renamed.
Change-Id: I26a70933289f8137107208ba75f7520fd7a33da0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This patch also drops support for automatically unbinding
devices from the kernel - run scripts/setup.sh first.
Our generic pci interface is now hidden behind include/spdk/pci.h
and implemented in lib/util/pci.c. We no longer wrap the calls
in nvme_impl.h or ioat_impl.h. The implementation now only uses
DPDK and the libpciaccess dependency has been removed. If using
a version of DPDK earlier than 16.07, enumerating devices
by class code isn't available and only Intel SSDs will be
discovered. DPDK 16.07 adds enumeration by class code and all
NVMe devices will be correctly discovered.
Change-Id: I0e8bac36b5ca57df604a2b310c47342c67dc9f3c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Provide a convenience wrapper for general purpose dataset
management commands. The previous wrapper for deallocate
was difficult to use correctly and only for deallocate.
Note that the name is "dataset_management" as opposed to
"data_set_management" to match the NVMe specification.
It's questionable whether "dataset" is valid English, but
it is best to match the specification.
Change-Id: Ifc03d66dbabeabe8146968cf8a09f7ac3446ad68
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Where possible (for tests that don't require DPDK), run the unit tests
under Valgrind to check for memory leaks and out-of-bounds accesses.
Change-Id: Ic7b3cdd39a6d59f4e41b4a161be3363f6b076f65
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Avoid putting the large JSON-RPC server structs on the stack in the unit
test code, since it confuses Valgrind.
Change-Id: I598530810aa23e802d07cd1bb94de16920f33dac
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Rather than requiring changes to a static list of header files, use the
GNU Make wildcard function to generate a .cpp file per header.
This also tests whether each header includes all of the system headers
for the types it uses.
Change-Id: I05b82510b194533672568019e138d7d1aad2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Modify the spdk_poller_unregister() function so that it works correctly
when unregistering a poller from its own callback function.
Change-Id: I57fa5ebd8a8bad522e34f597b406a4726f1b76ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This was added after the previous SPDK_CU_ASSERT_FATAL change was
merged.
Change-Id: I9d26fcd78157b6c9b232ac1e7484d0939cc90612
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
We already require the assert header from the C standard library,
so use that instead of RTE_VERIFY to further isolate DPDK
dependencies.
Change-Id: I4a718af858c88aff6080e33e6c3dd533c077b8f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Add some checks to hit paths not covered by the current tests.
Change-Id: If8e7977ab8327eacfa33657d0a167f3b935b0113
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Some subsystems may wish to create unique I/O channels
which are not shared across all users of the same I/O
device on the same thread.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3ade3675d57338cf85b6a301285e6f392bd6cd2e
Also remove libspdk_util.a from the io_channel_ut linker command, since
it already includes the tested C file directly and doesn't depend on any
other util library functions.
Change-Id: I4b3fc4d57b5af4524b53664365f6ba52686e4b80
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The test can't continue if a NULL pointer would be dereferenced.
Change-Id: If857057c69679de3be08c4605d15bc2b3892210a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
If posix_memalign() fails, it may not have updated buf, so set it to
NULL explicitly.
Change-Id: I756bdc59ec1e31987ad3e6754eec4e2194b95074
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
bdev and copy modules no longer have check_io functions
now - all polling is done via pollers registered when
I/O channels are created.
Other default resources are also removed - for example,
a qpair is no longer allocated and assigned per bdev
exposed by the nvme driver - the qpairs are only allocated
via I/O channels. Similar principle also applies to the
aio driver.
ioat channels are no longer allocated and assigned to
lcores - they are dynamically allocated and assigned
to I/O channels when needed. If no ioat channel is
available for an I/O channel, the copy engine framework
will revert to using memcpy/memset instead.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99435a75fe792a2b91ab08f25962dfd407d6402f
With the I/O channel changes, this test needs to be rewritten
to be event-based. bdevio uses the spdk_bdev_do_work() function
to poll for completions, which is built on the check_io functions
that are going away when we move to using I/O channels.
Do not delete the code from the tree - just detach it from the
build and the test scripts for now.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I88674988db6ccb3673faf7eb5b3e79b403059fa4
This patch adds a basic framework for creating I/O channels
for I/O devices. An spdk_io_channel represents a one-to-one
mapping between a calling thread (represented by spdk_thread)
and an I/O device that the thread will perform I/O operations
on.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I658ab7f995cc962f4e2a204e058cdd3ad3fd735d
Purpose: To make the function definition style consistent
Change-Id: I7ade943881aa5076fdd419958e386ae3c3661da6
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This matches the general order (LBA start then LBA count) for
the NVMe API.
While here, fix a copy/paste error in a debug message (write
instead of writev).
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ice326af5d6025867dffed4d1f6c7b81fb9eba5eb
Rather than forcing the NVMe library user to pass a specially-allocated
block of memory (e.g. rte_malloc() in the case of the default
nvme_impl.h), just make the NVMe library allocate a suitable buffer
itself and copy to/from the user buffer as needed.
The fast path I/O functions still require special rte_malloc()
allocations, since we don't want to add an allocation and copy to the
I/O critical path.
Change-Id: I7fe88c0ba60c859a33bbe95b7713f423c6bf1ea8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
1 Rename this function and make it more meaninful, since
we have spdk_nvmf_session_connect which is used to link a
connection to the session
2 split spdk_nvmf_session_destruct.
Change-Id: I150df7ccdf4de3428d8cecbb286d5f7944510a8c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
The application is now entirely responsible for scheduling subsystem
pollers and sending events between threads.
Change-Id: I88da1f53b5e8852c7c4acd6f0a7a1e2219fbed41
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reason: In acceptor_poller_unregistered_event, we
directly call spdk_nvmf_check_pools and spdk_app_stop,
it will fail the memory check.
And function nvmf_delete_subsystem_poller_unreg will
not be called since we already call spdk_app_stop.
Change-Id: I3ffa30c87b149a66cee1d87d1bb81d4dc8cc96b9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
The trace logs were useful during development, but now that the target
is working reliably, we can make the test output quieter and shorter by
turning them off.
Change-Id: I46cd2e22a3ccd69a5f94a1843b722f517223a343
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The translation code currently cheats a bit - it allocates a full 4KB
buffer for any DATA_IN command that is not a READ, and then the
different SCSI commands that fall into this category (INQUIRY,
READ_CAPACITY, MODE_SENSE, etc.) can write as much data as they
want without having to worry about a buffer overrun. Code higher
up the stack makes sure we only send the correct amount of data back
to the iSCSI initiator.
This patch fixes this behavior for standard INQUIRY (EVPD = 0).
Future patches will fix the behavior for other non-READ DATA_IN
commands, at which point we can remove the 4KB allocation and
only allocate the amount of data specified in the CDB.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If5e4a10eeba9851e2d91cab71228d2fc2d5baad0
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>
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>
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>
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>
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>
The user can now specify a maximum delay, in microseconds, that
defines the maximum amount of time a reactor will sleep for
between polling for new events. By default, the time is 0
which means the reactor will never sleep.
Change-Id: I94cddb69c832524878cad97b66673daa4bd5c721
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Add slightly better statistics to get a range of values instead of just
the average.
Change-Id: I159994dce38412755afdd8980030c407125957e9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Make sure any partition tables or other random data on the disks is
cleaned up before running the tests, rather than trying to clean it up
on failure when the system is in a potentially bad state.
Change-Id: Ia2119485aee6a50243744328dff2314d7a72adad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This leaves more flexibility for future changes to the poller
representation without requiring API changes (after this one).
It also prevents the user from accidentally using poller fields in a
non-thread-safe way, since they can't be accessed directly anymore.
Change-Id: I7677d5b93668665d29ae39c5e0ba74333ad3f878
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Report the maximum admin queue size correctly.
Change-Id: I52cad654bf59806e0abb8d869c22973647056617
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
We are already testing bdevperf in the previous 'verify' test, and the
I/O splitting is handled by the NVMe-specific tests, so shorten the bdev
tests somewhat by only doing the large I/O bdevperf test in the nightly
test run.
Change-Id: I33439be4553ea94127e2039069dd7f58162e5d0f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Move the long verify to nightly testing only, and make the other FIO
invocations shorter.
Change-Id: Ic09b88aa16ad2ce62113821ad0c66dbf44a5721e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is a step towards enabling sharing SPDK NVMe
device access from multiple processes using DPDK's
multi-process framework.
Change-Id: I57d5eec158b42addc1036bd2583596471a467a95
Signed-off-by: GangCao <gang.cao@intel.com>
Similar to our NVMf target, this is an iSCSI target that
can interoperate with the Linux and Windows standard iSCSI
initiators.
Change-Id: I6961c5ef99f7b161c396330ed5b543ea29b0ca7b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Allow pollers to be scheduled to be run periodically every N
microseconds instead of every iteration of the reactor loop.
Change-Id: Iaea3e98965d81044e6dc5ce5f406bcb7a455289e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Combine the necessary functionality with the main bdev file.
Change-Id: I96d796bc87ac2a8688cdf1fd3c16d2a7c8aef730
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
We reported virtualized NVMe devices through NVMe over Fabric specification,
with 1.2.1 NVMe version. For direct mode, the NVMe device maybe has lower
version, such as 1.0, the identify namespace list can not support in those
devices, so we need to add helper function here to simulate such commands
from initiator.
Change-Id: I226f4f34bf61017f538d2dd80332f1d054a501f1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
No need to do read and writes plus verify - the verify is
a read itself.
Change-Id: I28d08717e49b1327b04490810f8e6069504173c2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This is a much simpler approach and is only slightly
less efficient.
Change-Id: I909de376d576a74156c1be447e90e7dbc240f025
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
These can be simplified and merged into the subsystem.
Remove the concept of mappings from subsystems and replace
it with a list of hosts and ports. The host is optional -
not specifying a host means any host can connect.
Change-Id: Ib3786acb40a34b7e10935af55f4b6756d40cc906
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change the Port configuration file entries to a new format:
[Port1]
Listen <transport> <address>:<service>
Initially, this still only supports RDMA, but the new format will allow
specifying other transports once they are added.
Change-Id: Iadfd19b91db57b571064379368dbe77204ccecbb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The NVMf target is being refactored to split the RDMA transport-specific
code into its own file. Once this is complete, we should be able to
plug in other transports and build the NVMf target without any RDMA
dependency if desired.
To enable this, change the CONFIG option to RDMA; it still controls
whether the whole NVMf target is built for now, but once the RDMA
dependency is actually made optional, we will be able to build the
generic NVMf target code without libibverbs installed.
Change-Id: I8cd90a9aaa85dcefcc9b0f8f2e7b6af21958b2a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This never really made sense, so replace it with a list of
subsystems.
Change-Id: Ie7a9400083c091ac7142d01c23948200f515bdf7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This is just extra complication for no real benefit.
Change-Id: I528af98e799d0641e753390fe35ff561fa3d7d76
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This is a bit heavy handed, but really make sure all
activity has ceased.
Change-Id: Iaa1ce16fd9e059f9eaec6712226344d69075b243
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
There's no benefit of reloading the NIC drivers (unless the drivers
themselves are buggy), so save some time by skipping the rmmod of
drivers we are about to load.
Change-Id: I05c3fd06042a2e06333d0cac123d24e6cce65b23
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Only nvme-rdma should be loaded as part of the NVMf testing.
Change-Id: I232363bf0988ea9bd99a37df27c39cc8e9732ad5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Inline function that is only called once.
Fix == bashism.
Create the filesystems on the partition created by parted rather than on
the raw namespace block device.
Add 'sync' invocations to make sure data gets flushed to the block
device we are testing.
Drop the copy-pasted FIO cleanup code (filesystem test does not run
FIO).
Change-Id: Id47d68db208a618841291c4184824031476268f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Multiple NVMe controllers within a subsystem does not work correctly,
since we would need to virtualize the controller data, namespace IDs,
and so on. For now, only allow pass-through mapping of a single NVMe
controller per subsystem.
Change-Id: Ib2d3576d2856c46a086f38eb6bec56f3e7a73575
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Previously, we used cap_lo and cap_hi to represent the 32-bit halves of
the full CAP register. However, it is simpler to keep them in a single
64-bit structure, and is no less efficient on 64-bit platforms.
Also name the NSSRS field from NVMe 1.2, which was previously reserved.
Change-Id: I1d5d9b0dccbb12373b4aed3db29c883881d43223
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Make the path to the executable shorter so it fits in the coredump.
Change-Id: I651c6cb4bd37fea51dd8e39b47a97c4edeace22f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Make sure the reactor mask in profile take effect.
Change-Id: Ia471b2b88a711f05738cf93068c4f3a8c9a3039d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
There is a sporadic error mounting ext4. Enable
tracing to attempt and catch it.
Change-Id: I8cb8425cbd076add0676064fccce66fdd4531b19
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
4420 is the officially assigned IP port from IANA for NVMe over Fabrics.
Change-Id: I433a5ed0780d1ffd7ca6512617759d59fa5e8def
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
NVMe over Fabrics defines its own NVMe Qualified Name (NQN) format; it
does not use iSCSI Qualified Names.
Also change the default node base for nvmf_tgt to "nqn.2016-06.io.spdk".
Change-Id: I2b73c1426ef1d8c83cc2df499d79228ea61257cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This will allow removal notifications to be propagated to the library
user (e.g. for hotplug).
The callback is currently unused, but this at least prepares the API for
the future hotplug support.
Based on a patch by Dave Jiang <dave.jiang@intel.com>
Change-Id: I20b1c2dbf5e084e0b45a7e51205aba4514ee9a95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Use the knowledge that both the source and destination of
nvme_copy_command() are aligned to emit the aligned variants of the
SSE2/AVX mov instructions.
Change-Id: I0a7e32a3bb10b9a1920cd85691b79fa7172eecb3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Match the expected alignment for nvme_alloc_request() and nvme_malloc()
to allow optimized memory copy code to work even in the unit tests.
Change-Id: I546692a6df9615a12a8209618fb6159a9c9e426b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Also finish up the req_state -> req conversion.
Change-Id: I131dd52dcd36a790b942e06f0207a3274cc04ffc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fabric commands were skipping a step, so unify all
types of requests through the same completion path.
Change-Id: I5f38a7e1cdcdf33baf71486d5ddae9f5a6157fac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This moves some definitions from nvmf_spec.h to
nvme_spec.h based on the latest publication.
Change-Id: I51b0abd16f7d034696239894aea5089f8ac70c40
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
It is always set to nvmf_process_async_completion and is only used
within the library.
Also rename nvmf_process_async_completion to spdk_nvmf_request_complete
to clarify its purpose.
Change-Id: Ie737fb60688329bfe329a8553c4a40ff2e5f8f1d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Everything necessary for processing an admin command is now stored in
nvmf_request.
Change-Id: I74e75a5b7bb3b406ad167c2b31cab1af7a1f270a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Everything necessary for processing an I/O is now stored in
nvmf_request.
Change-Id: I3f390707ebe83ea66a116dcfda4d0388a6823629
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Simplify the build rules so that common libraries are always linked.
Also fix up a couple of -lpciaccess instances that should have been
changed to $(PCIACCESS_LIB).
Change-Id: I4c50fa3aa59cae013d3385e38fbb830794299f6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
vtophys() was checking for out-of-range addresses incorrectly: vfn_2mb
is already shifted to account for 2 MB hugepages, but it was being
compared with a mask that did not account for the shift. This would
allow out-of-bounds access to the 128tb map array for certain invalid
addresses (it had no effect on addresses within the valid userspace
range).
Change-Id: Ida7455595e586494c9025f9ba65d050abb16b1b9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Work around an issue with the mlx4 driver.
Make discovery of NICs more generic.
Change-Id: I9701d8d7937faa299d12d7ca4bfe1c923983c263
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This enables SPDK_NVMF_BUILD_ETC to be moved out of the library as well,
since only authfile was using it before
Change-Id: I10d1145881f9a0358d7effe2d2d9851899413e1b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The section is really defining a subsystem as defined
by the NVMf specification. There does not appear to be
any need for a group of subsystems.
This change only updates the configuration file. It does
not remove all references to a subsystem group from
the code.
Change-Id: I38e62735a5ac924dcafacb3c9a332a103d751d4a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The specification refers to this concept as a Host,
so use that term. This only changes the configuration
file usage. Initiator groups are still referenced in
the code and will be removed later.
Change-Id: I897f4dbdfb65d94da1e5a77434fc07a2c18bcdc2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Put the common funcs in test/nvmf/common.sh to
reduce duplicated code
Change-Id: I1c72f6fb22d092dafb7fb134b8bb3780b5525e48
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Gang Cao <gang.cao@intel.com>
The index should be 0 for fabricintf.
Moreover, when there is no fabricintf found, error should
be returned
Change-Id: I3aa04566a5a318b8c921dd37c8573ed075254266
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
NVMe opcodes contain a two-bit field that encodes the expected data
direction for each command. Add an enum and a function to extract these
bits.
Change-Id: Ie214319f121cf0899c6aa5663866f2988b128dd2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>