Commit Graph

1705 Commits

Author SHA1 Message Date
mav
6e8a812631 Remove couple excess SGLIST I/O flags.
Those flags duplicated respective (sg_entries > 0) values.
2015-09-20 10:40:30 +00:00
mav
ce8faf1ce9 Always execute REPORT LUNS and REQUEST SENSE commands locally.
REPORT LUNS command is more related to target rather then specific LUN.
This node may be primary for LUNs for some reason unknown to another,
and command forwarded to another node won't be able to report them.

REQUEST SENSE is related to LUN, but in our implementation it reports
only UAs and CAs, that are stored locally rather then on primary node.
2015-09-19 19:30:55 +00:00
mav
5c7a1c36c1 Split two command flags with different meaning.
This is only a cosmetical change.
2015-09-19 19:11:59 +00:00
mav
9435d43b5b Pack struct ctl_ha_msg_hdr by 8 bytes. 2015-09-19 18:23:06 +00:00
mav
b5750fe77b Fix memory corruption when >128K transferred through HA link.
While there, do some cleaning.
2015-09-19 13:12:09 +00:00
mav
02db1cf02c Mark I/Os with DMA flag while moving data through the HA link. 2015-09-18 20:11:10 +00:00
mav
d696fece47 Relax serseq option operation for reads.
Previously, with serseq enabled, next command was unblocked only after
previous completed.  With this change, for read operations, next command
is unblocked as soon as last media read completed.  This is important
for frontends that actually wait for data move completion (like camtgt),
or when data are moved through the HA link, or especially when both.
2015-09-18 19:43:14 +00:00
mav
6c4148c76b Kill HA link and shutdown the threads on shutdown. 2015-09-18 12:08:00 +00:00
mav
39b362d735 Update list of opcodes to 5/26/15. 2015-09-18 10:44:25 +00:00
mav
48d608e93d Update list of ASC/ASCQ codes from 5/20/12 to 8/12/15. 2015-09-18 10:23:17 +00:00
mav
e2cbfa7ae4 Replicate initiators WWPNs and names between HA peers. 2015-09-17 21:51:11 +00:00
mav
7d2c7a2790 Replicate port->init_devid to HA peer. 2015-09-17 20:36:34 +00:00
mav
5168f6a6d2 When reporting TPT UA, report which of thresholds was reached. 2015-09-17 17:00:36 +00:00
mav
a09fd181e0 Report number of failed XCOPY segment. 2015-09-17 14:22:52 +00:00
mav
c83e5e51a7 Report proper medium error code for VERIFY commands. 2015-09-17 12:52:18 +00:00
mav
5cd19bff79 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-09-16 21:43:51 +00:00
mav
319baa7ea6 Make COMPARE AND WRITE report offset of difference. 2015-09-16 18:33:04 +00:00
mav
a2e99dcb40 Fix fixed sense writing when passed more data then it can fit.
MFC after:	1 week
2015-09-16 17:56:24 +00:00
mav
1391356f66 Frontends don't need to set errors themselves. 2015-09-16 13:25:35 +00:00
mav
32d95a60aa Don't flap the HA link if sysctl is reset to the same value. 2015-09-16 09:59:05 +00:00
mav
b533e5b8f6 Make CAM log errors that make it wait.
Waiting can take minutes, and it would be good for user to know what is
going on.

MFC after:	2 weeks
2015-09-15 10:57:16 +00:00
mav
ff7a796ad3 Fix completion/error status reporting. 2015-09-15 10:42:53 +00:00
mav
6bfadefc07 Close potential race between datamove and HA failover. 2015-09-15 09:36:46 +00:00
markj
67708eb40c Preserve the device queue status before retrying a sense request in
chdone(). Previously, the retry could clear the CAM_DEV_QFRZN bit in the
CCB status, leaving the queue frozen.

Submitted by:	Jeff Miller <Jeff.Miller@isilon.com>
Reviewed by:	ken
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-15 05:09:17 +00:00
mav
183453ee1f 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-09-14 15:21:23 +00:00
mav
562710b276 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-09-14 15:15:32 +00:00
mav
d119065944 Remove CTL_PRIV_LBA_LEN from HA messages.
Previously it was used for statistics, but now just a 16 extra bytes.
2015-09-14 09:56:01 +00:00
mav
b48d2e5828 Implement QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT.
Now we support most of SAM-5 task management.
2015-09-14 08:01:05 +00:00
mav
29816fedba Map CLEAR TASK SET and I_T NEXUS RESET for iSCSI.
The last should not be called without iSCSIProtocolLevel negotiation.
2015-09-13 20:40:00 +00:00
mav
ec9abd30ae Implement iSCSI TARGET COLD RESET task management function.
Implement it as CTL_TASK_TARGET_RESET plus termination of all sessions.
2015-09-13 20:22:18 +00:00
mav
169f852b1d Improve read-only support. 2015-09-13 16:49:41 +00:00
mav
b61b12e919 Reannounce port to HA peer if LUN map changed after online. 2015-09-13 15:31:55 +00:00
mav
9f330a7e28 Report INQUIRY DATA HAS CHANGED for related LUNs on port on-/offline. 2015-09-13 14:52:31 +00:00
mav
a0c6a9234d Report CTL_UA_LUN_CHANGE on LUN map change. 2015-09-13 14:04:42 +00:00
mav
415ebdc1a8 Make TARGET RESET respect LUN mapping. 2015-09-13 13:00:20 +00:00
mav
194fd9ab33 Check for obsolete NUL bin in CSCD descriptor. 2015-09-12 20:45:09 +00:00
mav
7947a17ff4 Add HA support for CTL_TASK_I_T_NEXUS_RESET. 2015-09-12 20:06:22 +00:00
mav
7e1a392c4c Fix false CTL_UA_RES_RELEASE on secondary HA node. 2015-09-12 18:29:05 +00:00
mav
7cbc0c158c Decode WRITE ATOMIC(16) command. 2015-09-12 17:53:49 +00:00
mav
0783650561 Improve XCOPY error reporting. 2015-09-12 16:30:01 +00:00
mav
df69845d9f Report that we have no limit on POPULATE TOKEN segment size. 2015-09-12 14:20:11 +00:00
mav
0780257cd2 Correct RTPG bitmask. 2015-09-12 13:53:41 +00:00
mav
a4f6fb8257 Some HA polishing. 2015-09-12 12:46:04 +00:00
mav
ceb1e1488d CTL documentation update, mostly for HA. 2015-09-12 10:23:23 +00:00
mav
f992fbc2ed Make ctld restart on primary HA node less invasive for secondary. 2015-09-11 14:47:35 +00:00
mav
2d639a52d6 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-09-11 14:33:05 +00:00
mav
fcc54645c3 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-09-11 12:50:52 +00:00
mav
7ee575bcca 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-09-10 12:40:31 +00:00
mav
1d4ff31d06 Remove unused target and initiator IDs. 2015-09-10 10:46:21 +00:00
mav
c134e00127 Disable CTL_IO_DELAY feature.
It is too developer-oriented to be enabled by default.
2015-09-10 09:27:22 +00:00