Commit Graph

453 Commits

Author SHA1 Message Date
Lance Hartmann
b9be940ae9 lib: Return instead of exit in event
Modifies behavior of spdk_app_start() and spdk_app_parse_args()
such that they return on failure instead of terminating with
exit().

Change-Id: I82566417f04e1ae2e3ca60a00c72e664db26c9e4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/401243
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:47:01 -05:00
Daniel Verkamp
8a6ba58cb4 scripts/check_format: check for spaces before tabs
Automatically detect more whitespace errors.

All existing cases are fixed; only whitespace change (verify with
diff -w) except for one comment style fixup in include/spdk/nvme.h.

Change-Id: If750e54b9c8e3421ea6feda5f20184a31431631e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402360
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-05 11:09:13 -05:00
Changpeng Liu
d9321520ce nvmf: add Namespace deletion RPC support
Change-Id: I1c5adcce861b8a1fc8f8c96a3a237c4c2dae61af
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/401559
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-02 13:39:23 -05:00
Ben Walker
6285e36e5a nvmf: Add RPC methods to manage allowed hosts
Three new RPC methods are added to allow modification of the NVMe-oF
subsystem allowed host whitelist at runtime:
- nvmf_subsystem_add_host
- nvmf_subsystem_remove_host
- nvmf_subsystem_allow_any_host

Change-Id: I5c98658f949dad013165c04497cca49867022ba0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/396063
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-02-26 11:25:03 -05:00
Daniel Verkamp
d81f3dfd3e util: add spdk_mem_all_zero() function
Unify several similar functions checking for a buffer of all zero bytes
into the util library.

Change-Id: Idfbeffa22add34ac9ed1bd75ee27d6bd8b188940
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/400892
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-23 10:05:32 -05:00
Jim Harris
2ecab7bd6a net: remove ability to override default net_framework
In early days of SPDK, there was an experimental userspace
TCP stack called libuns.  The SPDK iSCSI target supported
using either the default POSIX/kernel TCP stack or this
libuns TCP stack.

libuns is no longer in use, but work has started on
supporting the FD.io VPP TCP userspace stack.  Abstractions
are being put in place to allow *both* the POSIX and VPP
stacks simultaneously.

So remove the concept of a "default" net_framework that is
defined with weak symbols that can be overridden by another
object file.  While here, also remove the "clear_socket_association"
concept which was specific to libuns.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8a0385ca5ae113e34a637f835d8d69f8d510433e

Reviewed-on: https://review.gerrithub.io/400328
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-02-21 12:40:30 -05:00
Daniel Verkamp
1023ca7b46 nvmf: allow configuration of ns NGUID and EUI64
Add optional parameters to namespace creation to let the user pick the
namespace globally unique identifier and EUI-64.

Change-Id: Ia3eebaf22f8a64733a00a83f90cafb4977c2d07a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399531
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-20 12:01:47 -05:00
Daniel Verkamp
119ccada0a nvmf: add namespaces individually in construct
This will allow us to specify individual namespace options in upcoming
patches.

Change-Id: Id3301a2313a1d7cbafac1f8a5bcd8d73eae4cd47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399522
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-16 13:06:11 -05:00
Daniel Verkamp
250d342bc1 nvmf: pass an options struct for ns creation
This will allow more parameters to be added to
spdk_nvmf_subsystem_add_ns() without breaking API/ABI compatibility
later.

Change-Id: I6b2f58f1a2d5fcd4c754830cbd4713dc461a31fc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399519
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-16 13:06:11 -05:00
Jim Harris
bb24ce82a6 build: add @: to remaining 'all' targets
It is not ideal to have to add this in a bunch of
different Makefiles, but further consolidation of
Makefiles is going to be a more arduous process.

With this change, rebuilding SPDK after no changes
will result in no output - all of the "Nothing to
be done for 'all'" messages have been removed.  Note
that DPDK build output still remains - this can be
suppressed by either using an out-of-tree DPDK, or
using SKIP_DPDK_BUILD=1 when using the in-tree DPDK
submodule.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib1d45432f2baaa1d9c1b9509906ee1e77966d3ca

Reviewed-on: https://review.gerrithub.io/399918
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-14 17:38:25 -05:00
Ziye Yang
ff3d53f74e nvmf_tgt: optimize the value assignment of g_num_poll_groups
We do not need the for loop.

Change-Id: Icd4cd768f8c7d8a8b996b19e4d9369e76ed1dcdb
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/399790
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-14 15:07:43 -05:00
Daniel Verkamp
9f04ca414c nvmf_tgt: remove unused shutdown function
nvmf_tgt_shutdown_subsystem_by_nqn() used to be part of the
delete_nvmf_subsystem RPC method, but that now uses the public
spdk_nvmf_subsystem_stop() API instead.

nvmf_tgt_shutdown_subsystem_by_nqn() isn't used anywhere else, so just
remove it.

Change-Id: Ic4908d5c911915da6794c3e096e027e4c9b06a52
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399511
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-13 08:40:32 -05:00
Ben Walker
47b17299a4 nvmf: Add an rpc to add a namespace to a subsystem
Change-Id: I351c7bda1b32dc161c49d47fb2887595099e4be6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/396696
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-07 23:22:57 -05:00
Daniel Verkamp
9f5970550c nvmf: use "nqn" rather than "subnqn" in RPC param
This fixes the new nvmf_subsystem_add_listener RPC method to use "nqn"
as the parameter name to be consistent with the other NVMe-oF target RPC
methods.

Since this method is brand new, no provision for compatibility with the
old name is provided.

Fixes: 6336217e16 ("nvmf: Add rpc to add listeners to subsystems")
Change-Id: I86263fb1c53ed6ab48fe70917686d78a4a7ce28d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398870
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-02-07 23:22:57 -05:00
Daniel Verkamp
039592e1fb nvmf: factor RPC trid parsing into a function
This will be reused in an upcoming patch to remove listen addresses.

Change-Id: Ia168ae1741f998fc7085ae05fb08406856aff6aa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398689
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-02-07 12:47:27 -05:00
Dariusz Stojaczyk
3fb4bc717b vhost: move app fini to the vhost subsystem
We already have a vhost subsystem and have to do
its fini anyway, so let's remove application fini.
Technically, any SPDK app can use vhost library
and create vhost devices, so we need to delete them
on shutdown in all cases - in module fini.

Change-Id: I013b45b4e73fd19288b9c10bc995dc24894ecf35
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/396573
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-02-06 11:05:01 -05:00
Ben Walker
6336217e16 nvmf: Add rpc to add listeners to subsystems
The construct_nvmf_subsystem method's "listen_addresses" parameter is
now optional, and new listen addresses may be configured at runtime
using the "nvmf_subsystem_add_listener" method.

Change-Id: Ie0217c5d112e278cc0491a561753f50ed877d842
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/395556
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-06 10:29:42 -05:00
Daniel Verkamp
1dab20c225 nvmf: remove unused constants from conf.c
Change-Id: I2f7e0f4e634d8ed83d93a8670b2c72ada24cd537
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398125
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-02-02 12:45:42 -05:00
Daniel Verkamp
c7b8b414d1 nvmf_tgt: add IPv6 listen address support
Change-Id: Ia165c3f033658adc86c8993a2a32783921ab1832
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/396494
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-29 12:41:57 -05:00
Daniel Verkamp
543cb17248 build: remove $(ENV_CFLAGS) where not necessary
Only Makefiles for libraries that directly depend on DPDK (rather than
the SPDK env abstraction) should add $(ENV_CFLAGS).

Change-Id: Ifdf44d3ef8c42bbf7f20edd524b330d00658235b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392818
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-03 12:05:59 -05:00
Ben Walker
95ac75aabe nvmf: Add synchronization primitives for subsystems
This allows the user to pause a subsystem, make some
modifications, and then resume it.

Change-Id: Ia18371023d8fc66e1797fda293a01b68c0a61c96
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392422
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-03 11:58:11 -05:00
Ziye Yang
7e8a611568 nvmf/tgt: Fix issues for ctrlr+ c handling.
When receving ctrlr+c event, NVMe-oF target
could in any state. So we cannot guarantee
g_acceptor_poller is initialized or not. If
we do not handle such case, ctrlr+c will
trigger unexpected coredump issue. To
solve this issue, following methods are used.

Currently, our code in event module (lib/event/app.c)
can only receive ctrlr + c command once, so
when we receive the ctrlr+c, we should complete
the shutdown process.

The idea is to use spdk_event_call, we will only
enter shutdown process if tgt is in NVMF_TGT_RUNNING
status.

After several patch tries, I think that this solution
is much simple. Though we would like to kill after
entering the running state, it may wait some time
if users kill the application in early state, but those
operations will not be quite often in real case.

Change-Id: Id89a96b5d39f8a528e72dea8c0eb6524bdaf7ee4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/389433
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-26 14:49:42 -05:00
Dariusz Stojaczyk
1c54773979 vhost: link with Linux-only libraries by default
vhost supports only Linux, so there's no
need to check OS inside vhost Makefiles.

Change-Id: Ia7129200ee4cb8db898552a8a990f6fab84f8711
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/392671
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-21 13:32:09 -05:00
Ben Walker
7b397f6281 nvmf: No longer tie subsystems to CPU cores
The "Core" parameter in the configuration file has been removed. New
connections are handed out to available cores using round-robin.

Change-Id: I24527fa22a0b2738ebbf5fb030e3bb373ead5da2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-15 16:26:33 -05:00
Ben Walker
8b79ef3372 nvmf: Remove poll group from controller
Now rely entirely on the user to create and poll
the poll groups.

Change-Id: I66baaa2d0f493390a055a32e6c902f5e2f574534
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385954
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 15:01:17 -05:00
Daniel Verkamp
2302dc6cdc nbd: add NBD subsystem to apps
Enable the NBD subsystem and RPC methods in the iSCSI target, NVMe-oF
target, vhost target, and bdev_svc test app.

Change-Id: I1c2e53a4c031ae6d4dc0a8e698bbfa085db33154
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391014
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 13:36:22 -05:00
Daniel Verkamp
59970a89be astyle: enforce braces around single-line statements
Require braces around all conditional statements, e.g.:

    if (cond)
        statement();

becomes:

    if (cond) {
        statement();
    }

This is the style used through most of the SPDK code, but several
exceptions crept in over time.  Add the astyle option to make sure we
are consistent.

Change-Id: I5a71980147fe8dfb471ff42e8bc06db2124a1a7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390914
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:19:32 -05:00
Ben Walker
e26e0e2689 nvmf: Look up bdev channel from poll group instead of namespace
Change-Id: I9afa07b5dae99955ba87d7c8130b2ce6f04e7941
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389641
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
7b57e9f973 nvmf: Stop subsystems from the thread they were started on
This correctly puts all of the I/O channels on the right
thread during shutdown.

Change-Id: I432c8cb981a68b40639f8876dae42597a9e6a85f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389637
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 16:41:57 -05:00
Ben Walker
3aba1a5690 nvmf: Use spdk_for_each_thread to simplify init
This simplifies both setting up and tearing down
the poll groups.

Change-Id: I719a544a6683e120cc6751f88a3c0944fe863c30
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388042
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-28 15:29:35 -05:00
Ben Walker
eaaddf3d48 nvmf: Poll groups now automatically register pollers
This simplifies the public API and requirements for
user applications.

Change-Id: Ibb0d25a7838a0fa683f39e79cb4fef78adf6aee8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388040
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-28 15:29:35 -05:00
Ben Walker
9c35e39c54 event: Move spdk_poller_register to io_channel
Make this generic and not directly dependent on
the event framework. That way our libraries can
register pollers without adding a dependency.

Change-Id: I7ad7a7ddc131596ca1791a7b0f43dabfda050f5f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387690
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-28 12:30:37 -05:00
Ben Walker
00b02039c5 event: Pollers must now be unregistered from the thread they run on.
Change-Id: I8ea8c59a0c67176c0c0c39abf807afad61ff3828
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387689
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
fcb4776fe7 event: Pollers must now be registered from the thread they run on.
Change-Id: I864cd8a6c206dfbe62fcb3f72275c1ae51aa4ed7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387688
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
9b63a93bab nvmf_tgt: Unregister pollers from the core they were polling on.
Change-Id: I129b278accb9f6e029abeba21701f633ecc775a5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387684
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
bfd55056b0 nvmf_tgt: Remove AcceptorCore config parameter
Historically, polling for new connections was costly.
Now, it's very inexpensive and there isn't a reason
to change which core it occurs on. Simplify
initialization and configuration by removing it.

Change-Id: I1cc4c321bb5986289bd48860cb270b0b552e3baa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387681
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
8cd7252f04 nvmf_tgt: Create pollers for poll groups on same core
Create the poller for a given poll group from the core
we intend to use it from.

Change-Id: I8bfb970f31f86b8b29f7fe89d82178b3f27da50b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387680
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ed Rodriguez
63bf022b93 trace: Move trace flags to separate implementation file
Change-Id: Ibe31b961fec36644cf64716c512429d68e873e88
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/386170
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-15 18:57:12 -05:00
Daniel Verkamp
52412ab10b build: include spdk.app.mk in all app Makefiles
This will be used to include common app-specific rules in upcoming
patches (it currently makes no difference).

Change-Id: Ia828ba01c94fc9f70e15db3fc1d9cafda387e912
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387629
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-15 17:57:07 -05:00
Ben Walker
1f8b6f3752 nvmf_tgt: Destroy poll groups on their respective cores
Destroy the poll group from the core it was created
on.

Change-Id: I6960a356358e8c00ae234149aa3a12eff1a24e05
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385953
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-15 17:54:13 -05:00
Ben Walker
07c639cdec nvmf: Create poll groups on their respective cores
Previously, all of the poll groups were created on the
core doing the configuration. However, creating poll groups
will eventually construct the I/O channels, and that must
be done on the core we plan to use the poll group on.

Change-Id: Iff57ac0e43bb722eb27cf01d7bf55f3946a165eb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385515
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-15 17:54:13 -05:00
Ben Walker
db3edeb341 nvmf_tgt: Rewrite initialization as a state machine
This is about to become a hot mess of asynchronous operations,
so introduce a state machine to make it easier to follow
the logic.

Change-Id: If67acfd61d4e70e30a95245d5f46112323943459
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385482
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-15 17:54:13 -05:00
Jim Harris
d97476efdf iscsi: shutdown iscsi library as part of subsystem fini path
With the new asynchronous subsystem finish framework, we can
drive shutdown of existing connections as part of the subsystem
finish path instead of a separate spdk_iscsi_shutdown function
called as the shutdown function in response to SIGINT.

This is a step towards enabling a single target app that
supports multiple protocols (i.e. iSCSI + vhost + NVMe-oF).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id9f596a8091912a72ab7eb93cb45a46fdb130a48

Reviewed-on: https://review.gerrithub.io/386695
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
fbb9430ec4 app: add spdk_app_parse_args()
This is a helper function that eliminates a lot of
duplicated code in our target applications, specifically
around common command line argument parsing and usage
messages.  This patch only moves the iscsi, nvmf and
vhost targets to use this function, but there are other
test/example applications that could also take advantage
of it to reduce duplicated code and improve consistency.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1903de3daed90ac6282b006a8283b9df07ce37e9

Reviewed-on: https://review.gerrithub.io/386542
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
246cdd08e1 iscsi, nvmf, vhost: break out common usage text to separate functions
This prepares for moving all of the common usage text into a library
that can be used by all applications using the app framework.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3dfc8beead6f40790eefc84b7767299f9d7b1bd4

Reviewed-on: https://review.gerrithub.io/385929
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
0489bcb137 iscsi, nvmf, vhost: break out arg parsing into separate functions
This prepares for moving all of the common app framework argument
parsing into a library that can be used by all app framework based
applications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibbfb08ac687acf3201c4a3e808edbe770213a6f0

Reviewed-on: https://review.gerrithub.io/385928
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
973a27d08c app: add print_level to opts structure
This allows us to remove some duplicated code from our
main target applications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I15b517fd2b58ce682660b4f6ba0b8412beda053b

Reviewed-on: https://review.gerrithub.io/385714
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00
Jim Harris
4bcfef0021 rpc: remove rpc subsystem
RPC is core functionality for SPDK applications and should always
be initialized last (after all subsystems have been initialized).
So make RPC a first class citizen and integrate it with the
app framework directly instead of making it an "optional" subsystem.
Then we initializing it after all subsystems have completed
initialization, and tear it down before tearing down subsystems.

We can also do some other cleanup while here - for example, reactors
are already started when spdk_rpc_initialize() is called, so remove
the extra event that was added during initialization since this is no
longer needed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4cc63586a6d55be68786629a2176c61a88979267

Reviewed-on: https://review.gerrithub.io/385914
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00
Daniel Verkamp
7ea544b46a nvmf: move poll groups to public API
The end goal is to have the application create one poll group per core.
Then each poll group will have a single CQ per network device and an I/O
channel per back-end storage device to poll.

This is just the first step toward that, which is to wire up the
creation of the per-core poll groups in the application.

Note that the app poll groups don't do anything yet.  We'll need
additional library API changes to make the library use the existing poll
groups, rather than creating a new poll group per subsystem as we do
right now.

Change-Id: I2d4e2a5e5aa354d37714750f1d5b1d1e4ab9edce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381887
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-09 12:51:18 -05:00
Daniel Verkamp
6a0e6abcd3 vhost: use int to store getopt() return value
getopt() returns int, not char, so assigning the return value into a
char will truncate it.

Fixes a warning on platforms where char is unsigned:

  vhost.c:109:61: warning: comparison is always true due to limited
  range of data type [-Wtype-limits]

Change-Id: I3a290096346db241a473434952e0f5fd69e98c2f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386347
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-09 12:42:45 -05:00
Jim Harris
df7cf89394 iscsi, vhost, nvmf: allow running without config file
If the default config file does not exist, keep the
app's config_file options field as NULL, so that the
app code will not fail when trying to open a non-existent
file.

Also leverage the recent iSCSI and NVMe-oF refactoring,
to just skip trying to read config file parameters if no
config file exists (or the requisite section in the config
file is not present).  vhost already handled this so it did
not need to be modified.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic32f0a7a8ce85322a8effd537b62d14732d7b82e

Reviewed-on: https://review.gerrithub.io/385497
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-03 18:42:53 -04:00
Jim Harris
889a9c762a nvmf: break out config file reading into separate function
This prepares for skipping the config file if it doesn't
exist or there is no Nvmf section.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib96c9c9e8bd462558240a2210150def1a950f1d1

Reviewed-on: https://review.gerrithub.io/385496
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-03 18:42:53 -04:00
Daniel Verkamp
901aafe675 nvmf_tgt/rpc: check trtype and adrfam for NULL
If the NVMe library trtype and adrfam translation functions are passed
an unknown value, they may return NULL.  This shouldn't normally happen,
since any supported transport type or address family in the NVMe-oF
target should always be supported in the string lookup functions, but
add a fallback anyway to satisfy the static analyzer.

Change-Id: Icadf991d6742a2a759b5793253b71b4eabc763ed
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383313
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-10-23 12:19:38 -04:00
Dariusz Stojaczyk
5b6e67886e vhost: added multi-process support
Added -i parameter to vhost that specifies DPDK shared memory id.

Fixes #171

Change-Id: I103eb57886eed2c1663137b5b8195a11039319fa
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373692
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-16 15:29:58 -04:00
Tomasz Zawadzki
48b2eff97d app: spdk_app_fini no longer gives return code
spdk_app_fini() changed to void, as no operation within it
can fail with meaningful return code.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If77cbf745a8e3fcba4ea24411aa1816f3910cde7
Reviewed-on: https://review.gerrithub.io/381537
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-10 10:56:34 -04:00
Pawel Wodkowski
c746de9baf vhost: add --no-pci support.
Change-Id: Id7cfb7ea3bbecf9ebe5db5f4b12cb20150168b04
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/381185
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-06 19:38:55 -04:00
Daniel Verkamp
691912ef44 nvmf: allow user to specify NSID via conf and RPC
The nvmf library now supports the ability to assign arbitrary NSIDs,
rather than automatically assigning the next one in line.  Expose this
functionality to the user via the configuration file and RPC interfaces.

Change-Id: Ia85a9a6dfe31a2cd0605c7a6c098eec0c1b7de68
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376463
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-09-05 13:03:09 -04:00
Daniel Verkamp
a2db49a121 nvmf: add AllowAnyHost option to subsystems
The previous behavior with an empty host NQN whitelist was to allow any
host to connect.

Change-Id: I5401e52d96642cf20afe0d50c692613e67262edf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376432
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-09-05 13:03:09 -04:00
Ben Walker
7b3c6fbd40 nvmf: Remove connect/disconnect_cb from subsystems
The requests are now sent using spdk_thread_send_msg
internally, so the user no longer needs to supply
these callbacks.

Change-Id: I84b0f5f0f1f6fa6eaf9a717934925d3ad802fcfd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376240
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-30 15:07:22 -04:00
Ben Walker
6428de9e34 nvmf: Remove spdk_nvmf_listen_addr
Everywhere this is used, we can just use
spdk_nvme_transport_id instead.

Change-Id: I407c812cd6a1ca3afcb3d1fe87c7e22183b09d7a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375461
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 14:59:33 -04:00
Daniel Verkamp
02f088bb95 nvmf: dynamically allocate ns array
This allows the user to configure an arbitrarily large number of
namespaces instead of the current hard-coded limit of 16.

Change-Id: I3a29b0de10eafd682b12c54e12411d1f9d41ce85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375636
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 12:35:35 -04:00
Daniel Verkamp
db24ff75fe nvmf_tgt: remove use of MAX_VIRTUAL_NAMESPACE
The configuration file parser now uses its own (arbitrary) limit on the
number of namespaces; this removes the need for MAX_VIRTUAL_NAMESPACE to
be in the public API.

The new MAX_NAMESPACES limit in conf.c is larger than the current
MAX_VIRTUAL_NAMESPACE; any namespaces beyond the current limit will
fail.  Later patches will allow dynamically increasing the number of
namespaces in a subsystem.

Change-Id: Ice508ac0fee34622cd738b8f477f2dc20870d5f0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375635
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-29 12:35:35 -04:00
Ben Walker
3d8e67d71f nvmf: Rename spdk_nvmf_tgt_poll to spdk_nvmf_tgt_accept
This function accepts new connections, so use the more
traditional name.

Change-Id: Ie4aaa4b1d6da81f81fa3cd1505e5ac45e157f052
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375205
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-23 11:06:47 -04:00
Ben Walker
656e443dd1 nvmf: spdk_nvmf_tgt_listen now takes a target parameter
Also, move the implementation into the appropriate
compilation unit.

Change-Id: Ie1c56bc5e077b81d744414716f9267ceaf591e49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375034
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-23 11:06:47 -04:00
Ben Walker
70bc390c82 nvmf: spdk_nvmf_find_subsystem now takes a tgt parameter
The user can now specify which target they want to
search for the subsystem. Also, change the name to
spdk_nvmf_tgt_find_subsystem and put it in the correct
compilation unit.

Change-Id: I7c085959814c14d8400a0ba2572103b0814a4d0e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374879
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-23 11:06:47 -04:00
Ben Walker
4addb5c899 nvmf: spdk_nvmf_tgt_create_subsystem takes a tgt parameter
The user can now specify which target to create the subsystem
on.

Change-Id: I6206c0d762d59ff6312cb58d36180281baaa7266
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374878
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-23 11:06:47 -04:00
Ben Walker
34d6e17598 nvmf: spdk_nvmf_tgt_init is now spdk_nvmf_tgt_create
This new function returns a reference to the target
object. This sets the library up to support multiple
targets in the future.

Change-Id: Id803dbcbb166eca33d8d5c381d9db97628606f3e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374877
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-22 11:29:03 -04:00
Ben Walker
d868cd0895 nvmf: Change spdk_nvmf_tgt_init to take an options struct
The list of options is going to continue to grow, so avoid
constant API churn by adding an options struct.

Change-Id: Ie9e7248281726d4aee42b3519fcf7535ba01ee34
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374872
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-22 11:29:03 -04:00
Ben Walker
683d4a4cad nvmf: Encapsulate spdk_nvmf_listener
Hide the implementation of spdk_nvmf_listener.

Change-Id: I62d46c76be0962b4246d1b7774ce8249b5baa039
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374871
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-21 15:11:59 -04:00
Ben Walker
45f04c8907 nvmf: Encapsulate spdk_nvmf_host
Hide the definition of spdk_nvmf_host. Add accessors
for the necessary data.

Change-Id: I28f5b8d243cb1b299724a1dd32fcf2f2bd95e1f9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374870
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-21 15:11:59 -04:00
Daniel Verkamp
14451d76fe nvmf: encapsulate namespace data into a struct
Add a new struct spdk_nvmf_ns to hold namespace information, and add
accessor functions so that it can be moved out of the public API in
future patches.

Change-Id: Id926aaa3cc279649057afc65e08024628edbc435
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374740
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-18 17:50:58 -04:00
Daniel Verkamp
45a8da55b6 nvmf: fix Mode Virtual comparison
The strcasecmp() comparison was incorrect, causing "Mode Virtual" to
take the opposite of the intended path.

Change-Id: Ic83f451dee2c7a786a1a9b88cf426fcd5abf3037
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373392
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-09 16:52:58 -04:00
Daniel Verkamp
f4f973e7d4 nvmf: free strings in construct_nvmf_subsystem RPC
Change-Id: I08283835594435ff05955d9d90bfd0817875171f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373407
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-09 13:24:40 -04:00
GangCao
7b7f2aa685 app: move the core usage display after DPDK init
Change-Id: I29a46cbaef20e15173781680a62bc8087ca5672f
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/372426
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 20:39:07 -04:00
Ben Walker
31d033f944 nvmf: Transports are no longer global
Create one transport per nvmf target. Today, there is just
one global nvmf target, but this paves the way for multiple.

Change-Id: Iaa1f8c5e7b3c1e87621ef2a636c68c2dd8fd929e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371748
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-08 14:09:45 -04:00
Ben Walker
1d304bc5d8 nvmf: Rename spdk_nvmf_conn to spdk_nvmf_qpair
Match the terminology used in the NVMe-oF specification,
which is queue pair. For the RDMA transport, this maps to
an RDMA queue pair, but may map to other things for other
transports. It still is logically a "connection" from
a networking sense.

Change-Id: Ic43a5398e63ac85c93a8e0417e4b0d2905bf2dfc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371747
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 13:46:48 -04:00
Ben Walker
03788f93df nvmf: Rename spdk_nvmf_session to spdk_nvmf_ctrlr
This is just a rename - the functionality hasn't changed.
Use the same terminology as the specification (which is controller)
so those familiar with the specification can more easily
approach the code base.

This is still conceptually equivalent to a "session" in the
networking sense.

Change-Id: I388b56df62d19560224c4adc2a03c71eae6fed0d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371746
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 13:46:48 -04:00
Ben Walker
1c83074299 nvmf: Use spdk_nvme_transport_id
The NVMe-oF target was written before we defined
spdk_nvme_transport_id. Now that we have it, go back
and replace all of the locations where we individually
tracked traddr, trsvcid, trtype, etc. and use a trid.

Change-Id: I84334a12c7581f414c1e84680f122fe885a3b9dd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370744
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-07 17:07:58 -04:00
Ben Walker
29f6172a56 nvmf: Use trtype enum in transport instead of strings
Change-Id: Ie05f58e677107072fea6cc7702bab47a077cb595
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370743
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-07 17:07:58 -04:00
Ben Walker
f6e62d2ce1 nvmf: Remove direct mode
There is now only virtual mode. Virtual mode has been
improved enough to reach feature parity with direct
mode and performance benchmarks show no degradation.
Simplify the code by always using virtual mode.

Change-Id: Id5cdb5d4d8c54e661b245ed7250c2f9d66ca2152
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/369496
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-02 13:57:45 -04:00
Daniel Verkamp
acb0bb46fe nvmf_tgt: fix uninitialized data in conf parsing
Fixes GitHub issue #176.

Change-Id: I1e6aa4462d3cc94f6515d062efa1a5bf147c133e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372143
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-01 17:57:09 -04:00
Jan Kryl
2019ebf43e Make iscsi app to work on freebsd
Change-Id: Ic4221e044eb5af92aa06e468eb989bee285022af
Signed-off-by: Jan Kryl <jan.kryl@nexenta.com>
Reviewed-on: https://review.gerrithub.io/371303
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-01 13:42:02 -04:00
Dariusz Stojaczyk
30c42b9b32 vhost: added option to save pid to file
Usage:
./vhost -f path/to/pidfile
A text file containing single pid number will be created

Change-Id: Ia7762ce3085400a47740c9a5f44b56d63c9fafc6
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/368518
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-17 12:49:20 -04:00
Daniel Verkamp
ac4398a31d log: set print level when enabling tracelogs
The default print level used by the apps is SPDK_LOG_NOTICE, which will
prevent the tracelogs from being shown.

Change-Id: I5f136e8aa0be0aa7634c7dd72231f2c23b129e51
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368803
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-11 18:02:47 -04:00
Daniel Verkamp
2bdec64fbf jsonrpc: modify API to pass request to handler
This will enable asynchronous request handling in a future patch, and it
also removes the need for the RPC handlers to know about request id and
the JSON-RPC rules about notification-only requests.

Change-Id: I25aaa8e48bff8d5594ffcccecb61842b1e31ec3c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368225
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-06 13:48:12 -04:00
Ben Walker
ad474e95bb log: Remove configurable log facility
Always use "Local7" internally. We want the log API
to be generic instead of syslog specific.

Change-Id: I021f719e90c236f123fa1cadebc0c199b87ba077
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 19:28:29 -04:00
Daniel Verkamp
b0e128db3d nvmf/rpc: add adrfam to listen address
This allows the user to optionally specify the address family for
construct_nvmf_subsystem (default is IPv4).

Note that the RDMA transport still only supports IPv4 because of the way
it binds to the listen address; this will be fixed in a separate patch.

Change-Id: I534ed75f6f81e53559d1bebcd2f34f1a2b210a97
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367429
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 13:01:20 -04:00
Daniel Verkamp
8486e38d4a nvmf/rpc: add trtype alias for transport names
Use "trtype" to represent transport types in nvmf_tgt RPCs for
consistency with the NVMe-oF spec and other SPDK RPCs.

The current "transport" names are still supported for compatibility with
existing RPC users.

Change-Id: Ib03dda384dc01a41a18c06c56baff16b82d36c00
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367422
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-30 12:43:18 -04:00
Ben Walker
65918cb8ff log: Add a print to stderr threshold
Change-Id: I9c1865ff1ca2d8093227c89aa9857ff18d3e346a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365294
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 13:34:47 -04:00
Ziye Yang
d939572ab3 event/env: remove dpdk_ prefix
Remove dpdk_ prefix in spdk_app_opts and spdk_env_opts

Change-Id: I6f231f67072b808e84945d41b1fe31a180beb350
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365787
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-16 14:20:26 -04:00
Ben Walker
8fbaa73e69 vhost: Add a separate subsystem library
This separates the vhost library from the event
framework's subsystem mechanism

Change-Id: I8206fcf0d55bee71c70482d989318e9d118f710a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365286
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
53a587de7b iscsi: Add a separate subsystem library
This separates the iscsi library from the event
framework's subsystem mechanism.

Change-Id: I880ee4749ab0a411ca8dfd04f669868cba5c8b49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365285
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
5015ec9ce8 scsi: Add a separate subsystem library
This separates the scsi library from the event framework's
subsystem mechanism.

Change-Id: Iac2bbdb861e28ee9af0f13bc7187ac24279d0f5b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365284
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
674de77551 rpc: Add a separate subsystem library
This separates the RPC library from the event framework.

Change-Id: I26a9cb318b56d44ec9337f8a4db98967eb87ad95
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365283
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
5cf5dbff24 net: Add a separate subsystem library
This breaks the strict dependency on the
SPDK event framework.

Change-Id: Id93d79bfbc482350dc9802fa84a554f7e11f3826
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365282
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
4808ff7957 copy: Create a separate copy subsystem library
This removes the strict dependency on the SPDK
event framework.

Change-Id: Ie6b6f9585d09ab1df0f25bf33d53e7cdecd83faa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365281
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
4c0eaac47a bdev: Create a separate bdev subsystem library
Much like bdev modules inside the bdev directory,
add a subsystems directory inside of event. The subsystem
specific code for the bdev library is placed in to
a separate library in that directory, breaking the
strict dependency of the bdev library on the event subsystem
code.

Change-Id: I255941b823a9ec3e2d62f22a586414949d8ff5ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365055
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Daniel Verkamp
a0a41eefb1 nvmf: allow inactive namespaces in virtual mode
Now that virtual mode namespaces can be chosen arbitrarily, there can be
holes in the ns_list.  Make sure all of the virtual mode code paths are
prepared to handle these inactive but valid NSIDs.

Change-Id: I0d70fd9dae37a29a8358e1d38dcc6cac3237fd9a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365717
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-16 12:48:38 -04:00
Ziye Yang
356e2ab20f event: remove spdk_app_init
In this patch, spdk_app_init will be merged into
spdk_app_start.
Due to this change, we need to change event_perf
to use spdk_app_start, since we cannot use spdk_app_init
anymore. So the related changes for event_perf is to
make it work with reactor framework.

Change-Id: Id67edf209fd628cca361a499068c93aeedfe6167
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/364153
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 18:26:52 -04:00
Daniel Verkamp
f65731c47e nvmf: allow caller to pick NSID when adding ns
Change-Id: I1ea22fd3f56a3c048e25dead986992c848cf37b1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365508
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Sriram Popuri <sgpopuri@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 16:52:31 -04:00
Daniel Verkamp
9f237eac85 env_dpdk: save and restore optind in spdk_env_init
DPDK's use of getopt() needs special handling of the optind global
variable since we are passing it a separate array of arguments (not the
typical argv and argc).  Set optind to 1 internally to env_dpdk so that
the apps don't need to know about it, and restore optind in case the
calling app is also using getopt().

Change-Id: Icbf07002c99fa9f94c866e8eff707124b0ef679b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365062
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-13 17:39:38 -04:00
Ben Walker
5613e6f3d3 nvmf_tgt: Remove use of rte_lcore
Change-Id: I272c2e56984abbb820758866297ee9e916af625a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/363605
Reviewed-by: John Meneghini <johnm@netapp.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <ed.rodriguez@netapp.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-02 19:59:13 -04:00
Ben Walker
9139304ac2 iscsi_tgt: Remove use of rte_lcore
Change-Id: I533a004e1c28247a19a893f970e273e3219ad702
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/363604
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Meneghini <johnm@netapp.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-02 19:59:13 -04:00
Daniel Verkamp
239ba69c78 nvmf_tgt: decouple RPC ns list from subsystem internals
MAX_VIRTUAL_NAMESPACE will be removed from the public API, so use an
RPC-specific array size to remove its use in nvmf_tgt.

Also increase the number of namespaces accepted by the RPC call; this
does not actually allow more than MAX_VIRTUAL_NAMESPACE right now, since
the namespaces are still stored in a fixed-size array inside the
subsystem, but at least the RPC side is not limited by that size now.
In the future, we will make the subsystem namespace list dynamically
sized.

Change-Id: I99c77ddeae4c13ddde34e2b945c663dbafdb68d9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363310
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
7b2a6b05d0 nvmf: add public API to get subsystem serial number
Change-Id: I61b6579e8698d16e5a8ab74d304af9ea53f9dce4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363307
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
83da13f1ec nvmf_tgt: remove unnecessary namespace count check
spdk_nvmf_subsystem_add_ns() already checks to see if there is space for
the new namespace.

Change-Id: I9c66311a4f1eb289e87089ab7fa04e8c05b68631
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363305
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
bbfcb0943b nvmf_tgt: use public API to set serial number
Also move the validation of serial number length into the library.

Change-Id: Ibc9384fc1fccb87bd15b75da7f3942570900bd96
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363304
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
7999c01b76 nvmf_tgt: use public API to get subsystem NQN
Change-Id: Icecbc0c8f43ad894e43e6cd1e818978615b56fd6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363302
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
806644a05f nvmf: remove spdk_nvmf_subsystem_exists()
spdk_nvmf_subsystem_exists(nqn) is exactly equivalent to
spdk_nvmf_find_subsystem(nqn) != NULL.

Change-Id: Icafa43166c99d1364b49cef30a5ade4b6625bcd5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363299
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
cunyinch
f4f3bef1cc nvmf: make sure nvmf target workable when it run as secondary porcess.
This patch do the following optimization:
1 when the nvmf target run as secondary process, the nvme probe will
  not call the probe callback function, which will skip the step to
  set up the ctx->found, so we set up it when we call attach callback.
2 when the nvmf target run as secondary process, every time when we try
  to probe one device, it will iterate all the attached devices and call
  the attach callback, for nvmf target, it will cause the overwrite of
  the nvme controller for the nvmf subsystem, so we need to compare the
  attached deivce with the device which we try to attach, if they are not
  the same one, just return.

Change-Id: I606ba75b1dab7fd1b1e4e1cfcf63248a506725d1
Signed-off-by: cunyinch <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/362807
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-30 17:59:44 -04:00
Daniel Verkamp
eaf9019738 nvmf: use bdev name getter
Change-Id: Id0094871bb18f90908f3a9d96f47ddd264cea5bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
1bcf22cde1 bdev: add getters for bdev name and product name
Change-Id: I6a75fada94fa845ecedd4cd8afc78f4259df14fe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-12 09:36:30 -07:00
Ben Walker
b961d9cc12 include: Move the remainder of the code base to stdinc.h
Change-Id: I6a142feeaad3117bd3c75e7c5cb7231a1cfa78ae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:20:36 -07:00
Ben Walker
8e97d585de nvmf_tgt: Rename g_last_rpc_core to g_last_core
This used to be only for RPC, but now it is used in both
the config file and RPC paths.

Change-Id: I138a23f87e9042be60460bc5451470a2443ac3c3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:38 -07:00
Ben Walker
16ae587966 env: Move lcore functions into env layer.
They were previously in the event library.

Change-Id: I24ffd8f771e895ccf5395c8120423cd114893139
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-04 09:19:01 -07:00
Prashanth Nayak
b512e01a50 nvmf: Move the nvmf_tgt app init and start functions out of main().
Added a new function spdk_nvmf_tgt_start() that initializes and
starts the nvmf app. The main function now only parses the command
line args and calls into spdk_nvmf_tgt_start().

Change-Id: I886a4021762a11c3c1f6ebfff5ed72adc409a34e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 17:23:39 -07:00
Jim Harris
10fd30eb01 app/trace: verify tsc_rate specified in shm is > 0
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If60eb51a1a5bad4340eb2ec39a24ad13434e9044
2017-03-28 12:31:30 -07:00
Jim Harris
21ceba8855 app/trace: exit if shm mmap fails
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icbe76cafddf5bd1e457c87e8241e68cb18a044dd
2017-03-28 11:00:01 -07:00
Jim Harris
608f52ebbf app/iscsi_top: use MAP_FAILED for mmap() check instead of NULL
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I69214fa90e9e7c6e789e04c0b5d4540a4a7d4b7f
2017-03-28 07:55:40 -07:00
Jim Harris
d35443d460 iscsi_top: restore old delay value if scanf fails
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I27d8565296e6c1e94cadaa47c0dfd2cea31f7236
2017-03-28 07:55:40 -07:00
Daniel Verkamp
d540f448b4 iscsi_top: replace sprintf() with snprintf()
Change-Id: Idcd9f088f07026be45ba5ba9e6e4f16454ba9acd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-24 14:04:11 -07:00
Daniel Verkamp
9412e60062 nvmf: check spdk_nvmf_tgt_listen() return value
spdk_nvmf_tgt_listen() can fail due to invalid user input (e.g. from a
config file), so we can't just assert() that it worked.

Change-Id: Iea2d4ab2c82d79f6eada24e6082456489bf304b8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-23 13:17:52 -07:00
Changpeng Liu
4ed8870958 vhost: add gitignore the vhost application
Change-Id: I9f73fa558f104eeb4295074ec0000d0eab94dd2d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-03-23 10:15:22 +08:00
Daniel Verkamp
ab061a717a build: replace DPDK_INC with ENV_CFLAGS
A few instances of DPDK_INC were added after the env library abstraction
was introduced; replace them with the correct ENV_CFLAGS variable
defined by env.mk.

Change-Id: I54ab2b2360a72506049fee549491f6614601a148
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-21 15:41:13 -07:00
Cunyin Chang
aa2de5c6f6 nvmf: Fix the bug when free listen_addrs.
it will free invalid address when we start nvmf using profile,
this patch fix the bug.

Change-Id: I5100eadc2fd129a5b9e3588decac1429d03d78a4
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-10 08:02:57 +08:00
Daniel Verkamp
60fc74584a event/app: use PID for trace ID if shm_id is unset
Change-Id: If79a09e109a3885e1282f3e834b531c250e59512
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-09 15:33:17 -07:00
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
Ben Walker
3cbed2ed86 nvmf: Add some accessors for subsystem data
This is a step toward abstracting away the definition
of the subsystem.

Change-Id: I88b2aa107b27152620f51a1ca2a153792b4c85e9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Ben Walker
f1017d7769 nvmf: Remove num from subsystem
It wasn't used for anything.

Change-Id: Ifc8c97481490f6389a739a37df03dea6c88ec692
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Daniel Verkamp
6c56bfa67a nvmf_tgt: remove uses of SPDK_TRACELOG in app
Change-Id: I28b50c71658e497ef723c908b1a896b941897d54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-08 08:58:14 -07:00
Daniel Verkamp
fcb00f3780 nvme: expand probe information to a struct
spdk_nvme_probe() will now provide a struct spdk_nvme_probe_info to the
probe and attach callbacks in place of the PCI device pointer.

This struct contains the useful information that could be retrieved from
the PCI device during probe.

The goal of this change is to allow expansion of the probe information
in the future when other transports (specifically, NVMe over Fabrics)
are added that do not necessarily use PCI addressing or device IDs.

Change-Id: I59a2a9e874e248ce5fa1d7f4b57c8056962ff3cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:02 -07:00
Daniel Verkamp
bbd7e1c4da env: add spdk_pci_addr_parse()
Add a helper function that converts a PCI address from a string into a
struct spdk_pci_addr and use it in place of the various sscanf()
invocations throughout SPDK.

Change-Id: Id2749723f76db741567e01b4bcb0fffb0e425fcd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:02 -07:00
Daniel Verkamp
e1baabee4a bdev: add get_bdevs RPC
Add an RPC interface to list all blockdevs and their properties.

Change-Id: I50db730d5eff8cffcbe8fe5df6b3461457e8581e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 09:10:54 -07:00
Daniel Verkamp
3c3824a3d2 nvmf_tgt: add list of libs that need whole-archive
Some of the SPDK libraries only expose constructor functions, so they
would normally be eliminted by the linker.  Add a new list in the
Makefile of libraries that must be linked with --whole-archive (while
still being added to the dependency list for the app).

Change-Id: I7e41a807c945468730fa84f1bdee23dfd6b59358
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 09:10:54 -07:00
Daniel Verkamp
fd6ebca7a8 nvmf: only save PCI address in direct ctrlr data
The NVMe over Fabrics target was storing the PCI device pointer for each
direct-mode controller, but it only really needs the PCI address, which
is exposed via the get_nvmf_subsystems RPC.

Also update the same code path to use the new spdk_pci_device_get_addr()
function for brevity.

Change-Id: I0708b3331b7c279c1a86f0d7459b5deb40dd7c89
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-01 09:40:36 -07:00
Tsuyoshi Uchida
f78bcc4821 iscsi_tgt: modify usage (#55)
- Delete -v and -V from usage because they are not implemented.
- Add -q to usage.
2016-10-27 13:37:13 -07:00
Ben Walker
cfafcc3edd nvmf: Init transport before adding listeners
Change-Id: I1fbaca75c6b95127ff2b6ac7c0ea0f0a918b9405
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-20 16:22:58 -07:00
Ben Walker
93ab45d68c nvmf: Add an accessor for transport name
This allows the entire transport structure definition
to become private.

Change-Id: I9ca19edbfc3cfb75b9b113a89bb2b90bc499ab16
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:45 -07:00
Ben Walker
1e6ffa0394 nvmf: Add a public API header
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>
2016-10-14 15:26:31 -07:00
Jim Harris
2848c8d1d3 nvmf: defer start of subsystem until fully initialized
Starting the subsystem consists of firing an event
to the subsystem poller's lcore and performing
I/O channel initialization (for virtual NVMe
subsystems) before starting the poller.

Previously the subsystem would be started immediately
when created, which was before the subsystem's
mode and other parameters (such as a virtual subsystem's
bdevs) have been set.  This resulted in no I/O channels
being allocated in virtual subsystem mode.

So break out the start code into a new
nvmf_tgt_start_subsystem() function, which clients
must call after fully initializing a subsystem created
with nvmf_tgt_create_subsystem().

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56534668887ef99d2e892844acd12194920c3245
2016-10-13 09:12:21 -07:00
Daniel Verkamp
5ec0b3227d nvmf/rpc: make sure NVMe device is found in create
Extend the check added in commit
7552ee5512 ("nvmf_tgt: fail if NVMe
controller is not found") to the RPC interface.

Also remove the default PCI address from rpc.py, since it is not a
useful default - the user must specify a PCI address, which will vary
depending on the configuration of the machine.

Change-Id: If9a4e19ef2a84c9d839b467abc011046613f7168
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
4afe9d1acb nvmf/rpc: make hosts parameter optional in create
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>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
45c041449f nvmf/rpc: don't allow namespaces in direct mode
create_nvmf_subsystem should not allow the user to specify any
namespaces in direct mode.

Also remove the default Malloc0 namespace in rpc.py; the user
should be required to specify the list in virtual mode.

Change-Id: I3aaf7c64b9ceee89a3f7db15760a669527adb29d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
0c8a5d8ce6 nvmf/rpc: rename listen_addrs -> listen_addresses
Change the output of get_nvmf_subsystems to be consistent with
construct_nvmf_subsystem.

Change-Id: I6987f6cbd916a870e9b15f0faa3cce2ed6d49795
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
b94e0dfdb2 nvmf/rpc: represent pci_address consistently
The get_nvmf_subsystems RPC reported the PCI address of direct-mode
NVMe devices as individual integers, but the construct_nvmf_subsystem
call requires pci_address in a string format (%x:%x:%x.%x).

Change get_nvmf_subsystems to format the PCI address in the same way
that construct_nvmf_subsystem takes as a parameter for consistency.

Change-Id: I6e55e9a9e73dd425fd560d609b86a2f839c53c61
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Ben Walker
18a2cc11c1 env: Remove unused DPDK headers.
Remove #includes for all DPDK headers that weren't
necessary.

Change-Id: Ib02522e0f04e64a1c98afceb7508cc0e8d931a9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ben Walker
535827c559 env: Eliminate remaining usage of rte_memzone
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>
2016-10-12 09:53:32 -07:00
Ben Walker
7f5b671db7 env: Convert some rte_mempools to spdk_mempools
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>
2016-10-12 09:53:32 -07:00
Ben Walker
2224ff2162 env: Replace rte_malloc with spdk_zmalloc
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>
2016-10-11 13:34:09 -07:00
Ben Walker
8c5a2b0823 nvmf: Rename some uses of virtual to virt for C++ compat
'virtual' is a keyword in C++, so avoid using it in variable
and structure names in case any files are eventually
included from a C++ project.

Change-Id: I2122750445def63038af68a3000758e33b937f9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-07 09:15:12 -07:00
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