Commit Graph

127 Commits

Author SHA1 Message Date
GangCao
3a74e273fc app/nvmf_tgt: free the allocated memory for the listeners
Change-Id: Icfd6ed4e4a00b28ad882e1fde0652025581760f9
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-08 09:56:28 -07:00
GangCao
4cdd929b66 nvmf: introduce the global and per subsystem listen addresses
Change-Id: I276a71a3280c41b215a9cf4ca85247bd397a85e5
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-07 12:56:13 -07:00
Daniel Verkamp
ba74eaf49f CONFIG: add CONFIG_VHOST option (on by default)
Change-Id: Ic493e5d4ebbd45370ddf0086cfe9e924d444c72f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-07 12:43:51 -07:00
Daniel Verkamp
b58a5d73ef util: add SPDK_COUNTOF() array size macro
SPDK_COUNTOF works like sizeof, except it returns the number of elements
in an array instead of the number of bytes.

Change-Id: I38ff4dd3485ed9b630cc5660ff84851d0031911f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-07 12:43:42 -07:00
Daniel Verkamp
cc85d7ef68 nvmf: move io_channel allocation to virtual.c
Change-Id: Ibe0464a539b7545d7f911d6af13a1bd3f7bd3cd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-06 17:15:31 -07:00
Piotr Pelplinski
1dbf53eebf vhost: add a library and app for userspace vhost-scsi processing
This patch adds a library, application and test scripts for extending
SPDK to present virtio-scsi controllers to QEMU-based VMs and
process I/O submitted to devices attached to those controllers.
This functionality is dependent on QEMU patches to enable
vhost-scsi in userspace - those patches are currently working their
way through the QEMU mailing list, but temporary patches to enable
this functionality in QEMU will be made available shortly through the
SPDK github repository.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Krzysztof Jakimiak <krzysztof.jakimiak@intel.com>
Signed-off-by: Michal Kosciowski <michal.kosciowski@intel.com>
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>

Signed-off-by: Krzysztof Jakimiak <krzysztof.jakimiak@intel.com>
Change-Id: I138e4021f0ac4b1cd9a6e4041783cdf06e6f0efb
2017-03-06 12:44:35 -07:00
Cunyin Chang
6da9e1792a nvmf: move the virtual mode related code to the virtual.c.
Change-Id: Ia68ffdd2019adba3a37295ee455e93f8e0427fa2
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-03 10:06:46 -07:00
Ziye Yang
bfe2897da3 nvmf,target: solve shutdown coredump issue
It is caused by this commit:
4163626c5c

nvmf_tgt_delete_subsystem registers the poller
with function subsystem_delete_event.
subsystem_delete_event is called asynchronously,
the deletion should happen in this function.
Otherwise, with the current code,

g_subsystems_shutdown = true
TAILQ_EMPTY(&g_subsystems) = true
when subsystem_delete_event is firstly called.

If there are multiple subsystems, the logic is wrong.
Thus other subsystem will never be delete. since
we already execute shutdown_complete().

Also add related test scripts.

Change-Id: I3823563fc9e8611c11a6d798685ff64e2939842e
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-02 09:39:48 -07:00
GangCao
fde3041296 app/nvmf_tgt: correct the parsing of listen addrs
Change-Id: I77ececd69884e58019e038096ebdcac8e87ede3a
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-01 12:26:48 +08:00
Daniel Verkamp
affd815c0e nvmf/conf: remove dead store of num_hosts
Change-Id: I0e129f1102f8a5925626fbeed3a5bf2341873874
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-24 16:13:47 -07:00
kaox2
2343b2ce22 conf.c: update num_hosts after parsing. (#125)
The number of hosts are not updated after parsing.
2017-02-24 16:07:02 -07:00
Tsuyoshi Uchida
f401557392 nvmf_tgt: modify removal timing of nvmf_tgt_subsystem from the list (#117)
subsystem_delete_event():
Delete TAILQ_REMOVE because nvmf_tgt_shutdown_subsystem_by_nqn has
already called TAILQ_REMOVE.
shutdown_subsystems():
Add TAILQ_REMOVE according to the above change.
nvmf_tgt_delete_subsystems():
Add TAILQ_REMOVE.
2017-02-24 15:08:44 -07:00
GangCao
6e8b6aea28 app/nvmf_tgt: rename spdk_nvmf_parse_subsystem_for_rpc
Change-Id: Ie07b8e593b757bcd1c796a2892292bffce2b77d7
Signed-off-by: GangCao <gang.cao@intel.com>
2017-02-22 19:13:05 -07:00
Ben Walker
18d26e42a3 env: Move DPDK intialization into the env library.
Change-Id: Ie3a324f1523ffa0ddb0bd6a24a9a3cd0acbf64b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
Ben Walker
25270f1d7c Rename instance_id to shm_id and make it default to pid
By default, all SPDK applications will not share memory.
To share memory, start the applications with the same
shared memory id.

Change-Id: Ib6180369ef0ed12d05983a21d7943e467402b21a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
GangCao
222bac51e8 app/nvmf_tgt: delete subsystems for invalid AcceptorCore
Change-Id: Id88b6edb3c1e6ee8b06c6357c91a13c04891faa2
Signed-off-by: GangCao <gang.cao@intel.com>
2017-02-15 14:46:33 -07:00
Daniel Verkamp
3403d59522 nvmf_tgt: unify subsystem config parsing code
Use the construct_nvmf_subsystem RPC call handler code from the
nvmf.conf parser to factor out some of the duplicated code.

Change-Id: I1b8f9af03f4a774cbb5c06dda7c57286e8968204
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-14 11:27:14 -07:00
Daniel Verkamp
4f8ab58ac1 nvmf_tgt: add cross-socket warning to subsystem RPC
This is the same check as the subsystem configuration file parsing uses.

Change-Id: Id301a929e06f51b060256a3038e0c24120ccd308
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-14 10:28:29 -07:00
Daniel Verkamp
4404793d09 string: make spdk_parse_ip_addr() params non-const
The host and port output parameters point into the (non-const) char *ip,
so it makes more sense for them to be non-const as well.

This allows the flexibility to pass non-const char pointers as the
output parameters, which will be used in the nvmf_tgt/conf.c parsing
code.

Change-Id: I1d5b102fc389c06d36432904e4fda944437b659e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-14 10:28:29 -07:00
Ziye Yang
0456bd08cd nvmf/conf: call spdk_nvme_probe_cb via trid
Change-Id: Iae11ebd2c565d8f0d806bcca3615147fe3261e91
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-02-10 12:51:13 -07:00
Daniel Verkamp
84d904841f util: move common helper functions to util.h
These were repeated a few different places, so pull them into a common
header file.

Change-Id: Id807fa2cfec0de2e0363aeb081510fb801781985
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-10 09:38:52 -07:00
Ben Walker
4baf5962e9 nvmf_tgt: Use new ip parsing utility function
Change-Id: Ia6575f8d7fb8be8002a5c1fec0abf04f837a0545
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-07 18:06:08 -07:00
Ziye Yang
38980dedfa nvmf,tgt: fix issue while shutting down nvmf tgt with CTRL + C
The phenoemon is that we can not shutdown the nvmf tgt.
The solution is that we need to adjust the shutting down orders of
nvmf tgt subsystem and rdma trasport layer.

Change-Id: Ie39657370b1574960e0ee7cf604cc5872db0bed3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-02-07 17:43:45 -07:00
Daniel Verkamp
b3d229e02a iscsi_tgt: add modules to dependency list
Make sure iscsi_tgt gets rebuilt when a blockdev or copy module is
modified.

Change-Id: Ia10cfbb4b71b686e9a97c68be1d50ae1eebac21f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-03 15:15:38 -07:00
Daniel Verkamp
ad063db506 nvmf: apply const to several char * arguments
These strings are not modified by the functions they are passed to, so
they can be const char *.

Change-Id: I11532f232990a305d706c14aac1b0f8f93b8f576
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-02 09:45:29 -07:00
Daniel Verkamp
47eec4329e env: add API to get NUMA socket ID of a PCI device
Change-Id: Ic13298752bd5c68e3449d7dc004bd466ef468085
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-31 14:50:18 -07:00
Ziye Yang
4440cd8d28 nvmf: Solve subsystem add/delete issue
When we do frequent same subsystem add/delete,
we will face the adding issue. For example,
1  Add subsystem A
2  Delete subsystem A
3  Add subsystem A  (Fail in this step).
The reason is that we did not correctly free
the listener resources of subsystems, and this patch
can solve this issue.

Change-Id: I6765a306a3f10c9a0f38c95dbba12e2a4073e705
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-01-30 11:14:38 -07:00
GangCao
4f752e1d75 nvmf_tgt: assign different core for subsystems under RPC mode
Change-Id: Ib751c45f916f66b682d3011397f1f8fe794b08d8
Signed-off-by: GangCao <gang.cao@intel.com>
2017-01-25 15:56:24 -07:00
Daniel Verkamp
d946f92079 nvmf_tgt: check existence of bdev in construct_nvmf_subsystem RPC
Change-Id: Ic1232e901ecea18dcf2f68b94ef966c343757618
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-18 16:08:04 -07:00
Daniel Verkamp
7ac9a4ecbb event: remove spdk_event_allocate() next parameter
The 'next' event pointer was never used in the entire code base (always
NULL).

Change-Id: I75f999d3a2e10512d86edec1a5a46ef263e2635b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
c3ede774c7 event: remove spdk_event_t typedef
Use 'struct spdk_event *' directly for consistency with the rest of the
API.

Change-Id: Ib41a9bf47f5b18f4aebf5f4dee055455cb12ef7d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
44ef085bed event: pass arg1 and arg2 directly to event fn
This allows the elimination of the spdk_event_get_arg1() and
spdk_event_get_arg2() macros, which accessed the event structure
directly; this was preventing the event structure definition from being
moved out of the public API header.

Change-Id: I74eced799ad7df61ff0b1390c63fb533e3fae8eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
3d528833d5 event: move default opt values out of public API
The public API user is supposed to retrieve the defaults via the
spdk_app_opts_init() function.

Change-Id: Ie2bd6e809b2d47dbd5d62d396e8715f89f4052d9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
2931a3efef event: remove 'complete' parameter from poller_register
The spdk_poller_register() function provides a way to pass an event to
call once the poller is registered, but it is always NULL in the current
code base.

Change-Id: I459bf40ae4d050589577d113b7984f1563aaa9cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Ben Walker
df46c41a4c nvme: Unify spdk_nvme_discover and spdk_nvme_probe
They were very close to the same already, so finish the job.

Change-Id: Ifba9e3b2d11a3e70cbfbe46f57a67552db2757ed
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 11:22:57 -07:00
Ben Walker
32e838af3c nvme: Remove probe_info, just use transport_id
The probe_info was reduced to just containing a
transport_id, so remove probe_info entirely.

Change-Id: Ica9a22d126cd14e282decd3eea1a0afe0460f099
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:17 -07:00
Ben Walker
3da43e64e4 nvme: Remove pci_addr from probe_info
This can be obtained by parsing the traddr.

Change-Id: Idaf35066cbf900c87e771a44934de99fb5420001
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:46:50 -07:00
liupan1111
47f13f5eca iscsi_tgt: add daemon mode for iscsi target (#69)
* iscsi: add daemon mode for iscsi target

* change the default daemon mode of iscsi tgt to false
2016-12-06 17:15:19 -07:00
Daniel Verkamp
dfe9fa9bea env: do not link env lib with --whole-archive
It is not necessary, and it prevents the linker from removing unused
object files.

Fix the iscsi_tgt Makefile's library order so that env is added at the
end after the libraries that use it.

Change-Id: I241eb46703c12691444037a350be65143259e82e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 09:30:55 -07:00
John Kariuki
64fc291291 nvmf_tgt: add socket ID to NUMA warning message
Added the socket ID to the NVMe over fabrics target warning messages.
This will help during troubleshooting to check that the NVMe device, Subsystem and NIC are on the same NUMA node

Change-Id: Id750a5a7694c898bb61ea26089ea3098611d530a
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
2016-12-01 16:12:23 -07:00
Ziye Yang
5f3761cf7e nvmf: change default AcceptorPollRate from 1 ms to 10 ms
If AcceptorPollRate is configured in configuration
file, the default value used will be given by
ACCEPT_TIMEOUT_US. So change the default value, it
can solve the performance degradation issue of
nvmf target.

Change-Id: I867bb03dd8b2b81b86911130babd0334d9857de8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-28 12:17:17 -07:00
Changpeng Liu
a3ed1795cd nvmf: add subsystem check on creation and cleanup for nvmf rpc
Change-Id: I85826c99c450426c26870ae261a7b7c8daeba031
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-11-23 10:27:54 -07:00
Daniel Verkamp
72054c70f6 nvmf/rpc: use spdk_json_write_string_fmt()
Change-Id: I7cf36201125a59637b43d4966d8f63e17947bc68
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:32:35 -07:00
Jim Harris
407b550ff4 build: define SPDK_LIB_LIST to simplify building dependencies and linker args
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia969f9e5ed01f4b58cec2559133347d836118131
2016-11-22 11:45:48 -07:00
Ziye Yang
246c39a7ee nvme: Add nvme over fabrics support
Change-Id: I6f6259e77baa5dc5861f31ec4a9034e15297d333
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-18 13:58:44 -07:00
Changpeng Liu
74c4833229 conf/nvmf: exit the process if we got invalid AcceptorCore input
Change-Id: Ib23ffb608de1c50c29207673958c55a3ef4c3850
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-11-18 12:53:01 -07:00
Daniel Verkamp
44e60dc47d build: consolidate library outputs in build/lib
Make it easier to use SPDK libraries by putting them all in a single
directory that can be added with -L rather than scattered around the
source tree.

Change-Id: I5c0f5dd6e7058b5f92fa9bc41548190ffc064761
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-17 13:15:09 -07:00
Daniel Verkamp
04c48172b9 conf: add accessors for section name and num
Remove usage of the conf structs so they can be moved out of the public
API header.

Change-Id: I1c7375ec7708b323f50af09aeb7b2b2c9c770df4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-16 10:33:12 -07:00
Ben Walker
b43db69a44 nvmf: Remove spdk_nvmf_transport from public API
The details of the structure were removed earlier, but
now remove all references even to a pointer to the
structure. The user can refer to transports by their
string name.

Change-Id: I273356f46329ea5372dcd951eda6f14767477d69
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Ben Walker
bb5d8e506c nvmf: Combine nvmf_tgt_init and nvmf_transport_init
Change-Id: I6d0f92842f3b8626bc2c25b38bfa7f7ddea5e7cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00