Commit Graph

200214 Commits

Author SHA1 Message Date
mav
3698331e56 MFC r279433 (by rstone): Implement asprintf in libkern 2015-10-05 09:46:23 +00:00
mav
d3014f47f4 MFC r287912: Report proper medium error code for VERIFY commands. 2015-10-05 09:26:52 +00:00
mav
c45abe2044 MFC r287875: Fix reading after end of file for file-backed LUNs.
If backing file is smaller then the LUN size, we have to explicitly clear
the rest of the buffer to not leak some random data from previous I/Os.
2015-10-05 09:26:00 +00:00
mav
2ddbc805cd MFC r287868: Make COMPARE AND WRITE report offset of difference. 2015-10-05 09:25:04 +00:00
mav
940d22f32e MFC r287860: Frontends don't need to set errors themselves. 2015-10-05 09:24:08 +00:00
mav
03f85b4859 MFC r287855: Don't flap the HA link if sysctl is reset to the same value. 2015-10-05 09:23:20 +00:00
mav
d74ee723c9 MFC r287823: Add ctl-lun config option for consistency in HA setups. 2015-10-05 09:22:31 +00:00
mav
90574827f1 MFC r287818: Fix completion/error status reporting. 2015-10-05 09:21:45 +00:00
mav
8c00f07d7f MFC r287816: Close potential race between datamove and HA failover. 2015-10-05 09:20:57 +00:00
mav
cb0cd52575 MFC r287784: Implement data/status aggregation for secondary HA node.
For short read requests this reduces latency by 30%, reporting command
completion after two interlink roundtrips instead of full three.
2015-10-05 09:20:09 +00:00
mav
aa4a28b040 MFC r287783: Implement data/status aggregation for camsim backend.
This is almost pointless for primary HA node, but useful for secondary,
where between fe_datamove and fe_done calls goes another link roundtrip.
2015-10-05 09:19:14 +00:00
mav
7a6cfae08e MFC r287778: Remove CTL_PRIV_LBA_LEN from HA messages.
Previously it was used for statistics, but now just a 16 extra bytes.
2015-10-05 09:18:22 +00:00
mav
77da07d14c MFC r287774: Implement QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT.
Now we support most of SAM-5 task management.
2015-10-05 09:16:55 +00:00
mav
048cd8404d MFC r287766: Add negotiation of iSCSIProtocolLevel to 2 (RFC7144).
We may need to pass negotiated value to kernel level, but so far it is
not necessary, since it does not use any new features without request.
2015-10-05 09:16:01 +00:00
mav
cada85b67a MFC r287765: Map CLEAR TASK SET and I_T NEXUS RESET for iSCSI.
The last should not be called without iSCSIProtocolLevel negotiation.
2015-10-05 09:15:11 +00:00
mav
9659490a64 MFC r287764: Implement iSCSI TARGET COLD RESET task management function.
Implement it as CTL_TASK_TARGET_RESET plus termination of all sessions.
2015-10-05 09:14:20 +00:00
mav
240ba1ee1f MFC r287760: Improve read-only support. 2015-10-05 09:13:30 +00:00
mav
0e819dab72 MFC r287758: Reannounce port to HA peer if LUN map changed after online. 2015-10-05 09:12:38 +00:00
mav
a0bb28fd76 MFC r287757: When updating port, apply only change of LUN map, not whole. 2015-10-05 09:11:46 +00:00
mav
985ffcba7f MFC r287756:
Report INQUIRY DATA HAS CHANGED for related LUNs on port on-/offline.
2015-10-05 09:10:58 +00:00
mav
e563859fd2 MFC r287754: Report CTL_UA_LUN_CHANGE on LUN map change. 2015-10-05 09:09:48 +00:00
mav
d17612b5d0 MFC r287748: Make TARGET RESET respect LUN mapping. 2015-10-05 09:08:58 +00:00
mav
89e8995fe2 MFC r287724: Check for obsolete NUL bin in CSCD descriptor. 2015-10-05 09:08:06 +00:00
mav
94d587a93b MFC r287721: Add HA support for CTL_TASK_I_T_NEXUS_RESET. 2015-10-05 09:07:15 +00:00
mav
de5feb201a MFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node. 2015-10-05 09:06:18 +00:00
mav
3b0ffe961d MFC r287718: Decode WRITE ATOMIC(16) command. 2015-10-05 09:05:23 +00:00
mav
3844e90a25 MFC r287715: Improve XCOPY error reporting. 2015-10-05 09:04:36 +00:00
mav
b41248ea28 MFC r287714: Report that we have no limit on POPULATE TOKEN segment size. 2015-10-05 09:03:50 +00:00
mav
b47be39047 MFC r287712: Correct RTPG bitmask. 2015-10-05 09:03:00 +00:00
mav
94d3cb685b MFC r287711: Some HA polishing. 2015-10-05 09:02:13 +00:00
mav
2ae17b4970 MFC r287707: CTL documentation update, mostly for HA. 2015-10-05 09:01:19 +00:00
mav
9712bb296c MFC r287671:
Make ctld restart on primary HA node less invasive for secondary.
2015-10-05 09:00:09 +00:00
mav
30616a0d8e MFC r287670: Close races between device close and request processing.
All requests arriving for processing after OFFLINE flag set are rejected
with BUSY status.  Races around OFFLINE flag setting are closed by calling
taskqueue_drain_all().
2015-10-05 08:59:18 +00:00
mav
b372bb7e21 MFC r287664: Reference/release devices on every I/O, rather on open/close.
While this may be slower, it allows device destruction to complete,
rather then block waiting for indefinitely long time.
2015-10-05 08:58:25 +00:00
mav
568256e886 MFC r287621: Reimplement CTL High Availability.
CTL HA functionality was originally implemented by Copan many years ago,
but large part of the sources was never published.  This change includes
clean room implementation of the missing code and fixes for many bugs.

This code supports dual-node HA with ALUA in four modes:
 - Active/Unavailable without interlink between nodes;
 - Active/Standby with second node handling only basic LUN discovery and
reservation, synchronizing with the first node through the interlink;
 - Active/Active with both nodes processing commands and accessing the
backing storage, synchronizing with the first node through the interlink;
 - Active/Active with second node working as proxy, transfering all
commands to the first node for execution through the interlink.

Unlike original Copan's implementation, depending on specific hardware,
this code uses simple custom TCP-based protocol for interlink.  It has
no authentication, so it should never be enabled on public interfaces.

The code may still need some polishing, but generally it is functional.

Relnotes:       yes
Sponsored by:   iXsystems, Inc.
2015-10-05 08:57:16 +00:00
mav
63b0da2b15 MFC r287620: Remove unused target and initiator IDs. 2015-10-05 08:55:59 +00:00
mav
76966ba3a7 MFC r287618: Disable CTL_IO_DELAY feature.
It is too developer-oriented to be enabled by default.
2015-10-05 08:55:00 +00:00
mav
f1a03e38c5 MFC r287534: Add two new portal group options "tag" and "foreign".
They are going to be useful in clustered setups.
2015-10-05 08:54:02 +00:00
mav
3f61db5756 MFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.
Not all changes take effect, but that is a different question.
2015-10-05 08:52:37 +00:00
mav
c060972cd4 MFC r287499: Move setting of media parameters inside open routines.
This is preparation for possibility to open/close media several times
per LUN life cycle.  While there, rename variables to reduce confusion.
As additional bonus this allows to open read-only media, such as ZFS
snapshots.
2015-10-05 08:51:20 +00:00
mav
158f0406b0 MFC r287455, r287458, r287459: Remove some dead code. 2015-10-05 08:50:15 +00:00
mav
9c0e046e5c MFC r287433: Small UA cleanup. 2015-10-05 08:48:47 +00:00
mav
efb416ffd8 MFC r287372:
Make most of port methods optional and remove bunch of dummies.
2015-10-05 08:47:45 +00:00
mav
a2a611a1d8 MFC r287293: Remove 600 bytes of port_priv from struct ctl_io_hdr.
This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.
2015-10-05 08:46:48 +00:00
mav
a4eceb6595 MFC r287221: Fix type bug introduced at r286811. 2015-10-05 08:45:56 +00:00
mav
f22bc34284 MFC r286811: Polish sizes processing. 2015-10-05 08:44:39 +00:00
mav
52a9e7a64d MFC r286807: Move "ioctl" CAM frontend into separate file.
It has nothing to share with too huge ctl.c other then device descriptor,
but even that may be counted as design error that may be fixed later.
At some point we may even want to have several ioctl ports.
2015-10-05 08:43:47 +00:00
mav
656a5c3136 MFC r286806: Drop "internal" CTL frontend.
Its idea was to be a simple initiator and execute several commands from
kernel level, but FreeBSD never had consumer for that functionality,
while its implementation polluted many unrelated places.
2015-10-05 08:42:43 +00:00
mav
6be41b0877 MFC r286406, r286414:
Wrap some unused functions with notyet, it is necessary to be able to
build the modules/ctl directly.
Remove a dead MALLOC_DEFINE.
2015-10-05 08:41:32 +00:00
mav
344c89f147 MFC r285600: MULTI_ID supported does not mean it is used. 2015-10-05 08:35:48 +00:00