| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
These weren't removed when $FreeBSD$ was removed. They aren't needed and
now are a style(9) nonconformity.
Sponsored by: Netflix
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
|
|
|
|
| |
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
move to the modern uintXX_t.
MFC After: 3 days
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that, as pointed out by scottl@, this code should really look
a bit different, in that the stack allocations should be replaced
with dynamic allocation, and the periph creation should be moved
to a context where one can use M_WAITOK. See the review for more
details. For now let's go with a minimal fix until we're done with
UMA CCBs.
Reviewed By: mav, imp
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30298
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
It is a rare, but still better to not have lock dependencies.
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Notes:
svn path=/head/; revision=365225
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no compelling reason to return a cam_status type for this
function and doing so only creates confusion with normal C
coding practices. It's technically an API change, but the periph API
isn't widely used. No efffective change to operation.
Reviewed by: imp, mav, ken
Sponsored by: Netflix
Differential Revision: D14063
Notes:
svn path=/head/; revision=328918
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
virtual address sizes
Summary:
Some architectures use physical addresses larger than virtual. This is the
minimal changeset needed to get CAM/CTL to build on these targets. No
functional changes. More changes would likely be needed for this to be fully
functional on said platforms, but they can be made when needed.
Reviewed By: mav, chuck
Differential Revision: https://reviews.freebsd.org/D14041
Notes:
svn path=/head/; revision=328425
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=326265
|
|
|
|
|
|
|
|
|
| |
There is at least CAM_UNLOCKED that should be kept.
MFC after: 3 days
Notes:
svn path=/head/; revision=322302
|
|
|
|
| |
Notes:
svn path=/head/; revision=320493
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.
Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=315084
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some SIMs may not abort them implicitly, that either fail the LUN disable
request or just make us wait for those CCBs forever. With this change
I can successfully disable LUNs on mpt(4). For isp(4), which aborts them
implicitly, this change should be irrelevant.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=315030
|
|
|
|
|
|
|
|
|
| |
It is mostly FIFO and we don't need random removal there.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=315025
|
|
|
|
|
|
|
|
|
| |
Separate WWNs change into separate request to know what actually failed.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=315022
|
|
|
|
|
|
|
|
| |
For now it allows to unload CTL kernel module if there are no target-capable
SIMs in CAM. As next step full teardown of CAM targets can be implemented.
Notes:
svn path=/head/; revision=314870
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we asked to send sense data by setting CAM_SEND_SENSE, but SIM didn't
confirm transmission by setting CAM_SENT_SENSE, assume it was not sent.
Queue the I/O back to CTL for later REQUEST SENSE with ctl_queue_sense().
This is needed for error reporting on SPI HBAs like ahc(4)/ahd(4).
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314307
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314300
|
|
|
|
|
|
|
|
|
| |
This code is complicated enough even in its base shape.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314247
|
|
|
|
|
|
|
|
|
|
| |
Before this change it was possible to trigger some use-after-free panics
by disabling LUNs/ports under heavy load.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314246
|
|
|
|
|
|
|
|
|
| |
This helps SIM to free related resources in questionable cases.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314204
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314200
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314196
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314193
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When LUN is disabled, SIM starts returning queued ATIOs/INOTs. But at the
same time there can be some ATIOs/INOTs still carrying real new requests.
If we free those, SIM may leak some resources, forever expecting for any
response from us. So try to be careful, separating ATIOs/INOTs carrying
requests which still must be processed, from ATIOs/INOTs completed with
errors which can be freed.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=314027
|
|
|
|
|
|
|
|
|
| |
This changes the CTL frontend ABI and thus shouldn't be MFC-ed.
Reviewed by: mav@
Notes:
svn path=/head/; revision=312651
|
|
|
|
|
|
|
|
|
|
|
| |
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 after: 2 weeks
Notes:
svn path=/head/; revision=312603
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 after: 2 weeks
Notes:
svn path=/head/; revision=312291
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=312026
|
|
|
|
|
|
|
|
|
| |
There are 16 bytes of space, so we may store two pointers in one.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=310649
|
|
|
|
|
|
|
|
|
|
| |
utilizing previously unused arg field of struct ccb_notify_acknowledge.
This makes new QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT requests
really functional for CAM target mode drivers.
Notes:
svn path=/head/; revision=300293
|
|
|
|
| |
Notes:
svn path=/head/; revision=296604
|
|
|
|
|
|
|
|
| |
CTL itself still lives in flat LUN space, but it can generate extended
numbers if CAM SIM reports such capability.
Notes:
svn path=/head/; revision=289881
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows to decode respective functions in isp(4) in target mode
and pass them through CAM to CTL. Unfortunately neither CAM nor isp(4)
support returning response info for those task management functions now.
On the other side I just have no initiator to test this functionality.
Notes:
svn path=/head/; revision=289843
|
|
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=289819
|
|
|
|
|
|
|
|
| |
This is only a cosmetic change. We still don't support atomic boundary
field in the CDB, but at least now we do it formally.
Notes:
svn path=/head/; revision=288166
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=287621
|
|
|
|
| |
Notes:
svn path=/head/; revision=287620
|
|
|
|
|
|
|
|
| |
This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.
Notes:
svn path=/head/; revision=287293
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To avoid conflicts between target and initiator devices in CAM, make
CTL use target ID reported by HBA as its initiator_id in XPT_PATH_INQ.
That target ID is known to never be used for initiator role, so it won't
conflict. For Fibre Channel and FireWire HBAs this specific ID choice
is irrelevant since all target IDs there are virtual. Same time for SPI
HBAs it seems could be even requirement to use same target ID for both
initiator and target roles.
While there are some more things to polish in isp(4) driver, first tests
of using both roles same time on the same port appeared successfull:
# camcontrol devlist -v
scbus0 on isp0 bus 0:
<FREEBSD CTLDISK 0001> at scbus0 target 1 lun 0 (da20,pass21)
<> at scbus0 target 256 lun 0 (ctl0)
<> at scbus0 target -1 lun ffffffff (ctl1)
Notes:
svn path=/head/; revision=285155
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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. :(
Notes:
svn path=/head/; revision=284640
|
|
|
|
|
|
|
|
|
|
|
|
| |
At this point CTL has no known use case for device queue freezes.
Same time existing (considered to be broken) code was found to cause
modify-after-free issues.
Discussed with: ken
MFC after: 1 week
Notes:
svn path=/head/; revision=284622
|
|
|
|
|
|
|
|
|
| |
are still running inside CTL.
MFC after: 1 week
Notes:
svn path=/head/; revision=284541
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=284013
|
|
|
|
|
|
|
|
|
|
|
| |
If we aggregated status sending with data move and got error, allow status
to be updated and resent again separately. Without this command may stuck
without status sent at all.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=277247
|