Commit Graph

3293 Commits

Author SHA1 Message Date
Ben Walker
8c9508f9b3 nvmf: Correctly unregister nvmf tgt as an I/O device
Change-Id: I9552354d620986c2a3d6b071f32b587e9e683198
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413861
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-06-07 16:07:38 +00:00
Ben Walker
f4f839ecd3 nvmf: Eliminate num_qpairs counter in controller struct
The qpair mask can be used instead.

Change-Id: I9063e656c7c44663dc96adfd5ef52a5a1065d2ba
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413860
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-06-07 16:07:38 +00:00
Ben Walker
f08cea7169 nvmf: Perform QID validation using a bit mask
Instead of scanning a list of all qpairs, use a bit
mask to determine if the requested QID is unique.

This is not for performance reasons, but because
eventually the ctrlr's list of qpairs is going to
need to go away.

Change-Id: Ic25ee60e4f9cd9d596815719760d5be892f29d0c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413286
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-07 16:07:38 +00:00
Daniel Verkamp
5eb33f0a5f nbd: return path to /dev/nbd* in start_nbd_disk
This will allow us to make the start_nbd_disk method choose an available
/dev/nbd* node automatically in an upcoming commit.

Change-Id: I3c6eb67e7e0c513212eba17139fd0cc96bf9b6dd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413847
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>
2018-06-07 16:05:59 +00:00
Daniel Verkamp
8b158aaacd nvme: factor out request timeout checking
This will be used in other transports as well.

Change-Id: I05026b0dfea2647d61a173379aca368ca48a2f52
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413864
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-06-07 15:46:50 +00:00
Daniel Verkamp
cdb3a594a8 nvme: ignore requests submitted before timeout set
If requests are in flight at the time a timeout callback is configured,
we can't retroactively get the submission time of those requests; treat
them as not having a timeout.

Change-Id: Ic589e874a0f2c8c7f4ce352afa7c3aea33b01fae
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413863
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-07 15:46:50 +00:00
Daniel Verkamp
e7b29a14c0 nvme: move timeout information to nvme_request
This is the first step toward timeout handling for other transports.

Change-Id: I386dd990f667d449e94ba4bcedaa3435743755fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413862
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-07 15:46:50 +00:00
Daniel Verkamp
1681a055f9 nvme/pcie: restore timeout checking on admin queue
This was partially fixed in commit ddeaeeec19 ("nvme: Only check
timeouts on requests from the same process"), but the function that
calls nvme_pcie_qpair_check_timeout() was also erroneously filtering out
the admin queue.  Restore the original behavior of checking all queue
types.

Change-Id: I26a44ff5eb772735d314ce7b8322ba9222675911
Fixes: 31bf5d795e ("nvme: make timeout function per process")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/411628
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-06-07 15:46:50 +00:00
Young Tack Jin
f52d800864 nvme: add metadata to spdk_nvme_ns_cmd_read/writev()
verified on QEMU NVMe for OCSSD 2.0 and RFC will be shared soon

Change-Id: I01c513e30768ac1961a5c5af20de3a2490da7729
Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/413854
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-06-06 23:20:43 +00:00
Piotr Pelplinski
8c45ed3822 blobstore: freeze I/O during snapshoting.
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I6182eb3a77d23db7088703492d71349e3a4b6460
Reviewed-on: https://review.gerrithub.io/399366
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-06-06 22:26:04 +00:00
Changpeng Liu
4c4c8ca269 nvme: don't reset controller when processing NS mangement commands
For attach/detach command, the identify namespace data should be
updated during the namespace attribute notice event callback, while
here, in case of the driver may not set aer callback, so update the
namespace identify same with attach command.

Change-Id: Ie594b2ff646a67488d03af2771c00f9947395aba
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/412884
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-06-06 20:02:16 +00:00
Pawel Wodkowski
5d3d5a49da nbd: use req.len in NBD_CMD_TRIM
Change-Id: I2c193498ae70e2813e5447ac4375c84635f5425a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/413808
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>
2018-06-06 17:13:15 +00:00
Ben Walker
4d58c1328a nvmf: Move QID error checks to common path
QIDs need to be validated for both I/O queues and admin
queues, so move the checking to a common path.

Change-Id: Icb2009b3fe4d70f146b741c046812d9df62cc2fb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413859
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-06-06 17:10:57 +00:00
Ben Walker
b95fc6fc64 nvmf: Return the correct error for out-of-range QID
This one is actually a bit tough to deduce in the specification.
The NVMe-oF spec says that QID errors detected in the RDMA
transport shall return an RDMA-specific error indicating
the problem. However, our code doesn't detect the error in
RDMA-specific code, and it isn't clear if the language is
a "must" or a "should".

The NVMe specification does clearly indicate what error
to return on invalid QID in response to a Create
I/O Queue Pair command. For now, return that while
we game plan whether we need to call into the RDMA
transport to correctly report this error.

Change-Id: I7faf37bad9b9202bc50a906214a51c17e4808fc0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413858
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-06-06 17:10:57 +00:00
Daniel Verkamp
008c111b48 nvme/pcie: only set mmio_ctrlr around actual MMIO
When the shadow doorbell feature is enabled, no actual MMIO takes place
when a shadow update is sufficient; tighten the bounds of the updates to
g_thread_mmio_ctrlr in the two doorbell update locations so that we only
need to touch the thread-local variable when actual MMIO access is
required.

Change-Id: Ida974bec33f56cbb9f7d3611f483c6975ec773ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413856
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-06-06 17:10:09 +00:00
Shuhei Matsumoto
f2554ee973 scsi: Change spdk_scsi_task_alloc/free_data() from public to private
This patch does a little cleanup of SPDK SCSI layer APIs.

spdk_scsi_task_alloc_data() is only used in spdk_scsi_task_scatter_data().
spck_scsi_task_free_data() is only used in spdk_scsi_task_put().

The latter was called in UT code but this can be removed without any
degradation.

SPDK SCSI layer is relatively matured and these will not be used
out of lib/scsi/task.c.

Additionally memory leak detected by ASAN is fixed in this patch.

Change-Id: I8eff7b4dbfc307c211087734649a9b9b10555f8d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/413872
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-06-06 17:09:22 +00:00
Jim Harris
c796b90747 bdev/iscsi: break out common code for completing a conn_req
Suggested-by: Ziye Yang
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6ca7f08aed2e12c59518269c7b277895b4817bd8

Reviewed-on: https://review.gerrithub.io/413844
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-06 16:05:57 +00:00
Daniel Verkamp
e83a62bf09 nvme: rename quirk from LIGHTNVM to OCSSD
This is consistent with the Open Channel naming we are using elsewhere.

Change-Id: Ib088359bed29a958f8b50e41cf34143a23429f54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413840
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-06-06 01:45:36 +00:00
Shuhei Matsumoto
6f872f5ab9 json: Add spdk_json_decode_uint16
int16_t is not used in SPDK yet. Hence add decode function only
for uint16_t.

Change-Id: I86f86a6768d95896d1840370f2d176c770c41418
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/413711
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-05 21:30:02 +00:00
Chunyang Hui
3f4c54a7c7 bdev/aio: bdev_aio_flush remove redundant parameters
Change-Id: I3f458fbf7758d912344c21026d672e7bdcf60e8e
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/413724
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: Jim Harris <james.r.harris@intel.com>
2018-06-05 18:45:42 +00:00
zkhatami88
0cdb08b0e0 env: add size parameter to spdk_mem_map_translate
Change-Id: I808101edaf4d75613baf19a950915f1d8e75b1af
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413154
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Zahra Khatami <zahra.k.khatami@oracle.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-05 18:36:00 +00:00
Pawel Wodkowski
fba68d61e1 bdev/iscsi: add RPC support and cofnig dump
Also, as we are here, switch to new spdk_json_write_named_* API in
bdev_iscsi_dump_info_json()

Change-Id: Ib29466eb5c6d6496dd1d8efc1f2064577bf56272
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406635
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-06-05 17:52:06 +00:00
Pawel Wodkowski
06fdb62b3b bdev/iscsi: make connection poll time 0.5ms
Change-Id: Ib8d77b44ef10b03d6554c32f78e92f197f6c7e7f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/412839
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-05 17:52:06 +00:00
Pawel Wodkowski
a76cc7ce61 bdev/iscsi: add create callback
Also convert bdev_iscsi_set_module_init() into new callback.

Change-Id: I439369180e1e10eab5dee6aba27ffb0489ea2550
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410095
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-06-05 17:52:06 +00:00
Philipp Skadorov
b6f90c527a nvmf/rdma: monitor asynchronous events
NVMf cnx acceptor poller is changed to check the asynchronous events
from the RDMA devices.

RDMA async events are polled together with RDMA CM events; the file
descriptors are combined into a poll fd array and processed in a single
poll syscall.

The errors handler is an empty placeholder for this patch, it just
prints the kind of event read from the IB device context.
The work for implementing event handling is left for later.

Signed-off-by: Philipp Skadorov <philipp.skadorov@wdc.com>
Change-Id: Ib167990651b585090aceef1404a88d431a910226
Reviewed-on: https://review.gerrithub.io/412540
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 17:28:04 +00:00
Daniel Verkamp
a1c7c58f71 util/bit_array: add functions to count 0/1 bits
Change-Id: I7c1ad078982a19c4093e787731974986011f535b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 17:24:48 +00:00
Ben Walker
72800826ec nvmf: Quiesce I/O before closing spdk_nvmf_qpairs
Change-Id: Iff58943f3f9db39b6fce1437a0cfe7380991daa6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412078
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-04 17:20:34 +00:00
Srikanth kaligotla
8580daa1ac nvmf: SGL support for NVMF RDMA Driver.
Change-Id: I447754c69de432b5a65dc8c1d9ae690926e88c51
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Srikanth kaligotla <kalis@netapp.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410302
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-04 17:15:49 +00:00
Ben Walker
a94accabff bdev: Begin encapsulating spdk_bdev_io
This begins the process of hiding data members in
spdk_bdev_io that don't need to be accessed from
within bdev modules.

One strategy would be to implement accessors for
every data member in the structure. However, that
may have negative performance effects. Instead,
create a new internal structure within the old
structure. This new structure will still be visible
for now, but at least makes clear which members
are accessible and which are not.

This patch shifts one data member to the new structure
as an example.

Change-Id: I68525db995325732fe9f5fc3f45b06920948309b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412298
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 17:14:22 +00:00
Xiaodong Liu
c6ae008db5 lnvm: add a quirk for identify LightNVM device
Change-Id: I841d7b47bc85498abb608944587e7b7585138263
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411588
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>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 03:31:46 +00:00
Jim Harris
13ed998697 nvme: make basic request functions static inline
This reduces submission+completion time by 10-15
core clocks per IO on an Intel Xeon Platinum
processor.  Similar improvements should be seen
on other processors as well.

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

Reviewed-on: https://review.gerrithub.io/413284
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-04 03:28:19 +00:00
Jim Harris
9c4679bc77 nvme: rename g_pid to g_spdk_nvme_pid
This variable will no longer be static in a future patch.
So make the name a bit more verbose since it will now
be visible outside of the module that defines it.

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

Reviewed-on: https://review.gerrithub.io/413283
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-04 03:28:19 +00:00
Jim Harris
d76cd984aa nvme: optimize nvme_allocate_request memsets
The memset was zeroing a lot of bytes that get
initialized either later in this function or elsewhere
in the submission code path.  Eliminating these
extra memsets saves a few nanoseconds of CPU overhead
in the NVMe submission path.

Note: one use of the cpl data member depended on
the nvme_allocate_request memset.  Since this use
case is not in the primary I/O path, just memset it
in that specific location before using it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife483a4d9c24c033cc7d26d94ec1700905a936f4
Reviewed-on: https://review.gerrithub.io/413153
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-06-01 21:01:42 +00:00
Daniel Verkamp
7dff719f7e nvme: optimize layout of struct nvme_payload
Rather than storing nvme_payload::type explicitly, use the SGL reset
function pointer as an indicator: if reset_sgl_fn is non-NULL, then the
payload is an SGL type; otherwise it is a contiguous buffer type.

This eliminates the one-byte type member from struct nvme_payload,
making it an even 32 bytes instead of 33, allowing the removal of the
awkward packing inside struct nvme_request.

Change-Id: If2a32437a23fe14eb5287e096ac060067296f1dd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413175
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>
2018-06-01 21:01:42 +00:00
Daniel Verkamp
caf85d8f23 nvme: add macros to populate nvme_payload
The definitions of these macros will change in an upcoming patch that
modifies the way nvme_payload is laid out.

Change-Id: Ic6edc18928542b07be7519a72bdbf6babbeb0131
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413174
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-01 21:01:42 +00:00
Daniel Verkamp
5c2ccd0628 nvme: add helper function to get payload type
This will simplify upcoming patches that change the way nvme_payload
stores its type.

Change-Id: Idf0a5b8dfd7d66a10f89254d2c5c54fee2968a43
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413173
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>
2018-06-01 21:01:42 +00:00
Shuhei Matsumoto
fafec18e3c subsystem/iscsi: Add iSCSI options to JSON config file
This patch is a pair to the following
- subsystem/iscsi: Add set_iscsi_options RPC to set global params

Now options can be loaded from JSON config file.

Change-Id: Ifb68cddbb045d51fbaf8161ad59ede9d399e70cb
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/410874
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>
2018-06-01 20:15:59 +00:00
Shuhei Matsumoto
59b3479bfd subsystem/iscsi: Add set_iscsi_options RPC to set global params
An new RPC set_iscsi_options allocates and set options dynamically.
Initialization of iSCSI subsystem skips initialization of options
if it is already allocated.

To use and test this RPC easily, add python script too.

Change-Id: I71e252da6495a194ae9a1a9e3aaae4feb543487a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403624
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-06-01 20:15:59 +00:00
Dariusz Stojaczyk
f8387acaa5 event/app: fix setting "single-file-segments"
This got broken in 93cb4a31 [1]

[1] 93cb4a31: event/app: Refactor initialization of app environment
in spdk_app_start()

Change-Id: I9dca9694d50b9132761b57da192ecd1a774337ab
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/413168
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-06-01 20:14:32 +00:00
Dariusz Stojaczyk
b5ad869cc1 virtio: merge contiguous memory regions
Although contiguous, memory regions may appear as separate
/proc/self/maps entries.

This patch brings support for DPDK 18.05.

Change-Id: I91eb8adc2c073a103f687320ec7b9dabe1e066b3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/413167
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-06-01 20:14:32 +00:00
Daniel Verkamp
40b6f761b2 nvmf: allow abort of AER requests
These are trivial to abort: since we just hold on to aer_req until an
event is triggered, we just need to set aer_req back to NULL and
complete the request.

Change-Id: I74ffe7a227fcaf816c0c584fe5c82a940475687f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412881
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-05-31 06:03:50 +00:00
GangCao
c5f3ab7a73 bdev/qos: queue and submit directly on same thread
There is some overhead notified for the message processing,
instead to always send a message to the QoS thread, check
whether the current thread is QoS thread or not. If yes,
queue the IO immediately base on the QoS logic.

Change-Id: I9c1f93aeaf68c9b1a0282c3b690614413949d901
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/413028
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-05-31 05:53:01 +00:00
Daniel Verkamp
85a822292d nvmf: refactor abort handling
Combine request lookup and abort into a single operation. Keeping them
separate would result in duplicating a lot of logic for finding the
proper list from which to remove aborted requests.

This is still a no-op for now, but it paves the way for aborting
requests that are still queued in software.

Change-Id: If8f268521f2c9f93b413261d87e9f39e539813aa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412880
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-05-31 05:50:54 +00:00
Ziye Yang
d10401cc07 iscsi: Solve the potential no io channel issue.
Reason: If we trigger the spdk_iscsi_conn_migration,
we may face the issue that the io channel of lun
is NULL(which means not allocated). So I think
that if we trigger the migration, we need to
stop the executing the further pdu of this conn
by the current polling group.

Also since the connection is triggered migration,
we should stop execution on the current core, and
let this connection be handled by next round.

Change-Id: I0ab89d79c976f3233890ae25cb7eac98de5e30ac
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/409984
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-31 01:01:17 +00:00
Daniel Verkamp
98d140d2af nvmf: remove unused #defines from nvmf_internal.h
Change-Id: I12e629d21f30372ae3c0d3939c036b0ae3562e6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412992
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>
2018-05-30 18:15:37 +00:00
Ben Walker
f14189b9a6 nvmf: Add states to spdk_nvmf_qpair
Change-Id: Ie37e0173f9c1b6fc766a154191df7d0bfa71042b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412077
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:38:26 +00:00
Ben Walker
4a8b3adb44 nvmf: Simplify qpair disconnect code path
This path works for disconnect events on qpairs at run time.
Disconnects in response to killing the target have
not been worked out yet.

This path does not currently wait for outstanding I/O to
complete.

Change-Id: I8e476c8444b460c18e51601fb950b9132d12f67d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412076
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:38:26 +00:00
Changpeng Liu
be1c82b7a8 nvme: update the NS identify data according to AER
Number of Namespaces of controller identify structure
defines the maximum number of namespaces supported by
this controller, for physical NVMe controllers, the NN
is a fixed number, while here, we set the same rule for
NVMeoF controllers.

After NVMe driver got namespace notice event, it should
update the namespace identify data structure for NS
attach/detach commands.

Change-Id: Id72a2600a2ce9492fa2d6e09924667acbb77ae43
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/412883
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:28:03 +00:00
Piotr Pelplinski
fbf06aca1a nvme: fail when request is too long
Fail when number of child requests is >= NVME_MAX_CHILD_REQUESTS.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I8c370053847c9f623b861137da8d2387a66fc030

Reviewed-on: https://review.gerrithub.io/408850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:22:11 +00:00
Daniel Verkamp
da7673f71f jsonrpc: make "jsonrpc" actually optional
The decoder was still marked as required, so omitting "jsonrpc" version
from the request did not work.

Change-Id: Ied6a8bb1fbbf072c5eff87ed0b343edd7b3702b3
Fixes: aa67900a2e ("jsonrpc: make "jsonrpc" request field optional")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412859
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 16:38:07 +00:00