summaryrefslogtreecommitdiffstats
path: root/sys/cam/ctl/ctl_frontend_iscsi.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r314659,r314676:ngie2017-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | r314659: usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output r314676: Fix build after r314656 Some of the changes I introduced to use .ALLSRC were correct in spirit, but incorrect in reality -- in particular, ../Makefile.inc hadn't been pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk explicitly so we can be certain that the values used as dependencies in the targets are defined when the target recipe has been evaluated. Reminder: thou shalt separate out separate functional changes before committing them. (YUGE) Pointyhat to: ngie In collaboration with: bdrewery
* MFC r316653: Fix few minor issues found by Clang Analyzer.mav2017-04-231-3/+9
|
* MFC r311283:trasz2017-03-181-1/+2
| | | | | | Don't release the cfiscsi session refcount too early. It wasn't observed to fix any actual error, but it's the right thing to do from the correctness point of view.
* MFC r313854, r313963: Change the way MaxCmdSN is used.mav2017-03-031-6/+6
| | | | | | | | | | | | Before this change MaxCmdSN was reported as CmdSN + delta, that made it limit number of requests in transmission from the initiator to target, that was pretty useless. After this change MaxCmdSN limits number of requests queued to CTL, i.e. maximal queue depth for the initiator. The default limit is 256 outstanding requests per initiator at a time. This code uses existing cs_outstanding_ctl_pdus counter to track queue depth. It's semantics doen't perfectly match, but close enough to not add another counter. Just don't set the maxtags below 2.
* MFC r312603: Add initial support for CTL module unloading.mav2017-02-071-2/+21
| | | | | | It is only a first step and not perfect, but better then nothing. The main blocker is CAM target frontend, that can not be unloaded, since CAM does not have mechanism to unregister periph driver now.
* MFC r312291, r312669:mav2017-02-071-9/+10
| | | | | | | | | | | | | | Make CTL frontends report kern_data_resid for under-/overruns. It seems like kern_data_resid was never really implemented. This change finally does it. Now frontends update this field while transferring data, while CTL/backends getting it can more flexibly handle the result. At this point behavior should not change significantly, still reporting errors on write overrun, but that may be changed later, if we decide so. CAM target frontend still does not properly handle overruns due to CAM API limitations. We may need to add some fields to struct ccb_accept_tio to pass information about initiator requested transfer size(s).
* MFC r312343: Improve error message on duplicate iSCSI port.mav2017-02-071-1/+2
|
* Report negotiated MaxBurstLength and FirstBurstLength in "iscsictl -v"trasz2016-06-051-0/+5
| | | | | | and "ctladm islist -v" outputs. MFC after: 1 month
* Add mechanism for choosing iSER-capable ICL modules.trasz2016-05-241-2/+3
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add icl_conn_connect() ICL method, required for iSER.trasz2016-05-171-0/+1
| | | | | | Obtained from: Mellanox Technologies (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Set bhsdi_target_transfer_tag to reserved value, which is 0xffffffff.mav2016-03-041-0/+1
| | | | This should be a purely cosmetic change.
* Give CTL support for PIM_EXTLUNS when talking to CAM.mav2015-10-241-58/+3
| | | | | CTL itself still lives in flat LUN space, but it can generate extended numbers if CAM SIM reports such capability.
* Remove some dead code found by Clang analyzer.mav2015-09-251-2/+1
|
* Remove some control_softc references.mav2015-09-251-1/+0
|
* Log iSCSI session reinstatements.mav2015-09-211-0/+10
| | | | | False session reinstatements can be result of misconfiguration, when several initiators use the same initiator name and ISID.
* Mark with DMA flag I/Os waiting for iSCSI write data after R2T.mav2015-09-201-0/+5
| | | | Reads and immediate writes are not blocking, so don't bother.
* Implement QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT.mav2015-09-141-10/+34
| | | | Now we support most of SAM-5 task management.
* Map CLEAR TASK SET and I_T NEXUS RESET for iSCSI.mav2015-09-131-0/+12
| | | | The last should not be called without iSCSIProtocolLevel negotiation.
* Implement iSCSI TARGET COLD RESET task management function.mav2015-09-131-1/+23
| | | | Implement it as CTL_TASK_TARGET_RESET plus termination of all sessions.
* Reimplement CTL High Availability.mav2015-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | CTL HA functionality was originally implemented by Copan many years ago, but large part of the sources was never published. This change includes clean room implementation of the missing code and fixes for many bugs. This code supports dual-node HA with ALUA in four modes: - Active/Unavailable without interlink between nodes; - Active/Standby with second node handling only basic LUN discovery and reservation, synchronizing with the first node through the interlink; - Active/Active with both nodes processing commands and accessing the backing storage, synchronizing with the first node through the interlink; - Active/Active with second node working as proxy, transfering all commands to the first node for execution through the interlink. Unlike original Copan's implementation, depending on specific hardware, this code uses simple custom TCP-based protocol for interlink. It has no authentication, so it should never be enabled on public interfaces. The code may still need some polishing, but generally it is functional. Relnotes: yes Sponsored by: iXsystems, Inc.
* Remove unused target and initiator IDs.mav2015-09-101-6/+3
|
* Make most of port methods optional and remove bunch of dummies.mav2015-09-011-19/+0
|
* Drop "internal" CTL frontend.mav2015-08-151-1/+0
| | | | | | Its idea was to be a simple initiator and execute several commands from kernel level, but FreeBSD never had consumer for that functionality, while its implementation polluted many unrelated places..
* Bring per-port LUN enable/disable code up to date:mav2015-06-201-6/+4
| | | | | | | | | | - remove last remnants of never implemented multiple targets support; - implement missing support for LUN mapping in this area. Due to existing locking constraints LUN mapping code is practically unlocked at this point. Hopefully it is not racy enough to live until somebody get idea how to call sleeping fronend methods under lock also taken by the same frontend in non-sleepable context. :(
* Fix ordering of "*logout" and "*terminate"; no functional changes.trasz2015-02-081-40/+40
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Extend ICL to add receive offload methods. For software ICL backendtrasz2015-02-081-11/+57
| | | | | | | they are no-ops. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Make it possible to set (via ctl.conf(5)) and query (via ctladm islist -v)trasz2015-02-061-5/+34
| | | | | | | | | target iSCSI offload. Add mechanism to query maximum receive data segment size supported by chosen hardware offload module, and use it in ctld(8) to determine the value to advertise to the other side. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Bring some more order into iSCSI portal group tags support.mav2015-02-031-19/+29
| | | | | | | | While ctld(8) still does not allow multiple portal groups per target to be configured, kernel should now be able to handle it. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* CTL LUN mapping rewrite.mav2015-02-011-98/+1
| | | | | | | | | | | | | | | | | | | | | Replace iSCSI-specific LUN mapping mechanism with new one, working for any ports. By default all ports are created without LUN mapping, exposing all CTL LUNs as before. But, if needed, LUN mapping can be manually set on per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2). The next step will be to teach ctld to work with FibreChannel ports also. Respecting additional flexibility of the new mechanism, ctl.conf now allows alternative syntax for LUN definition. LUNs can now be defined in global context, and then referenced from targets by unique name, as needed. It allows same LUN to be exposed several times via multiple targets. While there, increase limit for LUNs per target in ctld from 256 to 1024. Some initiators do not support LUNs above 255, but that is not our problem. Discussed with: trasz MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc.
* Add kobj interface between ICL and the rest of the iSCSI stack.trasz2015-01-311-1/+3
| | | | | | | Review note - icl.c was moved to icl_soft.c. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Make sequence numbers checks more strict.mav2014-12-171-11/+37
| | | | | | | | | | While we don't support MCS, hole in received sequence numbers may mean only PDU loss. While we don't support lost PDU recovery, terminate the connection to avoid stuck commands. While there, improve handling of sequence numbers wrap after 2^32 PDUs. MFC after: 2 weeks
* Coalesce last data move and command status for read commands.mav2014-11-251-7/+31
| | | | | | | | | | | | | | | Make CTL core and block backend set success status before initiating last data move for read commands. Make CAM target and iSCSI frontends detect such condition and send command status together with data. New I/O flag allows to skip duplicate status sending on later fe_done() call. For Fibre Channel this change saves one of three interrupts per read command, increasing performance from 126K to 160K IOPS. For iSCSI this change saves one of three PDUs per read command, increasing performance from 1M to 1.2M IOPS. MFC after: 1 month Sponsored by: iXsystems, Inc.
* Replace home-grown CTL IO allocator with UMA.mav2014-11-241-18/+0
| | | | | | | | | | | | | | | | | | Old allocator created significant lock congestion protecting its lists of preallocated I/Os, while UMA provides much better SMP scalability. The downside of UMA is lack of reliable preallocation, that could guarantee successful allocation in non-sleepable environments. But careful code review shown, that only CAM target frontend really has that requirement. Fix that making that frontend preallocate and statically bind CTL I/O for every ATIO/INOT it preallocates any way. That allows to avoid allocations in hot I/O path. Other frontends either may sleep in allocation context or can properly handle allocation errors. On 40-core server with 6 ZVOL-backed LUNs and 7 iSCSI client connections this change increases peak performance from ~700K to >1M IOPS! Yay! :) MFC after: 1 month Sponsored by: iXsystems, Inc.
* Read cs_outstanding_ctl_pdus before incrementing it for NEXUS RESET task.mav2014-11-241-1/+1
| | | | | | This removes extra log noise on idle connection termination. MFC after: 1 week
* Make iSCSI frontend less chatty while waiting for tasks termination.mav2014-11-221-3/+7
| | | | MFC after: 1 week
* Make cfiscsi_offline() synchronous, waiting for connections terminationmav2014-11-211-0/+10
| | | | | | before return. This should make ctld restart more clean and predictable. MFC after: 2 weeks
* Close race between cfiscsi_offline() and new connection arrival.mav2014-11-211-15/+17
| | | | Incoming connection should be either rejected or accepted and terminated.
* Partially reconstruct Active/Standby clusting.mav2014-11-211-1/+1
| | | | | | | | | In this mode one head is in Active state, supporting all commands, while another is in Standby state, supporting only minimal LUN discovery subset. It is still incomplete since Standby state requires reservation support, which is impossible to do right without having interlink between heads. But it allows to run some basic experiments.
* Fix typo.trasz2014-11-191-1/+1
| | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* s/icl_pdu_new_bhs/icl_pdu_new/; no functional changes, just a littletrasz2014-11-031-5/+5
| | | | | | nicer code. Sponsored by: The FreeBSD Foundation
* Change the default log level for iSCSI target from 3 to 1. It shouldtrasz2014-10-311-1/+1
| | | | | | | have been 1 from the beginning; not sure how it ended up at 3. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Give physical and virtual ports numbers some more meaning.mav2014-10-111-2/+6
|
* Make iSCSI connection close somewhat less aggressive.mav2014-10-091-1/+0
| | | | | | It allows to push out some final data from the send queue to the socket before its close. In particular, it increases chances for logout response to be delivered to the initiator.
* Add support for MaxBurstLength and Expected Data transfer Length parameters.mav2014-10-061-16/+64
| | | | | | | | | | | | | | | Before this change target could send R2T request for write transfer of any size, that could violate iSCSI RFC, which allows initiator to limit maximum R2T size by negotiating MaxBurstLength connection parameter. Also report an error in case of write underflow, when initiator provides less data than initiator expects. Previously in such case our target sent R2T request for non-existing data, violating the RFC, and confusing some initiators. SCSI specs don't explicitly define how write underflows should be handled and there are different oppinions, but reporting error is hopefully better then violating iSCSI RFC with unpredictable results. MFC after: 2 weeks
* Fix read overrun handling, broken by using wrong variable.mav2014-09-221-3/+3
| | | | MFC after: 3 days
* Make sure we handle less than zero timeouts in iSCSI initiator and targettrasz2014-09-101-1/+1
| | | | | | in a reasonable way. Sponsored by: The FreeBSD Foundation
* Make it possible to disable NOP-In PDUs by the iSCSI initiator by settingtrasz2014-09-101-0/+13
| | | | | | | | | kern.cam.ctl.iscsi.ping_timeout to 0. This fixes interoperability with some initiators that don't properly support NOP-Ins, namely iPXE/gPXE. Submitted by: Chen Wen <pokkys@gmail.com> MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Use proper include paths in kernel iSCSI code.trasz2014-08-211-3/+3
| | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Fix ctl(4) kldload failure that manifested like this:trasz2014-07-251-0/+1
| | | | | | | | | link_elf_obj: symbol icl_pdu_new_bhs undefined PR: 192031 Submitted by: Nils Beyer (earlier version) MFC after: 3 days Sponsored by: FreeBSD Foundation
* Add support for VMWare dialect of EXTENDED COPY command, aka VAAI Clone.mav2014-07-161-1/+1
| | | | | | | | | | | | | | | This allows to clone VMs and move them between LUNs inside one storage host without generating extra network traffic to the initiator and back, and without being limited by network bandwidth. LUNs participating in copy operation should have UNIQUE NAA or EUI IDs set. For LUNs without these IDs VMWare will use traditional copy operations. Beware: the above LUN IDs explicitly set to values non-unique from the VM cluster point of view may cause data corruption if wrong LUN is addressed! MFC after: 2 weeks Sponsored by: iXsystems, Inc.
OpenPOWER on IntegriCloud