Commit Graph

504 Commits

Author SHA1 Message Date
Ben Walker
882b790bfa nvmf: Make the poll rate for the acceptor configurable.
Change-Id: I6517220ef3f1a76938313c566f4ba642805ba1c5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-07 09:15:12 -07:00
Ben Walker
a0a92ff4c2 nvmf: Combine acceptor_init/fini with transport init/fini
These 4 callbacks can be condensed into two callbacks, which
simplifies the API.

Change-Id: I069da00de34b252753cdc8961439e13a75d1cc68
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-07 09:14:53 -07:00
Ben Walker
0dd80395f3 env: Move pci.c from util to env
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>
2016-10-05 11:53:24 -07:00
Ben Walker
a4747c6048 env: Make the environment library configurable.
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>
2016-10-05 11:51:37 -07:00
Ben Walker
a30b5532cb memory: Rename to env
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>
2016-10-05 09:49:35 -07:00
Ben Walker
6b1e4e732d Drop libpciaccess and switch to DPDK PCI
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>
2016-10-04 15:59:00 -07:00
GangCao
372942e569 nvme: move global request_mempool allocation into nvme_impl
The user no longer needs to create the request pool.

Change-Id: I83bb8948143d4cc961d232f9f30df3106d5e0eab
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-27 14:25:39 -07:00
Changpeng Liu
f07a666646 nvmf: check the user's Subsystem configuration is optimal or not
For NUMA architecture, you may get performance drop if your NVMe
devices and transport devices located in different socket, with
this patch, the NVMf target will print a warning message to remind
the user that your configuration is not optimal.

Change-Id: Ia6013ef95984f0ce8c7f1ca86b89c0375686a188
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-09-28 17:51:11 +08:00
Cunyin Chang
d20b90b21e nvmf: Add support for RPC interfaces.
Change-Id: I6f0fe35bf2876df181ad11294b62d64d97dcac2c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-26 16:07:30 -07:00
Jim Harris
06cf905c9a nvmf: allocate I/O channel for bdevs in virtual mode
I/O channels are not actually used for I/O yet however.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa3774ecacc7ec206c7c0c66e6b2f2d10c8fa785
2016-09-26 14:02:07 -07:00
Daniel Verkamp
884d076451 iscsi_tgt: report errors from spdk_app_fini()
Change-Id: Iae671fb7f7b3ac249256c70e8fc93b46e008219d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-23 12:31:47 -07:00
Ziye Yang
5dcf922cda nvmf: fix tgt subsystem delete related operations.
1 In our nvmf tgt implemention, we use the async
mode to delete the nvmf subsystem. However, when
we parse nvmf subsystem, we need to use the sync
function to delete the nvmf subsystem. Since if
there is error, we will call spdk_app_stop, thus
async functions will not be executed. It is
approved in my local test.

2 Add debug info in spdk_nvmf_delete_subsystem

Change-Id: Ia8ecd6eee1bbd25cb3e1ceeb0e2146f3f03be228
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-22 15:33:26 -07:00
Daniel Verkamp
7552ee5512 nvmf_tgt: fail if NVMe controller is not found
For subsystems in Direct mode, make sure the NVMe controller specified
is actually located during the probe call.

Change-Id: I7d5212ea628eadba3e720172a5ead8902eaaf6d0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-21 11:17:27 -07:00
Ziye Yang
6a6ef0d7e0 nvmf: update nvmf_disconnect to spdk_nvmf_session_disconnect
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>
2016-09-13 09:50:46 -07:00
Daniel Verkamp
bc0867dcaf nvmf: move subsytem poller to nvmf_tgt app
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>
2016-09-12 10:10:27 -07:00
Ziye Yang
9f2fc78e3f NVMf: Handle the memory leak issue of nvmf tgt
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>
2016-09-09 07:58:29 -07:00
Ziye Yang
dafac529a6 nvmf: fix bdev null pointer issue in spdk_nvmf_parse_subsystem
Need to check bdev != NULL, otherwise there will be a segment
fault later

Change-Id: I8aa74e7716decc3166f9f2abbbb0c8ff73816f84
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-09 07:57:58 -07:00
Cunyin Chang
9e501ce2fe nvmf: Remove the data structure spdk_nvmf_controller.
Change-Id: Ie6e8d0f60abc16216b8c95f12c658ba7cbb3aba0
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-06 13:54:58 -07:00
Daniel Verkamp
bc86133ecc nvmf: add notice for virtual namespace additions
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>
2016-08-30 09:28:15 -07:00
Cunyin Chang
b4d9cca109 nvmf: Add support for virtual controller.
Change-Id: I413553fcf7315038b4ce4ac9ebea70fffbec9a3d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-08-25 15:02:21 -07:00
Daniel Verkamp
c04b2968a6 nvmf: enforce NQN validity at creation time
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>
2016-08-24 13:34:47 -07:00
Daniel Verkamp
80d30bf903 app/nvmf_tgt: rename conf.h to nvmf_tgt.h
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>
2016-08-24 09:19:47 -07:00
Daniel Verkamp
467ea9e0a8 iscsi: add 'iscsi_top' monitoring app
Change-Id: Ief4efbc45f81ec59c75de28be701778e403b9f67
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-24 09:10:44 -07:00
Daniel Verkamp
39cda18718 nvmf: rename trsvc -> trsvcid for spec consistency
Change-Id: I5f73ef20ba231a7b1721562964dfd50de9b2c735
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-23 09:03:28 -07:00
Daniel Verkamp
20bee521a6 log: dynamically generate usage for -t option
Change-Id: I8c709b507c4cb00092d5dc9b1e8ca1c0fe880b02
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-22 16:57:19 -07:00
Daniel Verkamp
4ace96533d nvmf_tgt: build even if RDMA is disabled
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>
2016-08-19 09:47:51 -07:00
Ben Walker
f0ab59a325 nvmf: Include the JSON RPC server
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>
2016-08-19 09:47:04 -07:00
Ben Walker
5d21943624 nvmf: Allow cores not handling subsystems to go idle.
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>
2016-08-19 09:46:45 -07:00
Daniel Verkamp
8c931adaa4 nvmf: move shutdown cleanup to nvmf_tgt app
Change-Id: Ie1f5869dbbea3300d0aeb32e60a95d9a3c7ea535
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 09:17:38 -07:00
Daniel Verkamp
4c6e4d4963 nvmf: move acceptor poller into nvmf_tgt app
The NVMe over Fabrics target library now exposes a simple function call
that polls the acceptor once, and the application handles registration
of the poller.

Also rename the transport function pointers related to the acceptor so
they better reflect their purpose.

Change-Id: I5fa0d516586bf17e73afeb88ff3c2d5b0d46794d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-17 10:01:37 -07:00
Daniel Verkamp
0c00baf9bc nvmf: move conf file parsing to nvmf_tgt app
Change-Id: Iaf09d39046bceae023739d49e31804e150bb19d4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-17 10:01:37 -07:00
Cunyin Chang
077fe1da65 nvmf: Add nvmf subsystem dependence on bdev
prepare for the virtual controller.

Change-Id: I022e2c88cf8332c035b51e843d6b3ced4716df9c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-08-16 08:54:25 -07:00
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
31bb40dcf9 iscsi_tgt: print net framework name during startup
Change-Id: I5ae4d6605fcc1b5777fff6a73f2edcb9851ce805
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 14:01:50 -07:00
Daniel Verkamp
40c874105e iscsi_tgt: remove outdated comment blocks
Change-Id: I2173bd1920f54c55feb4956a3f78b173ca4f7f93
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 16:31:33 -07:00
Daniel Verkamp
5dbe2299cc iscsi_tgt: remove unused headers
Change-Id: Ie35a1c6bf54c484a94314112b85ea43d459b13dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 16:31:14 -07:00
Daniel Verkamp
c48df8950a iscsi_tgt: add missing #include <stdlib.h>
Change-Id: I8dd467057d8de8b3f1888a6995c3ffe9d4969b8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 14:59:37 -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
Cunyin Chang
8c094266ac nvmf: Adjust the data structure of spdk_nvmf_subsystem.
Move the ctrlr and io_qpair out of spdk_nvmf_subsystem, package them
as a new data structure. Union the direct and virtual mode namespaces.

Change-Id: I839aee3372c6c57aa03a0be76f8aaeb5045ecdaf
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-07-25 13:56:00 -07:00
Daniel Verkamp
c943e9ff4f trace: hard-code lcore history array size
Make sure the trace history that is exported via shared memory is always
the same size, regardless of DPDK configuration.

Also removes the necessity of including DPDK headers from spdk/trace.h
(so we have to fix up other files to include what they use).

Change-Id: I32f88921fd95c64a9d1f4ba768ae75e2ca5d91da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-22 12:50:44 -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
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
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
fdc1278440 nvmf: simplify session and connection cleanup
The whole cleanup process is now started by
spdk_shutdown_nvmf_subsystems().  Each subsystem will clean up its
session, if any, and each session will clean up its connections.

Change-Id: I9915d4547751ed4ffc4baa2c45c628698dd0b881
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:01:34 -07:00
Cunyin Chang
adcbbe19ff event: Add dpdk framework start function into event.
Make sure the reactor mask in profile take effect.

Change-Id: Ia471b2b88a711f05738cf93068c4f3a8c9a3039d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-07-01 10:07:42 -07:00
Ziye Yang
88669436f9 nvmf: remove unnecessary nvmf.h
The function call of spdk_nvmf_check_pools can be
directly put in nvmf.c.

Reason: This pool is created by nvmf subsystem,
it should be recycled by this subsystem.

Change-Id: I49e49bcb56079fc25d26b1f5078a1808c2f8e189
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-28 12:45:33 -07:00
Daniel Verkamp
39cc59635a build: include -lrt and -lpthread in LDFLAGS
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>
2016-06-23 09:04:02 -07:00
Ben Walker
dc6a0a2bd2 nvmf: Rename init_grp.h/c to host.h/c
Match the names in the specification.

Change-Id: Ic3f95220efea4dfbdf209af43db20da26ae232b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Daniel Verkamp
1bb4fac463 nvmf: remove unimplemented AuthFile config
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>
2016-06-09 14:25:26 -07:00
Daniel Verkamp
9b00a03a24 nvmf: drop spdk_nvmf_check_pools() parameter
There is only a single global g_nvmf_tgt that can be passed to this
function, so remove the parameter and use the global directly.

Change-Id: Ia1a2a1e6cd3801101ddeb4de5526dd115fa7ef8f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-09 14:25:26 -07:00
Cunyin Chang
f7ccfc6160 nvmf: Remove unused start_fn in spdk_app_opts.
Change-Id: I8f54612305af419ccc19356c09fe5053d52cd59e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-06-08 09:13:14 -07:00
Daniel Verkamp
0f912a0eaf nvmf: add NVMe over Fabrics userspace target
Change-Id: I739916824d033bd1a8f8b7f5def09e58f23d13cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-06 15:21:25 -07:00
Daniel Verkamp
22f741d539 trace: update shm name to match event lib
Add the '/' prefix to the trace shm name.

Change-Id: I4cf1011b639f299314ea379ba3fb626f5c2c787a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-01 10:14:46 -07:00
Daniel Verkamp
bdece622f5 trace: add tracepoint library and app
Change-Id: I472fb7e7a82e1337c6c06b1d3bb4e8a2a13d884a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-11 10:43:09 -07:00