#
59657816 |
| 03-May-2024 |
John Baldwin <jhb@FreeBSD.org> |
ctl: Add structure and related constants for NVMe commands
This includes static inline functions to serve as getters/setters for fields shared between SCSI and NVMe I/O requests to manage data buffe
ctl: Add structure and related constants for NVMe commands
This includes static inline functions to serve as getters/setters for fields shared between SCSI and NVMe I/O requests to manage data buffers.
Reviewed by: ken, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44717
show more ...
|
#
ac7a514e |
| 03-May-2024 |
John Baldwin <jhb@FreeBSD.org> |
ctl: Add CTL_IO_ASSERT wrapper macro
Currently, this pattern is commonly used to assert that a union ctl_io is a SCSI request. In the future it will be used to assert other types.
Suggested by: im
ctl: Add CTL_IO_ASSERT wrapper macro
Currently, this pattern is commonly used to assert that a union ctl_io is a SCSI request. In the future it will be used to assert other types.
Suggested by: imp Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44844
show more ...
|
Revision tags: release/13.3.0 |
|
#
105eee97 |
| 27-Dec-2023 |
John Baldwin <jhb@FreeBSD.org> |
ctl: Add missing comma after CTL_FLAG_ALREADY_DONE
Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D42930
|
Revision tags: release/14.0.0 |
|
#
4efebb3d |
| 17-Oct-2023 |
John Baldwin <jhb@FreeBSD.org> |
ctl: Make ctl_io.h more self-contained
Include <cam/scsi/scsi_all.h> for struct scsi_sense_data. Include <sys/queue.h> for queue macros.
Reviewed by: ken, imp Sponsored by: Chelsio Communications D
ctl: Make ctl_io.h more self-contained
Include <cam/scsi/scsi_all.h> for struct scsi_sense_data. Include <sys/queue.h> for queue macros.
Reviewed by: ken, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D42207
show more ...
|
#
2ff63af9 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\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 |
|
#
7467a695 |
| 03-Dec-2022 |
Alexander Motin <mav@FreeBSD.org> |
CTL: Allow userland supply tags via ioctl frontend.
Before this ioctl frontend always replaced tags with sequential ones. It was done for ctladm, that can not keep track of global tag list. But in c
CTL: Allow userland supply tags via ioctl frontend.
Before this ioctl frontend always replaced tags with sequential ones. It was done for ctladm, that can not keep track of global tag list. But in case of virtio-scsi in bhyve we can pass provided tags as-is. It should be on virtio-scsi initiator to provide us valid tags. It should allow proper task management, error reporting, etc. In case of several virtio-scsi devices, they should use different CTL ports or initiator IDs to avoid conflicts, but this is expected by design.
PR: 267539
show more ...
|
#
0acc026d |
| 03-Dec-2022 |
Alexander Motin <mav@FreeBSD.org> |
CTL: Increase maximum SCSI tag size from 32 to 64 bits.
SAM-5 specification states maximum size of command identifier (tag), defined by specific transports, should not be larger than 64 bits. While
CTL: Increase maximum SCSI tag size from 32 to 64 bits.
SAM-5 specification states maximum size of command identifier (tag), defined by specific transports, should not be larger than 64 bits. While most of supported transports use 32 bits or less, it was reported that virtio-scsi uses 64 bits. Truncation to 32 bits in bhyve code caused false tag conflict errors reported and possibly other issues.
This changes CTL ABI and HA protocol, so CTL_HA_VERSION is bumped.
While we make HA protocol incompatible, increase default maximum number of ports in CTL from 256 to 1024, matching number of LUNs. There are many reports from people who need many iSCSI targets with only one LUN each. Increased memory consumption should be less of a problem these days.
PR: 267539
show more ...
|
Revision tags: release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0 |
|
#
9d9fd8b7 |
| 27-Feb-2021 |
Alexander Motin <mav@FreeBSD.org> |
Micro-optimize OOA queue processing.
- Move ctl_get_cmd_entry() calls from every OOA traversal to when the requests first inserted, storing seridx in struct ctl_scsiio. - Move some checks out of t
Micro-optimize OOA queue processing.
- Move ctl_get_cmd_entry() calls from every OOA traversal to when the requests first inserted, storing seridx in struct ctl_scsiio. - Move some checks out of the loop in ctl_check_ooa(). - Replace checks for errors that can not happen with asserts. - Transpose ctl_serialize_table, so that any OOA traversal accessed only one row (cache line). Compact it from enum to uint8_t. - Optimize static branch predictions in hottest places.
Due to O(n) nature on deep LUN queues this can be the hottest code path in CTL, and additional 20% of IOPS I see in some 4KB I/O tests are good to have in reserve. About 50% of CPU time here according to the profiles is now spent in two memory accesses per traversed request in OOA.
Sponsored by: iXsystems, Inc. MFC after: 2 weeks
show more ...
|
#
c02a2875 |
| 21-Feb-2021 |
Alexander Motin <mav@FreeBSD.org> |
Fix build after 2c7dc6bae9fd.
MFC after: 1 month
|
#
2c7dc6ba |
| 21-Feb-2021 |
Alexander Motin <mav@FreeBSD.org> |
Refactor CTL datamove KPI.
- Make frontends call unified CTL core method ctl_datamove_done() to report move completion. It allows to reduce code duplication in differerent backends by accounting D
Refactor CTL datamove KPI.
- Make frontends call unified CTL core method ctl_datamove_done() to report move completion. It allows to reduce code duplication in differerent backends by accounting DMA time in common code. - Add to ctl_datamove_done() and be_move_done() callback samethr argument, reporting whether the callback is called in the same context as ctl_datamove(). It allows for some cases like iSCSI write with immediate data or camsim frontend write save one context switch, since we know that the context is sleepable. - Remove data_move_done() methods from struct ctl_backend_driver, unused since forever.
MFC after: 1 month
show more ...
|
#
05d882b7 |
| 19-Feb-2021 |
Alexander Motin <mav@FreeBSD.org> |
Microoptimize CTL I/O queues.
Switch OOA queue from TAILQ to LIST and change its direction, so that we traverse it forward, not backward. There is only one place where we really need other directio
Microoptimize CTL I/O queues.
Switch OOA queue from TAILQ to LIST and change its direction, so that we traverse it forward, not backward. There is only one place where we really need other direction, and it is not critical.
Use STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE() in backends.
Replace few impossible conditions with assertions.
MFC after: 1 month
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 ...
|
Revision tags: release/12.2.0 |
|
#
27dcd3d9 |
| 02-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
cam: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
9a4510ac |
| 08-Jun-2020 |
Alexander Motin <mav@FreeBSD.org> |
Implement zero-copy iSCSI target transmission/read.
Add ICL_NOCOPY flag to icl_pdu_append_data(), specifying that the method can just reference the data buffer instead of immediately copying it.
Ex
Implement zero-copy iSCSI target transmission/read.
Add ICL_NOCOPY flag to icl_pdu_append_data(), specifying that the method can just reference the data buffer instead of immediately copying it.
Extend the offload KPI with optional PDU queue method, allowing to specify completion callback, called when all the data referenced by above has been transferred and won't be accessed any more (the buffers can be freed).
Implement the above functionality in software iSCSI driver using mbufs with external storage and reference counter. Note that some NICs (ixl(4)) may keep the mbuf in TX queue for a long time, so CTL has to be ready.
Add optional method to struct ctl_scsiio for buffer reference counting. Implement it for CTL block backend, allowing to delay free of the struct ctl_be_block_io and memory it references as needed. In first reincarnation of the patch I tried to delay whole I/O as it is done for FibreChannel, that was cleaner, but due to the above callback delays I had to rewrite it this way to not leave LUN referenced potentially for hours or more.
All together on sequential read from ZFS ARC this saves about 30% of CPU time and memory bandwidth by avoiding one of 3 memory copies (the other two are from ZFS ARC to DMU cache and then from DMU cache to CTL buffers). On tests with 2x Xeon Silver 4114 this allows to reach full line rate of 100GigE NIC. Tests with Gold CPUs and two 100GigE NICs are stil TBD, but expectations to saturate them are pretty high. ;)
Discussed with: Chelsio Sponsored by: iXsystems, Inc.
show more ...
|
Revision tags: release/12.1.0, release/11.3.0 |
|
#
2aaf9152 |
| 18-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345275
|
#
b18a4cca |
| 05-Mar-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344786
|
#
844fc3e9 |
| 04-Mar-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r344549 through r344775.
|
#
321f819b |
| 27-Feb-2019 |
Alexander Motin <mav@FreeBSD.org> |
Refactor command ordering/blocking mechanism in CTL.
Replace long per-LUN queue of blocked commands, scanned on each command completion and sometimes even twice, causing up to O(n^^2) processing cos
Refactor command ordering/blocking mechanism in CTL.
Replace long per-LUN queue of blocked commands, scanned on each command completion and sometimes even twice, causing up to O(n^^2) processing cost, by much shorter per-command blocked queues, scanned only when respective command completes, and check only commands before the previous blocker, reducing cost to O(n).
While there, unblock aborted commands to make them "complete" ASAP to be removed from the OOA queue and so not waste time ordering other commands against them. Aborted commands that were not sent to execution yet should have no visible side effects, so this is safe and easy optimization now, comparing to commands already in processing, which are a still pain.
Together those two optimizations should fix quite pathological case, when due to backend slowness CTL accumulated many thousands of blocked requests, partially aborted by initiator and so supposedly not even existing, but still wasting CTL CPU time.
MFC after: 2 weeks Sponsored by: iXsystems, Inc.
show more ...
|
#
18b18078 |
| 25-Feb-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344527
|
#
a8fe8db4 |
| 25-Feb-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r344178 through r344512.
|
#
62e802cf |
| 24-Feb-2019 |
Alexander Motin <mav@FreeBSD.org> |
Free some space in struct ctl_io_hdr for better use.
- Collapse original_sc and serializing_sc fields into one, since they are never used simultanously, we have only one local I/O and one remote.
Free some space in struct ctl_io_hdr for better use.
- Collapse original_sc and serializing_sc fields into one, since they are never used simultanously, we have only one local I/O and one remote.
- Move remote_sglist and local_sglist fields into CTL_PRIV_BACKEND, since they are used only on Originating SC in XFER mode, where requests don't ever reach backends, so we can reuse backend's private storage.
MFC after: 2 weeks Sponsored by: iXsystems, Inc.
show more ...
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
bec9534d |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/cam: further adoption of SPDX licensing ID tags.
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
sys/cam: further adoption of SPDX licensing ID tags.
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.
show more ...
|
#
c2c014f2 |
| 07-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r323559 through r325504.
|
#
d5db4328 |
| 01-Oct-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r324148
|