aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_freebsd.h
Commit message (Collapse)AuthorAgeFilesLines
* More cleanup in response queue and reset code.Alexander Motin2020-11-261-1/+0
| | | | Notes: svn path=/head/; revision=368079
* Remove more legacy of parallel SCSI.Alexander Motin2020-11-241-14/+5
| | | | Notes: svn path=/head/; revision=368001
* Remove concept of mbox_sleep_ok.Alexander Motin2020-11-241-14/+0
| | | | | | | | | | | | | It was broken by design and unused for years due to conflicts between different threads, fighting for the same set of mailbox registers, not designed for multiple requests at a time. So either request has to be synchronous and spin under the lock, or it should be sent asynchronously through the queues as Mailbox Command IOCB or some other way. This removes any OS specifics from the wait code, so it can be inlined. Notes: svn path=/head/; revision=367986
* Remove remnants of execthrottle and maxalloc parameters.Alexander Motin2020-11-221-2/+0
| | | | | | | | The first was obsolete since 26xx, not used on 25xx and not needed on 24xx. The second seems never worked on 24xx and up. Notes: svn path=/head/; revision=367924
* Increase queue depths from 1024/256 to 8192/1024 IOCBs.Alexander Motin2020-11-201-2/+0
| | | | | | | | | | | | | | Qlogic chips store S/G lists in the same queue as requests themselves. In the worst case 1MB I/O may require up to 52 IOCBs, that means queue of 1024 IOCBs can store only 19 of such requests. The increase reduces chances of overflow, while we should be able to afford additional 512KB of RAM per HBA. The Linux driver uses comparable numbers. While there, decouple ATIO queue size from response queue size. There is no reason for them to be equal. Notes: svn path=/head/; revision=367909
* Cleanup DMA handling.Alexander Motin2020-11-201-1/+7
| | | | | | | | | | | | - Make isp_start() to set all the IOCB fields aside of S/G list, removing extra information from isp_send_cmd(), now only doing S/G lists and sending. - Turn DMA setup/free from being card and PCI-specific into OS-specific, instead add new card-specific method for isp_send_cmd(). Previously this function was a monster handling all the cards. - Remove double error code translation. Notes: svn path=/head/; revision=367906
* Remove parallel SCSI and 1/2Gb FC support from isp(4).Alexander Motin2020-11-201-91/+11
| | | | | | | | | | | | | | | | | | | | | This removes 288KB (36%) of the driver code and zillions of hacks and workarounds, making single driver uniformly support several different generations of hardware interfaces, not counting minor card variations. After years of the hopeless fight, I don't think it worth to continue support for hardware obsolete for 15-20 years. Instead much cleaner now code should allow to move forward toward better locking, multiple queues and other cool features. All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use the same hardware/firmware interface with minor incremental improvements, so it seems to be a good new starting point. Except one PCI-X model all all of them are PCIe and so still usable in modern systems. Discussed with: ken, scottl, jpaetzel, imp Relnotes: yes Notes: svn path=/head/; revision=367857
* Move ecmd memory allocation itto separate DMA tag.Alexander Motin2020-11-181-1/+5
| | | | | | | | | | | Ecmd memory is not directly related to the request queue, only referenced from it sometimes in target mode. Separate allocation should be easier in case of fragmented memory and can be skipped when target is not built. MFC after: 1 month Notes: svn path=/head/; revision=367784
* Introduce support of SCSI Command Priority.Alexander Motin2020-10-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SAM-3 specification introduced concept of Task Priority, that was renamed to Command Priority in SAM-4, and supported by all modern SCSI transports. It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and 0 - default. SAT specification for SATA devices translates priorities 1-3 into NCQ high priority. This change adds new "priority" field into empty spots of struct ccb_scsiio and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL. Respective support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers for both initiator and where applicable target roles. Minimal support was added to CTL to receive the priority value from different frontends, pass it between HA controllers and report in few places. This patch does not add consumers of this functionality, so nothing should really change yet, since the field is still set to 0 (default) on initiator and not actively used on target. Those are to be implemented separately. I've confirmed priority working on WD Red SATA disks connected via mpr(4) and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4). While there, added missing tag_action support to ocs_fc(4) initiator role. MFC after: 1 month Relnotes: yes Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=367044
* Remove sparc64 kernel supportWarner Losh2020-02-031-4/+0
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326255
* Unify initiator and target DMA setup and command sending.Alexander Motin2017-03-241-1/+7
| | | | | | | | | The code is so alike that it is pointless to keep it separate. MFC after: 2 weeks Notes: svn path=/head/; revision=315908
* isp field in struct isp_pcmd is also unused.Alexander Motin2017-03-231-1/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315870
* Remove write-only crn field from struct isp_pcmd.Alexander Motin2017-03-231-1/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315869
* Cleanup response queue processing.Alexander Motin2017-03-221-20/+11
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315708
* Improve command timeout handling.Alexander Motin2017-03-211-2/+3
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=315681
* Clean/unify some macro usage.Alexander Motin2017-03-211-12/+4
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315677
* Remove some more dead code.Alexander Motin2017-03-201-10/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315652
* Add initial support for multiple MSI-X vectors.Alexander Motin2017-03-191-2/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=315579
* Remove not very useful ATIO/INOT stats.Alexander Motin2017-03-151-2/+0
| | | | | | | | | While there polish respective debug logging. MFC after: 2 weeks Notes: svn path=/head/; revision=315327
* Remove tangled isp_mbox_continue() mechanism.Alexander Motin2017-03-141-5/+5
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=315273
* Improvements around attach, reset and detach.Alexander Motin2017-03-141-1/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=315234
* Remove strange config_intrhook_establish() magic.Alexander Motin2017-03-121-2/+0
| | | | | | | | | | Interrupts are enabled as part of chip reset just during driver attach. Later "enabling" of already enabled interrupts is useless. MFC after: 2 weeks Notes: svn path=/head/; revision=315163
* Try to slight untangle I/O and loop status handling.Alexander Motin2017-03-121-2/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315161
* Remove code for unsupported FreeBSD versions.Alexander Motin2017-03-121-5/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315160
* Send TERMINATE to firmware when aborting active ATIO.Alexander Motin2017-02-271-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314326
* Return better error code in case of too long CDB.Alexander Motin2017-02-261-0/+1
| | | | | | | | | | 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. MFC after: 2 weeks Notes: svn path=/head/; revision=314302
* Fix multiple problems around LUN disable under load.Alexander Motin2017-02-221-21/+24
| | | | | | | | | | | | | | | | | | | | - Move private data about ATIOs/INOTs from per-LUN to per-channel data. This allows active commands to continue operation after LUN destruction. This also simplifies lookup of the data by tag in some situations. - Unify three restart_queue processing implementations. - Complete all ATIOs from restart_queue on LUN disable. - Delete ATIO private data when command completed or aborted, not depending on the ATIO being requeued, that was ugly hack and could never happen. CAM should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT. - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4). - Unify isp_endcmd() arguments to make it more usable in generic code. - Remove never really used LUN state reference counter. MFC after: 2 weeks Notes: svn path=/head/; revision=314086
* Remove ancient __FreeBSD_version checks.Alexander Motin2017-02-211-8/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314038
* Move CTIO waitq from per-LUN to per-channel.Alexander Motin2017-02-191-4/+5
| | | | | | | | | | | | | All resources lack of which may put CTIO into the queue are either per-channel or potentially per-queue, but none of them are per-LUN. This is a first step to fix live LUN disabling. Before this change any CTIOs held in a queue in time of disabling were just leaked. MFC after: 2 weeks Notes: svn path=/head/; revision=313936
* Allocate separate DMA area for synchronous IOCB execution.Alexander Motin2016-04-121-0/+18
| | | | | | | | | | | 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=/head/; revision=297858
* Register symbolic port/node names in FC name server.Alexander Motin2016-04-091-0/+1
| | | | | | | | | | | | 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. MFC after: 2 weeks Notes: svn path=/head/; revision=297751
* Split DMA buffers for request, response and ATIO queues.Alexander Motin2015-12-271-20/+22
| | | | Notes: svn path=/head/; revision=292764
* Use single DMA tag for scratch areas of all virtual ports.Alexander Motin2015-12-261-7/+7
| | | | Notes: svn path=/head/; revision=292745
* Make 16Gig chips to use new queue pointer registers.Alexander Motin2015-12-041-8/+7
| | | | | | | | While 24xx-style ATIO and reply queue registers seems like still working, request queue doesn't. So instead of that use registers from PCI BAR(4). Notes: svn path=/head/; revision=291821
* One more round of port scanner rewrite.Alexander Motin2015-11-261-7/+4
| | | | | | | | | | - 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=/head/; revision=291365
* Remove "disable" hint, which duplicates system-wide "disabled".Alexander Motin2015-11-231-1/+0
| | | | Notes: svn path=/head/; revision=291221
* Rip off target mode support for parallel SCSI QLogic adapters.Alexander Motin2015-11-231-28/+5
| | | | | | | | | | 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=/head/; revision=291188
* Fix/improve CRN tracking.Alexander Motin2015-11-141-1/+1
| | | | Notes: svn path=/head/; revision=290830
* Rework r290504.Alexander Motin2015-11-071-2/+2
| | | | Notes: svn path=/head/; revision=290507
* Make ISP_SLEEP() really sleep instead of spinning.Alexander Motin2015-11-071-2/+8
| | | | | | | While there, simplify the wait logic. Notes: svn path=/head/; revision=290504
* Add PIM_EXTLUNS support to isp(4) driver.Alexander Motin2015-10-241-7/+5
| | | | | | | | | Now 24xx and above chips support full 8-byte LUN address space. Older FC chips may support up to 16K LUNs when firmware allows. Tested in both initiator and target modes for 23xx, 24xx and 25xx. Notes: svn path=/head/; revision=289882
* Remove ISP_INTERNAL_TARGET code.Alexander Motin2015-10-241-12/+0
| | | | | | | We have CTL now, which is real and much more functional then this joke. Notes: svn path=/head/; revision=289877
* Disable full bus scan by CAM for FC adapters.Alexander Motin2015-10-231-1/+0
| | | | | | | | | FC port database code already notifies CAM about all devices. Additional full scan is just a waste of time, that by definition won't find anything that is not present in port database. Notes: svn path=/head/; revision=289817
* Fix Fibre Channel Command Reference Number handling in the isp(4) driver.Kenneth D. Merry2015-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=276839
* Some microoptimizations.Alexander Motin2014-11-261-1/+2
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=275118
* Fix build without INVARIANTS, broken by r274675.Alexander Motin2014-11-191-3/+3
| | | | Notes: svn path=/head/; revision=274708
* Convert the refire_notify_ack timer from timeout(9) to callout(9).John Baldwin2014-11-181-0/+2
| | | | | | | Tested by: no one Notes: svn path=/head/; revision=274675
* Fix a kernel panic when unloading isp(4).Will Andrews2014-09-181-0/+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. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1070921 on 2014/06/22 13:01:17 Notes: svn path=/head/; revision=271731
* Use relaxed (write-only) memory barriers when writing some of queue indexAlexander Motin2013-11-101-0/+33
| | | | | | | | registers (for now on ISP2400+). We never read those registers back and AFAIK their semantics does not require any immediate reaction on write. Notes: svn path=/head/; revision=257932