Commit Graph

12 Commits

Author SHA1 Message Date
Changpeng Liu
4f95ec427c scsi: add a helper function to check the LUN holds a reservation or not
Change-Id: I8cf71783ad4af4f7bdef823018f907933b793c9d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455765
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>
2019-06-03 23:59:49 +00:00
Changpeng Liu
8c0c8e5333 scsi: add persistent reservation SCSI commands check
All the SCSI commands have two states: allowed and conflict,
based on different reservation types and I_T nexus, the SCSI
module will check each commands before sending to the backend
device.

Change-Id: Ib05cece1c237873360f85c68d139362200d2d47e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436097
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-30 21:42:36 +00:00
Changpeng Liu
94e9f0ab8b scsi: add persistent reserve in command with read full status support
Change-Id: I9093397ec674de55473e61af1c54009bf60878aa
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436096
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-30 21:42:36 +00:00
Changpeng Liu
c25e9b2437 scsi: add persistent reserve in command with report capabilities support
Change-Id: I676c385ffd51c0ad2c606f948f21beb031ef4c95
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436095
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>
2019-05-30 21:42:36 +00:00
Changpeng Liu
fecac0d871 scsi: fix SCSI reservation typos
Change-Id: Ibbc5c95fddc3d39b7d9222fa203bc29e1cf44cf6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456285
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>
2019-05-30 21:42:36 +00:00
Changpeng Liu
2b09903c2c scsi: add persistent reservation in with read reservations support
Change-Id: I5345207a6331889182324ae3231bb62c84b69d69
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436094
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: Paul Luse <paul.e.luse@intel.com>
2019-05-29 20:57:37 +00:00
Changpeng Liu
4e9e220e7c scsi: add persistent reservation in command with read keys action support
Change-Id: Ia8e4ad31e84a1a97c83d4f49680bb7090ee4e041
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436093
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-29 20:57:37 +00:00
Changpeng Liu
8f2a85362b scsi: add persistent reservation out command with preempt service action support
A PERSISTENT RESERVE OUT command with PREEMPT service action action is used to:
a) preempt (i.e., replace) the persistent reservation and remove registrations; or
b) remove registrations.

Change-Id: I906b09057e5ddef0ea2fe180bb5fff6e9e0a04f6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436092
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-24 23:04:03 +00:00
Changpeng Liu
8d79b4109f scsi: add persistent reservation out command with clear service action support
Any application client can release the persistent reservation and remove all
registrations from a device server by issuing a PERSISTENT RESERVE OUT command
with CLEAR service action through a registered I_T nexus.

Change-Id: Ie21885f7f9632b9da77e877fbce7c51b2e0b47a7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436091
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-24 23:04:03 +00:00
Changpeng Liu
e8e791f7b5 scsi: add persistent reservation out with release service action support
An application client releases the persistent reservation by issuing a
PERSISTENT RESERVE OUT command with RELEASE service action through an
I_T nexus that is a persistent reservation holder.  The RELEASE service
action will release the persistent reservation and do noting to
existing registrants.  Unit Attention isn't supported by SPDK so here
we will not establish any unit attention condition.

Change-Id: If0df3b3fc4e89ffa78d827e2b31cf5c61aa149db
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436090
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-24 23:04:03 +00:00
Changpeng Liu
601fbbf969 scsi: add persistent reservation out with reserve service action support
An application client creates a persistent reservation by issuing a
PERSISTENT RESERVE OUT command with RESERVE service action through
a registered I_T nexus with RESERVATION KEY and TYPE, and persistent
reservation has a scope of LUN, only one persistent reservation is
allowed at a time per LUN.

Change-Id: I052d0ddd439dd9994c0793218dd5c5d6ed176d2c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436089
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-24 23:04:03 +00:00
Changpeng Liu
d0d19eb82e scsi: add persistent reservation out with register feature support
To establish a persistent reservation the application client shall first
register an I_T nexus with the device server. An application client registers
with a logical unit by issuing a PERSISTENT RESERVE OUT command with REGISTER
service action or REGISTER AND IGNORE EXISTING KEY service action.

Specify Initiator Ports (SPEC_I_PT) bit and All Target Ports (ALL_TG_PT) bit
are not supported for now, the registrants belong to the I_T nexus who sends
the command.

Also Activate Persist Through Power Loss (APTPL) bit will be supported in
following patches.

Change-Id: If057a764a4bfa73017f98048c94b697dbfa4b4a1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436088
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-24 23:04:03 +00:00