200207 Commits

Author SHA1 Message Date
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
mav
66cf55baf8 MFC r285510:
Switch initiator IDs in target mode to the same address space as target
IDs in initiator mode -- index in port database instead of handlers.

This makes initiator IDs persist across role changes and firmware resets,
when handlers previously assigned by firmware are lost and reused.
2015-10-05 08:33:41 +00:00
mav
f19237a8be MFC r285481: Make role sysctl handling from r284727 less strict. 2015-10-05 08:32:34 +00:00
mav
ec7deb53d1 MFC r285459: Unify port database use for target and initiator roles.
Aside from cleaner and more consistent code, this allows ports to be both
target and initiator same time, and easily switch from any role to any.
2015-10-05 08:31:48 +00:00
mav
9b07ecd099 MFC r285155:
Make first step toward supporting target and initiator roles same time.

To avoid conflicts between target and initiator devices in CAM, make
CTL use target ID reported by HBA as its initiator_id in XPT_PATH_INQ.
That target ID is known to never be used for initiator role, so it won't
conflict.  For Fibre Channel and FireWire HBAs this specific ID choice
is irrelevant since all target IDs there are virtual. Same time for SPI
HBAs it seems could be even requirement to use same target ID for both
initiator and target roles.

While there are some more things to polish in isp(4) driver, first tests
of using both roles same time on the same port appeared successfull:

# camcontrol devlist -v
scbus0 on isp0 bus 0:
<FREEBSD CTLDISK 0001>             at scbus0 target 1 lun 0 (da20,pass21)
<>                                 at scbus0 target 256 lun 0 (ctl0)
<>                                 at scbus0 target -1 lun ffffffff (ctl1)
2015-10-05 08:30:49 +00:00
mav
587443b8f9 MFC r285154: Remove extra level of target ID indirection (isp_dev_map).
FreeBSD never had limitation on number of target IDs, and there is no
any other requirement to allocate them densely.  Since slots of port
database already populated just sequentially, there is no much need
for another indirection to allocate sequentially too.
2015-10-05 08:29:31 +00:00
mav
276dc40196 MFC r285147: Change comment added in r284540.
This appeared to be not card's issue, but driver's, though solution is
the same so far.
2015-10-05 08:28:33 +00:00
bapt
49c462994f MFC 287473,287485,287493,287494
Add a new sesutil(8) utility

This is an utility for managing SCSI Enclosure Services (SES) device.

For now only one command is supported "locate" which will change the test of the
external LED associated to a given disk.

Usage if the following:
sesutil locate disk [on|off]

Disk can be a device name: "da12" or a special keyword: "all".

Reviewed by:	mav
Relnotes:	yes
Sponsored by:	gandi.net
2015-10-05 08:18:31 +00:00