Commit Graph

1453 Commits

Author SHA1 Message Date
mav
db78e6d004 MFC r272893:
Store persistent reservation keys as uint64_t instead of uint8_t[8].

This allows to simplify the code and save 512KB of RAM per LUN (8%)
by removing no longer needed "registered" keys flags.
2014-10-20 07:38:36 +00:00
mav
5889805f1c MFC r272812: Make iSCSI connection close somewhat less aggressive.
It allows to push out some final data from the send queue to the socket
before its close.  In particular, it increases chances for logout response
to be delivered to the initiator.
2014-10-20 07:35:46 +00:00
mav
cc6cca3f1e MFC r272748:
Implement software (mode page) and hardware (config) write protection.
2014-10-20 07:34:37 +00:00
mav
29253fce18 MFC r272734:
Add support for WRITE ATOMIC (16) command and report SBC-4 compliance.

Atomic writes are only supported for ZVOLs in "dev" mode.  In other cases
atomicity can not be guarantied and so the command is blocked.
2014-10-20 07:33:41 +00:00
mav
f7c3270824 MFC r272613:
Add support for MaxBurstLength and Expected Data transfer Length parameters.

Before this change target could send R2T request for write transfer of any
size, that could violate iSCSI RFC, which allows initiator to limit maximum
R2T size by negotiating MaxBurstLength connection parameter.

Also report an error in case of write underflow, when initiator provides
less data than initiator expects.  Previously in such case our target
sent R2T request for non-existing data, violating the RFC, and confusing
some initiators.  SCSI specs don't explicitly define how write underflows
should be handled and there are different oppinions, but reporting error
is hopefully better then violating iSCSI RFC with unpredictable results.
2014-10-20 07:32:33 +00:00
mav
5b5dd1452a MFC r272597: Fix length of Extended INQUIRY Data VPD page. 2014-10-20 07:31:23 +00:00
mav
df2c4c17fc MFC r271718 (by bdrewery): Correct a comment 2014-10-20 07:29:43 +00:00
mav
072d9b12ca MFC r271395 (by trasz):
Make sure we handle less than zero timeouts in iSCSI initiator and target
in a reasonable way.

Sponsored by:	The FreeBSD Foundation
2014-10-20 07:28:18 +00:00
mav
2cb46b9c51 MFC r271588: Update CAM CCB accounting for the new status quo.
devq_openings counter lost its meaning after allocation queues has gone.
held counter is still meaningful, but problematic to update due to separate
locking of CCB allocation and queuing.

To fix that replace devq_openings counter with allocated counter.  held is
now calculated on request as difference between number of allocated, queued
and active CCBs.
2014-10-14 12:13:01 +00:00
mav
a45382b275 Use proper variable when looping through periphs with CAM_PERIPH_FREE.
PR:		194256
Submitted by:	Scott M. Ferris <smferris@gmail.com>
Sponsored by:	EMC/Isilon Storage Division
2014-10-12 06:14:50 +00:00
mav
70056e5be9 MFC r272650: Set CAM_SIM_QUEUED flag before calling ctl_queue() to avoid race.
PR:		194128
Submitted by:	Scott M. Ferris <smferris@gmail.com>
Sponsored by:	EMC/Isilon Storage Division
2014-10-09 05:28:11 +00:00
mav
7da2f7e9ed MFC r269472: Do not retry on set of non-transient XCOPY errors. 2014-10-06 15:24:04 +00:00
mav
fd1b7bf16c MFC r269469: Do not retry token errors.
They are not going to disappear by themselves.
2014-10-06 15:23:12 +00:00
mav
3d422a235e MFC r272355: Fix couple issues with ROD tokens content. 2014-10-06 13:34:12 +00:00
mav
65c4d40e1d MFC r272247:
Do not transfer unneeded training zero bytes in INQUIRY response.

It is an addition to r269631.
2014-10-06 13:33:22 +00:00
mav
70661238f1 MFC r272224: Fix page length reported for Block Limits VPD page. 2014-10-06 13:31:44 +00:00
mav
19ba8133b4 MFC r272033:
Fix ASCQ for "Logical unit not ready, manual intervention required" error.
2014-10-06 13:30:52 +00:00
mav
d1d1b3035d MFC r271959: Pretend that we support BYTCHK=1 in WRITE AND VERIFY command.
Technically that is not true, but since we don't implement VERIFY there
at all, doing only WRITE part, this is a minor sin.
2014-10-06 13:30:06 +00:00
mav
1be3714fc8 MFC r271954:
Deny ANCHOR flag set without UNMAP flag set in WRITE SAME commands.
2014-10-06 13:29:15 +00:00
mav
bd68280c28 MFC r271951: Don't try to continue aborted commands if status was not set. 2014-10-06 13:28:17 +00:00
mav
33c92e2233 MFC r271945:
Simplify legacy reservation handling.  Drop it on I_T nexus loss.
2014-10-06 13:27:18 +00:00
mav
a4245e0a49 MFC r271942:
Don't report unsupported FUA_NV bit set in READ/WRITE commands as error.

While this bit is obsolete in SBC-3, SBC-2 allowed to silently ignore it.
2014-10-06 13:26:26 +00:00
mav
9d8f6e06a8 MFC r271941:
Report proper errors codes for unsupported SERVICE ACTION values.
2014-10-06 13:25:36 +00:00
mav
28d91d5dcf MFC r271940: Polish INQUIRY command fields validation. 2014-10-06 13:24:25 +00:00
mav
9189486c50 MFC r271930: Allow SUBPAGE CODE field in MODE SENSE commands. 2014-10-06 13:23:37 +00:00
mav
d219050090 MFC r271869:
Fix inverted expression to report block size in mode page block descriptor.
2014-10-06 13:22:53 +00:00
mav
b913091bf1 MFC r271845:
Allow more commands to pass persistent reservation according to SPC-4 r37.
2014-10-06 13:22:05 +00:00
mav
48c3bee1ac MFC r271839:
Add support for "no Data-Out Buffer" (NDOB) flag of WRITE SAME (16) command.
2014-10-06 13:21:13 +00:00
mav
116bd3882f MFC r271606:
Always report that we support REPORT TARGET PORT GROUPS command.

Without clustering support we any way have only one group of permanently
active ports, but that gives us one more supported VMWare feature. ;)

Solaris' Comstar also reports it even when only one port is present.
2014-10-06 13:20:18 +00:00
mav
36c0adf871 MFC r271507:
Implement control over command reordering via options and control mode page.

It allows to bypass range checks between UNMAP and READ/WRITE commands,
which may introduce additional delays while waiting for UNMAP parameters.
READ and WRITE commands are always processed in safe order since their
range checks are almost free.
2014-10-06 13:19:20 +00:00
mav
143513e376 MFC r271505:
Add "readcache" and "writecache" LUN options to control default behavior.

Default values are "on".  Disabling requires backend to support IO_DIRECT
and IO_SYNC flags respectively, or some alternatives.
2014-10-06 13:18:28 +00:00
mav
5951623a23 MFC r271503: Implement range checks between UNMAP and READ/WRITE commands.
Before this change UNMAP completely blocked other I/Os while running.
Now it blocks only colliding ones, slowing down others only due to ZFS
locks collisions.

Sponsored by:	iXsystems, Inc.
2014-10-06 12:54:06 +00:00
mav
e2b4e0c243 MFC r271443: Add support for Extended INQUIRY Data (0x86) VPD page. 2014-10-06 12:49:07 +00:00
mav
994e3ee5d0 MFC r271313: Oops, missed piece of r271311. 2014-10-06 12:48:10 +00:00
mav
dba3e8e2f0 MFC r271360: Remove uninitialized and unused variable, reported by Coverity. 2014-10-06 12:42:06 +00:00
mav
a21c949f78 MFC r271358: Fix array overrun, reported by Coverity. 2014-10-06 12:41:07 +00:00
mav
39e205854e MFC r271354: Fix couple off-by-one range check errors, reported by Coverity. 2014-10-06 12:40:15 +00:00
mav
401b622675 MFC r271353: Fix memory leak on error, reported by Coverity. 2014-10-06 12:39:25 +00:00
mav
c963137dee MFC r271352: Fix minor buffer overflow reported by Coverity. 2014-10-06 12:38:35 +00:00
mav
89c5125dfb MFC r271316: Report that DPO and FUA bits are supported after r271311. 2014-10-06 12:37:35 +00:00
mav
cf304edcc4 MFC r271311:
Add support for Mode Page Policy (0x87) VPD page.
2014-10-06 12:36:42 +00:00
mav
f60999f291 MFC r271309:
Improve cache control support, including DPO/FUA flags and the mode page.

At this moment it works only for files and ZVOLs in device mode since BIOs
have no respective respective cache control flags (DPO/FUA).
2014-10-06 12:35:41 +00:00
mav
5df569ca0a MFC r272040:
When reporting some major UNIT ATTENTION condition, like POWER ON OCCURRED
or I_T NEXUS LOSS, clear all minor UAs for the LUN, redundant in this case.

All SAM specifications tell that target MAY do it, but libiscsi initiator
seems require it to be done, terminating connection with error if some more
UAs happen to be reported during iSCSI connection.

Approved by:	re (gjb)
2014-09-27 08:14:15 +00:00
mav
5f1a68aede MFC r271957: Fix read overrun handling, broken by using wrong variable.
Approved by:	re (marius)
2014-09-25 09:12:11 +00:00
mav
9f773a51bb MFC r271949:
Fix UNMAP stuck if the last block descriptor in the list is empty.

Approved by:	re (glebius)
2014-09-25 09:11:01 +00:00
mav
88996dc68a MFC r271794: When updating device media size use cached cdevsw pointer.
Using pointer from the cdev directly is dangerous since we have no
reference on it, and it may change any time.  That caused panic if
device has gone.

While there, report capacity change only if it really changed.

Approved by:	re (dephij)
2014-09-21 12:07:22 +00:00
mav
b701075b7b MFC r271702:
Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL
UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not
just as Identification Descriptor.

Approved by:	re (gjb)
2014-09-20 13:48:52 +00:00
mav
9cd8f95281 MFC r271700: Fix typo in defined ROD types in r269497.
Approved by:	re (gjb)
2014-09-20 13:46:16 +00:00
mav
30b741cb6c MFC r271644:
Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.

Submitted by:	Sean Fagan <sef@ixsystems.com>
Approved by:	re (kib)
2014-09-18 09:21:29 +00:00
trasz
7b29f9e4e1 MFC r271393:
Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting
kern.cam.ctl.iscsi.ping_timeout to 0.  This fixes interoperability with
some initiators that don't properly support NOP-Ins, namely iPXE/gPXE.

Approved by:	re (kib)
2014-09-15 11:35:14 +00:00