Spdk/lib
Shuhei Matsumoto 855633a597 iscsi: Get LUN ID from task instead of Data-Out PDU to fix SCSI compliance test failure
A major SCSI compliance test expects that the LUN field is reserved
(not to be checked) in the SCSI Data-Out PDU.

In that test, the LUN field in the first SCSI Command PDU is 0 and
the LUN field in the SCSI Data-Out PDU sent in response to the R2T
is 0xFFFFFFFFFFFFFFFF. The TTT field in the SCSI Data-Out PDU is 0xF that
is copied from the R2T. 0xF is valid as TTT.

Hence spdk_iscsi_op_data() returns Check Condition because LUN is
not found.

This patch changes to get LUN ID from not the LUN field in the SCSI
Data-Out PDU but the saved task.

The following is excerpts from iSCSI specification (RFC7143). The
behavior of the SCSI compliance test looks against the specification
but changing SPDK will be safer.

11.7.4.  Target Transfer Tag and LUN

   On outgoing data, the Target Transfer Tag is provided to the target
   if the transfer is honoring an R2T.  In this case, the Target
   Transfer Tag field is a replica of the Target Transfer Tag provided
   with the R2T.

   On incoming data, the Target Transfer Tag and LUN MUST be provided by
   the target if the A bit is set to 1; otherwise, they are reserved.
   The Target Transfer Tag and LUN are copied by the initiator into the
   SNACK of type DataACK that it issues as a result of receiving a SCSI
   Data-In PDU with the A bit set to 1.

   The Target Transfer Tag values are not specified by this protocol,
   except that the value 0xffffffff is reserved and means that the
   Target Transfer Tag is not supplied.  If the Target Transfer Tag is
   provided, then the LUN field MUST hold a valid value and be
   consistent with whatever was specified with the command; otherwise,
   the LUN field is reserved.

Change-Id: I110a7e396d1e517b2a39ca5e586ab2bb2d45e5f3
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/425333
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-09-12 13:21:43 +00:00
..
bdev bdev/raid: optimize for single base bdev case 2018-09-12 13:18:12 +00:00
blob blobstore: Add support for bdev_blob_queue_io in blobstore 2018-09-11 21:19:34 +00:00
blobfs thread: Add a name parameter to spdk_register_io_device 2018-09-05 16:00:54 +00:00
conf conf: don't strdup name if section already exist 2018-05-17 17:13:19 +00:00
copy thread: Add a name parameter to spdk_register_io_device 2018-09-05 16:00:54 +00:00
env_dpdk env/dpdk: add security checks to spdk_env_get_socket_id() 2018-09-10 17:23:39 +00:00
event nvmf: Place deprecated RPCs in a separate file 2018-09-12 13:20:32 +00:00
ioat ioat: change return type of spdk_ioat_detach() to be void 2018-09-11 21:16:48 +00:00
iscsi iscsi: Get LUN ID from task instead of Data-Out PDU to fix SCSI compliance test failure 2018-09-12 13:21:43 +00:00
json json: Add spdk_json_decode_uint16 2018-06-05 21:30:02 +00:00
jsonrpc jsonrpc: fix error path of spdk_jsonrpc_parse_request() 2018-08-31 17:41:58 +00:00
log app: allow full-name command line options 2018-08-13 17:30:10 +00:00
lvol lvol: move null check from verify_lvol_name 2018-09-05 15:59:45 +00:00
nbd nbd: Encapsulate spdk_event usage in subsystem module 2018-09-05 19:32:37 +00:00
net lib: fix typos in the lib directory 2018-08-24 17:15:12 +00:00
nvme nvmf/host: Add incapsule data support to nvmef host. 2018-09-11 23:15:32 +00:00
nvmf nvmf: get qp_context only on QP related event 2018-09-11 21:33:39 +00:00
rocksdb blobfs: add a new API to return file's unique ID 2018-08-29 16:29:22 +00:00
rpc rpc: g_rpc_lock_path: remove redundant plus 2018-09-04 22:21:04 +00:00
scsi trace: remove alias concept 2018-09-05 18:03:43 +00:00
sock sock: fix socket memory free 2018-08-10 15:38:38 +00:00
thread thread: Fix issue where a channel would be destroyed twice 2018-09-05 16:00:54 +00:00
trace trace: remove alias concept 2018-09-05 18:03:43 +00:00
ut_mock test: Simplify the mock library 2018-08-09 17:18:23 +00:00
util Clean up some incorrect Copyright statements 2018-07-30 16:29:38 +00:00
vhost vhost: show failed taks status 2018-09-12 04:19:46 +00:00
virtio virtio: clarify feature negotiation failure 2018-08-01 19:16:54 +00:00
Makefile test: remove spdk_cunit library 2018-07-06 18:35:03 +00:00