#
74e71380 |
| 26-Dec-2023 |
Mark Johnston <markj@FreeBSD.org> |
iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive()
Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43148
|
#
fdafd315 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
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.
Remov
sys: Automated cleanup of cdefs and other formatting
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
show more ...
|
#
2ce1c45b |
| 23-Nov-2023 |
Mitchell Horne <mhorne@FreeBSD.org> |
iscsi: adjust shutdown_pre_sync handler
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
iscsi: adjust shutdown_pre_sync handler
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
show more ...
|
#
4eb861d3 |
| 23-Nov-2023 |
Mitchell Horne <mhorne@FreeBSD.org> |
shutdown: audit shutdown_post_sync event callbacks
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
shutdown: audit shutdown_post_sync event callbacks
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
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
show more ...
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0 |
|
#
7b02c1e8 |
| 18-Apr-2022 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Fetch limits based on a socket rather than assuming global limits.
cxgbei needs the ability to return different limits based on the connection (e.g. if the connection is over a T5 adapter or
iscsi: Fetch limits based on a socket rather than assuming global limits.
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
show more ...
|
#
756220b5 |
| 03-Apr-2022 |
Gordon Bergling <gbe@FreeBSD.org> |
isci(4): Remove a double word in an error message
- s/is is/is/
MFC after: 1 week
|
#
7aab9c14 |
| 11-Mar-2022 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Handle unmapped I/O requests.
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_p
iscsi: Handle unmapped I/O requests.
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
show more ...
|
#
9c7a4875 |
| 11-Mar-2022 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Use ICL_NOCOPY for SCSI command immediate data and R2T.
The associated csio ccb will not be completed via xpt_done() until after the associated PDUs are transmitted to the other side and eith
iscsi: Use ICL_NOCOPY for SCSI command immediate data and R2T.
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
show more ...
|
#
bd6bb493 |
| 25-Feb-2022 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
iscsi: per-session timeouts and rapid teardown of session on reconnect
Add per-Session configurable ping (SCSI NOP) and login timeouts.
Remove the torn down, old iSCSI session quickly, when perform
iscsi: per-session timeouts and rapid teardown of session on reconnect
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
show more ...
|
#
972a7d95 |
| 15-Feb-2022 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
iscsi: Use calloutng instead of ticks in iscsi initiator
callout *_sbt functions are used to reduce ping/timeout scheduling overhead, while allowing later improvments in the functionality. Keep simi
iscsi: Use calloutng instead of ticks in iscsi initiator
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
show more ...
|
#
fa669505 |
| 21-Jan-2022 |
Ka Ho Ng <khng@FreeBSD.org> |
iscsi: Fix missing is_lock unlock after cam_simq_alloc() failed
Sponsored by: The FreeBSD Foundation MFC after: 3 days
|
Revision tags: release/12.3.0 |
|
#
cdbc4a07 |
| 26-Oct-2021 |
John Baldwin <jhb@FreeBSD.org> |
Further refine the ExpDataSN checks for SCSI Response PDUs.
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
Further refine the ExpDataSN checks for SCSI Response PDUs.
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
show more ...
|
#
4f0f5bf9 |
| 24-Aug-2021 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Validate DataSN values in Data-In PDUs in the initiator.
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
iscsi: Validate DataSN values in Data-In PDUs in the initiator.
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
show more ...
|
#
f0594f52 |
| 06-Aug-2021 |
John Baldwin <jhb@FreeBSD.org> |
iSCSI: Add support for segmentation offload for hardware offloads.
Similar to TSO, iSCSI segmentation offload permits the upper layers to submit a "large" virtual PDU which is split up into multiple
iSCSI: Add support for segmentation offload for hardware offloads.
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
show more ...
|
#
30f8afd0 |
| 29-Jun-2021 |
Warner Losh <imp@FreeBSD.org> |
cam: fix xpt_bus_register and xpt_bus_deregister return errno
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
cam: fix xpt_bus_register and xpt_bus_deregister return errno
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
show more ...
|
#
0cc7d64a |
| 20-May-2021 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Move the maximum data segment limits into 'struct icl_conn'.
This fixes a few bugs in iSCSI backends where the backends were using the limits they advertised initially during the login phase
iscsi: Move the maximum data segment limits into 'struct icl_conn'.
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
show more ...
|
#
89df4847 |
| 12-Apr-2021 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Kick threads out of iscsi_ioctl() during unload.
iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to sleep forever if iscsi.ko is unloaded while iscsid is running.
Reported
iscsi: Kick threads out of iscsi_ioctl() during unload.
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
show more ...
|
Revision tags: release/13.0.0 |
|
#
47769bc5 |
| 11-Feb-2021 |
John Baldwin <jhb@FreeBSD.org> |
iscsi: Mark iSCSI CAM sims as non-pollable.
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 ne
iscsi: Mark iSCSI CAM sims as non-pollable.
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
show more ...
|
#
3dd2a7a5 |
| 02-Feb-2021 |
Alexander Motin <mav@FreeBSD.org> |
Make DataSN counter of solicited Data-Out local.
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
Make DataSN counter of solicited Data-Out local.
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
show more ...
|
#
9bee9a98 |
| 24-Jan-2021 |
Alexander Motin <mav@FreeBSD.org> |
Exclude reserved iSCSI Initiator Task Tag.
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
Exclude reserved iSCSI Initiator Task Tag.
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
show more ...
|
#
cd853791 |
| 28-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Make MAXPHYS tunable. Bump MAXPHYS to 1M.
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_pag
Make MAXPHYS tunable. Bump MAXPHYS to 1M.
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
show more ...
|
#
bce7ee9d |
| 28-Oct-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Drop "All rights reserved" from all my stuff. This includes Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those peopl
Drop "All rights reserved" from all my stuff. This includes 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
show more ...
|
#
88364968 |
| 25-Oct-2020 |
Alexander Motin <mav@FreeBSD.org> |
Introduce support of SCSI Command Priority.
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 pr
Introduce support of SCSI Command Priority.
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.
show more ...
|