500 Commits

Author SHA1 Message Date
Daniel Verkamp
7ec9bb11da pci: stub out kernel driver functions on FreeBSD
The kernel driver unloading/loading code is Linux specific; replace it
with stubs on FreeBSD for now.

Change-Id: Ic67c1d89b2fb9a65e9ce5b88d27b6cd6af5554a7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 09:23:24 -07:00
Daniel Verkamp
51bc5fce79 nvmf: drop redundant response CID assignments
spdk_nvmf_request_complete() always sets CID to the value in the
command, so there is no need to set it in the command execution
functions.

Change-Id: Ibbe745b862e27fff7c55e553758ef093e3ef7f6d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 09:20:55 -07:00
Daniel Verkamp
13c65342d4 nvmf: wrap number of queue lines in a nicer place
Change-Id: Ideffc66bd8051a8275c6692db08166f2b4ad6e9b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 09:20:55 -07:00
Daniel Verkamp
03cd283e43 nvmf: simplify Identify command handling
Use the passthrough command for all Identify commands except Identify
Controller.

Also only check the CNS field of CDW10 and use the new enumerated names
instead of magic numbers.

Change-Id: Ia94f820ac85a2d6b2d0ae02659e73c53f1b1a4cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 09:20:55 -07:00
Daniel Verkamp
fc07014a54 copy_engine: add I/OAT copy engine module
Change-Id: I670ab7c32aa7571def22c06dde091972808f215b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:57:22 -07:00
Daniel Verkamp
746dc47d62 copy_engine: add memory copy offload engine layer
Change-Id: I1aee004d6e0938972ece16eba6317d02ba3b0042
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:57:22 -07:00
Daniel Verkamp
336ba0d09c build: replace USE_PCIACCESS with config.h define
Drop the special-case preprocessor definition for PCI access library now
that config.h is available with an equivalent SPDK_CONFIG_PCIACCESS
define.

Change-Id: I4891d0f2fd7d3eea51b767df9e594555b36265ea
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:53:47 -07:00
Changpeng Liu
cd258ce089 nvmf: ack the disconect event before call rdma_destroy_id
If we connected a subsystem twice from the initiator, the second
connection will be rejected by the NVMf target, however, the previous
connection will also be impacted because we destroy the connection id
before ack the disconnect event.

Change-Id: Ib597cc68a7823524460693053898f4d6e5499eb4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-20 09:45:16 -07:00
Changpeng Liu
080bdfb1da nvmf: destruct the session when no connections on it
Change-Id: I32a9d71ea139eec346f020c629260a395fd228b9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-20 09:41:44 -07:00
Ben Walker
88245ea26b nvmf: Rename MaxConnectionsPerSession to MaxQueuesPerSession
Change-Id: I9891f9ed481b93312152c2a59f4263003167f1d6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-20 07:26:58 -07:00
Daniel Verkamp
b5e6d221bb nvmf: use raw passthrough for all I/O commands
There is no need to handle Read and Write commands separately; the
generic raw I/O command case can handle them just as well.

Change-Id: I8475eed0a20bd809c447ed2ccac0b99f6c2a9b4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 07:26:38 -07:00
Daniel Verkamp
77cb78fadf nvme: add enumeration of Identify command types
Change-Id: I2f8dc3de48c2e5dc06ccc9d007373e361bffcf63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 13:31:06 -07:00
Daniel Verkamp
ffa936d94b nvmf: switch to rte_mempool_avail_count()
Replace use of the newly-deprecated rte_mempool_count() with the new
name, rte_mempool_avail_count().

Also add a compatibility wrapper so that builds against older DPDK
versions still work.

Change-Id: If3c44bdef4bbcf7a456a1dfa272348ccc6f35261
Reported-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 10:02:20 -07:00
Daniel Verkamp
ec39dd62e7 nvmf: fail commands when controller is disabled
The host is not allowed to send normal admin or I/O commands until the
controller is enabled (via the Fabric Property Set command).

Change-Id: Ib62be3a3792fc0b36bace28b4c9afdf78dad3bcd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:28:15 -07:00
Daniel Verkamp
b794135bb1 nvmf: enforce fabric command order and type rules
Only allow Connect on a new connection (one that has no associated
session yet), and only allow Propert Set/Get on admin queues.

Change-Id: Iae22379ee47b095333372e6d151a7a1509acf654
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:28:15 -07:00
Daniel Verkamp
2d1c3419ad nvmf: verify correct IOSQES and IOCQES on connect
The NVMe spec requires that the I/O queue entry size values in CC are
set before any I/O queues may be created.

Change-Id: I4f0c9a9c20411223d281993745c85a8431197961
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
43510e1292 nvmf: fail attempts to modify reserved bits in CC
Track each individual bit in the Set Property handler for CC, and fail
the request if any unhandled bits are modified.

Also add handlers for IOSQES and IOCQES (I/O submission and completion
queue entry size).

Change-Id: I374dc3c15197e029ba07fd9ee1cff0e38a0a884d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
c53c5c6a9b nvmf: stub out CC.EN reset path
It is not implemented yet, but add a message to remind us to write it
later.

Change-Id: Ic1c35a0d35f728bc63b38c334d9c622493bee967
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
b9a67e983a nvmf: remove nvmf_property_set() shutdown flag
Property Set of CC.SHN is not supposed to terminate the session - remove
the commented-out code that was attempting to do this.

Change-Id: I1db230df9be549764287a8fd45ccdebea1d22a8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
8a2395d0e6 nvmf: update CSTS when host writes CC.SHN
Set CSTS.SHST = 10b to indicate that shutdown is complete, and
CSTS.RDY = 0 to match the state of CC.EN.

Change-Id: Ia651c34427526a38f22cba3910df2cf7d4bedd92
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
0cb9522781 build: include spdk.common.mk in lib Makefiles
Explicitly include spdk.common.mk at the top of all lib Makefiles so
that CONFIG options and other predefined variables are set.

Change-Id: I1e560c294fe8242602e45191a280f4295533ae44
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-18 16:17:40 -07:00
Changpeng Liu
cf29df4418 nvmf: fix the compile issue when enable CONFIG_RDMA in the CONFIG file
Change-Id: I3fb3b4cf762467f652af088b36669d30a8d8b726
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-18 16:07:39 -07:00
Daniel Verkamp
0480df054b nvmf: generate RDMA SGLs on the fly
There is no need to allocate ibv_sge structures within the RDMA request;
we can just fill them out on the stack right before submitting each
request.

Change-Id: I438ff0be2f6d07ffa933255c92c4ec964aa1b235
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 17:46:21 -07:00
Daniel Verkamp
2d75d67aa9 nvmf: don't count RDMA CQ entries
Just return success or failure - the actual count was not used.

Change-Id: I26e7c4c6319af444d221d9b0f313fb7071733619
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:48 -07:00
Daniel Verkamp
10687626e5 nvmf: factor out common RDMA completion code
All of the WC events that we handle map back to a request, so look it up
before checking the opcode.

Change-Id: I1b70a773374f64387df0a21a4f7fd64b26534b14
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:48 -07:00
Daniel Verkamp
e9658d055e nvmf: clean up RDMA tracelogs
Make sure all tracelogs in rdma.c use SPDK_TRACE_RDMA.

Change-Id: Idc3d3b6654215b5ab3ee84a106e46ffd3019cc7a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:48 -07:00
Daniel Verkamp
543b6d0932 nvmf: remove definitions that duplicate NVMe
These NVMf spec structure definitions are the same as the equivalent
NVMe structs.

Change-Id: I21c45973b7843e3767c48f97ec42e7b446df296f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:48 -07:00
Daniel Verkamp
70601d5e0e nvmf: add Doxygen comments to discovery log page
Also add the missing ASQSZ field.

Change-Id: I67e67a6b4076de226d30882aa40afd78bc8be2af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:46 -07:00
Ben Walker
677a2dc5d7 nvmf: Merge conn.[ch] into session.[ch]
There was only one function and a structure declaration
left.

Change-Id: I63277b4182120e7a76a925ed0bf7378ec7c23f20
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 14:45:26 -07:00
Ben Walker
2b9d85c448 nvmf: Remove host.[ch] and port.[ch]
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>
2016-07-15 14:35:24 -07:00
Ben Walker
d38d299576 nvmf: Round-robin allocate subsystems to lcores
Change-Id: I3f3937e0cdcf99f4e4be755df2865682ab230dfc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 13:12:18 -07:00
Daniel Verkamp
e3d9e24e20 nvmf: add discovery callback to transport
Make the transport responsible for filling out the fabric-specific
details in the discovery log entry.

Change-Id: I41d871c605becd557dca18f8ef7e80da66950257
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 13:11:03 -07:00
Daniel Verkamp
21c450e187 nvmf: add transport function pointer table
Make the core NVMf to transport interface generic and allow for multiple
transport types to be registered.

Change-Id: I0a2767a47d55999c45f788ae1318bb50af60ab4e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 13:11:03 -07:00
Daniel Verkamp
6a1383813c nvmf: rename FabricIntf to Listen, add transport
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>
2016-07-15 13:07:43 -07:00
Ben Walker
d6a499fec2 nvmf: Move poller from connection to subsystem
Change-Id: Iea6be8156152367c0fd48b8cee8e2ca1e67f340a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 12:22:53 -07:00
Ben Walker
96a54158bd nvmf: Assign each subsystem to an lcore
Each subsystem will run on a single core, which is more than enough
to fully saturate a device and a NIC. For now, all subsystems
run on the master lcore.

Change-Id: I95340a262d70fd346fa81fe519e7d4190a369e64
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 10:43:41 -07:00
Ben Walker
ca7a61e18a nvmf: New RDMA connections move to lcore after CONNECT capsule
Instead of starting the connection poller immediately upon
the connect event, wait for the first connect capsule to
start the poller.

This builds toward associating all connections with the same
session with the same lcore.

Change-Id: I7f08b2dd34585d093ad36a4ebca63c5f782dcf14
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 10:32:40 -07:00
Daniel Verkamp
0e1dc05efb nvmf: move TSAS to fabric_intf
It can be different per fabric interface within a single port.

Change-Id: If13590d7f12291499ccfd705efaf6d2b1b1d7003
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Daniel Verkamp
baf523b5d8 nvmf: add _subtype to TSAS structures
Fix the naming to match the spec.

Change-Id: I5e2fba54c796f8d1f11d61fb3d131aabc5c90503
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Daniel Verkamp
70e26ebd6f nvmf: remove unused port type field and enum
The type is already stored in the fabric_intf.

Change-Id: Icd33dd29f2fa1313329b4053892693c7ff90945d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Daniel Verkamp
2653cb49a7 nvmf: define transport-specific address union
For now, it just contains RDMA, plus a raw byte array to allow generic
copying.

Change-Id: I02fe11f99dd8b49000de0dba991cd34c99fd7a4a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Daniel Verkamp
ac470faa01 nvmf: remove unused #define SPDK_CN_TAG_MAX
Change-Id: I4ce711b3a9878fe06e508fbb1448791fda5c6917
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Daniel Verkamp
b10bf60cac nvmf: remove arbitrary 4-port limit
Change-Id: Id37a0f044845c175b2de43a5e1fa76513843f314
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 10:23:46 -07:00
Changpeng Liu
3c96acb4f4 nvmf: fix double free of session structure when exit the NVMf process
Change-Id: Iea34ca82898e58633c6f7edd2ab8ff04f5484220
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-15 10:15:03 -07:00
Daniel Verkamp
49e0054f18 nvmf: clean up redundant function name in TRACELOG
Change-Id: I87a01e0fe8c1437c084757e66377ac50ca83a0c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 13:32:33 -07:00
Daniel Verkamp
eca013c2e1 nvmf: simplify RDMA queue depth calculation
Pull out the duplicated min checks against the ibdev_attr values.

Change-Id: I774c355ba669486afde5c05c55a4ed653723db98
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -07:00
Daniel Verkamp
c3ed14d3a0 nvmf: refactor Connect command handling
Set a status code in the response capsule for each possible error case.

Also enforce CC.EN == 1 before I/O connect.
The NVMf spec requires that the controller is enabled before any I/O
queue Connect commands are allowed.

Change-Id: If56d6b4d6bedad00e9e845e77f05f715e3969f8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -07:00
Daniel Verkamp
31965a7021 nvmf: don't store connection QID
Drop the debug print in conn.c that was the only user.

We still have the connect data structure when determining the connection
type, and after that point, the queue ID is not needed.

Change-Id: Ida9e170099f977ec6b84478874863c40d6f7d8a1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -07:00
Daniel Verkamp
3f80d55199 CONFIG: rename CONFIG_NVMF to CONFIG_RDMA
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>
2016-07-14 12:58:17 -07:00
Daniel Verkamp
51701f0053 nvmf: add headers for in6_addr
Fix build on FreeBSD.

Change-Id: I2f50e79b71ebbe2bba98722be092a7a4c06c8f19
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -07:00