diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-31 14:31:42 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-31 14:31:42 -0400 |
| commit | dae8f283bf30738593f6d2a4623945c5e6d7794e (patch) | |
| tree | f4ef01f19ff8cbdae0eaac61f12236ed5e9f297d /Documentation | |
| parent | 30a5f11896a26a345e934e18e9a62c714bc1ceed (diff) | |
| parent | b2feda4feb1b0ea74c0916b4a35b038bbfef9c82 (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.txt | 33 |
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 |
| 18 | 3) Command filtering and pass_level | 18 | 3) A final note |
| 19 | 4) A final note | ||
| 20 | 19 | ||
| 21 | 20 | ||
| 22 | TCM Userspace Design | 21 | TCM 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 | ||
| 363 | Command filtering and pass_level | ||
| 364 | -------------------------------- | ||
| 365 | |||
| 366 | TCMU supports a "pass_level" option with valid values of 0 or 1. When | ||
| 367 | the value is 0 (the default), nearly all SCSI commands received for | ||
| 368 | the device are passed through to the handler. This allows maximum | ||
| 369 | flexibility but increases the amount of code required by the handler, | ||
| 370 | to support all mandatory SCSI commands. If pass_level is set to 1, | ||
| 371 | then only IO-related commands are presented, and the rest are handled | ||
| 372 | by LIO's in-kernel command emulation. The commands presented at level | ||
| 373 | 1 include all versions of: | ||
| 374 | |||
| 375 | READ | ||
| 376 | WRITE | ||
| 377 | WRITE_VERIFY | ||
| 378 | XDWRITEREAD | ||
| 379 | WRITE_SAME | ||
| 380 | COMPARE_AND_WRITE | ||
| 381 | SYNCHRONIZE_CACHE | ||
| 382 | UNMAP | ||
| 383 | |||
| 384 | |||
| 385 | A final note | 366 | A final note |
| 386 | ------------ | 367 | ------------ |
| 387 | 368 | ||
