numam-spdk/include/spdk
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
..
accel_engine.h lib/accel: remove batching from the framework and plug-in modules 2021-12-08 16:35:40 +00:00
assert.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
barrier.h nvmf/vfio-user: Fix doorbell polling not working on some ARM platform 2021-12-14 09:09:09 +00:00
base64.h util/base64: Extend b64 decode to calculate exact len 2020-02-03 11:39:49 +00:00
bdev_module.h bdev: guard bdev_module.h with extern "C" 2021-12-20 08:45:20 +00:00
bdev_zone.h bdev/zone: add support for get zone id 2021-11-11 23:23:35 +00:00
bdev.h spelling: include 2021-12-01 09:15:13 +00:00
bit_array.h util: added bit array bitmask load, store and clear 2018-12-14 15:34:53 +00:00
bit_pool.h util: add spdk_bit_pool 2020-09-15 07:12:44 +00:00
blob_bdev.h module/blob: remove deprecated spdk_bdev_create_bs_dev/from_desc() 2021-03-05 08:33:45 +00:00
blob.h spelling: include 2021-12-01 09:15:13 +00:00
blobfs_bdev.h blobfs/fuse: put FUSE code in module blobfs_bdev 2019-10-15 16:25:09 +00:00
blobfs.h doc: do not document void returns 2021-12-02 15:41:33 +00:00
conf.h spelling: include 2021-12-01 09:15:13 +00:00
cpuset.h cpuset: Expose internal of struct spdk_cpuset in header file 2019-07-04 00:30:22 +00:00
crc16.h util/crc16: Add spdk_crc16_t10dif_copy to use in read strip and write insert 2018-12-20 17:52:29 +00:00
crc32.h util/crc32c: Add spdk_crc32c_iov_update. 2021-06-02 11:37:17 +00:00
dif.h dif: Add spdk_dix_remap_ref_tag to remap ref. tag for separate metadata payload 2019-07-11 11:14:22 +00:00
dma.h spelling: include 2021-12-01 09:15:13 +00:00
endian.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
env_dpdk.h spelling: include 2021-12-01 09:15:13 +00:00
env.h env: add experimental APIs to handle PCI device interrupts 2022-01-14 08:35:24 +00:00
event.h spelling: include 2021-12-01 09:15:13 +00:00
fd_group.h spelling: include 2021-12-01 09:15:13 +00:00
fd.h include/fd.h: add comments for pubclic APIs 2018-01-04 12:12:10 -05:00
file.h util: add a new file operation API 2019-05-15 18:54:27 +00:00
ftl.h lib/ftl: Create l2p on l2p_path file if set in config 2020-03-06 10:28:21 +00:00
gpt_spec.h bdev/gpt: dump partition name 2017-07-12 18:12:52 -04:00
histogram_data.h histogram: add handling for datapoint == 0 2021-05-19 07:50:28 +00:00
idxd_spec.h idxd: Add support for vectored crc32c generation 2022-01-12 08:20:39 +00:00
idxd.h idxd: Remove spdk_idxd_chan_get_max_operations 2022-01-20 07:54:55 +00:00
init.h event: Move json config loading to init 2021-05-26 09:13:34 +00:00
ioat_spec.h ioat_spec: fix gcc9 warning 2019-06-17 14:09:03 +00:00
ioat.h lib/ioat: add mew API to get the max # of descriptors supported 2020-07-23 22:26:39 +00:00
iscsi_spec.h spelling: include 2021-12-01 09:15:13 +00:00
json.h json: add spdk_json_write_bytearray 2021-12-14 09:08:59 +00:00
jsonrpc.h spelling: include 2021-12-01 09:15:13 +00:00
likely.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
log.h log: fix out-of-order designated initializer 2021-12-20 08:44:34 +00:00
lvol.h lvol: ensure enum for lvol clear method is the same as blobstore 2019-02-28 20:50:27 +00:00
memory.h memory.h: move to public headers 2020-03-19 08:50:45 +00:00
mmio.h mmio: add functions for 1 and 2 byte I/O accesses 2017-10-13 10:46:00 -04:00
nbd.h nbd: Use async manner to stop nbd device. 2020-12-28 14:05:15 +00:00
notify.h spelling: include 2021-12-01 09:15:13 +00:00
nvme_intel.h nvme: pad struct spdk_nvme_intel_marketing_description_page 2019-06-05 02:46:50 +00:00
nvme_ocssd_spec.h ocssd: add chunk notification log struct 2018-09-27 01:30:45 +00:00
nvme_ocssd.h spelling: include 2021-12-01 09:15:13 +00:00
nvme_spec.h spelling: include 2021-12-01 09:15:13 +00:00
nvme_zns.h lib/nvme: NVMe ZNS - Zone Descriptor Extension support 2021-09-16 07:21:40 +00:00
nvme.h nvme: Limit spdk_nvme_poll_group_remove() to use only for disconnected qpairs 2022-01-19 08:44:09 +00:00
nvmf_cmd.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_fc_spec.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_spec.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_transport.h nvmf: make zcopy_end void 2022-01-06 18:53:42 +00:00
nvmf.h nvmf: zero-copy enable flag in transport opts 2022-01-06 18:53:42 +00:00
opal_spec.h spelling: include 2021-12-01 09:15:13 +00:00
opal.h lib/opal: remove deprecated spdk_opal_supported() 2021-03-18 14:43:08 +00:00
pci_ids.h nvmf/vfio-user: define SPDK_PCI_VID_NUTANIX macro and use it in vfio-user 2021-12-06 23:17:07 +00:00
pipe.h pipe: Add a utility for buffering data from sockets 2019-11-20 09:35:32 +00:00
queue_extras.h include: remove util.h include from queue_extras.h 2021-04-14 07:25:21 +00:00
queue.h Include: Test for __linux__ 2020-11-19 09:53:21 +00:00
reduce.h lib/reduce: change and move the max IOVEC define for reduce 2019-07-29 04:36:59 +00:00
rpc.h rpc: add spdk_rpc_verify_methods() 2019-11-06 15:19:48 +00:00
scheduler.h spelling: include 2021-12-01 09:15:13 +00:00
scsi_spec.h Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
scsi.h doc: match spdk_scsi_dev_get_next_lun argument name 2021-12-02 15:41:33 +00:00
sock.h sock: Deprecate enable_zerocopy_send in sock_impl_set_options RPC 2021-04-27 08:13:32 +00:00
stdinc.h util: add zipf random number generator 2021-05-17 11:29:52 +00:00
string.h string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
thread.h thread: improve api description 2021-12-02 08:08:46 +00:00
trace_parser.h spelling: include 2021-12-01 09:15:13 +00:00
trace.h trace: make trace_create_tpoint_group_mask() external 2022-01-05 08:52:40 +00:00
tree.h util: rename RB_ROOT into _RB_ROOT 2021-06-04 22:46:40 +00:00
util.h util: Add spdk_ioviter for iterating iovecs 2021-12-17 09:45:44 +00:00
uuid.h util/uuid: add a new uuid copy API. 2018-12-06 22:25:09 +00:00
version.h version: SPDK 22.01 pre 2021-10-22 18:10:27 +00:00
vfio_user_pci.h NVMe/vfio-user: add initial version vfio-user transport to NVMe driver 2021-01-21 05:00:18 +00:00
vfio_user_spec.h libvfio-user: update submodule 2021-06-22 23:42:02 +00:00
vhost.h spelling: include 2021-12-01 09:15:13 +00:00
vmd.h lib/vmd: detach devices during shutdown 2020-02-04 16:50:25 +00:00
zipf.h util: add zipf random number generator 2021-05-17 11:29:52 +00:00