|
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0 |
|
| #
5d949247 |
| 17-May-2019 |
Kenneth D. Merry <[email protected]> |
MFC r345008: ------------------------------------------------------------------------ r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines
Fix CRN resets in the isp(4) drive
MFC r345008: ------------------------------------------------------------------------ r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines
Fix CRN resets in the isp(4) driver in certain situations.
The Command Reference Number (CRN) is part of the FC-Tape features that we enable when talking to tape drives. It starts at 1, and goes to 255 and wraps around to 1. There are a number of reset type conditions that result in the CRN getting reset to 1. These are detailed in section 4.10 (table 8) of the FCP-4r02b specification.
One of the conditions is when a PRLI (Process Login) is sent by the initiator, and the Establish Image Pair bit is set in Word 0 of the PRLI.
Previously, the isp(4) driver core sent a notification via isp_async() that the target had changed or stayed in place, but there was no indication of whether a PRLI was sent and whether the Establish Image Pair bit was set.
The result of this was that in some situations, notably switching back and forth between a direct connection and a switch connection to a tape drive, the isp(4) driver would fail to reset the CRN in situations that require it according to the spec. When the CRN isn't reset in a situation that requires it, the tape drive then rejects every subsequent command that is sent to the drive. It is assuming that the commands are being sent out of order.
So, modify the isp(4) driver to include Word 0 of the PRLI command when it sends isp_async() notifications of target changes. Look at the Establish Image Pair bit, and reset the CRN if that bit is set.
With this change, I am able to switch a tape drive back and forth between a direct connection and a switch connection, and the isp(4) driver resets the CRN when it should.
sys/dev/isp_stds.h: Add bit definitions for PRLI Word 0.
sys/dev/ispmbox.h: Add PRLI Word 0 to the port database type, isp_pdb_t.
sys/dev/ispvar.h Add PRLI Word 0 to fcportdb_t.
sys/dev/isp.c: Populate the new prli_word0 parameter in the port database.
In isp_pdb_add_update(), add a check to see if the Establish Image Pair bit is set in PRLI Word 0. If it is, then that is an additional reason to create a change notification.
sys/dev/isp_freebsd.c: In isp_async(), if the device changed or stayed, look at PRLI Word 0 to see if the Establish Image Pair bit is set. If it is, reset the CRN if we haven't already.
Sponsored by: Spectra Logic
------------------------------------------------------------------------ Differential Revision: https://reviews.freebsd.org/D19472
show more ...
|
|
Revision tags: release/12.0.0, release/11.2.0 |
|
| #
14e084ad |
| 28-Feb-2018 |
Alexander Motin <[email protected]> |
Add support for Enhanced Gen 5 (16Gb) and Gen 6 (32Gb) QLogic FC HBAs.
MFC after: 2 weeks Sponsored by: iXsystems, Inc.
|
| #
718cf2cc |
| 27-Nov-2017 |
Pedro F. Giffuni <[email protected]> |
sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
|
Revision tags: release/10.4.0, release/11.1.0 |
|
| #
a94fab67 |
| 03-Jul-2017 |
Alexander Motin <[email protected]> |
Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.
Instead of using GID_FT SNS request to get list of registered FCP ports, use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or G
Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.
Instead of using GID_FT SNS request to get list of registered FCP ports, use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or GFT_ID requests to find whether they are FCP and target capable.
The problem with old approach is that GID_FT does not report ports without FC-4 type registered. In particular it was impossible to boot OS from FreeBSD FC target using QLogic FC BIOS, since one does not register FC-4 type even on new cards and so ignored by old code as incompatible.
As a side bonus this allows initiator to skip pointless logins to other initiators by fetching that information from SNS instead.
In case some switches do not implement GFF_ID/GFT_ID correctly, add sysctls to disable that functionality. I handled broken GFF_ID of my Brocade 200E, but there may be other switches with different bugs.
Linux also uses GID_PT, but GFF_ID is disabled by default there, and GFT_ID is not supported.
Sponsored by: iXsystems, Inc.
show more ...
|
| #
57b6261f |
| 03-May-2017 |
Kenneth D. Merry <[email protected]> |
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
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 MFC after: 1 week
show more ...
|
| #
7e31684e |
| 24-Mar-2017 |
Alexander Motin <[email protected]> |
Unify initiator and target DMA setup and command sending.
The code is so alike that it is pointless to keep it separate.
MFC after: 2 weeks
|
| #
2d24b6af |
| 22-Mar-2017 |
Alexander Motin <[email protected]> |
Cleanup response queue processing.
MFC after: 2 weeks
|
| #
31c161a6 |
| 21-Mar-2017 |
Alexander Motin <[email protected]> |
Improve command timeout handling.
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
Improve command timeout handling.
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.
MFC after: 2 weeks
show more ...
|
| #
98339da1 |
| 20-Mar-2017 |
Alexander Motin <[email protected]> |
Remove some more dead code.
MFC after: 2 weeks
|
| #
9abc1e2b |
| 19-Mar-2017 |
Alexander Motin <[email protected]> |
Remove some useless code.
MFC after: 2 weeks
|
| #
08826086 |
| 19-Mar-2017 |
Alexander Motin <[email protected]> |
Add initial support for multiple MSI-X vectors.
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 loc
Add initial support for multiple MSI-X vectors.
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.
MFC after: 2 weeks
show more ...
|
| #
9c81a61e |
| 19-Mar-2017 |
Alexander Motin <[email protected]> |
Remove hackish code delaying ATIOs to unknown virtual port.
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
Remove hackish code delaying ATIOs to unknown virtual port.
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.
MFC after: 2 weeks
show more ...
|
| #
0e6bc811 |
| 15-Mar-2017 |
Alexander Motin <[email protected]> |
Refactor interrupt handling.
Instead of single isp_intr() function doing all possible magic, introduce four different functions to handle mailbox operation completions, async events, response and AT
Refactor interrupt handling.
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.
MFC after: 2 weeks
show more ...
|
| #
9c2e9bcf |
| 14-Mar-2017 |
Alexander Motin <[email protected]> |
Remove some dead/broken code paths around async handling
MFC after: 2 weeks
|
| #
6327b0d2 |
| 14-Mar-2017 |
Alexander Motin <[email protected]> |
Remove tangled isp_mbox_continue() mechanism.
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 operat
Remove tangled isp_mbox_continue() mechanism.
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.
MFC after: 2 weeks
show more ...
|
| #
a1fa0267 |
| 14-Mar-2017 |
Alexander Motin <[email protected]> |
Improvements around attach, reset and detach.
This change fixes DMA resource leak on driver unload. Also it removes DMA resources allocation for hardcoded number of requests before fetching the rea
Improvements around attach, reset and detach.
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.
MFC after: 2 weeks
show more ...
|
|
Revision tags: release/11.0.1, release/11.0.0 |
|
| #
352427b3 |
| 19-May-2016 |
Alexander Motin <[email protected]> |
Add proper reporting for early task management errors.
This covers unknown requests and requests to unknown virtual ports. Previously it "worked" only because of timeout handling on initiator.
|
| #
5fa351ed |
| 17-May-2016 |
Alexander Motin <[email protected]> |
Completely remove broken now autologin port flag.
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.
M
Completely remove broken now autologin port flag.
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.
MFC after: 1 week
show more ...
|
| #
453130d9 |
| 03-May-2016 |
Pedro F. Giffuni <[email protected]> |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
| #
212fad74 |
| 14-Apr-2016 |
Alexander Motin <[email protected]> |
Extract virtual port address from RQSTYPE_RPT_ID_ACQ.
This should close the race between request arriving on new target mode virtual port and its scanner thread finally fetch its address for request
Extract virtual port address from RQSTYPE_RPT_ID_ACQ.
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.
show more ...
|
| #
ace7039e |
| 13-Apr-2016 |
Alexander Motin <[email protected]> |
Filter Port Database Changed notifications.
For some reason firmware sends Port Database Changed notifications in case of explicit login requests from the driver when target port is unavailabe. Thos
Filter Port Database Changed notifications.
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.
show more ...
|
| #
5f2638da |
| 13-Apr-2016 |
Alexander Motin <[email protected]> |
Respect NVRAM topology settings on 24xx and above chips.
|
| #
4ff970c4 |
| 12-Apr-2016 |
Alexander Motin <[email protected]> |
Allocate separate DMA area for synchronous IOCB execution.
Usually IOCBs should be put on queue for asynchronous processing and should not require additional DMA memory. But there are some cases li
Allocate separate DMA area for synchronous IOCB execution.
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.
show more ...
|
|
Revision tags: release/10.3.0 |
|
| #
5d084976 |
| 27-Dec-2015 |
Alexander Motin <[email protected]> |
Allocate separate scratch space for scanner purposes.
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, s
Allocate separate scratch space for scanner purposes.
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.
show more ...
|
| #
66e979f1 |
| 26-Dec-2015 |
Alexander Motin <[email protected]> |
Make virtual ports control asynchronous.
Before this change virtual ports control IOCBs were executed synchronously via Execute IOCB mailbox command. It required exclusive use of scratch space of d
Make virtual ports control asynchronous.
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.
show more ...
|