Commit Graph

626 Commits

Author SHA1 Message Date
Roman Sudarikov
c3bc40a6ef io_channel: add return value to pollers
This will be used to track time used in pollers - each poller can now
indicate if it found any work to do or not.

For cases where it was obvious and the infrastructure was already in
place, existing pollers have been modified to return 0 or a positive
value to indicate whether work was done.  Other pollers have been
modified to return -1 by default, indicating that the poller isn't
indicating anything about whether work was performed.  This will allow
us to find un-annotated pollers easily in the future and fix them
incrementally.

Change-Id: Ifebfa56604a38434fac5c76ba7263267574ff199
Signed-off-by: Roman Sudarikov <roman.sudarikov@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391042
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 11:16:20 -04:00
Changpeng Liu
5d841040ab nvmf: remove the duplicated line for aerl setting
Change-Id: I22c11cdd5ab0ffdf72b27223c0c9cd7282537613
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/402667
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-08 11:21:42 -05:00
Daniel Verkamp
4c06ce9b9d util: add uuid.h to wrap libuuid
This lets us have a common place to put definitions like the length of
the UUID string, as well as abstract away some of the API warts in
libuuid (non-const values, no size checking for uuid_unparse, etc.).

Change-Id: I80607fcd21ce57fdbb8729442fbb721bc71ccb98
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402176
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:51 -05:00
Ziye Yang
76c501834e lib/nvmf: set sgroup->channels[nsid] = NULL
We should add this state after free the io channel.
To make sure that we will not touch the wild pointer.

Change-Id: I570f649fe3ddffaea430125b40c6b6b020a05222
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/402999
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:15 -05:00
Changpeng Liu
0bce761614 nvmf: fix potential leak when processing multi-range deallocate command
Change-Id: Ic3a612ceed65799d16dae111db355333a1915187
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403002
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-07 11:14:41 -05:00
Changpeng Liu
14a18cca32 nvmf: don't submit FLUSH command to backend which can't support it
As for NVMeoF controller, SPDK always set volatile write cache to
present, so OS may submit FLUSH command to backend block device,
while here, return success for those block devices which can't
support FLUSH command.

Change-Id: Ib764503f1986e7e0a38a1751a91d6c11e1b78865
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/402653
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-07 10:18:19 -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
param
c5cd53cce0 Support for Commands Supported and Effects Log Page
Change-Id: If28662585887b613e3510a8fd8414caeca9ba99b
Signed-off-by: param <kumaraparamesh92@gmail.com>
Reviewed-on: https://review.gerrithub.io/401314
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-02 13:45:35 -05:00
Daniel Verkamp
5c2952ab9d nvmf: implement NS Identification Descriptor list
Currently, this just reports the EUI64 and NGUID types, which are
already available in the Identify Namespace data, but this sets up the
framework for reporting a Namespace UUID (which doesn't have a
corresponding field in Identify Namespace) in the future.

Change-Id: I758e6d402ff874d65eca3f1db98d92c1a3f7a11f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/400893
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-27 13:01:28 -05:00
Ziye Yang
7346be69e7 nvmf: Make the ctrlr create/remove in subsystem in an asynchronous way
Ctrlrs list maintanined by the subsystem structure should be operated
by the thread which creates the subsystem. And this will make the
operations correct.

Change-Id: I7f881a77b1846658b3acd4270b74f86816e87803
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/401541
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-27 12:35:08 -05:00
Ziye Yang
6d4c78eaf4 lib/nvmf: reorder the order of the functions
Purpose: To make the nvmf subsystem management correct
in next patch.

Change-Id: Ie5433f3a7d47f05c5949dfc723aba73465623f88
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/401540
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-27 12:35:08 -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
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
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
Daniel Verkamp
8af4b6c40f nvmf: fix potential use-after-free in hot remove
The subsystem->ns array may be resized with realloc(), so old ns
pointers can become invalid.

To fix this, allocate each ns as a separate object, and change the
subsystem->ns[] array to point to the namespaces rather than containing
them.

Change-Id: I873502fa90cf840e4eaa9b1abd94a95afe0f737f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399726
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-16 13:06:11 -05:00
Ziye Yang
30ef8cac7d nvmf: Solve the coredump issue when client conduct nvme disconnect
This patch is used to solve
https://github.com/spdk/spdk/issues/235

With multiple core bining for NVMe-oF target,
the qpairs which belonging to the same ctrlr may
be scheduled to different cores. Thus there is
resource contention to access the struct spdk_nvmf_ctrlr.

And we put the thread info in polling group. Morever,
we introduce an admin_qpair in ctrlr. Since admin_qpair will
always be created at first and freed at last, to reference
this pointer is safe.

Change-Id: I12ac26f9e65b4ed8e48687750046455af0e3be1d
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/398904
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-15 13:19:08 -05:00
Ziye Yang
114a91fdea nvmf: extract some codes in functions.
This patch is used to solve
https://github.com/spdk/spdk/issues/235
in the later patch.

Change-Id: I8ef6d3effbff7a6b27e82c397969687d0000542b
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/399349
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-14 18:09:45 -05:00
Ziye Yang
32ad027b0c nvmf: Adjust the resource free order for transport
Reason: In spdk_nvmf_subsystem_destroy, we call
spdk_nvmf_ctrlr_destruct(ctrlr), and this function
will still use the transport, so definitely, it is
a defect(reproduced in my platform).
So we need to defer freeing the transport resource.

Change-Id: I3eee2a29c223e2759a623604485af6f081746581
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/399368
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-12 18:21:55 -05:00
Daniel Verkamp
54bfde6a09 nvmf: allow removal of listen addresses at runtime
Change-Id: I53ffdd061ba068070f66a752780229ecfe53e737
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398688
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
Daniel Verkamp
6ad3a5ce9b nvmf: check for duplicate listen addresses
Don't allow a duplicate listener to be added to a subsystem.

Change-Id: I1a5f2ae09146a31859921430fb716a36d7f2048e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398652
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 12:47:27 -05:00
Daniel Verkamp
d13d21e651 nvmf: remove spdk_nvmf_qpair::type field
The type of a queue is purely a function of its queue ID.

Add a helper function, spdk_nvmf_qpair_is_admin_queue(), to make the
logic more obvious (akin to nvme_qpair_is_admin_queue() in the NVMe
library).

Change-Id: I7cf5a82d1e3dc50834cc2ff03f5f88c5719c6952
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398663
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:21:54 -05:00
Changpeng Liu
6cfdeefe23 nvme: add asynchronous event configuration definition
Change-Id: Id1e2a7da0db319c4d43988ec4991462fc956dde2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/398542
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-02-06 18:14:41 -05:00
GangCao
fc7e847539 nvmf: check whether the transport already in poll group
Add a check when adding transport in the poll group.
If already there, just return.

The poll_group_add_transport operation can be called
at the poll group creation and target listen both.

Change-Id: I655d6fa97cafdc11fa23d199bdfe31350b920ca4
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/395039
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>
2018-02-02 12:27:00 -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
Ben Walker
be774bf664 nvmf: Check subsystem state when modifying listeners or hosts
Change-Id: Idadd4eb7574b005cce8b888b28c8c3b6993343a4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/395555
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-01-24 15:52:48 -05:00
Ben Walker
2bbc59fa79 nvmf: Fix bug when accessing realloc'd pointer
Caught by the latest scan-build.

Change-Id: I606a30447e5221c86e79accb9a2c1fe76e9eeee0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/396054
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-23 17:20:05 -05:00
Ben Walker
6d4d942b2a nvmf: Remove master_thread concept
Individual threads can now pause and resume subsystems
as needed, so the master_thread isn't used.

Change-Id: I49ccb1f87d3e5956db7bd8fc9da0542c5c487923
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/394260
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-01-17 17:28:13 -05:00
Ben Walker
7358fb6f85 nvmf: Hot plug notifications now use the subsystem pause functionality
Use the general purpose mechanism to pause a subsystem when a bdev
is hot removed.

Change-Id: I3cd4fb15140d6682707b7840c6a9c3f63fe48e55
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/394259
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-01-17 17:28:13 -05:00
Ben Walker
d346b9c5a2 nvmf: State change functions now have a return code
When the state change is known to fail immediately, use
a return code instead of calling the callback.

Most of the callbacks didn't actually check for errors,
so this patch also doesn't check for errors on return
codes. That should be done in the future.

Change-Id: I67e03f93d7f53892473dfc073f4150e7e620cad2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/394281
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-01-17 17:28:13 -05:00
Ben Walker
6711e5a525 nvmf: Fail incoming commands to an inactive subsystem
Eventually this should probably queue, but for now
just fail these commands.

Change-Id: Ie1b1088aa38198c17062ac9874539ad6d99b01eb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/394125
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-01-17 17:28:13 -05:00
Ben Walker
823b565b5f nvmf: No longer route fabrics/admin commands to a single thread
These commands can now pause a subsystem if they need to operate
on it. We don't currently implement any of the NVMe commands
that would need to pause, so this patch is simpler than most
would expect.

Change-Id: I25bfdf8e7577cda2bb0ce248d2889447032b9b4c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/394121
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-01-17 17:28:13 -05:00
GangCao
8d61a0a5f6 nvmf: remove the unused thread variable
The thread variable defined in the struct spdk_nvmf_rdma_qpair is
not used. Just remove it.

Change-Id: I5f406ff276733cc9474a997b3c18d23c7420cac8
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/394152
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: Jim Harris <james.r.harris@intel.com>
2018-01-11 11:00:11 -05:00
Seth Howell
a1a47b5592 nvmf/subsystem.c: add checks for valid utf-8 chars:
The NVMe spec states that nqn names are to be encoded in utf-8. The
prefixes of all nqn's are already required to be ascii by virtue of
their structure so they are already valid utf-8, but the user specified
strings should be checked for valid utf-8 strings.

Change-Id: I20090d366e93e98af4932eaa120d4edb6e512206
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/394118
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-11 10:57:38 -05:00
Ziye Yang
678fe32898 nvmf,rdma: set cm_id = NULL
Purpose: If the qp creates in a failure state,
we should set cm_id = NULL, then we do not need to
destroy the qp which is not created.

Also this patch add return value check while calling
spdk_nvmf_rdma_qpair_initialize.

Change-Id: I084c186738fcf6079cb36666f68e10b906e77145
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/394016
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-09 15:51:50 -05:00
Seth Howell
b21fad1a80 nvmf/subsystem: spdk_nvmf_valid_nqn fits nvme spec
Added tighter regulations to the NVMe-oF nqn checking to conform with
the nvme 1.3 spec. including, adding checks for valid nqn's in the case
of a generic uuid based nqn and checking for reverse domain name and
colon prefixed strings in a user specific nqn. Unit tests included.

Change-Id: I3ee4b269d0655ac9968699617e43e3297695c7ed
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/393265
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-09 13:30:24 -05:00
Pawel Wodkowski
891c12a63c util: add spdk_strerror() wrapper with TLS support
This patch remove need for additional buffer when translating error code
to string.

Change-Id: Iaa60088b5c450581d3cdddbb425119b17d55a44b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386114
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-04 15:00:09 -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
Ben Walker
1545c8eb5e nvmf: Fix bug when resizing sgroups array
Change-Id: I366b941a60d1fb00951591e7f631a65e8a449904
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392566
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-20 21:38:25 -05:00
Ben Walker
fd0770fecb nvmf: Delete subsystems when target is destroyed
Change-Id: I102954505c2c53458aae30f6d15b46e008355501
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392565
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-20 21:38:25 -05:00
Philipp Skadorov
6d98264552 nvmf/rdma: decrement r/w counter if ibv_post_send fails
The outstanding r/w requests counter is not decremented
back if IB r/w request fails.

As the result, the rdma qpair stops pumping the requests
after the number of ibv_post_send failures reaches
the threshold for outstanding r/w requests for that qpair.

The patch decrements qpair's r/w counter back in case of
ibv_post_send returns an error.

Change-Id: I8fa0f2905974a50037034962e4d2a001290a06a9
Signed-off-by: Philipp Skadorov <philipp.skadorov@wdc.com>
Reviewed-on: https://review.gerrithub.io/391799
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-15 16:42:51 -05:00
Ben Walker
2a0772e3b8 nvmf/rdma: Create one cq per thread instead of per connection
This greatly increases the efficiency when the target is scaled
to many connections. Now all connections being handled by a given
thread can be polled in O(1), whereas before it was O(n) where
n was the number of connections.

Change-Id: I9f695f68093d73e6538df416b0f1aabef07119ff
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/391491
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-15 16:26:33 -05:00
Cunyin Chang
bdcb0d709a nvmf: add support of hotplug for nvmf.
Change-Id: Iebd5b75e3525e77bf256f5b7f52aa2504d7a68c3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390549
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-15 16:14:02 -05:00
Cunyin Chang
7f5864be20 nvmf: Add public interface of remove ns from subsystem.
Change-Id: I9c2746dd54a13f3dae0ac2bab1d5fced931e8591
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391699
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-15 16:14:02 -05:00
Cunyin Chang
0b99cd6f1e nvmf: remove the data structure spdk_nvmf_subsystem_add_ns_ctx.
Add pointer of subsystem in namespace data structure, then we can remove
the spdk_nvmf_subsystem_add_ns_ctx.

Change-Id: I2d024f10d35fdac64fc34d0cb6523cfca74a8164
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391697
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-15 12:22:20 -05:00
Ben Walker
5165aee686 channel: Make spdk_for_each_channel support async operations
While iterating, allow the user to perform asynchronous
operations. To continue iteration, the user is expected
to call spdk_for_each_channel_continue.

Change-Id: Ifd7d03d5fbf17cf13843704274b036d49ca0484a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/391309
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-14 12:05:07 -05:00
Ben Walker
33376dd136 nvmf: Add subsystem iterators
Add functions to iterate the list of subsystems for a given
target.

Change-Id: Id3831f656033092224168b353788ae87238bf800
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388294
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
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
Cunyin Chang
fcccf16767 nvmf: close all the bdevs when delete subsystems.
Change-Id: Ie3c7c8d960b0074b86e983e0e8bf04de2d99f61f
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390365
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 17:14:40 -05:00
Daniel Verkamp
bedc405f35 nvmf: add duplicate QID check in I/O Connect
Disallow multiple I/O queues for the same controller with the same queue
ID.  NVMe-oF 1.0 ECN 001 specifies that this condition should return a
status value of Command Sequence Error.

Change-Id: I41126ddec388a985c403025e099ab15da5d3987c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390662
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-12-08 14:08:19 -05:00