Commit Graph

1501 Commits

Author SHA1 Message Date
mav
cc4fa4df69 MFC r275478: Swap resource count scopes for used/available space.
Used count should be reported as per-LUN, while available should not.
2014-12-11 00:25:26 +00:00
mav
4875c0a205 MFC r275446: Plug memory leaks on UNMAP and XCOPY with invalid parameters. 2014-12-10 08:52:47 +00:00
mav
16ad04df25 MFC r275368:
When passing LUN IDs through treat ASCII values as fixed-length, not
interpreating NULLs as EOLs, but converting them to spaces.

SPC-4 does not tell that T10-based IDs should be NULL-terminated/padded.
And while it tells that it should include only ASCII chars (0x20-0x7F),
there are some USB sticks (SanDisk Ultra Fit), that have NULLs inside
the value.  Treating NULLs as EOLs there made those LUN IDs non-unique.
2014-12-08 09:47:49 +00:00
mav
c2a2522fc4 MFC r274805:
Make cfiscsi_offline() synchronous, waiting for connections termination
before return.  This should make ctld restart more clean and predictable.
2014-12-05 07:25:02 +00:00
mav
0d78a1c549 MFC r274795:
Close race between cfiscsi_offline() and new connection arrival.

Incoming connection should be either rejected or accepted and terminated.
2014-12-05 07:24:17 +00:00
mav
cc2f0f4af5 MFC r274785: Partially reconstruct Active/Standby clusting.
In this mode one head is in Active state, supporting all commands, while
another is in Standby state, supporting only minimal LUN discovery subset.

It is still incomplete since Standby state requires reservation support,
which is impossible to do right without having interlink between heads.
But it allows to run some basic experiments.
2014-12-05 07:23:25 +00:00
trasz
ea68673881 MFC r274703:
Fix typo.

Sponsored by:	The FreeBSD Foundation
2014-12-03 08:22:13 +00:00
trasz
eafe9cc2c3 MFC r273918:
Change the default log level for iSCSI target from 3 to 1.  It should
have been 1 from the beginning; not sure how it ended up at 3.

Sponsored by:	The FreeBSD Foundation
2014-11-30 10:36:29 +00:00
mav
d424575bb7 MFC r274756:
Remove residual xpt_release_device() call left after r272406 cleanup.

Excessive release here could trigger use-after-free condition and kernel
panic on LUN 0 disconnect.
2014-11-28 09:23:15 +00:00
mav
8eec24be06 MFC r274840, r274940:
Make iSCSI frontend less chatty while waiting for tasks termination.
2014-11-28 08:56:37 +00:00
mav
2e80dc504a MFC r274790: Remove bunch of unused lun variables. 2014-11-28 08:54:43 +00:00
mav
6625927f31 MFC r274789: Reduce race between LUN destruction and request arrival. 2014-11-28 08:53:44 +00:00
mav
6f5634bed9 MFC r274786: Log errors for absent LUNs too. 2014-11-28 08:52:38 +00:00
mav
6414b04c27 MFC r274154, r274163:
Add to CTL support for logical block provisioning threshold notifications.

For ZVOL-backed LUNs this allows to inform initiators if storage's used or
available spaces get above/below the configured thresholds.

Sponsored by:	iXsystems, Inc.
2014-11-20 01:55:12 +00:00
mav
3f382b8a2d MFC r274477: Fix check for vendor-specific peripheral qualifier.
Submitted by:	anton.rang@isilon.com
2014-11-20 01:50:46 +00:00
mav
5966236aa7 MFC r274333: Handle PREEMPT AND ABORT service action equal to PREEMPT.
With command serialization used in CTL, there are no other commands to abort
when PREEMPT AND ABORT gets to run, so it is practically equal to PREEMPT.
2014-11-16 01:47:43 +00:00
mav
862a9d976c MFC r274206:
Synchronize medium rotation rate in legacy Rigid Disk Drive Geometry mode
page with modern Block Device Characteristics VPD page.
2014-11-14 00:25:10 +00:00
mav
004861f324 MFC r274081: Fix residual copy/paste in r274080. 2014-11-11 17:18:51 +00:00
mav
2be19bde46 MFC r274080: Improve error handling around duplicate lun and port enable.
This fixes kernel panic if port enabled twice and then disabled.
2014-11-11 17:17:41 +00:00
mav
2a51a4259a MFC r274253: Fix LUN resize broken by r272911 commit. 2014-11-11 17:14:35 +00:00
gnn
52c05ed231 MFC: 273279
Add new quirks for the latest Samsung SSD, model 850.

Submitted by:	sbruno
2014-11-08 00:47:16 +00:00
mav
edabf036a2 MFC r273809:
Implement better handling for ENOSPC error for both CTL and CAM.

This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing
the virtual machine, when backing storage (ZFS pool) is getting overflowed.
2014-11-03 03:45:41 +00:00
mav
131eff3491 MFC r273730, r273731:
Reduce code duplication around Write Exclusive persistent reservation.

While there, allow some more commands to pass persistent reservation.
2014-11-03 03:44:59 +00:00
mav
58bf349623 MFC r273711:
Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand.

These commands are rare, but consume additional 256KB RAM per LUN.
2014-11-03 03:43:40 +00:00
mav
9252414b60 MFC r273708: Fix support for LUN flat space addressing. 2014-11-02 17:31:45 +00:00
mav
9e735a2fb2 MFC r273693: Fix printing non-terminated strings in devlist XML. 2014-11-02 17:31:10 +00:00
mav
c9979422b8 MFC r273687:
Add "rpm" and "formfactor" LUN options to match istgt functionality.
2014-11-02 17:30:30 +00:00
mav
522da768bb MFC r273640: Add support for 12/16-byte EUI and 16-byte NAA IDs. 2014-11-02 17:29:48 +00:00
mav
db924e4c03 MFC r273075: Remove couple Copan's vendor-specific mode pages.
Those pages are highly system-/hardware-specific, the code is incomplete,
and so they hardly can be useful for anybody else.
2014-11-02 17:28:44 +00:00
mav
9ac81dc0af MFC r273073: Some groundwork for later Informational Exceptions support.
This includes support for:
 - Read-Write Error Recovery mode page;
 - Informational Exceptions Control mode page;
 - Logical Block Provisioning mode page;
 - LOG SENSE command.

No real Informational Exceptions features yet. This is only a placeholder.
2014-11-02 17:28:08 +00:00
mav
13d0c695a0 MFC r272409:
Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected.

SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other
then LUN 0.  If we see LUN 0 disconnected, guess there may be others, and
so REPORT LUNS shall be supported.
2014-11-02 17:26:13 +00:00
mav
5c2f41bdb0 MFC r272406:
Make disconnected LUN 0 don't remain in half-configured state if there are
no LUNs on SPC-3 target after we tried REPORT LUNS.
2014-11-02 17:25:03 +00:00
mav
3f2b3e757a MFC r272401, r272402: Rework the logic of sequential SCSI LUN scanner.
Previous logic was not differentiating disconnected LUNs and absent targets.
That made it to stop scan if LUN 0 was not found for any reason.  That made
problematic, for example, using iSCSI targets declaring SPC-2 compliance and
having no LUN 0 configured.

The new logic continues sequential LUN scan if:
 -- we have more configured LUNs that need recheck;
 -- this LUN is connected and its SCSI version allows more LUNs;
 -- this LUN is disconnected, its SCSI version allows more LUNs and we
    guess they may be connected (we haven't scanned first 8 LUNs yet or
    kern.cam.cam_srch_hi sysctl is set to scan more).
2014-11-02 17:23:44 +00:00
smh
93face2ccb MFC: r273704
Fix CF ERASE breakage caused by 268205.

Sponsored by:	Multiplay
2014-10-29 09:27:24 +00:00
hselasky
1f41d295fb MFC r263710, r273377, r273378, r273423 and r273455:
- De-vnet hash sizes and hash masks.
- Fix multiple issues related to arguments passed to SYSCTL macros.

Sponsored by:	Mellanox Technologies
2014-10-27 14:38:00 +00:00
mav
9d96d4ad45 MFC r273259:
Make VPD 80h (Serial Number) transfer length match serial number length.
2014-10-23 07:37:48 +00:00
mav
b118502c8f MFC r273163: Implement more functional CTL debug logging.
Setting bits in kern.cam.ctl.debug allows to log errors, commands and some
commands data respectively.
2014-10-23 07:36:33 +00:00
mav
173113fe4e MFC r273072: Add LBPERE mode bit definition. 2014-10-20 08:09:36 +00:00
mav
ad16b79ee7 MFC r273046:
Don't confuse frontend with zero length data moves, just return immediately.
2014-10-20 08:08:43 +00:00
mav
7cb7c8f153 MFC r273038: Add support for READ DEFECT DATA (10/12) commands.
SPC-4 r2 allows to return empty defect list if the list is not supported.
We don't reallu support defect data lists, but this suppresses some errors.
2014-10-20 08:07:29 +00:00
mav
9281ac4831 MFC r273029:
Report physical block size for file-backed LUNs, using vattr.va_blocksize.
2014-10-20 08:06:17 +00:00
mav
d6db3716e1 MFC r273008: Remove stale comments. 2014-10-20 08:04:46 +00:00
mav
d8647fe277 MFC r272978: Improve and document ctladm portlist subcommand.
Make this subcommand less FC-specific, reporting target and port addresses
in more generic way.  Also make it report list of connected initiators in
unified way, working for both FC and iSCSI, and potentially others.
2014-10-20 08:03:23 +00:00
mav
deb98691d8 MFC r272947: Give physical and virtual ports numbers some more meaning. 2014-10-20 07:59:29 +00:00
mav
d9f8df105f MFC r272939: Shorten frontend name. 2014-10-20 07:58:01 +00:00
mav
e2ad56a41d MFC r272938: Filter out duplicate AC_PATH_REGISTERED async events.
Queued async events handling in CAM opened race, that may lead to duplicate
AC_PATH_REGISTERED events delivery during boot.  That was not happening
before r272935 because the driver was initialized later.  After that change
it started create duplicate ports in CTL.
2014-10-20 07:57:07 +00:00
mav
a0796a04ee MFC r272935: Mark CTL frontend's CAM driver as CAM_PERIPH_DRV_EARLY.
Target mode operation does not depend on the initiator mode scan process.
This change allows the target driver to attach earlier and receive some
async events (like AC_CONTRACT) that could be lost otherwise.
2014-10-20 07:52:48 +00:00
mav
b61a1b5706 MFC r272911:
Make ctld start even if some LUNs are unable to open backing storage.

Such LUNs will be visible to initiators, but return "not ready" status
on media access commands.  If backing storage become available later,
`ctladm modify ...` or `service ctld reload` can trigger its reopen.
2014-10-20 07:41:37 +00:00
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