Commit Graph

7660 Commits

Author SHA1 Message Date
Pawel Niedzwiecki
4a5e97c9d0 configure: Add "ftl" dependency co configure's help message.
--with-ftl dependeny is missing in spdk configuere's script
help message.

Change-Id: I505a2914073d392809d243d8df8b42c0f5d79dab
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447320
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-08 21:00:06 +00:00
Chunyang Hui
aa09ce098d nvme_manage: Fix a bug of uninitialized namespace
Uninitialized namespace struct will be all zeros.
Some drive might have multiple namespaces but not initialized.
nvme_manage will get to segment fault when this happens. This
patch is to fix this.

Change-Id: I8ea5bf3d7c29cf876fbea3d1bee22b95748d3b8a
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447414
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-08 20:59:51 +00:00
Changpeng Liu
e39b4d6cdb nvmf: set controller/namespace identify data to enable reservation
Persist through power loss feature is not supported for now.

Change-Id: Id2a5088389dc28b9d28d88c04ff819d20ea11902
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436940
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-08 20:55:10 +00:00
Changpeng Liu
4b55682e3a nvmf: add namespace reservation report command support
For number of registered controllers field in Reservation
Status Data Structure, we caculate all the controllers
in the subsystem which Host Identifier are same with
existing registrants.

Change-Id: Ib4de22c7020dbd8294f448f23c0c5c8c142629dd
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436939
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 20:55:10 +00:00
Ziye Yang
4cd6544d44 nvmf: solve the memory leak issue caused by subsystem listerner port
The possible issue could be following if you shutdown NVMe-oF target
with TCP transport as an example,

=================================================================
==61022==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 560 byte(s) in 1 object(s) allocated from:
    #0 0x7ffff6efcfe0 in calloc (/lib64/libasan.so.3+0xc6fe0)
    #1 0x4c6216 in spdk_nvmf_tcp_listen /home/ziyeyang/spdk/lib/nvmf/tcp.c:680

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ffff6efcfe0 in calloc (/lib64/libasan.so.3+0xc6fe0)
    #1 0x4a77b8 in spdk_posix_sock_create /home/ziyeyang/spdk/lib/sock/posix/posix.c:291

After checking the issue, it seems that we did not call
spdk_nvmf_transport_stop_listen when removing the subsystem listener.
And this patch can solve this issue.

Change-Id: Ic75d99cb0c6a3ba1c47ac79a2d8e3887b0f6b012
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447020
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-08 20:33:33 +00:00
Piotr Pelplinski
d6c4518c69 ocf: Move ocf configuration to Makefile
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I116b53319152b229900e56afc6277340a9daa988
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445261
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-03-08 19:16:28 +00:00
paul luse
1fc4165fe9 bdev/crypto: add /include symlink for ISAL
Currently we only include the dir just above ISA-L which allows
the isal.h file includes to be found however DPDK can't find
isa-l.h at that location because its one level deeper.

By adding a symlink in the isa-l subdir we can redirect DPDK to
find the isa-l header files.

Change-Id: Ieeabd4273bade0241db5581764b2169103f9770f
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445767
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-08 18:52:17 +00:00
James Bergsten
d2bbef66dc lib/util: Add ISA-L and faster table-based options for T10 CRC-16 generation
This patch extends existing ISA-L support for NVMe/SCSI T10 CRC-16
protection check (PI). The choice of which algorithm to use is set
via an existing configure parameter.  The default for x86 systems with
appropriate CPU instructions is to us ISA-L.

Testing shows that PI checking/generation will run at device speed using
ISA-L.  The table-based algorithm is much faster than the original algorithm
and is provided to speed up calculations on non-x86 systems.

This patch also fixes one issue in a false configure error if nasm
is at a higher version than currently checked (i.e. 2.13.03)

Local performance testing yeilds these results:

Original -    15 mbit/sec. (code removed)
Table    -   400 mbit/sec. (27 times faster than original)
ISA-L    - 3,400 mbit/sec. (227 times faster than original)

Signed-off-by: James Bergsten <jamesx.bergsten@intel.com>
Change-Id: Idc7f1d97252644d839621ffe9fa995edd922da52
Signed-off-by: James Bergsten <jamesx.bergsten@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/443646
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-08 15:39:32 +00:00
Maciej Szwed
71b08028e2 bdev/nvme: Move functions related to NVMe controller to common.c
Functions moved in this patch may be used in future by
other NVMe based bdevs.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I975b61b7f78855e67d65ab7d9fd9f5dd859ac570
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/443753
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-08 12:47:53 +00:00
Maciej Szwed
d8ee123782 bdev/nvme: Rename non-public API NVMe bdev functions
Renaming functions to make it clear they are not part
of the public API.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I9a283143a11090032b74684611403637bc6605a3

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447056
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-08 12:47:53 +00:00
Changpeng Liu
84ee3a62c7 nvmf: add namespace reservation release command support
The reservation holder may release the reservation on
a namespace, release notification feature is supported
in comming patches.

Change-Id: If5d3158e691fcc782f7cf0b67a326bf62edf0531
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436938
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-08 04:48:18 +00:00
Changpeng Liu
ef7827dc06 nvme: remove spdk_nvme_ctrlr_connect_opts data structure
For API spdk_nvme_connect(), users can only use NULL or
struct spdk_nvme_ctrlr_opts for their own driver options,
so parameter opts_size doesn't take effect here.  Since
some applications outside SPDK's git repository are using
such API, so we only remove the internal data structure
for now.

Change-Id: Ia727d2950d56abba637214ad17ecfa3eeab71d38
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445656
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-08 04:42:21 +00:00
Changpeng Liu
4ce22e0f0e nvme: use asynchronous probe API in spdk_nvme_probe()
Change-Id: I64a7aa548a82f2698f8c16611bf939c9eb377348
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-08 04:42:21 +00:00
Changpeng Liu
59746336cb nvme: return error if the controller with probe context got errors
Change-Id: I72b2ab93d15a82c20d90e787248248b15bc197c7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447021
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-08 04:42:21 +00:00
Changpeng Liu
9e37807399 nvme: free probe context for asynchronous probe API
Free the probe context after the controllers in the probe
context list become READY.  Then users don't need to free
the context which is allocated by SPDK driver.

Change-Id: I2dcb76bacf26a401b5b559c4326764a4ddb97e83
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446820
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-08 04:42:21 +00:00
Changpeng Liu
030fb5e2bb fio_plugin: fix the wrong usage of queue pair data structure in fio thread
If multiple numjobs and filename were used in fio tests, one thread may
have a list of queue pairs, so we should store the queue pair when
submitting a new request.

Change-Id: I585cd40ea4295b94c8766f9adfa5a7344cb0bc3c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447272
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-08 04:34:22 +00:00
Ben Walker
50c48ee92d event: Eliminate extra event in spdk_subsystem_init
This isn't required anymore because spdk_subsystem_init
is now always called after an event has been executed, so it
always runs after the framework has initialized.

Change-Id: I05e1a4dd605f27247b6d43f5234173e07d9b9dd2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446996
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
4d6a89044f event: No longer require event in spdk_subsystem_fini
Just use a function pointer and a context.

Change-Id: I2d41ed2572d892f3328aadf7f22d8696816bf4d1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446995
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
f90c3be49e event: Don't use an event to initialize RPC
Now that the boot strap event exists, this is not
necessary.

Change-Id: I277179fbc15ebe140fd22be1b67847cf23c6153e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446994
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
f155c98084 event: spdk_subsystem_init no longer requires an event
It just takes a function pointer and a context instead.

Change-Id: Id8cdc968ddbc3776f60ad73e9aa09983ca03fa3f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446993
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Liang Yan
c1672b6021 test/spdkcli: update match file to cover larger volume NVMe SSD
The match file is hardcoded to $(FP)G. If using xxTB volume NVMe
SSD, this test case will fail. So using $(S) to cover larger
volume NVMe SSD.

Change-Id: Id046cadfbc5236cd8f480981fa337d2ee9a68bf4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447130
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-08 02:18:15 +00:00
Ziye Yang
f7b50f7361 nvme/tcp: update the comments in nvme_tcp_pdu_recv_state
Change-Id: I78ea97902df894cf8f4678f059e4252f5efdc1be
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446822
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-08 02:07:50 +00:00
Shuhei Matsumoto
b8a51ff5b8 iscsi: Add an API to return DIF context of SCSI command
Ths patch adds an API spdk_iscsi_get_dif_ctx().

When opcode of BHS is SCSI command, spdk_iscsi_get_dif_ctx() extracts
CDB and LUN ID from BHS. When opcode of BHS is Data Out or Data In,
spdk_iscsi_get_dif_ctx() extracts TTT and get R2T task corresponding
to TTT, and gets CDB and LUN ID from the task.

Then spdk_iscsi_get_dif_ctx() gets LUN by using LUN ID and calls
spdk_scsi_lun_get_dif_ctx().

Additionally spdk_iscsi_get_dif_ctx() checks the state of the connection
and the type of the session is valid before starting decode operation
because contents of PDU is not reliable when the state of the connection
is invalid. The necessity of the check was found by the Calsoft test tool.
Checks and test cases are not matched yet but copying existing checks
from spdk_iscsi_conn_execute, spdk_iscsi_op_scsi, and spdk_iscsi_op_data
will be enough. The check added for Data Out is not necessary for Data In
but it will not be harmful for Data In.

Change-Id: Iba09e0ac3e760aa1c5b582a120596c49b9e9d51e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446231
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-08 01:21:26 +00:00
Shuhei Matsumoto
8697bce7af scsi: Add an API to return DIF context of bdev and CDB
This patch adds an API spdk_scsi_bdev_get_dif_ctx().

spdk_scsi_bdev_get_dif_ctx() decodes opcode in CDB, and if opcode
is read or write block commands, it gets LBA and use the lower
32bits of LBA as Reference Tag. It gets DIF information from
specified bdev next. Then it sets all to DIF context and return.

spdk_scsi_bdev_get_dif_ctx() is exported to iSCSI through
spdk_scsi_lun_get_dif_ctx().

Change-Id: Id8aac164c48e9e9d4ff7cfc9fa81bb5090f3e187
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446224
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-08 01:21:26 +00:00
Shuhei Matsumoto
e17851314e iscsi: Hold size of buffer to store PDU data segment in struct spdk_iscsi_pdu
Upcoming patches will store larger data in the data buffer than
iSCSI Initiator transfers, and size of metadata is not known until
asking to SCSI layer. This addition will be used to avoid overflow
in them.

Change-Id: I43e15d0cfbfddcf01342325b134d90e3d7dae038
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446378
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 01:21:26 +00:00
Shuhei Matsumoto
af85c0ff68 iscsi: Add a function to read PDU data from socket by spdk_sock_readv
This patch adds spdk_iscsi_conn_readv_data() to read PDU data
from network socket by using spdk_sock_readv().

Additionally, this patch changes the existing spdk_iscsi_conn_read_data()
to call spdk_iscsi_conn_readv_data() by creating a single struct
iovec.

Change-Id: Ied487bb71bd4261ad53c9f3744ae272e65f98d7a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446377
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 01:21:26 +00:00
Shuhei Matsumoto
1ee8deae9c sock: Add spdk_sock_readv(sock, iov, iovcnt)
Add an new API spdk_sock_readv(sock, iov, iovcnt) to the sock
library. This will be used in SPDK iSCSI target first.

Implementation was done based on vcom_socket_readv in VPP.

Change-Id: I88a8f2af4856b1035165b78d76b4a4f4587b265d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-08 01:21:26 +00:00
Pawel Wodkowski
e80efe8f61 vhost-scsi: use spdk_vhost_scsi_dev_get_tgt while dumping JSON config
This is already done for JSON info dump. In addition, the
spdk_vhost_scsi_dev_get_tgt function might implement additional logic to
no return SCSI targets under removal process.

Change-Id: I21d6f660926091dfd34da553705116926f27b30d
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446910
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.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>
2019-03-07 15:53:26 +00:00
Seth Howell
3704b949fa test/nvmf: detect a subclass of Chelsio NICs
This automates the process of probing some RDMA capable Chelsio NICs

Change-Id: I1ef52ffd899d4cbd1ace65037c8acf0be099adae
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446968
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Seth Howell
4698f61bd6 test/nvmf: add checks for X722 NICs
Add the option to test with intel X722 NICs

Change-Id: Icb439e43768eb397dac881c6cb6979b3426fa62e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446660
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Seth Howell
1e867a8966 test/nvmf: make common function for probing pci NICs
Change-Id: I9368a44ebfec54ab705bd371ffd45de1c0bce5ac
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446967
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Seth Howell
9f03beea38 test/nvmf: change reporting strategy for NICs.
This makes it so we only have to check one variable when determining if
we want to load Soft-RoCE NICs.

Change-Id: I5ba615e26252041023ec8615a00c1777bee6cb12
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446966
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Seth Howell
5dff03721b test/nvmf: detect mlx_4 and mlx_5 NICS into 2 funcs
This helps us simplify the detection of Mellanox NICS and paves the way
for a more modular detection scheme for PCIe connected NICs.

Change-Id: I93f16f469c569977c43d6e20fd4616299fa8c723
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446965
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Seth Howell
8985c5b6be test/nvmf: add new function detect_pci_nics
Change-Id: I5d433dc78bd0e7ff24dddee73c1e159607175084
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446720
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 08:35:02 +00:00
Shuhei Matsumoto
11839b805c bdev/null: Check if the number of blocks of read I/O is not larger than allowed.
Add a check if the number of blocks of read I/O is not larger
than allowed. This is a preparation to the subsequent patches that
support DIF in NULL bdev.

Change-Id: I82d4c835788d2f347fd5fdef82e1def313dd49a1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446052
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-07 07:25:37 +00:00
Shuhei Matsumoto
6716729c9c dif: Create iovec array so that a space for metadata is left for each block
This patch adds an API spdk_dif_set_md_interleave_iovs().
This function is used to leave a space for metadata for each block
when the network socket reads data, or to make the network socket
ignore a space for metadata for each block when the network socket
writes data. This function removes the necessity of data copy in
the SPDK application during DIF insertion and strip.

Change-Id: I018efd77bdadcaec4679eea4dc1e404f155b0879
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446216
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-07 07:03:27 +00:00
Shuhei Matsumoto
adc8da4aac scsi: Use data block size not including metadata instead of block size
SPDK iSCSI and SCSI target don't expose any metadata and DIF settings
to the corresponding iSCSI and SCSI initiator.

Even when SPDK iSCSI and SCSI target allocate any bdev formatted
with DIF,  SCSI commands sent from iSCSI and SCSI initiator don't
have any metadata and DIF information.

For that case, iSCSI target inserts and strips DIF on behalf of
iSCSI and SCSI initiator.

Hence SPDK SCSI target has to use data block size not including
metadata to process SCSI commands correctly.

This patch replaces spdk_bdev_get_block_size by
spdk_bdev_get_data_block_size in necessary places.

Change-Id: I264c8e532d1d1b016f6d8774c8ec03389528044f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445083
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 07:03:27 +00:00
Shuhei Matsumoto
fb16799191 bdev: Add spdk_bdev_get_data_block_size API.
iSCSI target will need to get data block size except for metadata.
Other SPDK application may need to get the same information
future. Hence this patch adds an new API spdk_bdev_get_data_block_size
to bdev layer. In the header file, spdk_bdev_get_data_block_size
is located next to spdk_bdev_is_md_interleaved to avoid confusion
by new users.

Change-Id: I0fd2a6d0bcf6a4c18c583f70d96cc5035fc57fe9
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445082
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-07 07:03:27 +00:00
James Bergsten
672b47119c nvme_spec: Add data structures for NVMe Telemetry Log page and Interrupt Coalescing Feature
Adding two NVMe Specification data structures for near future use.

Change-Id: Ic492dc35846239dd771c6a5e210b4f3978cdd03c
Signed-off-by: James Bergsten <jamesx.bergsten@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444292
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-07 07:01:56 +00:00
Changpeng Liu
8ccf24ed52 nvmf: release the reservation when unregistering one registrant
Unregistering by a host may cause a reservation held by the host
to be released. If a host is the last remaining reservation holder
or is the only reservation holder, then the reservation is released
when the host unregisters.  This may occur with Acquire/preempt
and Register/unregister commands.

Change-Id: If59fe2fdaa69c8ad70f364618d6c281494ad6245
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446821
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-07 06:46:45 +00:00
Changpeng Liu
71ac18d1ad nvmf: add namespace reservation acquire command support
A registrant can obtain a reservation on a namespace by executing
acquire command. Acquire command is associated with specific namespace.
For now only Acquire and Preempt reservation acquire action is
supported, Preempt And Abort will be supported in future.

Change-Id: Ifcbb6b414827393ffc266ceada5982b743716321
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436937
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-07 06:46:45 +00:00
Changpeng Liu
bc1d0b91b5 nvmf: add namespace reservation register command support
Reservations can be used by two or more hosts to coordinate
acccess to a shared namespace, host must register to a namespace
prior to establishing a reservation.  Unregistering by a host
may cause a reservation release, this feature will be supported
after reservation acquire patch.

Change-Id: Id44aa1f82f30d9ecc5999a2a9a7c20b2af77774a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436936
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-07 06:46:45 +00:00
Ziye Yang
791d89bfa7 nvme/tcp: optimize nvme_tcp_build_iovecs function.
Borrow the ideas from iSCSI and optimize
the nvme_tcp_build_iovecs function.

Change-Id: I19b165b5f6dc34b4bf655157170dec5c2ce3e19a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446836
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-07 02:59:33 +00:00
Chunyang Hui
51ab378862 nvme: Add getting supported flag for controllers
New API added for upper level to get controllers'
supported flags.

Change-Id: I51e9d0e57c355fa37f092602a94f4c08deb8898c
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446091
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-03-07 00:03:34 +00:00
Ben Walker
d92a1fb4ac event: spdk_app_json_config_load no longer requires an event
Take a callback and an argument instead.

Change-Id: I9edda1a9bd506e12f309e52e520e97c0d705d6a2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-06 08:26:04 +00:00
Ben Walker
46777dd8b9 event: Eliminate extra event when loading JSON config
Now that there is always one event to bootstrap,
we don't need an event here.

Change-Id: Ic87501461a608f5b15745a50b6e15f0f28aa55c2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446991
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-06 08:26:04 +00:00
Ben Walker
744857a79a event: Eliminate g_app_start_event
Change-Id: Ied9c6ebe5e15ee66d6d9695e55b04b33200dd33b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446990
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-06 08:26:04 +00:00
Ben Walker
e2104c3339 event: Don't construct rpc and json events until bootstrapped
These can now be delayed. Next they'll be converted to thread
operations instead of events.

Change-Id: Id8c183621fb88594a9fd508eff064b4a1557a5b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446989
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-06 08:26:04 +00:00
Michal Mielewczyk
c274db3bf8 OCF: rebase to ocf master 276d91fcd7
- locks moved from ocf to adapter code,
- 'data object' renamed to 'volume',
- context and volume API reorganized.

Change-Id: Id4670ddfcb8eda9aefabc273497498c5bd3db1d5
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444092
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Robert Bałdyga <r.baldyga@hackerion.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-05 12:09:25 +00:00
Ben Walker
f96b8293e6 event: Don't rely on events capturing arguments during bootstrap
This will make it easier to convert these operations to
spdk_thread_send_msg.

Change-Id: I4c975c22f3967a7197e69ccd230a14bdb97ba332
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446988
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-05 08:43:12 +00:00