| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------------------------------------
r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines
Fix probing FC targets with hard addressing turned on.
This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.
The intent of that change was to keep loop IDs persistent across
chip reinits.
The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address. It also turned off soft addressing on 2400
(4Gb) and newer controllers.
The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on. So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.
The solution is to largely revert that change. I left some elements
in place that are related to virtual ports, since they were new.
This does work with IBM tape drives with hard and soft addressing
turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers.
sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937. I left the
ispmbox.h changes in place.
Don't use the PREV_ADDRESS bit on initialization. It tells
the chip to not participate if it can't get the requested
loop ID.
Do use soft addressing on 2400 and newer chips.
Use hard addressing when the user has requested a specific
initiator ID. (hint.isp.X.iid=N in /boot/loader.conf)
Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.
Reviewed by: mav
Sponsored by: Spectra Logic
------------------------------------------------------------------------
r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines
Remove duplicate assignments from r321622.
Submitted by: mav
Sponsored by: Spectra Logic
------------------------------------------------------------------------
Notes:
svn path=/stable/10/; revision=321945
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Correct loop mode CRN resets to adhere to FCP-4 section 4.10
Prior to this change, the CRN (Command Reference Number) is reset on any
firmware LIP, LOOP DOWN, or LOOP RESET event in violation of FCP-4 which
specifies that the CRN should only be reset in response to a LIP Reset
(LIPyx) primitive. FCP-4 also indicates PLOGI/LOGO and PRLI/PRLO ELS
actions as conditions for resetting the CRN for the associated initiator
port.
These violations manifest themselves when the HBA is removed from the
loop, or a target device is removed (especially during an outstanding
command) without power cycling. If the HBA and and the target device
determine upon re-establishing the loop that no PLOGI or PRLI is
required, and the target does not issue a LIPxy to the initiator, the
CRN for the target will have been improperly reset by the isp driver. As
a result, the target port will silently ignore all FCP commands issued
during the device probe (which will time out) preventing the device from
attaching.
This change corrects thie CRN reset behavior in response to loop state
changes, also introduces CRN resets for the above mentioned ELS actions
as encountered through async PDB change events.
This change also adds cleanup of outstanding commands in isp_loop_dead()
that was previously missing.
sys/dev/isp/isp.c
Add the last login state to debug output when syncing the pdb
sys/dev/isp/isp_freebsd.c
Replace binary statement setting aborted ccb status in
isp_watchdog() with the XS_SETERR macro used elsewhere
In isp_loop_dead(), abort or complete pending commands as done
in isp_watchdog()
In isp_async(), segregate the ISPASYNC_LOOP_RESET action from
ISPASYNC_LIP, ISPASYNC_LOOP_DOWN, and ISPASYNC_LOOP_UP
fallthroughs, and only reset the CRN in the RESET case. Also add
checks to handle false LOOP RESET actions that do not have a
proper associated LIP primitive, and log the primitive in the
debug messages
In isp_async(), remove the goto from ISP_ASYNC_DEV_STAYED, and
only reset the CRN in the DEV_CHANGED action
In isp_async(), when processing an ISPASYNC_CHANGE_PDB status,
reset CRN(s) for the associated nphdl (or all ports) if the
change reason is some form of ELS login/logout. Also remove
assignment to fc since it is not used in the scope
sys/dev/isp/ispmbox.h
Add macro definition for the global N-Port handle, and correct a
macro typo 'PDB24XX_AE_PRLI_DONJE'
sys/dev/isp/ispvar.h
Add macros FCP_AL_DA_ALL, FCP_AL_PA, and FCP_IS_DEST_ALPD for
more legible code when determining if an AL_PD port matches the
portid for a given struct fcparam* by value or by virtue of the
AL_PD port being 0xFF
Submitted by: Reid Linnemann
Sponsored by: Spectra Logic
Notes:
svn path=/stable/10/; revision=318149
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317636
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317363
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317322
|
| |
|
|
|
|
|
|
|
|
| |
Let firmware do its best first, and if it can't, try software recovery.
I would remove software timeout handler completely, but found bunch of
complains on command timeout on sparc64 mailing list few years ago, so
better be safe in case of interrupt loss.
Notes:
svn path=/stable/10/; revision=316407
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316405
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316401
|
| |
|
|
|
|
|
|
|
|
| |
For 24xx and above use 2 vectors (default and response queue).
For 26xx and above use 3 vectors (default, response and ATIO queues).
Due to global lock interrupt hardlers never run simultaneously now, but
at least this allows to save one regitster read per interrupt.
Notes:
svn path=/stable/10/; revision=316399
|
| |
|
|
|
|
|
|
| |
Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful
in loop mode, which probably doesn't worth having this hack in 2017.
Notes:
svn path=/stable/10/; revision=316169
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316155
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of single isp_intr() function doing all possible magic, introduce
four different functions to handle mailbox operation completions, async
events, response and ATIO queues. The goal is to isolate different code
paths to make code more readable, and to make easier support for multiple
interrupt vectors. Even oldest hardware in many cases can identify what
code path it should run on interrupt. Contemporary hardware can assign
them to different interrupt vectors.
Notes:
svn path=/stable/10/; revision=316146
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316093
|
| |
|
|
|
|
|
|
|
|
| |
It was implemented to reduce context switches when uploading firmware to
card's RAM. But this mechanism is not used last 10 years since all mbox
operations are now polled, and it was never used for cards produced in
last 15 years. Newer cards can use DMA to upload firmware.
Notes:
svn path=/stable/10/; revision=316091
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316089
|
| |
|
|
|
|
|
|
|
|
| |
This change fixes DMA resource leak on driver unload. Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware. Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.
Notes:
svn path=/stable/10/; revision=316087
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=315980
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=315978
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=314765
|
| |
|
|
|
|
|
|
| |
Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.
Notes:
svn path=/stable/10/; revision=314759
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------------------------------------
r313568 | ken | 2017-02-10 15:02:45 -0700 (Fri, 10 Feb 2017) | 68 lines
Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.
The isp(4) driver was changing the tag type for REQUEST SENSE
commands to Head of Queue, when the CAM CCB flag
CAM_TAG_ACTION_VALID was NOT set. CAM_TAG_ACTION_VALID is set
when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
and when the target has tagged queueing turned on.
In most cases when CAM_TAG_ACTION_VALID is not set, it is because
the target is not doing tagged queueing. In those cases, trying to
send a Head of Queue tag may cause problems. Instead, default to
sending a simple tag.
IBM tape drives claim to support tagged queueing in their standard
Inquiry data, but have the DQue bit set in the control mode page
(mode page 10). CAM correctly detects that these drives do not
support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
on CCBs sent down to the drives.
This caused the isp(4) driver to go down the path of setting the
tag action to a default value, and for Request Sense commands only,
set the tag action to Head of Queue.
If an IBM tape drive does get a Head of Queue tag, it rejects it with
Invalid Message Error (0x49,0x00). (The Qlogic firmware translates that
to a Transport Error, which the driver translates to an Unrecoverable
HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
to get a good response from a REQUEST SENSE to an FC-attached IBM
tape drive with the isp(4) driver.
IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
with 4470 firmware) also have a bug in that sending a command with a
non-simple tag attribute breaks the tape drive's Command Reference
Number (CRN) accounting and causes it to ignore all subsequent
commands because it and the initiator disagree about the next
expected CRN. The drives do reject the initial command with a head
of queue tag with an Invalid Message Error (0x49,0x00), but after that
they ignore any subsequent commands. IBM confirmed that it is a bug,
and sent me test firmware that fixes the bug. However tape drives in
the field will still exhibit the bug until they are upgraded.
Request Sense is not often sent to targets because most errors are
reported automatically through autosense in Fibre Channel and other
modern transports. ("Modern" meaning post SCSI-2.) So this is not
an error that would crop up frequently. But Request Sense is useful on
tape devices to report status information, aside from error reporting.
This problem is less serious without FC-Tape features turned on,
specifically precise delivery of commands (which enables Command
Reference Numbers), enabled on the target and initiator. Without
FC-Tape features turned on, the target would return an error and
things would continue on.
And it also does not cause problems for targets that do tagged
queueing, because in those cases the isp(4) driver just uses the
tag type that is specified in the CCB, assuming the
CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
tag action if it isn't an ordered or head of queue tag.
sys/dev/isp/isp.c:
In isp_start(), don't try to send Request Sense commands
with the Head of Queue tag attribute if the CCB doesn't
have a valid tag action. The tag action likely isn't valid
because the target doesn't support tagged queueing.
Sponsored by: Spectra Logic
------------------------------------------------------------------------
Notes:
svn path=/stable/10/; revision=313700
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This code was originally implemented 7 years ago, but never really worked
due to trivial error. I think this functionality may be not required.
Initiators supporting optional periodic command status checks detected
those terminated commands and retried them 3 seconds later. But thinking
about less featured initiators and the fact that it is our race makes
virtual ports "unknown" it may be good to have this feature.
Notes:
svn path=/stable/10/; revision=304416
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=300583
|
| |
|
|
|
|
|
|
| |
It is normal for ZOMBIE ports to be logged out. This status is not really
an error until Gone Device Timeout expires, so make CAM retry after delay.
Notes:
svn path=/stable/10/; revision=300581
|
| |
|
|
|
|
|
|
| |
Firmware automatically logs in only to local loop ports, and those ports
can be easily identified without extra flag by zero domain and area IDs.
Notes:
svn path=/stable/10/; revision=300580
|
| |
|
|
|
|
|
| |
ZOMBIE ports are always logged out, and so initiator may try to relogin.
Notes:
svn path=/stable/10/; revision=300578
|
| |
|
|
|
|
|
|
|
| |
Since we no longer need additional buffers for request and response IOCBs,
we can increase receive space by 192 bytes, that is enough for fetching 48
more ports. The new limit is 1020 fabric ports per virtual port.
Notes:
svn path=/stable/10/; revision=298975
|
| |
|
|
|
|
|
|
|
| |
This should close the race between request arriving on new target mode
virtual port and its scanner thread finally fetch its address for request
routing.
Notes:
svn path=/stable/10/; revision=298972
|
| |
|
|
|
|
|
|
|
|
| |
For some reason firmware sends Port Database Changed notifications in case
of explicit login requests from the driver when target port is unavailabe.
Those notifications don't give driver any new information, but only cause
infinite scan loop.
Notes:
svn path=/stable/10/; revision=298970
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=298969
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously we had to do it synchronously because we could not drop the lock
due to potential scratch memory use conflicts. Previous commits fixed that
collision, so here it goes -- slower and less reliable external requests
are executed asynchronously without spinning in tight loop and with more
safe timeout handling.
Notes:
svn path=/stable/10/; revision=298968
|
| |
|
|
|
|
|
|
| |
While technically it is not IOCB, it is synchronous and can be called from
different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient.
Notes:
svn path=/stable/10/; revision=298967
|
| |
|
|
|
|
|
|
|
|
|
| |
Usually IOCBs should be put on queue for asynchronous processing and should
not require additional DMA memory. But there are some cases like aborts and
resets that for external reasons has to be synchronous. Give those cases
separate 2*64 byte DMA area to decouple them from other DMA scratch area
users, using it for asynchronous requests.
Notes:
svn path=/stable/10/; revision=298966
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=298964
|
| |
|
|
|
|
|
| |
Add few more missing cases, unify byte order.
Notes:
svn path=/stable/10/; revision=298963
|
| |
|
|
|
|
|
|
|
|
| |
This is cosmetics that simplifies identification of new ports on FC switch.
It would be good to use target name from CTL here instead of hostname, but
it is not passed here through CAM now.
Notes:
svn path=/stable/10/; revision=298962
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=298961
|
| |
|
|
|
|
|
|
|
|
|
| |
This space does not require DMA syncing. It reduces lock scope of the DMA
scratch space. It allows whole DMA scratch space to be used to I/O, so now
we can fetch up to ~1000 ports from SNS.
Due to the last fact, increase maximal number of ports from 256 to 1024.
Notes:
svn path=/stable/10/; revision=292931
|
| |
|
|
|
|
|
|
| |
This is even more important since it involves more network operations and
more prone to delays and timeouts.
Notes:
svn path=/stable/10/; revision=292924
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change virtual ports control IOCBs were executed synchronously
via Execute IOCB mailbox command. It required exclusive use of scratch
space of driver and mailbox registers of the hardware. Because of that
shared resources use this code could not really sleep, having to spin for
completion, blocking any other operation.
This change introduces new asynchronous design, sending the IOCBs directly
on request queue and gracefully waiting for their return on response queue.
Returned IOCBs are identified with unified handle space from r292725.
Notes:
svn path=/stable/10/; revision=292922
|
| |
|
|
|
|
|
|
|
| |
I am not sure why this was split long ago, but I see no reason for it.
At this point this unification just slightly reduces memory usage, but
as next step I plan to reuse shared handle space for other IOCB types.
Notes:
svn path=/stable/10/; revision=292921
|
| |
|
|
|
|
|
|
| |
Previously it was done only on full chip reinit, that caused old ports
resurrect in case of virtual port reenabling.
Notes:
svn path=/stable/10/; revision=292919
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=292918
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=292916
|
| |
|
|
|
|
|
| |
Add initial support for 16Gbps FC QLogic chips.
Notes:
svn path=/stable/10/; revision=292598
|
| |
|
|
|
|
|
|
|
|
| |
- Make scan aborted by event restart immediately and infinitely.
- Improve handling of some loop events from firmware.
- Remove loop down timer, adding its functionality to scanner thread.
- Some more unification and simplification.
Notes:
svn path=/stable/10/; revision=291532
|
| |
|
|
|
|
|
| |
New name better repsents its meaning for modern chips.
Notes:
svn path=/stable/10/; revision=291531
|
| |
|
|
|
|
|
|
| |
Now target mode works for all supported FC adapters except ancient 2100,
which is not tested.
Notes:
svn path=/stable/10/; revision=291529
|
| |
|
|
|
|
|
|
|
|
| |
Hacks to enable target mode there complicated code, while didn't really
work. And for outdated hardware fixing it is not really interesting.
Initiator mode tested with Qlogic 1080 adapter is still working fine.
Notes:
svn path=/stable/10/; revision=291528
|
| |
|
|
|
|
|
|
|
|
|
| |
Explicitly call SEND CHANGE REQUEST for pre-24xx chips in target mode.
While later firmware always registers for RSCN requests, older one does
it only in initiator mode. But in target mode there RSCN can be the only
way to detect gone intiator.
Notes:
svn path=/stable/10/; revision=291523
|