]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r288259: Remove some duplicate, legacy, dead and questionable code.
mav [Mon, 5 Oct 2015 11:25:48 +0000 (11:25 +0000)]
MFC r288259: Remove some duplicate, legacy, dead and questionable code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288805 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288247: Pass to sobind() copy of the address, not the original.
mav [Mon, 5 Oct 2015 11:24:51 +0000 (11:24 +0000)]
MFC r288247: Pass to sobind() copy of the address, not the original.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288804 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288239: Properly lock LUN in ctl_failover_lun().
mav [Mon, 5 Oct 2015 11:05:56 +0000 (11:05 +0000)]
MFC r288239: Properly lock LUN in ctl_failover_lun().

git-svn-id: svn://svn.freebsd.org/base/stable/10@288803 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288224: Constify ctl_serialize_table.
mav [Mon, 5 Oct 2015 11:05:04 +0000 (11:05 +0000)]
MFC r288224: Constify ctl_serialize_table.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288802 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288229: Fix bit masks changed for the wrong commands in r288221.
mav [Mon, 5 Oct 2015 11:04:13 +0000 (11:04 +0000)]
MFC r288229: Fix bit masks changed for the wrong commands in r288221.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288221: Remove some dead code found by Clang analyzer.
mav [Mon, 5 Oct 2015 11:03:24 +0000 (11:03 +0000)]
MFC r288221: Remove some dead code found by Clang analyzer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288220: Remove stale comments and some excessive empty lines.
mav [Mon, 5 Oct 2015 11:02:17 +0000 (11:02 +0000)]
MFC r288220: Remove stale comments and some excessive empty lines.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288799 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288215: Switch I/O time accounting from system time to uptime.
mav [Mon, 5 Oct 2015 11:01:18 +0000 (11:01 +0000)]
MFC r288215: Switch I/O time accounting from system time to uptime.

While there, make num_dmas accounted independently of CTL_TIME_IO.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288798 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288214: Collect DMA statistics on secondary HA node.
mav [Mon, 5 Oct 2015 11:00:25 +0000 (11:00 +0000)]
MFC r288214: Collect DMA statistics on secondary HA node.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288797 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288213:
mav [Mon, 5 Oct 2015 10:59:37 +0000 (10:59 +0000)]
MFC r288213:
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288211: Remove some control_softc references.
mav [Mon, 5 Oct 2015 10:58:41 +0000 (10:58 +0000)]
MFC r288211: Remove some control_softc references.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288175: Allow WRITE SAME with NDOB bit set but without UNMAP.
mav [Mon, 5 Oct 2015 10:57:50 +0000 (10:57 +0000)]
MFC r288175: Allow WRITE SAME with NDOB bit set but without UNMAP.

This combination was originally forbidden, but allowed at spc4r3.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288170: Add new report types to REPORT LUNS command.
mav [Mon, 5 Oct 2015 10:56:57 +0000 (10:56 +0000)]
MFC r288170: Add new report types to REPORT LUNS command.

This is only for completeness, since we have nothing new to report there.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288166: Update WRITE ATOMIC(16) support to sbc4r8 draft.
mav [Mon, 5 Oct 2015 10:56:04 +0000 (10:56 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288165: Add support for READ BUFFER(16) command.
mav [Mon, 5 Oct 2015 10:55:08 +0000 (10:55 +0000)]
MFC r288165: Add support for READ BUFFER(16) command.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288148: Synchronize mode pages between HA peers.
mav [Mon, 5 Oct 2015 10:54:06 +0000 (10:54 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288146: Make HA peers announce their parameters on connect.
mav [Mon, 5 Oct 2015 10:53:13 +0000 (10:53 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288110: Add support for Control extension mode page.
mav [Mon, 5 Oct 2015 10:52:22 +0000 (10:52 +0000)]
MFC r288110: Add support for Control extension mode page.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288104: Remove duplicate and incomplete code handling LUN modify.
mav [Mon, 5 Oct 2015 10:51:24 +0000 (10:51 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288067: Log iSCSI session reinstatements.
mav [Mon, 5 Oct 2015 10:50:35 +0000 (10:50 +0000)]
MFC r288067: Log iSCSI session reinstatements.

False session reinstatements can be result of misconfiguration, when
several initiators use the same initiator name and ISID.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288786 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288061: Make cltd ignore HA ports.
mav [Mon, 5 Oct 2015 10:49:47 +0000 (10:49 +0000)]
MFC r288061: Make cltd ignore HA ports.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288785 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288059: Bunch of improvements to ctlstat.
mav [Mon, 5 Oct 2015 10:49:01 +0000 (10:49 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288784 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288043:
mav [Mon, 5 Oct 2015 10:48:14 +0000 (10:48 +0000)]
MFC r288043:
Output times as normal microseconds, rather then in bintime format.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288783 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288021: Mark with DMA flag I/Os waiting for iSCSI write data after R2T.
mav [Mon, 5 Oct 2015 10:47:18 +0000 (10:47 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288020: Remove couple excess SGLIST I/O flags.
mav [Mon, 5 Oct 2015 10:46:24 +0000 (10:46 +0000)]
MFC r288020: Remove couple excess SGLIST I/O flags.

Those flags duplicated respective (sg_entries > 0) values.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287994: Always execute REPORT LUNS and REQUEST SENSE commands locally.
mav [Mon, 5 Oct 2015 10:45:33 +0000 (10:45 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288779 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287993: Split two command flags with different meaning.
mav [Mon, 5 Oct 2015 10:44:36 +0000 (10:44 +0000)]
MFC r287993: Split two command flags with different meaning.

This is only a cosmetical change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287991: Pack struct ctl_ha_msg_hdr by 8 bytes.
mav [Mon, 5 Oct 2015 10:43:45 +0000 (10:43 +0000)]
MFC r287991: Pack struct ctl_ha_msg_hdr by 8 bytes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288777 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287986: Fix memory corruption when >128K transferred through HA link.
mav [Mon, 5 Oct 2015 10:42:58 +0000 (10:42 +0000)]
MFC r287986: Fix memory corruption when >128K transferred through HA link.

While there, do some cleaning.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287968: Mark I/Os with DMA flag while moving data through the HA link.
mav [Mon, 5 Oct 2015 10:42:07 +0000 (10:42 +0000)]
MFC r287968: Mark I/Os with DMA flag while moving data through the HA link.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288775 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287967: Relax serseq option operation for reads.
mav [Mon, 5 Oct 2015 10:41:08 +0000 (10:41 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288774 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287957: Kill HA link and shutdown the threads on shutdown.
mav [Mon, 5 Oct 2015 10:40:15 +0000 (10:40 +0000)]
MFC r287957: Kill HA link and shutdown the threads on shutdown.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288773 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287956: Update list of opcodes to 5/26/15.
mav [Mon, 5 Oct 2015 10:39:21 +0000 (10:39 +0000)]
MFC r287956: Update list of opcodes to 5/26/15.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288772 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287955: Update list of ASC/ASCQ codes from 5/20/12 to 8/12/15.
mav [Mon, 5 Oct 2015 10:38:32 +0000 (10:38 +0000)]
MFC r287955: Update list of ASC/ASCQ codes from 5/20/12 to 8/12/15.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288771 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287940: Replicate initiators WWPNs and names between HA peers.
mav [Mon, 5 Oct 2015 10:37:20 +0000 (10:37 +0000)]
MFC r287940: Replicate initiators WWPNs and names between HA peers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288770 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287933: Replicate port->init_devid to HA peer.
mav [Mon, 5 Oct 2015 10:36:28 +0000 (10:36 +0000)]
MFC r287933: Replicate port->init_devid to HA peer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288769 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287921: When reporting TPT UA, report which of thresholds was reached.
mav [Mon, 5 Oct 2015 10:35:36 +0000 (10:35 +0000)]
MFC r287921: When reporting TPT UA, report which of thresholds was reached.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288768 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287913: Report number of failed XCOPY segment.
mav [Mon, 5 Oct 2015 10:34:40 +0000 (10:34 +0000)]
MFC r287913: Report number of failed XCOPY segment.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r279433 (by rstone): Implement asprintf in libkern
mav [Mon, 5 Oct 2015 09:46:23 +0000 (09:46 +0000)]
MFC r279433 (by rstone): Implement asprintf in libkern

git-svn-id: svn://svn.freebsd.org/base/stable/10@288766 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287912: Report proper medium error code for VERIFY commands.
mav [Mon, 5 Oct 2015 09:26:52 +0000 (09:26 +0000)]
MFC r287912: Report proper medium error code for VERIFY commands.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287875: Fix reading after end of file for file-backed LUNs.
mav [Mon, 5 Oct 2015 09:26:00 +0000 (09:26 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288764 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287868: Make COMPARE AND WRITE report offset of difference.
mav [Mon, 5 Oct 2015 09:25:04 +0000 (09:25 +0000)]
MFC r287868: Make COMPARE AND WRITE report offset of difference.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287860: Frontends don't need to set errors themselves.
mav [Mon, 5 Oct 2015 09:24:08 +0000 (09:24 +0000)]
MFC r287860: Frontends don't need to set errors themselves.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288762 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287855: Don't flap the HA link if sysctl is reset to the same value.
mav [Mon, 5 Oct 2015 09:23:20 +0000 (09:23 +0000)]
MFC r287855: Don't flap the HA link if sysctl is reset to the same value.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288761 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287823: Add ctl-lun config option for consistency in HA setups.
mav [Mon, 5 Oct 2015 09:22:31 +0000 (09:22 +0000)]
MFC r287823: Add ctl-lun config option for consistency in HA setups.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287818: Fix completion/error status reporting.
mav [Mon, 5 Oct 2015 09:21:45 +0000 (09:21 +0000)]
MFC r287818: Fix completion/error status reporting.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287816: Close potential race between datamove and HA failover.
mav [Mon, 5 Oct 2015 09:20:57 +0000 (09:20 +0000)]
MFC r287816: Close potential race between datamove and HA failover.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288758 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287784: Implement data/status aggregation for secondary HA node.
mav [Mon, 5 Oct 2015 09:20:09 +0000 (09:20 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288757 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287783: Implement data/status aggregation for camsim backend.
mav [Mon, 5 Oct 2015 09:19:14 +0000 (09:19 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288756 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287778: Remove CTL_PRIV_LBA_LEN from HA messages.
mav [Mon, 5 Oct 2015 09:18:22 +0000 (09:18 +0000)]
MFC r287778: Remove CTL_PRIV_LBA_LEN from HA messages.

Previously it was used for statistics, but now just a 16 extra bytes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287774: Implement QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT.
mav [Mon, 5 Oct 2015 09:16:55 +0000 (09:16 +0000)]
MFC r287774: Implement QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT.

Now we support most of SAM-5 task management.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287766: Add negotiation of iSCSIProtocolLevel to 2 (RFC7144).
mav [Mon, 5 Oct 2015 09:16:01 +0000 (09:16 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288753 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287765: Map CLEAR TASK SET and I_T NEXUS RESET for iSCSI.
mav [Mon, 5 Oct 2015 09:15:11 +0000 (09:15 +0000)]
MFC r287765: Map CLEAR TASK SET and I_T NEXUS RESET for iSCSI.

The last should not be called without iSCSIProtocolLevel negotiation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287764: Implement iSCSI TARGET COLD RESET task management function.
mav [Mon, 5 Oct 2015 09:14:20 +0000 (09:14 +0000)]
MFC r287764: Implement iSCSI TARGET COLD RESET task management function.

Implement it as CTL_TASK_TARGET_RESET plus termination of all sessions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287760: Improve read-only support.
mav [Mon, 5 Oct 2015 09:13:30 +0000 (09:13 +0000)]
MFC r287760: Improve read-only support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288750 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287758: Reannounce port to HA peer if LUN map changed after online.
mav [Mon, 5 Oct 2015 09:12:38 +0000 (09:12 +0000)]
MFC r287758: Reannounce port to HA peer if LUN map changed after online.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287757: When updating port, apply only change of LUN map, not whole.
mav [Mon, 5 Oct 2015 09:11:46 +0000 (09:11 +0000)]
MFC r287757: When updating port, apply only change of LUN map, not whole.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288748 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287756:
mav [Mon, 5 Oct 2015 09:10:58 +0000 (09:10 +0000)]
MFC r287756:
Report INQUIRY DATA HAS CHANGED for related LUNs on port on-/offline.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287754: Report CTL_UA_LUN_CHANGE on LUN map change.
mav [Mon, 5 Oct 2015 09:09:48 +0000 (09:09 +0000)]
MFC r287754: Report CTL_UA_LUN_CHANGE on LUN map change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287748: Make TARGET RESET respect LUN mapping.
mav [Mon, 5 Oct 2015 09:08:58 +0000 (09:08 +0000)]
MFC r287748: Make TARGET RESET respect LUN mapping.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288745 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287724: Check for obsolete NUL bin in CSCD descriptor.
mav [Mon, 5 Oct 2015 09:08:06 +0000 (09:08 +0000)]
MFC r287724: Check for obsolete NUL bin in CSCD descriptor.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288744 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287721: Add HA support for CTL_TASK_I_T_NEXUS_RESET.
mav [Mon, 5 Oct 2015 09:07:15 +0000 (09:07 +0000)]
MFC r287721: Add HA support for CTL_TASK_I_T_NEXUS_RESET.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288743 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node.
mav [Mon, 5 Oct 2015 09:06:18 +0000 (09:06 +0000)]
MFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288742 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287718: Decode WRITE ATOMIC(16) command.
mav [Mon, 5 Oct 2015 09:05:23 +0000 (09:05 +0000)]
MFC r287718: Decode WRITE ATOMIC(16) command.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288741 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287715: Improve XCOPY error reporting.
mav [Mon, 5 Oct 2015 09:04:36 +0000 (09:04 +0000)]
MFC r287715: Improve XCOPY error reporting.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288740 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287714: Report that we have no limit on POPULATE TOKEN segment size.
mav [Mon, 5 Oct 2015 09:03:50 +0000 (09:03 +0000)]
MFC r287714: Report that we have no limit on POPULATE TOKEN segment size.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287712: Correct RTPG bitmask.
mav [Mon, 5 Oct 2015 09:03:00 +0000 (09:03 +0000)]
MFC r287712: Correct RTPG bitmask.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287711: Some HA polishing.
mav [Mon, 5 Oct 2015 09:02:13 +0000 (09:02 +0000)]
MFC r287711: Some HA polishing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287707: CTL documentation update, mostly for HA.
mav [Mon, 5 Oct 2015 09:01:19 +0000 (09:01 +0000)]
MFC r287707: CTL documentation update, mostly for HA.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288736 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287671:
mav [Mon, 5 Oct 2015 09:00:09 +0000 (09:00 +0000)]
MFC r287671:
Make ctld restart on primary HA node less invasive for secondary.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287670: Close races between device close and request processing.
mav [Mon, 5 Oct 2015 08:59:18 +0000 (08:59 +0000)]
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().

git-svn-id: svn://svn.freebsd.org/base/stable/10@288734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287664: Reference/release devices on every I/O, rather on open/close.
mav [Mon, 5 Oct 2015 08:58:25 +0000 (08:58 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288733 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287621: Reimplement CTL High Availability.
mav [Mon, 5 Oct 2015 08:57:16 +0000 (08:57 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288732 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287620: Remove unused target and initiator IDs.
mav [Mon, 5 Oct 2015 08:55:59 +0000 (08:55 +0000)]
MFC r287620: Remove unused target and initiator IDs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287618: Disable CTL_IO_DELAY feature.
mav [Mon, 5 Oct 2015 08:55:00 +0000 (08:55 +0000)]
MFC r287618: Disable CTL_IO_DELAY feature.

It is too developer-oriented to be enabled by default.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287534: Add two new portal group options "tag" and "foreign".
mav [Mon, 5 Oct 2015 08:54:02 +0000 (08:54 +0000)]
MFC r287534: Add two new portal group options "tag" and "foreign".

They are going to be useful in clustered setups.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.
mav [Mon, 5 Oct 2015 08:52:37 +0000 (08:52 +0000)]
MFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.

Not all changes take effect, but that is a different question.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287499: Move setting of media parameters inside open routines.
mav [Mon, 5 Oct 2015 08:51:20 +0000 (08:51 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287455, r287458, r287459: Remove some dead code.
mav [Mon, 5 Oct 2015 08:50:15 +0000 (08:50 +0000)]
MFC r287455, r287458, r287459: Remove some dead code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288726 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287433: Small UA cleanup.
mav [Mon, 5 Oct 2015 08:48:47 +0000 (08:48 +0000)]
MFC r287433: Small UA cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288725 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287372:
mav [Mon, 5 Oct 2015 08:47:45 +0000 (08:47 +0000)]
MFC r287372:
Make most of port methods optional and remove bunch of dummies.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288724 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287293: Remove 600 bytes of port_priv from struct ctl_io_hdr.
mav [Mon, 5 Oct 2015 08:46:48 +0000 (08:46 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287221: Fix type bug introduced at r286811.
mav [Mon, 5 Oct 2015 08:45:56 +0000 (08:45 +0000)]
MFC r287221: Fix type bug introduced at r286811.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288722 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286811: Polish sizes processing.
mav [Mon, 5 Oct 2015 08:44:39 +0000 (08:44 +0000)]
MFC r286811: Polish sizes processing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288721 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286807: Move "ioctl" CAM frontend into separate file.
mav [Mon, 5 Oct 2015 08:43:47 +0000 (08:43 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288720 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286806: Drop "internal" CTL frontend.
mav [Mon, 5 Oct 2015 08:42:43 +0000 (08:42 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288719 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286406, r286414:
mav [Mon, 5 Oct 2015 08:41:32 +0000 (08:41 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288718 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285600: MULTI_ID supported does not mean it is used.
mav [Mon, 5 Oct 2015 08:35:48 +0000 (08:35 +0000)]
MFC r285600: MULTI_ID supported does not mean it is used.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285510:
mav [Mon, 5 Oct 2015 08:33:41 +0000 (08:33 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288716 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285481: Make role sysctl handling from r284727 less strict.
mav [Mon, 5 Oct 2015 08:32:34 +0000 (08:32 +0000)]
MFC r285481: Make role sysctl handling from r284727 less strict.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288715 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285459: Unify port database use for target and initiator roles.
mav [Mon, 5 Oct 2015 08:31:48 +0000 (08:31 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288714 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285155:
mav [Mon, 5 Oct 2015 08:30:49 +0000 (08:30 +0000)]
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)

git-svn-id: svn://svn.freebsd.org/base/stable/10@288713 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285154: Remove extra level of target ID indirection (isp_dev_map).
mav [Mon, 5 Oct 2015 08:29:31 +0000 (08:29 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288712 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285147: Change comment added in r284540.
mav [Mon, 5 Oct 2015 08:28:33 +0000 (08:28 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288711 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287473,287485,287493,287494
bapt [Mon, 5 Oct 2015 08:18:31 +0000 (08:18 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@288710 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285146: Drop discovered targets when initiator role is disabled.
mav [Mon, 5 Oct 2015 08:16:10 +0000 (08:16 +0000)]
MFC r285146: Drop discovered targets when initiator role is disabled.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288709 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r273051 (by imp):
mav [Mon, 5 Oct 2015 08:14:27 +0000 (08:14 +0000)]
MFC r273051 (by imp):
Use the C99 flexible array construct to denote a variable amount of
data rather than the old-school [1] construct. We have required c99
compilers for some time.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r271731 (by will): Fix a kernel panic when unloading isp(4).
mav [Mon, 5 Oct 2015 08:13:29 +0000 (08:13 +0000)]
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:

sysctl_kern_proc
  sysctl_out_proc
    kern_proc_out
      fill_kinfo_proc
        fill_kinfo_thread
          strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));

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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288707 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285030: Fix couple panics on forced unmount of backing file.
mav [Mon, 5 Oct 2015 08:09:34 +0000 (08:09 +0000)]
MFC r285030: Fix couple panics on forced unmount of backing file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288706 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r281532 (by delphij): Eliminate unused headers.
mav [Mon, 5 Oct 2015 07:42:05 +0000 (07:42 +0000)]
MFC r281532 (by delphij): Eliminate unused headers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@288704 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f