numam-spdk/lib/scsi
GangCao 6b7e9d0af2 Lib/iSCSI: add the LUN Resize support
From SAM-4, section 5.13 (Sense Data);
“When a command terminates with a CHECK CONDITION status, sense data shall be returned
in the same I_T_L_Q nexus transaction (see 3.1.50) as the CHECK CONDITION status. After
the sense data is returned, it shall be cleared except when it is associated with a unit
attention condition and the UA_INTLCK_CTRL field in the Control mode page (see SPC-4)
contains 10b or 11b.”

SPDK does not set UA_INTLCK_CTRL to 10b or 11b, so we set the unit attention condition
immediately against a single IO or Admin IO after reporting it via a CHECK CONDITION.
Once the failed IO received at iSCSI initiator side, it will be retried. In the case of
resize operation, if there is no IO from iSCSI initiator side, the unit attention
condition will be delayed to report until the first IO is received at the iSCSI target
side.

Meanwhile, we clear the resizing (newly added) flag on our SCSI LUN structure after
first time we report the resize unit attention condition.

The kernel initiator won’t actually resize the corresponding block device automatically.
It will report a uevent, and then you can set up udev rules to trigger a rescan. SPDK
iSCSI initiator will automatically report the LUN size change.

Change-Id: Ifc85b8d4d3fbea13e76fb5d1faf1ac6c8f662e6c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11086
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-01-20 07:56:23 +00:00
..
dev.c scsi: Manage LUNs per device by not fixed size array but linked list 2021-10-12 09:10:18 +00:00
lun.c Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
Makefile scsi: Add spdk_scsi_dev_get_first/next_lun() to traverse all LUNs 2021-10-11 10:08:22 +00:00
port.c lib/scsi: Remove spdk_ prefix from internal APIs 2020-04-16 08:09:14 +00:00
scsi_bdev.c spelling: lib 2021-12-03 08:12:55 +00:00
scsi_internal.h Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
scsi_pr.c spelling: lib 2021-12-03 08:12:55 +00:00
scsi_rpc.c lib/scsi: Remove spdk prefix from private functions 2020-04-16 08:09:14 +00:00
scsi.c scsi: Decide LUN format for each LUN ID 2021-10-12 09:10:18 +00:00
spdk_scsi.map scsi: Add spdk_scsi_dev_get_first/next_lun() to traverse all LUNs 2021-10-11 10:08:22 +00:00
task.c scsi: relax spdk_scsi_task_gather_data assert 2021-03-09 08:53:21 +00:00