Spdk/lib
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
..
bdev bdev/null: Check if the number of blocks of read I/O is not larger than allowed. 2019-03-07 07:25:37 +00:00
blob lvol: add option to change clear method for lvol store creation 2019-02-28 20:50:27 +00:00
blobfs blobfs: fix the length value of file. 2019-01-17 05:04:13 +00:00
conf string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
copy lib/copy: unregister copy engine on finish 2018-10-15 17:42:20 +00:00
env_dpdk env/memory: use spdk_iommu_is_enabled internally 2019-03-05 06:45:11 +00:00
event event: spdk_app_json_config_load no longer requires an event 2019-03-06 08:26:04 +00:00
ftl lib/ftl: Fix band picking for write pointer 2019-02-25 22:37:44 +00:00
ioat ioat: reduce completion writebacks 2019-02-18 07:44:17 +00:00
iscsi iscsi: Add an API to return DIF context of SCSI command 2019-03-08 01:21:26 +00:00
json json_util: add debug logs to spdk_json_decode_object function 2019-01-10 14:31:37 +00:00
jsonrpc jsonrpc: Use spdk_json_write_named_* APIs throughout 2019-02-04 07:08:04 +00:00
log app: rename traceflag cmdline option to logflag 2018-12-03 19:50:15 +00:00
lvol lvol: add option to change clear method for lvol store creation 2019-02-28 20:50:27 +00:00
nbd nbd: avoid impact to device setup by other task 2019-02-15 22:02:48 +00:00
net net: Use spdk_json_write_named_* APIs throughout 2019-02-04 07:08:04 +00:00
nvme nvme/tcp: optimize nvme_tcp_build_iovecs function. 2019-03-07 02:59:33 +00:00
nvmf nvmf: release the reservation when unregistering one registrant 2019-03-07 06:46:45 +00:00
reduce reduce: fix ordering bug 2019-02-04 19:23:35 +00:00
rocksdb event: Remove arg2 from spdk_app_start() 2019-03-05 08:43:12 +00:00
rpc rpc: add spdk_rpc_is_method_allowed 2018-12-05 00:35:35 +00:00
scsi scsi: Add an API to return DIF context of bdev and CDB 2019-03-08 01:21:26 +00:00
sock sock: Add spdk_sock_readv(sock, iov, iovcnt) 2019-03-08 01:21:26 +00:00
thread thread: add spdk_thread_is_idle() 2019-03-01 21:38:02 +00:00
trace lib/trace: add trace_record tool 2019-01-30 06:36:25 +00:00
ut_mock thread: Eliminate use of pthread_self and thread_ids 2019-01-15 16:53:12 +00:00
util dif: Create iovec array so that a space for metadata is left for each block 2019-03-07 07:03:27 +00:00
vhost vhost-scsi: use spdk_vhost_scsi_dev_get_tgt while dumping JSON config 2019-03-07 15:53:26 +00:00
virtio virtio: Use spdk_json_write_named_* APIs throughout 2019-02-04 07:08:04 +00:00
Makefile ftl: Initial implementation 2019-01-11 09:15:39 +00:00