freebsd-dev/sys
Kenneth D. Merry fb4a43562a Fix Fibre Channel Command Reference Number handling in the isp(4) driver.
The Command Reference Number is used for precise delivery of
commands, and is part of the FC-Tape functionality set.  (This is
only enabled for devices that support precise delivery of commands.)
It is an 8-bit unsigned number that increments from 1 to 255.  The
commands sent by the initiator must be processed by the target in
CRN order if the CRN is non-zero.

There are certain scenarios where the Command Reference Number
sequence needs to be reset.  When the target is power cycled, for
instance, the initiator needs to reset the CRN to 1.  The initiator
will know this because it will see a LIP (when directly connected)
or get a logout/login event (when connected to a switch).

The isp(4) driver was not resetting the CRN when a target
went away and came back.  When it saw the target again after a
power cycle, it would continue the CRN sequence where it left off.
The target would ignore the command because the CRN sequence is
supposed to be reset to 1 after a power cycle or other similar
event.

The symptom that the user would see is that there would be lots of
aborted INQUIRY commands after a tape library was power cycled, and
the library would fail to probe.  The INQUIRY commands were being
ignored by the tape drive due to the CRN issue mentioned above.

isp_freebsd.c:
	Add a new function, isp_fcp_reset_crn().  This will reset
	all of the CRNs for a given port, or the CRNs for all LUNs
	on a target.

	Reset the CRNs for all targets on a port when we get a LIP,
	loop reset, or loop down event.

	Reset the CRN for a particular target when it arrives, is changed
	or departs.  This is less precise behavior than the
	clearing behavior specified in the FCP-4 spec (which says
	that it should be reset for PRLI, PRLO, PLOGI and LOGO),
	but this is the level of information we have here.  If this
	is insufficient, then we will need to add more precise
	notification from the lower level isp(4) code.

isp_freebsd.h:
	Add a prototype for isp_fcp_reset_crn().

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-01-08 17:41:28 +00:00
..
amd64 Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
arm Move the inclusion of cpu-v6.h inside the #ifdef _KERNEL block, so that 2015-01-08 03:59:03 +00:00
boot Missed change in r276688. Apologies for build breakage. 2015-01-05 16:52:25 +00:00
bsm
cam Improve camcontrol(8) handling of drive defect data. 2015-01-08 16:58:40 +00:00
cddl Correct zpool list displaying invalid EXPANDSZ for unavailable pool vdevs 2014-12-31 04:54:48 +00:00
compat Regen for r276654 (__getcwd()). 2015-01-04 10:40:23 +00:00
conf Add dev/mbox/mbox_if.m to MFILES list so we can use it in kernel modules 2015-01-07 21:40:23 +00:00
contrib In order to reduce use of M_EXT outside of the mbuf allocator and 2015-01-06 12:59:37 +00:00
crypto Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
ddb ddb: ANSI-fy function declarations. 2014-10-12 18:01:52 +00:00
dev Fix Fibre Channel Command Reference Number handling in the isp(4) driver. 2015-01-08 17:41:28 +00:00
fs Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro 2015-01-07 17:22:56 +00:00
gdb Add support for gdb's memory searching capabilities to our in-kernel gdb 2014-09-05 16:40:47 +00:00
geom Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
gnu reiserfs: Use signed i_nlink 2014-09-25 19:10:32 +00:00
i386 Don't call the SSE routines when they aren't enabled (or even compiled 2015-01-08 00:39:40 +00:00
isa
kern Create a cpuset mask for each NUMA domain that is available in the 2015-01-08 15:53:13 +00:00
kgssapi Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
libkern Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
mips Move MALTA_COMMON to std.MALTA (as we have for XLP and SWARM). 2015-01-07 12:12:36 +00:00
modules Refactor and split out the net80211 software scan engine from the rest 2015-01-06 02:08:45 +00:00
net MFV r276759: libpcap 1.6.2. 2015-01-06 22:29:12 +00:00
net80211 Global-ify channel_type() - this fixes non-debug net80211 builds. 2015-01-06 18:25:10 +00:00
netgraph In order to reduce use of M_EXT outside of the mbuf allocator and 2015-01-06 12:59:37 +00:00
netinet Use M_WRITABLE() and M_LEADINGSPACE() rather than checking M_EXT and 2015-01-06 14:32:28 +00:00
netinet6 To ease changes to underlying mbuf structure and the mbuf allocator, reduce 2015-01-05 09:58:32 +00:00
netipsec In order to reduce use of M_EXT outside of the mbuf allocator and 2015-01-06 12:59:37 +00:00
netnatm
netpfil Reapply previous patch to fix build. 2015-01-06 16:47:02 +00:00
netsmb
nfs Remove the old NFS client and server from head, 2014-12-23 00:47:46 +00:00
nfsclient Remove the old NFS client and server from head, 2014-12-23 00:47:46 +00:00
nfsserver Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro 2015-01-07 17:22:56 +00:00
nlm Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
ofed Use the M_SIZE() macro when possible. 2015-01-08 14:58:54 +00:00
opencrypto Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
pc98 Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
powerpc Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
rpc Add facility to stop all userspace processes. The supposed use of the 2014-12-13 16:18:29 +00:00
security Adjust printf format specifiers for dev_t and ino_t in kernel. 2014-12-17 07:27:19 +00:00
sparc64 Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
sys Create a cpuset mask for each NUMA domain that is available in the 2015-01-08 15:53:13 +00:00
teken mdoc: improvements to SEE ALSO. 2014-12-27 07:07:37 +00:00
tools Allow the make_dtb script to work outside of a "make buildkernel" context 2014-08-30 22:39:15 +00:00
ufs Handle MAKEENTRY cnp flag in the VOP_CREATE(). Curiously, some 2014-12-21 13:29:33 +00:00
vm Eliminate a stale debug message. The per-CPU cache locks were replaced 2014-12-31 17:44:57 +00:00
x86 Update Features2 to display SDBG capability of processor. This is 2015-01-08 16:50:35 +00:00
xdr
xen Pacify clang 3.3 by ending the file with a newline. This is common 2015-01-06 21:26:35 +00:00
Makefile Remove "pci" from CSCOPEDIRS. 2014-09-23 06:32:19 +00:00