Implement it as CTL_TASK_TARGET_RESET plus termination of all sessions.
288750 by mav:
MFC r287760: Improve read-only support.
288749 by mav:
MFC r287758: Reannounce port to HA peer if LUN map changed after online.
288748 by mav:
MFC r287757: When updating port, apply only change of LUN map, not whole.
288747 by mav:
Report INQUIRY DATA HAS CHANGED for related LUNs on port on-/offline.
288746 by mav:
MFC r287754: Report CTL_UA_LUN_CHANGE on LUN map change.
288745 by mav:
MFC r287748: Make TARGET RESET respect LUN mapping.
288744 by mav:
MFC r287724: Check for obsolete NUL bin in CSCD descriptor.
288743 by mav:
MFC r287721: Add HA support for CTL_TASK_I_T_NEXUS_RESET.
288742 by mav:
MFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node.
288741 by mav:
MFC r287718: Decode WRITE ATOMIC(16) command.
288740 by mav:
MFC r287715: Improve XCOPY error reporting.
288739 by mav:
MFC r287714: Report that we have no limit on POPULATE TOKEN segment size.
288738 by mav:
MFC r287712: Correct RTPG bitmask.
288737 by mav:
MFC r287711: Some HA polishing.
288736 by mav:
MFC r287707: CTL documentation update, mostly for HA.
288735 by mav:
Make ctld restart on primary HA node less invasive for secondary.
288734 by mav:
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
288733 by mav:
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.
288732 by mav:
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.
Sponsored by: iXsystems, Inc.
288731 by mav:
MFC r287620: Remove unused target and initiator IDs.
288730 by mav:
MFC r287618: Disable CTL_IO_DELAY feature.
It is too developer-oriented to be enabled by default.
288729 by mav:
MFC r287534: Add two new portal group options "tag" and "foreign".
They are going to be useful in clustered setups.
288728 by mav:
MFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.
Not all changes take effect, but that is a different question.
288727 by mav:
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
288726 by mav:
MFC r287455, r287458, r287459: Remove some dead code.
288725 by mav:
MFC r287433: Small UA cleanup.
288724 by mav:
Make most of port methods optional and remove bunch of dummies.
288723 by mav:
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.
288722 by mav:
MFC r287221: Fix type bug introduced at r286811.
288721 by mav:
MFC r286811: Polish sizes processing.
288720 by mav:
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.
288719 by mav:
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.
288718 by mav:
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.
288717 by mav:
MFC r285600: MULTI_ID supported does not mean it is used.
288716 by mav:
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.
288715 by mav:
MFC r285481: Make role sysctl handling from r284727 less strict.
288714 by mav:
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.
288713 by mav:
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)
288712 by mav:
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.
288711 by mav:
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.
288710 by bapt:
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".
288709 by mav:
MFC r285146: Drop discovered targets when initiator role is disabled.
288708 by mav:
MFC r273051 (by imp):
Use the C99 flexible array construct to denote a variable amount of
data rather than the old-school  construct. We have required c99
compilers for some time.
288707 by mav:
MFC r271731 (by will): Fix a kernel panic when unloading isp(4).
In the current implementation, the isp_kthread() threads never exit.
The target threads do have an exit mode from isp_attach(), but it is
not invoked from isp_detach().
Ensure isp_detach() notifies threads started for each channel, such
that they exit before their parent device softc detaches, and thus
before the module does. Otherwise, a page fault panic occurs later in:
For isp_kthread() (and isp(4) target threads), td->td_wmesg references
now-unmapped memory after the module has been unloaded. These threads
are typically msleep()ing at the time of unload, but they could also
attempt to execute now-unmapped code segments.
288706 by mav:
MFC r285030: Fix couple panics on forced unmount of backing file.
288704 by mav:
MFC r281532 (by delphij): Eliminate unused headers.
288702 by mav:
MFC r281531 (by asomers):
Initialize async_arg_ptr in xpt_async when called with async_code
Without this change, newly inserted hard disks won't always have their
physical path device nodes created. The problem reproduces most readily
when attaching a large number of disks at once.
288701 by mav:
MFC r280845 (by eadler):
Add some additional quirks for various Western Digital Caviar MHDDs
288811 by mav:
MFC r288348: Umplement media load/eject support for removable devices.
In case of block backend eject really closes the backing store, while
load tries to open it back. Failed store open is reported as no media.
288810 by mav:
MFC r288310: Add to CTL initial support for CDROMs and removable devices.
288809 by mav:
MFC r288264: Allow LOG SENSE command on non-disk devices.
288808 by mav:
MFC r288262: Remove concept of control device.
288807 by mav:
MFC r288261: Move ioctl frontend defines where they belong.
288806 by mav:
MFC r288260: Remove few more unused variables.
288805 by mav:
MFC r288259: Remove some duplicate, legacy, dead and questionable code.
288804 by mav:
MFC r288247: Pass to sobind() copy of the address, not the original.
288803 by mav:
MFC r288239: Properly lock LUN in ctl_failover_lun().
288802 by mav:
MFC r288224: Constify ctl_serialize_table.
288801 by mav:
MFC r288229: Fix bit masks changed for the wrong commands in r288221.
288800 by mav:
MFC r288221: Remove some dead code found by Clang analyzer.
288799 by mav:
MFC r288220: Remove stale comments and some excessive empty lines.
288798 by mav:
MFC r288215: Switch I/O time accounting from system time to uptime.
While there, make num_dmas accounted independently of CTL_TIME_IO.
288797 by mav:
MFC r288214: Collect DMA statistics on secondary HA node.
288796 by mav:
Make HA handle datamove and done in a universal way, using port methods.
Now from primary node point of view requests transferred from secondary
node should look almost normal and always have valid port.
288795 by mav:
MFC r288211: Remove some control_softc references.
288794 by mav:
MFC r288175: Allow WRITE SAME with NDOB bit set but without UNMAP.
This combination was originally forbidden, but allowed at spc4r3.
288793 by mav:
MFC r288170: Add new report types to REPORT LUNS command.
This is only for completeness, since we have nothing new to report there.
288792 by mav:
MFC r288166: Update WRITE ATOMIC(16) support to sbc4r8 draft.
This is only a cosmetic change. We still don't support atomic boundary
field in the CDB, but at least now we do it formally.
288791 by mav:
MFC r288165: Add support for READ BUFFER(16) command.
288790 by mav:
MFC r288148: Synchronize mode pages between HA peers.
We allow to modify only few fields in mode pages now, but still it is
not good if they unexpectedly change during failover. Also this fixes
reporting of "Mode parameters changed" UAs on secondary node.
288789 by mav:
MFC r288146: Make HA peers announce their parameters on connect.
HA protocol requires strict version, parameters and configuration match.
Differences there may cause full set of problems up to kernel panic.
To avoid that, validate peer parameters on connect, and abort connection
immediately if some mismatch detected.
288788 by mav:
MFC r288110: Add support for Control extension mode page.
288787 by mav:
MFC r288104: Remove duplicate and incomplete code handling LUN modify.
Instead reuse code from LUN creation. This allows most of LUN media
options to be changed live with modify request without full restart.
288786 by mav:
MFC r288067: Log iSCSI session reinstatements.
False session reinstatements can be result of misconfiguration, when
several initiators use the same initiator name and ISID.
288785 by mav:
MFC r288061: Make cltd ignore HA ports.
288784 by mav:
MFC r288059: Bunch of improvements to ctlstat.
Add -p option to allow filtering by ports.
Make -l and -p options work in all modes as filters.
Improve output formatting to better fit columns.
288783 by mav:
Output times as normal microseconds, rather then in bintime format.
288782 by mav:
MFC r288021: Mark with DMA flag I/Os waiting for iSCSI write data after R2T.
Reads and immediate writes are not blocking, so don't bother.
Those flags duplicated respective (sg_entries > 0) values.
288779 by mav:
MFC r287994: 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.
288778 by mav:
MFC r287993: Split two command flags with different meaning.
This is only a cosmetical change.
288777 by mav:
MFC r287991: Pack struct ctl_ha_msg_hdr by 8 bytes.
288776 by mav:
MFC r287986: Fix memory corruption when >128K transferred through HA link.
While there, do some cleaning.
288775 by mav:
MFC r287968: Mark I/Os with DMA flag while moving data through the HA link.
288774 by mav:
MFC r287967: 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.
288773 by mav:
MFC r287957: Kill HA link and shutdown the threads on shutdown.
288772 by mav:
MFC r287956: Update list of opcodes to 5/26/15.
288771 by mav:
MFC r287955: Update list of ASC/ASCQ codes from 5/20/12 to 8/12/15.
288770 by mav:
MFC r287940: Replicate initiators WWPNs and names between HA peers.
288769 by mav:
MFC r287933: Replicate port->init_devid to HA peer.
288768 by mav:
MFC r287921: When reporting TPT UA, report which of thresholds was reached.
288767 by mav:
MFC r287913: Report number of failed XCOPY segment.
288766 by mav:
MFC r279433 (by rstone): Implement asprintf in libkern