Commit Graph

658 Commits

Author SHA1 Message Date
Daniel Verkamp
0f99e7ab9e nvmf: report that namespaces may be shared
The namespaces exposed by the NVMe-oF target may be attached to multiple
(virtual) controllers at once, so we should indicate this via the
Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field
in the Identify Namespace data.

Change-Id: Iecca80f01577422f73d781c05dcb212db55f7ee1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407834
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>
2018-04-18 12:33:15 -04:00
Daniel Verkamp
0a162815d6 Revert "subsystem.c: make subsystem_remove_ns asynchronous"
This reverts commit 498f9add11.

Making the subsystem removal asynchronous seems to be triggering an
intermittent failure in the NVMe AER test.  Let's revert this for now
until we can diagnose the issue.

Change-Id: Ie1d598f0d5cce07e6869d87cd8388848caa78e46
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408118
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 20:17:27 -04:00
Seth Howell
498f9add11 subsystem.c: make subsystem_remove_ns asynchronous
Performing a subsystem update on each poll group after the addition or
removal of a namespace allows us to avoid the case where we pause a
subsystem, perform a removal, then an addition, resume the subsystem and
don't update the channel for that subsystem. This, however requires that
spdk_nvmf_subsystem_remove_ns be asynchronous.

Change-Id: I856572c02e6267f708da3a956accbbedae7260fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407012
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>
2018-04-17 18:23:19 -04:00
Ziye Yang
27d47b9a10 nvmf: make the qpair disconnnect in the right order.
Reason: Initiator sends the qpair deletion in wrong order.
The correct order should be all io qpairs deletion and then
the admin qpair deletion. However, nvme perf does not follow
this since we did not catch ctrlr + c. If we catch ctrlr + c,
we need to use the spdk app framework, or other methods. We should
support this in another patch.

Morever, to prevent the incorrect behavior causing the coredump
of target, we need also consider such case in our NVMe-oF target
design. And this patch, can solve this issue, it will defer the
admin qpair deletion when there are still active io qpairs.

Change-Id: Iec9b88c1d6254f36963c92402ebfe8bd99abaea5
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407771
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-17 01:58:36 -04:00
Ziye Yang
b332897a04 nvmf: add the assert in spdk_nvmf_ctrlr_disconnect
Change-Id: I41c9946e6c30c3eda1abf3669270a9b9533e3a50
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407612
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>
2018-04-16 19:23:18 -04:00
Daniel Verkamp
565932d27a nvmf: fix non-deallocate Dataset Management status
If the host sends a Dataset Management command that does not specify the
Deallocate attribute, the NVMe-oF target should return success; the spec
says that this command is advisory, and all combinations of attributes
may be set.

Change-Id: I5d87d93ec61d27c8d65a17bbe4accc12ba26bbd3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406995
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>
2018-04-10 15:44:38 -04:00
Xiaodong Liu
6684c3b5ac nvmf: correct args order to get bdev_io status
Change-Id: Ib0b5e75f33ed22801a564a89651caa28ebe2b4f6
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/406890
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>
2018-04-09 13:13:41 -04:00
Ben Walker
26dd844d8a nvmf: Detect bdev additions and removals on subsystem resume
Change-Id: Icd365143bafe259526e303e74618908d2c52f146
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406663
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-04-06 18:41:59 -04:00
Daniel Verkamp
9689e6cca5 nvmf: use standard types in spdk_nvmf_valid_nqn()
Change-Id: Ia1b26b35a5befbd6e3775bce224a8a9f473426e9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406442
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>
2018-04-05 15:57:34 -04:00
Daniel Verkamp
8cad9604bd nvmf: verify that serial number is an ASCII string
Don't allow the user to specify an invalid ASCII string for the
controller serial number field.

Change-Id: I1c3acf6997a0afcdbfc03caf9e8d9b5fab429106
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406441
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>
2018-04-05 15:57:34 -04:00
Ben Walker
fe54959b62 nvmf: Queue incoming requests to a paused subsystem
Subsystems enter the paused state when their internal
data representation is changing (i.e. namespaces are
being added, etc.). Queue incoming requests while
in this state.

Change-Id: I51e0c687b5b0f98351faa20dffa57110eb4a9df4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406449
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-04-05 12:54:31 -04:00
Ben Walker
2b79861deb nvmf: Make spdk_nvmf_tgt_listen asynchronous
This was internally asynchronous already, but make it
explicitly asynchronous so other code can properly
wait on the operation to complete.

This fixes an intermittent CI crash.

Change-Id: I81c9b19673566047dcffa94796236ca9fd7fa7d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406226
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-04-05 12:54:31 -04:00
Daniel Verkamp
9770ee7817 nvmf: reduce log level of informational messages
Change-Id: I595f0ec871174557a35811fe3b102c33a5a60ab0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405931
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-04-05 12:06:45 -04:00
Daniel Verkamp
61d379fd7e nvmf: move Command Effects log page to ctrlr.c
No code change - the existing code is moved as-is.

This is the only place it is used, and it is conceptually part of the
virtual controller implementation.

Change-Id: I863f5931225c4d78e515341445e91b29a73da64d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406251
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>
2018-04-04 15:10:30 -04:00
Daniel Verkamp
1ec2c81bbc nvmf: report support for multiple ports and controllers
The NVMe-oF subsystems that our target exposes may have multiple
subsystem ports and multiple controllers; report these in the Identify
Controller data structure Controller Multi-Path I/O Capabilities field.

Change-Id: I5f1d4ce91698fe6abd281fdc022b6e3b37efd3ef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406244
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-04-04 14:55:48 -04:00
Daniel Verkamp
3165d0c070 nvmf: report support for NS Attribute notification
Fixes: 26541489ef ("nvmf: implement Get Log Page - Changed NS List")
Fixes: 763ab88884 ("nvmf: add Namespace attribute notice support")
Change-Id: Id015e4d96fe98a7f6c845821395463e341b7066c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406247
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-04-04 14:55:48 -04:00
Daniel Verkamp
26541489ef nvmf: implement Get Log Page - Changed NS List
Change-Id: I6219ace8deba0bfc3e3c7f6a4e00c0098584d5ee
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405122
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-03 17:29:56 -04:00
Changpeng Liu
0f15edee2d nvmf: factor out namespace change helper function
Change-Id: Iaeaf308bc2135cf94a3e1fd94c3c5d56f8a2f86e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405130
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-03 17:29:56 -04:00
Changpeng Liu
763ab88884 nvmf: add Namespace attribute notice support
Users can use RPC to add/remove a namespace to/from
existing NVMe controller, SPDK NVMeoF target will
generate an asynchronous event as an indication to
host when asynchronous event request is available.

While here, we also set the event with invalid log
identifier, so that the host doesn't need to clear
the event. Users can use Set Feature to disable
such event.

Change-Id: I93c4d752f552d3c86c53e80877aa61c093e167cc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/398759
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-04-03 17:29:56 -04:00
Changpeng Liu
998b961e75 nvmf: set the subsystem state to inactive when removing it
Since the function call will remove all the active I/O channels,
the pollers don't need to submit all the pending I/O requests any
more.

Change-Id: I93e7b070f5c74b10f67bd1248fa515a29dca5620
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403759
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>
2018-04-03 14:12:24 -04:00
suman chakraborty
bc9423e229 Segfault occurs during connect to the subsystem when a namespace is added with a nsid smaller than the nsid previously added
Change-Id: I74c7b32e1713d683e5d80818724ed3b19f3dac64
Signed-off-by: suman chakraborty <suman.chakraborty@wdc.com>
Reviewed-on: https://review.gerrithub.io/405373
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>
2018-04-03 13:26:14 -04:00
Ziye Yang
6d4e6ffd08 nvmf: add the assert in ctrlr_delete_qpair
Change-Id: I4c23f83ebaf80f1b62fb4c1144ff864bdfd6efbe
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/406014
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-04-02 19:57:05 -04:00
Daniel Verkamp
d2e7daa435 nvmf: add stubs for all mandatory Get/Set Features
Most of these don't actually do anything useful yet, but they are all
required by the NVMe 1.3 specification.

The features are also rearranged in numeric order to make it easier to
match up the cases in the switch statements to the specification.

Change-Id: I5f70ecb0bb38b9e1d8287d32fc2e03bca5f1f8a6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403903
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-03-30 20:18:54 -04:00
suman chakraborty
5e98dfd126 nvmf: add capability to add namespaces dynamically during active connection
1) The user should provide MaxNamespaces during the construction of the subsystem
2) The namespace which is added should have nsid less than or equal to MaxNamespaces
3) If the user does not provides MaxNamespaces then the exsisting behaviour continues where the nisd can grow dynamically when it is not connected.

Change-Id: I54769d9669575a5f6bf56fe5a262191ac51c474d
Signed-off-by: suman chakraborty <suman.chakraborty@wdc.com>
Reviewed-on: https://review.gerrithub.io/405375
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-30 19:24:29 -04:00
Daniel Verkamp
c5008b37a0 nvmf: report support for Command Effects log page
Change-Id: Ia382110fbbadea51d3b454e07e775afc9e286eae
Fixes: c5cd53cce0 ("Support for Commands Supported and Effects Log Page")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405821
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-03-30 16:26:57 -04:00
Daniel Verkamp
ed6e83f958 nvmf: implement Firmware Slot Information log page
Change-Id: I93a4cae46dad7ec42fd82fa4917fd27e3b14c46a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405827
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-03-30 16:26:10 -04:00
Daniel Verkamp
9a43cbd490 nvmf: mask off reserved bits in AER configuration
Set Features - Asynchronous Event Configuration has reserved bits in the
CDW11 value, which we shouldn't allow the host to set.  Explicitly set
them to 0 in the Set Features handler to avoid propagating them to the
Get Features return value.

Change-Id: I73ed87d6d310e585c073b1db3b875147b4727007
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403902
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:45:23 -04:00
Daniel Verkamp
4fce1a5fa6 nvmf: factor out generic Get Features handler
Most Get Features commands can be handled by just setting CDW0 to a
particular value and returning success.

Get Features - Host Identifier needs special handling, so it isn't
converted.

Change-Id: I8a3e2d5659a9ecbb3904589912ccf44d0d25b715
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403901
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-03-23 03:45:23 -04:00
Daniel Verkamp
0f56183728 nvmf: use Set/Get Features structure types
No functionality change, just a cleanup.  This will help with future
simplification patches.

Change-Id: Id2efd851ed0add664e516725ab98b5e1f8cafff5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403900
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:45:23 -04:00
Daniel Verkamp
a05f88ff34 nvmf: retrieve namespace UUID from bdev
A new optional parameter is added to the NVMe-oF target namespace
options to set the Namespace UUID, which will be reported via the
Identify command Namespace Identification Descriptor list.

Change-Id: I53c6d6fa6475d3395d412d196b42000715e9ed81
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/400894
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-20 17:18:44 -04:00
Daniel Verkamp
b86ae8534a nvmf: increase emulated NVMe version to 1.3
Now that the NVMe-oF target emulated controller supports Identify with
CNS = 03h (Namespace Identification Descriptor list), I believe we
support all of the mandatory parts of NVMe 1.3, so let's increase the
reported VS/VER fields to 1.3.

Change-Id: Iee1052bf9ee1a0954f47770c7e5151886e63f11c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403891
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-03-16 14:15:47 -04:00
Daniel Verkamp
524e8fc976 nvmf: centralize duplicate subsystem NQN check
This should be enforced by the main NVMe-oF target library, not in the
event subsystem code.

Change-Id: Ibce4fd78710b4a9da374e3d5979df4a16e91533c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403380
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-03-14 12:54:15 -04:00
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