aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iscsi
Commit message (Collapse)AuthorAgeFilesLines
* iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive()Mark Johnston2023-12-261-4/+4
| | | | | | Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43148
* sockets: don't malloc/free sockaddr memory on accept(2)Gleb Smirnoff2023-11-301-6/+4
| | | | | | | | | | | | | | Let the accept functions provide stack memory for protocols to fill it in. Generic code should provide sockaddr_storage, specialized code may provide smaller structure. While rewriting accept(2) make 'addrlen' a true in/out parameter, reporting required length in case if provided length was insufficient. Our manual page accept(2) and POSIX don't explicitly require that, but one can read the text as they do. Linux also does that. Update tests accordingly. Reviewed by: rscheff, tuexen, zlei, dchagin Differential Revision: https://reviews.freebsd.org/D42635
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-274-4/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* iscsi: adjust shutdown_pre_sync handlerMitchell Horne2023-11-231-2/+4
| | | | | | | | | | | Don't attempt to service reconnections if RB_NOSYNC is set. More crucially, don't do it if the scheduler is stopped, as the maintenance thread will never run again. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42342
* shutdown: audit shutdown_post_sync event callbacksMitchell Horne2023-11-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Ensure they are all panic/debugger safe. Most handlers for this event are for disk drivers/geom modules. There are a mix of checks being used here (or not), so let's standardize on checking the presence of the RB_NOSYNC flag. This flag is set whenever: 1. The kernel has panicked and kern.sync_on_panic=0* 2. We reboot from within the kernel debugger (the "reset" command) 3. Userspace requested it, e.g. by 'reboot -n' Name the functions consistently. *This sysctl is tuned to zero by default, but its existence means that these handlers can be executed after a panic, at the user's discretion. IMO this use-case is implicitly understood to be risky, and we'd be better off eliminating it altogether. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42337
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-164-8/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-165-10/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-129-9/+9
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Suppress possible unused variable warning for icl_soft.cDimitry Andric2022-07-271-1/+1
| | | | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced on i386: sys/dev/iscsi//icl_soft.c:1277:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable] int i; ^ The 'i' variable is used later in the icl_soft_conn_pdu_get_bio() function, via the PHYS_TO_DMAP() macro. However, on i386 and some other architectures, this macro is defined to panic immediately, so in those cases, 'i' is indeed not used. Suppress the warning by marking 'i' as unused. MFC after: 3 days
* Fix unused variable warning in icl_soft.cDimitry Andric2022-07-241-3/+14
| | | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/dev/iscsi//icl_soft.c:886:6: error: variable 'coalesced' set but not used [-Werror,-Wunused-but-set-variable] int coalesced, error; ^ The 'coalesced' variable is eventually used only in an #if 0'd block, obviously meant for debugging. Ensure that 'coalesced' is only declared and used when DEBUG_COALESCED is defined, so the debugging can be easily turned on later, if desired. MFC after: 3 days
* iscsi: Fetch limits based on a socket rather than assuming global limits.John Baldwin2022-04-185-28/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | cxgbei needs the ability to return different limits based on the connection (e.g. if the connection is over a T5 adapter or a T6 adapter as well as factoring in the MTU). This change plumbs through the changes in the ioctls without changing any of the backends. The limits callback passed to icl_register now accepts a second socket argument which holds the integer file descriptor. To support ABI compatiblity for old binaries, the callback should return "global" values if the socket fd is zero. The CTL_ISCSI_LIMITS argument used with CTL_ISCSI by ctld(8) now accepts the socket fd in a field that was previously part of a reserved spare field. Old binaries zero this request which results in passing a socket fd of 0 to the limits callback. The ISCSIDREQUEST ioctl no longer returns limits. Instead, iscsid(8) invokes a new ISCSIDLIMITS ioctl after establishing the connection via connect(2). For ABI compat, if the old ISCSIDREQUEST is invoked, the global limits are still fetched (with a socket fd of 0) and returned. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D34928
* isci(4): Remove a double word in an error messageGordon Bergling2022-04-031-1/+1
| | | | | | - s/is is/is/ MFC after: 1 week
* icl_soft: Use PHYS_TO_DMAP instead of pmap_map_io_transient.John Baldwin2022-03-111-14/+2
| | | | | | | The latter API is not actually MI but is only supported on amd64, arm64, and RISC-V. Sponsored by: Chelsio Communications
* iscsi: Support unmapped I/O requests in the default initiator.John Baldwin2022-03-101-11/+199
| | | | | | | | | | | | | | | | - Add icl_pdu_append_bio and icl_pdu_get_bio methods. - When ICL_NOCOPY is used to append data from an unmapped I/O request to a PDU, construct unmapped mbufs from the relevant pages backing the struct bio. - Use m_apply with a helper to compute crc32 digests on mbuf chains to handle unmapped mbufs. Since m_apply requires PMAP_HAS_DMAP for unmapped mbufs, only support unmapped requests when PMAP_HAS_DMAP is true. Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D34406
* iscsi: Handle unmapped I/O requests.John Baldwin2022-03-103-3/+75
| | | | | | | | | | | | | | | | | | Don't assume that csio->data_ptr is pointer to a data buffer that can be passed to icl_get_pdu_data and icl_append_data. For unmapped I/O requests, csio->data_ptr is instead a pointer to a struct bio as indicated by CAM_DATA_BIO. To support these requests, add icl_pdu_append_bio and icl_pdu_get_bio methods which pass a pointer to the bio and an offset and length relative to the bio's buffer. Note that only backends supporting unmapped requests need to implement these hooks. Implement simple no-op hooks for the iser backend. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D34382
* iscsi: Use ICL_NOCOPY for SCSI command immediate data and R2T.John Baldwin2022-03-101-2/+3
| | | | | | | | | | | | | | The associated csio ccb will not be completed via xpt_done() until after the associated PDUs are transmitted to the other side and either the original PDU is acked with a SCSI response, or a response is received for a subsequent abort CCB (which means the earlier PDU has also been sent since it would have been sent before the abort PDU). This does assume that once an I/O request has been aborted, no further PDUs with data payload are queued for that I/O request. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D34405
* iscsi: per-session timeouts and rapid teardown of session on reconnectRichard Scheffenegger2022-02-253-5/+43
| | | | | | | | | | Add per-Session configurable ping (SCSI NOP) and login timeouts. Remove the torn down, old iSCSI session quickly, when performing a reconnect. Reviewed By: trasz Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34198
* iscsi: Use calloutng instead of ticks in iscsi initiatorRichard Scheffenegger2022-02-152-3/+12
| | | | | | | | | | | callout *_sbt functions are used to reduce ping/timeout scheduling overhead, while allowing later improvments in the functionality. Keep similar 1000ms callouts while adding a 10 ms window, to allow some kernel scheduling improvements. Reviewed By: jhb Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34222
* iscsi: address unused-but-set-variable warningRichard Scheffenegger2022-02-121-5/+1
| | | | | | | | remove "interrupted" in icl_soft_proxy_connect() Reviewed By: hselasky Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34223
* iscsi: Fix missing is_lock unlock after cam_simq_alloc() failedKa Ho Ng2022-01-211-0/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* iscsi: Pass the request PDU to icl_conn_transfer_setup().John Baldwin2022-01-043-5/+6
| | | | | | | | | | This matches icl_conn_task_setup() which passes the PDU and avoids the need for a layering violation in cxgbei to fetch the request PDU from the ctl_io. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D33746
* Move the ICL_CONN_*LOCK* macros to <dev/iscsi/icl.h>.John Baldwin2021-11-052-5/+5
| | | | | | | | | These macros are not backend-specific but reference a backend-independent field in struct icl_conn. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32858
* Further refine the ExpDataSN checks for SCSI Response PDUs.John Baldwin2021-10-261-8/+32
| | | | | | | | | | | | | | | | | | | According to 11.4.8 in RFC 7143, ExpDataSN MUST be 0 if the response code is not Command Completed, but we were requiring it to always be the count of DataIn PDUs regardless of the response code. In addition, at least one target (OCI Oracle iSCSI block device) returns an ExpDataSN of 0 when returning a valid completion with an error status (Check Condition) in response to a SCSI Inquiry. As a workaround for this target, only warn without resetting the connection for a 0 ExpDataSN for responses with a non-zero error status. PR: 259152 Reported by: dch Reviewed by: dch, mav, emaste Fixes: 4f0f5bf99591 iscsi: Validate DataSN values in Data-In PDUs in the initiator. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32650
* iscsi: Validate DataSN values in Data-In PDUs in the initiator.John Baldwin2021-08-242-1/+21
| | | | | | | | | | | | As is done in the target, require that DataSN values are consecutive and in-order. If an out of order Data-In PDU is received, force a session reconnect. In addition, when a SCSI Response PDU is received, verify that the ExpDataSN field matches the count of Data-In PDUs received for this command. If not, force a session reconnect. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31594
* iscsi: Teach the iSCSI stack about "large" received PDUs.John Baldwin2021-08-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When using iSCSI PDU offload (cxgbei) on T6 adapters, a burst of received PDUs can be reported via a single message to the driver. Previously the driver passed these multi-PDU bursts up to the iSCSI stack up as a single "large" PDU by rewriting the buffer offset, data segment length, and DataSN fields in the iSCSI header. The DataSN field in particular was rewritten so that each of the "large" PDUs used consecutively increasing values. While this worked, the forged DataSN values did not match the ExpDataSN value in the subsequent SCSI Response PDU. The initiator does not currently verify this value, but the forged DataSN values prevent adding a check. To avoid this, allow a logical iSCSI PDU (struct icl_pdu) to describe a burst of PDUs via a new 'ip_additional_pdus' field. Normally this field is set to zero when 'struct icl_pdu' represents a single PDU. If logical PDU represents a burst of on-the-wire PDUs, then 'ip_npdus' contains the count of additional on-the-wire PDUs. The header of this "large" PDU is still modified, but the DataSN field now contains the DataSN value of the first on-the-wire PDU in the burst. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31577
* iSCSI: Add support for segmentation offload for hardware offloads.John Baldwin2021-08-062-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to TSO, iSCSI segmentation offload permits the upper layers to submit a "large" virtual PDU which is split up into multiple segments (PDUs) on the wire. Similar to how the TCP/IP headers are used as templates for TSO, the BHS at the start of a large PDU is used as a template to construct the specific BHS at the start of each PDU. In particular, the DataSN is incremented for each subsequent PDU, and the 'F' flag is only set on the last PDU. struct icl_conn has a new 'ic_hw_isomax' field which defaults to 0, but can be set to the largest virtual PDU a backend supports. If this value is non-zero, the iSCSI target and initiator use this size instead of 'ic_max_send_data_segment_length' to determine the maximum size for SCSI Data-In and SCSI Data-Out PDUs. Note that since PDUs can be constructed from multiple buffers before being dispatched, the target and initiator must wait for the PDU to be fully constructed before determining the number of DataSN values were consumed (and thus updating the per-transfer DataSN value used for the start of the next PDU). The target generates large PDUs for SCSI Data-In PDUs in cfiscsi_datamove_in(). The initiator generates large PDUs for SCSI Data-Out PDUs generated in response to an R2T. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31222
* iscsi: Remove icl_soft-only fields from struct icl_conn.John Baldwin2021-08-052-110/+128
| | | | | | | | | | Create a struct icl_soft_conn which extends struct icl_conn and move fields only used by icl_soft from struct icl_conn to struct icl_soft_conn. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31414
* cam: fix xpt_bus_register and xpt_bus_deregister return errnoWarner Losh2021-06-281-2/+1
| | | | | | | | | | | | | | | | | | | xpt_bus_register and xpt_bus_deregister returns a hybrid error that's neither a cam_status, nor an errno, but a mix of both. Update xpt_bus_register and xpt_bus_deregister to return an errno. The vast majority of current users compare against zero, which can also be spelled CAM_SUCCESS. Nobody uses CAM_FAILURE, so remove that symbol to prevent comfusion (nothing returns it either). Where the return value is saved, ensure that the variable 'error' is used to store an errno and 'status' is used to store a cam_status where it makes the code clearer (usually just in functions that already mix and match). Where the return value isn't used at all, avoid storing it at all. Reviewed by: scottl@, mav@ (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30860
* Consistently use the SOCKBUF_MTX() and SOCK_MTX() macrosMark Johnston2021-06-141-1/+1
| | | | | | | | This makes it easier to change the socket locking protocols. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* iscsi: Move the maximum data segment limits into 'struct icl_conn'.John Baldwin2021-05-204-28/+30
| | | | | | | | | | This fixes a few bugs in iSCSI backends where the backends were using the limits they advertised initially during the login phase as the final values instead of the values negotiated with the other end. Reported by: Jithesh Arakkan @ Chelsio Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D30271
* iscsi: Kick threads out of iscsi_ioctl() during unload.John Baldwin2021-04-122-0/+12
| | | | | | | | | | | iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to sleep forever if iscsi.ko is unloaded while iscsid is running. Reported by: Jithesh Arakkan @ Chelsio Reviewed by: mav MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29688
* Move ic_check_send_space clear to the actual check.Alexander Motin2021-03-031-1/+1
| | | | | | | | | It closes tiny race when the flag could be set between being cleared and the space is checked, that would create us some more work. The flag setting is protected by both locks, so we can clear it in either place, but in between both locks are dropped. MFC after: 1 week
* Restore condition removed in df3747c6607b.Alexander Motin2021-03-031-1/+2
| | | | | | | | | | I think it allowed to avoid some TX thread wakeups while the socket buffer is full. But add there another options if ic_check_send_space is set, which means socket just reported that new space appeared, so it may have sense to pull more data from ic_to_send for better TX coalescing. MFC after: 1 week
* Replace STAILQ_SWAP() with simpler STAILQ_CONCAT().Alexander Motin2021-03-021-7/+4
| | | | | | | Also remove stray STAILQ_REMOVE_AFTER(), not causing problems only because STAILQ_SWAP() fixed corrupted stqh_last. MFC after: 1 week
* Fix initiator panic after 6895f89fe54e.Alexander Motin2021-03-021-2/+4
| | | | | | There are sessions without socket that are not disconnecting yet. MFC after: 3 weeks
* Optimize TX coalescing by keeping pointer to last mbuf.Alexander Motin2021-03-021-4/+6
| | | | | | Before m_cat() each time traversed through all the coalesced chain. MFC after: 1 week
* Coalesce socket reads in software iSCSI.Alexander Motin2021-02-221-169/+89
| | | | | | | | | | Instead of 2-4 socket reads per PDU this can do as low as one read per megabyte, dramatically reducing TCP overhead and lock contention. With this on iSCSI target I can write more than 4GB/s through a single connection. MFC after: 1 month
* iscsi: Mark iSCSI CAM sims as non-pollable.John Baldwin2021-02-111-9/+1
| | | | | | | | | | | | | Previously, iscsi_poll() just panicked. This meant if you got a panic on a box when using the iSCSI initiator, the attempt to shutdown would trigger a nested panic and never write out a core. Now, CCB's sent to iSCSI devices (such as the sychronize-cache request in dashutdown()) just fail with a timeout during a panic shutdown. Reviewed by: scottl, mav MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28455
* Make DataSN counter of solicited Data-Out local.Alexander Motin2021-02-022-6/+5
| | | | | | | | | | | DataSN for solicited Data-Out is per-R2T. Since we handle whole R2T in one go, we don't need to store it anywhere, especially in global per-command structure. This may allow us to handle multiple R2T per command at once, if we decide, or may be relax locking. Rename the second use of that field to io_referenced_task_tag. MFC after: 1 month
* Make software iSCSI more configurable.Alexander Motin2021-01-282-22/+25
| | | | | | | | | | | | | | | | | Move software iSCSI tunables/sysctls into kern.icl.soft subtree. Replace several hardcoded length constants there with variables. While there, stretch the limits to better match Linux' open-iscsi and our own initiator with new MAXPHYS of 1MB. Our CTL target is also optimized for up to 1MB I/Os, so there is also a match now. For Windows 10 and VMware 6.7 initiators at default settings it should make no change, since previous limits were sufficient there. Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput increase by 29% on idle connection and 132% with concurrent QD8 reads. MFC after: 3 days Sponsored by: iXsystems, Inc.
* Exclude reserved iSCSI Initiator Task Tag.Alexander Motin2021-01-241-0/+5
| | | | | | | | | | RFC 7143 (11.2.1.8): An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a task by the initiator. The only instance in which it may be seen on the wire is in a target-initiated NOP-In PDU (Section 11.19) and in the initiator response to that PDU, if necessary. MFC after: 1 month
* Remove FirstBurstLength limit for software iSCSI.Alexander Motin2021-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | For hardware offload solicited data may potentially be handled more efficiently than unsolicited due to direct data placement. Or there can be some unsolicited write buffering limitations. It may create situations where FirstBurstLength limit is really useful. Software driver though has no those factors, having to do memcopy() any way and having no so hard limit on the temporary storage. Same time more active use of unsolicited transfers allows to avoid some of Ready To Transfer (R2T) PDU round-trip times and processing. This change effectively doubles from 64KB to 128KB the maximum size of write command that can be transferred within one link RTT. Tests of (64KB, 128KB] QD1 writes mixed with simultaneous QD8 reads over the same connection, increasing RTT, shows almost double write speed and half latency, while we should be able to afford few megabytes of RAM for additional buffering on a target these days. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* Convert remaining cap_rights_init users to cap_rights_init_oneMateusz Guzik2021-01-121-1/+1
| | | | | | | | | | | | | semantic patch: @@ expression rights, r; @@ - cap_rights_init(&rights, r) + cap_rights_init_one(&rights, r)
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Drop "All rights reserved" from all my stuff. This includesEdward Tomasz Napierala2020-10-2810-10/+0
| | | | | | | | | | | | Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those people, feel free to make similar change. Reviewed by: emaste, imp, gbe (manpages) Differential Revision: https://reviews.freebsd.org/D26980 Notes: svn path=/head/; revision=367105
* Introduce support of SCSI Command Priority.Alexander Motin2020-10-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add network QoS support for PCP to iscsi initiator.Richard Scheffenegger2020-10-241-1/+2
| | | | | | | | | | | | | | Make the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the initiator side only. Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26739 Notes: svn path=/head/; revision=367023
* Negotiate iSCSIProtocolLevel of 2 (RFC 7144) in initiator.Alexander Motin2020-10-224-4/+9
| | | | | | | | | | | It does not change anything immediately, but allows further support of Command Priority, Status Qualifier and new task management functions. MFC after: 1 month Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=366953