Commit Graph

258 Commits

Author SHA1 Message Date
Alexander Motin
514a71eba7 Fix delaying requests to unknown virtual ports 2s after init.
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.
2016-05-19 17:48:56 +00:00
Alexander Motin
0bd83292ef Add IOCB debugging for ISPCTL_RESET_DEV and ISPCTL_ABORT_CMD. 2016-05-19 16:53:53 +00:00
Alexander Motin
3a82d79d30 Make RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable.
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.

MFC after:	1 week
2016-05-17 15:12:57 +00:00
Alexander Motin
5fa351ed89 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
2016-05-17 13:18:57 +00:00
Alexander Motin
b2699a1bae No need to check login status for ZOMBIE ports.
ZOMBIE ports are always logged out, and so initiator may try to relogin.

MFC after:	1 weeks
2016-05-16 16:44:34 +00:00
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Alexander Motin
50f2c01d32 Simplify memory allocation for NS requests.
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.

MFC after:	1 month
2016-04-16 06:36:56 +00:00
Alexander Motin
212fad7469 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.
2016-04-14 20:49:01 +00:00
Alexander Motin
ace7039eaa 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.
2016-04-13 10:35:17 +00:00
Alexander Motin
5f2638dabb Respect NVRAM topology settings on 24xx and above chips. 2016-04-13 07:04:04 +00:00
Alexander Motin
1521935737 Make all CT Pass-Through (name server requests) asynchronous.
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.
2016-04-12 18:50:37 +00:00
Alexander Motin
e3188c2f31 Switch isp_getpdb() to synchronous IOCB DMA area.
While technically it is not IOCB, it is synchronous and can be called from
different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient.
2016-04-12 14:43:17 +00:00
Alexander Motin
4ff970c462 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.
2016-04-12 14:19:19 +00:00
Alexander Motin
003c82d713 Add couple missing memory barriers. 2016-04-12 11:48:50 +00:00
Alexander Motin
5e3e6a8241 Polish debugging IOCB dumping.
Add few more missing cases, unify byte order.

MFC after:	1 month
2016-04-11 10:48:26 +00:00
Alexander Motin
7e53e7accc Register symbolic port/node names in FC name server.
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
2016-04-09 14:50:47 +00:00
Alexander Motin
06c5618335 Reduce code duplication when executing Passthrough IOCB.
MFC after:	2 weeks
2016-04-09 11:54:09 +00:00
Alexander Motin
5d084976cb 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.
2015-12-27 06:28:31 +00:00
Alexander Motin
9d8b002160 Make port logins asynchronous, following r292739 logic.
This is even more important since it involves more network operations and
more prone to delays and timeouts.
2015-12-26 06:13:01 +00:00
Alexander Motin
66e979f15c 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.
2015-12-26 04:26:32 +00:00
Alexander Motin
970ceb2fd5 Unify handles allocation for initiator and target IOCBs.
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.
2015-12-25 13:03:18 +00:00
Alexander Motin
a4f43c01c0 Clear virtual port's port database when disabling it.
Previously it was done only on full chip reinit, that caused old ports
resurrect in case of virtual port reenabling.
2015-12-25 03:44:29 +00:00
Alexander Motin
a46709e2ab Some polishing for command timeouts handling. 2015-12-24 14:53:29 +00:00
Alexander Motin
b7200a19e6 Fix speed setting by NVRAM for 24xx and above chips. 2015-12-22 17:01:30 +00:00
Alexander Motin
c7a771a0b5 Guess NVRAM address for 16Gbps Qlogic cards.
I have feeling this approach is wrong, but it works for me so far and
it is better then nothing.
2015-12-10 01:17:30 +00:00
Alexander Motin
8a30def363 There is no priority request queue on 16Gig chips. 2015-12-05 22:07:02 +00:00
Alexander Motin
7bd4b42414 Enable interrupt handshake for 16Gig chips.
We don't support MSI-X so far, so it is always required.
2015-12-03 22:55:40 +00:00
Alexander Motin
218be0b2ee Add initial support for 16Gbps FC QLogic chips.
I still don't know how to read NVRAM there, so WWNs and other parameters
are incorrect, but other then that driver seems like attaching normally.
2015-12-02 20:22:50 +00:00
Alexander Motin
e561aa79fb One more round of port scanner rewrite.
- 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.
2015-11-26 13:04:58 +00:00
Alexander Motin
e2929f5f91 Rename ASYNC_LIP_F8 to ASYNC_LIP_NOS_OLS_RECV.
New name better repsents its meaning for modern chips.
2015-11-24 19:20:49 +00:00
Alexander Motin
a4ccb5d682 Fix target mode support for Qlogic 2200 FC adapters.
Now target mode works for all supported FC adapters except ancient 2100,
which is not tested.
2015-11-23 15:49:50 +00:00
Alexander Motin
3e6deb330e Rip off target mode support for parallel SCSI QLogic adapters.
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.
2015-11-23 10:06:19 +00:00
Alexander Motin
1575756978 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.
2015-11-22 17:03:38 +00:00
Alexander Motin
88912b29b6 Gracefully stop firmware before resetting chip when changing role. 2015-11-22 15:57:54 +00:00
Alexander Motin
4e432bf678 Add some more asynchronous event status codes. 2015-11-22 11:44:30 +00:00
Alexander Motin
ec6d4d0f5d Add mode mailbox command codes. 2015-11-22 11:13:09 +00:00
Alexander Motin
4187a96543 Fix target mode with fabric for pre-24xx chips.
For those chips we are not receiving login events, adding initiators
based on ATIO requests.  But there is no port ID in that structure, so
in fabric mode we have to explicitly fetch it from firmware to be able
to do normal scan after that.
2015-11-21 21:01:00 +00:00
Alexander Motin
1fd7e8637c Some cosmetics for ancient cards. 2015-11-20 14:20:24 +00:00
Alexander Motin
1e0e8c83b5 Optimize SNS_GID_FT request scratch memory usage.
Now with present 4K of scratch we can fetch up to 508 ports (16 more).
2015-11-20 08:54:19 +00:00
Alexander Motin
eea52482f9 Another round of port scanner rewrite.
This change simplifies and unifies port adding/updating for loop and
fabric scanners.  It also fixes problems with scanning restarts due to
concurrent port databases changes.  It also fixes many cosmetic issues.
2015-11-19 17:43:47 +00:00
Alexander Motin
c61fdcb93c Simplify fabric tasting code.
Except cosmetic changes this removes fabric ports from our port database.
It is always firmware duty to manage them, so driver don't need to worry.
2015-11-18 12:39:20 +00:00
Alexander Motin
c5fd36edc7 Remove some confusions between loopid and nphdl.
Modern cards in most cases operate abstract port handles, that have no
any relation to real loop IDs.  Leave loopid used only where it really
goes about local loop IDs.

While there, fix few more cases where LUNs were still printed in decimal.
2015-11-18 11:14:59 +00:00
Alexander Motin
92056a05e5 Register our FC4 Features in SNS. 2015-11-17 19:57:49 +00:00
Alexander Motin
955d53eedc Cosmetic addition to r290993. 2015-11-17 16:46:05 +00:00
Alexander Motin
b6bd5f7fc1 Unify and cleanup FC ports scan. 2015-11-17 16:33:46 +00:00
Alexander Motin
6955aeb2c3 Off-by-one correctiont to r290980. 2015-11-17 14:22:56 +00:00
Alexander Motin
53c0eee354 Make firmware handle virtual ports SNS logins for us. 2015-11-17 14:13:55 +00:00
Alexander Motin
6d53b0a7aa Add real initial support for RQSTYPE_RPT_ID_ACQ. 2015-11-17 13:02:44 +00:00
Alexander Motin
277911a38e Rework r290504. 2015-11-07 19:33:57 +00:00
Alexander Motin
7b6371ca7c Specify VP when sending a marker. 2015-11-07 19:03:47 +00:00