640 Commits

Author SHA1 Message Date
Daniel Verkamp
b8e5fbe688 iscsi: move g_flush_timeout into iSCSI globals
Change-Id: Ib77db9c4f0f1487fa8eb9e46409c7661dbb08cbc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 15:53:57 -07:00
Daniel Verkamp
ab90ab3cda iscsi: split spec definitions into iscsi_spec.h
Change-Id: Ia41f2e87f8bbfbcfc93ef6f4f2fa53893511c6a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 15:53:57 -07:00
Daniel Verkamp
ad6fa9f0d6 iscsi: replace printf()s with spdk/log.h calls
Change-Id: Ic2df5a410f5308bf8567058659d518052395fc36
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 15:53:57 -07:00
Daniel Verkamp
3c85e0a394 iscsi: add missing (void) in empty param list
Change-Id: Ia1c81e96b4109c92f50296cc29b86f38dd1e6652
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 15:53:57 -07:00
Daniel Verkamp
8cbf609982 net: remove unused #defines
Change-Id: Ifd84fc620cfec6302882bc967c3c135e896c70ac
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 13:46:20 -07:00
Daniel Verkamp
2c83419518 test/cunit: include stdio.h for fprintf()
Change-Id: Iabb79d8986c12b40c1dea322a319a6bee6971354
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 09:04:20 -07:00
Daniel Verkamp
184984603f nvmf: use Connect command SQSIZE to manage SQHD
The NVMe submission queue head wraparound point can be determined in the
generic NVMe over Fabrics layer; it should not be using the RDMA
connection queue depth.

Change-Id: I9da8f09e4f057f8fdc1ff4c6cc5f48cea7123e11
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 08:45:38 -07:00
Daniel Verkamp
f279de1f71 nvmf: set ASQSZ in discovery log
Report the maximum admin queue size correctly.

Change-Id: I52cad654bf59806e0abb8d869c22973647056617
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 08:45:38 -07:00
Daniel Verkamp
be0dae64be nvmf: simplify spdk_nvmf_rdma_conn_create()
Use the max_queue_depth parameter rather than rdma_conn->max_queue_depth
so that we can start to eliminate rdma_conn->max_queue_depth.

Change-Id: I1670c634e6d12aa004fb5a10338b7624850fbc4a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 08:45:38 -07:00
Ben Walker
26350acc0a scsi: Fix integer size mismatch when setting lba
Change-Id: I25ce88006dbd073fb795046b80086237246a6ff5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-05 16:08:01 -07:00
Ben Walker
55ec46aac6 nvmf: Free traddr/trsvc strings during config parsing
Change-Id: I10ab386a86a27e19ad571a9239039cc5a6c766f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-05 16:07:18 -07:00
Ben Walker
644b903b6c nvmf: Check callocs for failures
There were two unchecked allocations in the nvmf library. Check
for allocation failures.

Change-Id: Ic6b3104d825dba1ee6bd1748fa99e132702f300c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-05 15:46:13 -07:00
Ben Walker
2cf599b378 nvmf: Make domain/bus/dev/func unsigned
This fixes a static analysis warning for unsigned/signed
mismatch.

Change-Id: I49bd8d6d195f13b402e14a85503a5de6114f5b7f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-05 15:44:18 -07:00
Daniel Verkamp
021be6df16 bdev: add Linux AIO (libaio) backend
Change-Id: I6e7de4330f0c792514df21557a3010adef08c670
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 09:08:23 -07:00
Daniel Verkamp
040c0193f4 bdev: change blocklen from uint64_t to uint32_t
This is the size of a logical block in bytes; 4 GB is more than plenty.

Also allows cleaning up casts to uint32_t in the SCSI translation layer.

Change-Id: I3ec2e2f41fd378f1a83f31aac25c46ef780f63e9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 09:03:15 -07:00
Daniel Verkamp
60a91f33cc nvmf: add messages for session_init failure cases
Change-Id: I079df9a15ac023d160b842676aab162393f6da80
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 08:51:02 -07:00
Daniel Verkamp
5f6f676cbf nvmf: fix rdma_reg_msgs size argument
The large buffer pool allocation was using the per-connection queue
depth, whereas the RDMA memory region registration was using the global
RDMA max queue depth.  These sizes need to match, so use the global RDMA
max queue depth for both calls.

Change-Id: Iae161b719e09e19ca3e81df6593b68a4a2e86614
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 08:51:02 -07:00
Daniel Verkamp
cc0091cf00 iscsi: use new rte_mempool_avail_count() API
Change-Id: I75fc46181202d6b4732f65079815e1ae34e14cf9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 16:48:28 -07:00
GangCao
b724e2e5a6 nvme: change global g_nvme_driver object to a pointer
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>
2016-08-04 15:45:35 -07:00
Daniel Verkamp
ac7151b161 app: add function to get current core ID
Change-Id: I3428fc9944f7117facc6488489187dcf8b6ed825
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 15:43:07 -07:00
Daniel Verkamp
268ee865ab iscsi: convert acceptor timer to SPDK poller
Change-Id: I36dc81fd1d2240d925963a69f6a49fac51c50556
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 15:43:06 -07:00
Ben Walker
1e92d78a10 iscsi: Add an iscsi target application
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>
2016-08-04 13:15:33 -07:00
Ben Walker
b91c6e0e4a scsi: Make OBJECT_SCSI_TASK public
Change-Id: Icb4a5532dffe671aaa8e2b1b619de17ead66d3b4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-04 13:15:23 -07:00
Ben Walker
d29384bf97 iscsi: Add an iscsi library.
Change-Id: I28f3f4723a66f845eb478a6873d7aedb8f5409b8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-03 14:43:40 -07:00
Ben Walker
d3090c8455 Add a network stack abstraction layer.
This is a useful abstraction when you want to plug in
a userspace networking layer instead of using the kernel.

Change-Id: I7039d2987e6abad9dcd1987fa105282b1598e2f5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-03 13:30:27 -07:00
Ben Walker
01d13145c9 scsi: Flesh out the public header file
The public header file was missing some required definitions.

Change-Id: Ic4f8028367b1e21ea00c02660ca36be28da54e37
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-03 09:47:28 -07:00
Daniel Verkamp
e7a6744a88 nvmf: switch RDMA acceptor to spdk_poller
Use the new timer-based poller functionality to replace rte_timer.

Change-Id: Ic40653306cc73b40139fe18e06bab29b35721a43
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-03 09:00:54 -07:00
Daniel Verkamp
c41ab41c17 event: add timer-based pollers
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>
2016-08-03 09:00:54 -07:00
Ben Walker
d95d6822f9 scsi: No longer mark a bdev claimed when getting it by name
Just getting a reference to a bdev should not claim it.

Change-Id: I21e07160662490ec95b52fa31ea1d2ae93a21f09
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-02 10:07:34 -07:00
Ben Walker
e648950f89 bdev: Delete bdev_db
Combine the necessary functionality with the main bdev file.

Change-Id: I96d796bc87ac2a8688cdf1fd3c16d2a7c8aef730
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-02 09:08:51 -07:00
Daniel Verkamp
921bf34289 event: replace poller rte_ring with TAILQ
The rte_ring used for pollers is already single-producer and
single-consumer, so it is not providing any thread safety guarantees.
ALl modifications to the active_pollers ring are done from the core that
is running the reactor (via events).  This means the rte_ring can be
replaced with a simpler intrusive linked list.

This simplifies the removal of pollers in the middle of the list and
avoids extra allocations for the ring.

Change-Id: Ica149b7a1668a8af1e6ca8f741c48f2217f6f9bf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-01 12:40:34 -07:00
Daniel Verkamp
bd4ac74eaf scsi: import SCSI/blockdev translation layer
Change-Id: Ie96943f40ea8be4156d55bc5eeacc567743cf9d6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-01 10:35:01 -07:00
Changpeng Liu
5627b6871e nvmf: add identify namespace list support to NVMf target
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>
2016-07-29 15:49:41 -07:00
Changpeng Liu
ae20d784c2 nvmf: Print NVMe probe messages only on attach
Change-Id: I50f0cbf792f2d88316fbba9dd90ca1389961fecf
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-29 15:49:34 -07:00
Ben Walker
f1a584a9f7 nvmf: Use a shared memory pool for large data buffers.
Change-Id: Iab66335cee2a1e6c1774edd34978735be6763ce1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-29 15:36:10 -07:00
Ben Walker
b7b747eab1 nvmf: Correctly handle multiple wildcard NVMe directives.
Change-Id: Ie0c4a76734f1f0c4b87c7a752fe68627892a93b9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 14:29:15 -07:00
Ben Walker
caf8860900 nvmf: Allow higher queue depths
Allow higher queue depths by allowing many more send/recv
operations than read/write.

Change-Id: I66c424a6463e5e09be6d5463667241ce9271404b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 13:55:43 -07:00
Ben Walker
eee64c69f7 nvmf: Re-post the capsule immediately upon sending a completion
The target can only provide updates to sq_head inside
of completions. Therefore, we must update sq_head prior
to sending the completion or we'll incorrectly get into
queue full scenarios.

Change-Id: If2925d39570bbc247801219f352e690d33132a2d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 10:27:31 -07:00
Ben Walker
7e23841d28 nvmf: Separate the send and recv completion queues.
This allows the target to poll for internal completions
at higher priority.

Change-Id: I895c33a594a7d7c0545aa3a8405a296be3c106fb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 09:00:48 -07:00
Ben Walker
04beb5661e nvmf: Send completions after RDMA write has completed.
This ensures that the data buffers are not in use
when we go to send the completion.

Change-Id: I30467b3e3964001150f81b21e5b695dcd0974b0c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 09:00:48 -07:00
Ben Walker
d7b8da3b81 nvmf: Add a transport specific session
This is useful for holding session-wide buffer pools.

Change-Id: I7024da24b210a2205bf1e159d5935e0093b81120
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 09:00:47 -07:00
Ben Walker
52a4a388fb nvmf: Make RDMA WRITE operations signalled
Change-Id: Iad9e216144d88c899b52220ae9b32c24e3cbb252
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-28 09:00:47 -07:00
Changpeng Liu
0075135deb nvmf: fix the wrong caculation of Number of Queues for Get Features
Change-Id: I1aa388a85ebfba5a724ecde40d6ab6201ca8a410
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-28 08:09:30 +08:00
Ben Walker
8a701c3f8d nvmf: Use the inline SGL for keyed SGLs if the size is small enough
For small SGLs, even if they are keyed and not inline, use the
buffer we allocated for inline data.

Change-Id: I5051c43aabacb20a4247b2feaf2af801dba5f5a9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 15:24:01 -07:00
Ben Walker
ca0c13387a nvmf: Calculate queue_depth separately from rw_depth
Read/Write depth is much lower than Send/Recv depth.
Calculate them separately to prepare for supporting
a larger number of receives than read/writes.

Currently, the target still only exposes a queue depth
equal to the read/write depth.

Change-Id: I08a7434d4ace8d696ae7e1eee241047004de7cc5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 14:24:41 -07:00
Ben Walker
756df04485 nvmf: Remove g_nvmf_tgt global usage from transport layer
Change-Id: Id788312f597abf6ea937beb7d1d1bd5a168ae0f0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 14:24:39 -07:00
Ben Walker
296add8bb1 nvmf: Add config options for inline and max I/O size
These don't actually work quite yet, but pipe the
configuration file data through to where it will
be needed.

Change-Id: I95512d718d45b936fa85c03c0b80689ce3c866bc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 14:23:25 -07:00
Ben Walker
3d52e57cd0 nvmf: Allocate rdma reqs as a single contiguous buffer
For each connection, allocate a single buffer each
of requests, inline data buffers, commands, and
completions.

Change-Id: Ie235a3c0c37a3242831311fa595c8135813ae49e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:40:25 -07:00
Ben Walker
b43945830f nvmf: Simplify error handling in rdma conn create
Change-Id: I5380c7785a066f4414aaa1a27a467089d7b50031
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:40:25 -07:00
Ben Walker
5ade1c40f4 nvmf: Standardize names of rdma conn create/destroy
Change-Id: Id1b3328deceeeaa7da8ee2bda992a006286886b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:40:25 -07:00