Commit Graph

1469 Commits

Author SHA1 Message Date
mav
5586a5309c Fix inverted expression to report block size in mode page block descriptor. 2014-09-19 11:15:30 +00:00
mav
2286325b1e Allow more commands to pass persistent reservation according to SPC-4 r37. 2014-09-18 22:22:14 +00:00
mav
0db50d6959 Add support for "no Data-Out Buffer" (NDOB) flag of WRITE SAME (16) command. 2014-09-18 21:39:00 +00:00
mav
03ea8d9f92 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.

MFC after:	3 days
2014-09-18 17:25:20 +00:00
bdrewery
a8c488eae3 Correct a comment 2014-09-17 18:59:25 +00:00
mav
89e612ca98 Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT
DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as
Identification Descriptor.

MFC after:	3 days
2014-09-17 07:08:59 +00:00
mav
bf11079f06 Fix typo in defined ROD types in r269497.
MFC after:	3 days
2014-09-17 06:46:37 +00:00
mav
764d4fbb38 Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.
Submitted by:	Sean Fagan <sef@ixsystems.com>
MFC after:	3 days
2014-09-15 19:48:27 +00:00
mav
2969b41f65 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-09-14 23:39:13 +00:00
mav
b2cfbc4e0b 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.

MFC after:	1 month
2014-09-14 11:59:49 +00:00
mav
01d0aad798 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-09-13 10:34:23 +00:00
mav
20d551b720 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-09-13 08:55:22 +00:00
mav
d38ee29868 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-09-13 07:45:03 +00:00
mav
a132abedb0 Add support for Extended INQUIRY Data (0x86) VPD page. 2014-09-11 22:40:11 +00:00
mav
a3e07f1c6a Extend UNMAP blacklist on all STEC SSD models.
None of existing STEC devices need UNMAP or even support it well, having
many limitations and even hanging sometimes executing those commands.
New devices that may use UNMAP going to be released under HGST name.

MFC after:	3 days
2014-09-10 21:24:15 +00:00
trasz
d8aaa0480a Make sure we handle less than zero timeouts in iSCSI initiator and target
in a reasonable way.

Sponsored by:	The FreeBSD Foundation
2014-09-10 14:04:10 +00:00
trasz
6cacb7cf77 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.

Submitted by:	Chen Wen <pokkys@gmail.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-09-10 13:34:27 +00:00
mav
645f3f53cf Make ctl_port_mask an array to support more then 32 ports.
Overflow reported by Coverity.

CID:		1229894
MFC after:	3 days
2014-09-10 07:16:17 +00:00
mav
20136fb37c Remove uninitialized and unused variable, reported by Coverity.
CID:		1230015
2014-09-10 07:00:36 +00:00
mav
4db7e51eb2 Fix array overrun, reported by Coverity.
CID:		1229970
2014-09-10 06:56:45 +00:00
mav
a209c226c5 Fix couple off-by-one range check errors, reported by Coverity.
CID:		1007837
2014-09-10 06:35:00 +00:00
mav
8633346319 Fix memory leak on error, reported by Coverity.
CID:		1007773
2014-09-10 06:29:31 +00:00
mav
aa30f2d2de Fix minor buffer overflow reported by Coverity.
CID:		1006781
2014-09-10 06:25:18 +00:00
mav
d6b90c0b3c Report that DPO and FUA bits are supported after r271311. 2014-09-09 15:19:38 +00:00
mav
fbe6280d13 Oops, missed piece of r271311. 2014-09-09 14:20:55 +00:00
mav
abf46035ae Add support for Mode Page Policy (0x87) VPD page. 2014-09-09 14:09:51 +00:00
mav
57ec24a023 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).

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2014-09-09 11:38:29 +00:00
imp
8d965d25be Add a few defines and packet types for SATA 3.2 and FPDMA (First Party
DMA).

Sponsored by: Netflix
2014-08-30 02:13:04 +00:00
imp
44dfc5f335 We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.
2014-08-22 13:15:59 +00:00
sbruno
62d85fb59c Add the Samsung 843T as a 4k enabled drive
Submitted by:	Jason Wolfe <jason@llnw.com>
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2014-08-21 21:05:58 +00:00
trasz
aa773326bf Use proper include paths in kernel iSCSI code.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 16:08:17 +00:00
imp
0340ee1c6e Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
that's only mostly similar. Specifically word 78 bits are defined for
IDENTIFY DEVICE as
	5 Supports Hardware Feature Control
while a IDENTIFY PACKET DEVICE defines them as
	5 Asynchronous notification supported
Therefore, only pay attention to bit 5 when we're talking to ATAPI
devices (we don't use the hardware feature control at this time).
Ignore it for ATA devices. Remove kludge that papered over this issue
for Samsung SATA SSDs, since Micron drives also have the bit set and
the error was caused by this bad interpretation of the spec (which is
quite easy to do, since bits aren't normally overlapping like this).
2014-08-20 22:58:12 +00:00
jhb
1671819e3e Unexpand TAILQ_FOREACH(). 2014-08-20 16:07:56 +00:00
mav
bc970eb078 Fix lock recursion on LUN shutdown, introduced on r269497.
MFC after:	3 days
2014-08-19 17:04:18 +00:00
smh
47f0aea153 Added 4K quirks for Corsair Force GT and Samsung 840 SSDs
MFC after:	1 week
Sponsored by:	Multiplay
2014-08-14 13:57:17 +00:00
imp
bd93942a76 is_full_id is set to 0 and then not used. remove it. 2014-08-08 11:46:45 +00:00
mav
65cb012bfb Reduce reported additional INQUIRY data length.
sizeof(struct scsi_inquiry_data) of 256 bytes combined with off-by-one
error in the changed code gave total INQUIRY data length above 255 bytes,
that was maximal INQUIRY length in SPC-2.  While SPC-3 increased the
maximal length to 64K, at least sg3_utils are still confused by that.

MFC after:	1 week
2014-08-06 17:02:19 +00:00
mav
8e18ceaa15 Fix several issues and inconsistencies in UNMAP capabilities reporting.
This makes Windows 2012 to start using UNMAP on our disks.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2014-08-06 08:54:31 +00:00
mav
05e822bfff Reimplement WRITE USING TOKEN with Block Zero token using WRITE SAME.
On my ZVOL of SSDs that increases speed of zero writing in that way from
1 to 2.5GB/s by reducing CPU overhead.
MFC after:	2 weeks
2014-08-05 15:01:30 +00:00
mav
abcceae4d7 Add support for Windows dialect of EXTENDED COPY command, aka Microsoft ODX.
This allows to avoid extra network traffic when copying files on NTFS iSCSI
disks within one storage host by drag'n'dropping them in Windows Explorer
of Windows 8/2012.  It should also accelerate Hyper-V VM operations, etc.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2014-08-04 01:16:20 +00:00
mav
211a74241c Do not retry on set of non-transient XCOPY errors.
MFC after:	1 week
2014-08-03 11:43:14 +00:00
mav
8ad922d14d Do not retry token errors. They are not going to disappear by themselves.
MFC after:	1 week
2014-08-03 10:02:14 +00:00
mav
7dab858aad Rework r269444 to work also for lists without IDs.
MFC after:	3 days
2014-08-02 23:20:43 +00:00
mav
0875444264 Plug EXTENDED COPY request data memory leak.
MFC after:	3 days
2014-08-02 20:15:00 +00:00
mav
4fc98f231b Fix some bugs in RECEIVE COPY STATUS data.
MFC after:	3 days
2014-08-02 19:59:19 +00:00
mav
621e857f01 Add missing comparisons to make list IDs in EXTENDED COPY per-initiator,
as they should be.  Wrap it into a function to not duplicate the code.

MFC after:	3 days
2014-08-02 19:51:10 +00:00
joerg
5cbb895ebf Fix breakage introduced by r256843: removing the SA_CCB_WAITING bit
left some of the decisions based on its counterpart, SA_CCB_BUFFER_IO
being random.  As a result, propagation of the residual information
for the SPACE command was broken, so the number of filemarks
encountered during a SPACE operation was miscalculated.  Consequently,
systems relying on properly tracked filemark counters (like Bacula)
fell apart.

The change also removes a switch/case in sadone() which r256843
degraded to a single remaining case label.

PR:		192285
Approved by:	ken
MFC after:	2 weeks
2014-07-31 22:09:50 +00:00
mav
bc918439e5 Fix several cases of NULL dereference when INQUIRY sent to absent LUN.
MFC after:	3 days
2014-07-27 06:49:55 +00:00
mav
56e0af05ed Implement separate I/O dispatch method for ZVOLs in "dev" mode.
Unlike disk devices ZVOLs process all requests synchronously.  That makes
impossible sending multiple requests to them from single thread.  From the
other side ZVOLs have real d_read/d_write methods, which unlike d_strategy
can handle uio scatter/gather and have no strict I/O size limitations.

So, if ZVOL in "dev" mode is detected, use of d_read/d_write methods instead
of d_strategy allows to avoid pointless splitting of large requests into
MAXPHYS (128K) sized chunks.

MFC after:	1 week
2014-07-26 13:56:50 +00:00
mav
55374f2c30 Fix infinite loop, when doing WRITE SAME on file-backed LUN.
MFC after:	3 days
2014-07-26 13:43:25 +00:00