aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-31 14:31:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-31 14:31:42 -0400
commitdae8f283bf30738593f6d2a4623945c5e6d7794e (patch)
treef4ef01f19ff8cbdae0eaac61f12236ed5e9f297d /Documentation
parent30a5f11896a26a345e934e18e9a62c714bc1ceed (diff)
parentb2feda4feb1b0ea74c0916b4a35b038bbfef9c82 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target fixes from Nicholas Bellinger: "These are mostly minor fixes, with the exception of the following that address fall-out from recent v4.1-rc1 changes: - regression fix related to the big fabric API registration changes and configfs_depend_item() usage, that required cherry-picking one of HCH's patches from for-next to address the issue for v4.1 code. - remaining TCM-USER -v2 related changes to enforce full CDB passthrough from Andy + Ilias. Also included is a target_core_pscsi driver fix from Andy that addresses a long standing issue with a Scsi_Host reference being leaked on PSCSI device shutdown" * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: iser-target: Fix error path in isert_create_pi_ctx() target: Use a PASSTHROUGH flag instead of transport_types target: Move passthrough CDB parsing into a common function target/user: Only support full command pass-through target/user: Update example code for new ABI requirements target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem target: Drop signal_pending checks after interruptible lock acquire target: Add missing parentheses target: Fix bidi command handling target/user: Disallow full passthrough (pass_level=0) ISCSI: fix minor memory leak
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/target/tcmu-design.txt33
1 files changed, 7 insertions, 26 deletions
diff --git a/Documentation/target/tcmu-design.txt b/Documentation/target/tcmu-design.txt
index 43e94ea6d2ca..263b907517ac 100644
--- a/Documentation/target/tcmu-design.txt
+++ b/Documentation/target/tcmu-design.txt
@@ -15,8 +15,7 @@ Contents:
15 a) Discovering and configuring TCMU uio devices 15 a) Discovering and configuring TCMU uio devices
16 b) Waiting for events on the device(s) 16 b) Waiting for events on the device(s)
17 c) Managing the command ring 17 c) Managing the command ring
183) Command filtering and pass_level 183) A final note
194) A final note
20 19
21 20
22TCM Userspace Design 21TCM Userspace Design
@@ -324,7 +323,7 @@ int handle_device_events(int fd, void *map)
324 /* Process events from cmd ring until we catch up with cmd_head */ 323 /* Process events from cmd ring until we catch up with cmd_head */
325 while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) { 324 while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) {
326 325
327 if (tcmu_hdr_get_op(&ent->hdr) == TCMU_OP_CMD) { 326 if (tcmu_hdr_get_op(ent->hdr.len_op) == TCMU_OP_CMD) {
328 uint8_t *cdb = (void *)mb + ent->req.cdb_off; 327 uint8_t *cdb = (void *)mb + ent->req.cdb_off;
329 bool success = true; 328 bool success = true;
330 329
@@ -339,8 +338,12 @@ int handle_device_events(int fd, void *map)
339 ent->rsp.scsi_status = SCSI_CHECK_CONDITION; 338 ent->rsp.scsi_status = SCSI_CHECK_CONDITION;
340 } 339 }
341 } 340 }
341 else if (tcmu_hdr_get_op(ent->hdr.len_op) != TCMU_OP_PAD) {
342 /* Tell the kernel we didn't handle unknown opcodes */
343 ent->hdr.uflags |= TCMU_UFLAG_UNKNOWN_OP;
344 }
342 else { 345 else {
343 /* Do nothing for PAD entries */ 346 /* Do nothing for PAD entries except update cmd_tail */
344 } 347 }
345 348
346 /* update cmd_tail */ 349 /* update cmd_tail */
@@ -360,28 +363,6 @@ int handle_device_events(int fd, void *map)
360} 363}
361 364
362 365
363Command filtering and pass_level
364--------------------------------
365
366TCMU supports a "pass_level" option with valid values of 0 or 1. When
367the value is 0 (the default), nearly all SCSI commands received for
368the device are passed through to the handler. This allows maximum
369flexibility but increases the amount of code required by the handler,
370to support all mandatory SCSI commands. If pass_level is set to 1,
371then only IO-related commands are presented, and the rest are handled
372by LIO's in-kernel command emulation. The commands presented at level
3731 include all versions of:
374
375READ
376WRITE
377WRITE_VERIFY
378XDWRITEREAD
379WRITE_SAME
380COMPARE_AND_WRITE
381SYNCHRONIZE_CACHE
382UNMAP
383
384
385A final note 366A final note
386------------ 367------------
387 368