Repository navigation
SBP-2: DMA HBA task data in place via fBufferIOVMAddr - #219
Merged
Merged
Conversation
mhellevang
force-pushed
the
perf/sbp2-zero-copy
branch
2 times, most recently
from
October 22, 2026 11:23
2b72ca4 to
c04dbe0
Compare
Contributor
Author
|
LS-9000 run on this branch (
No crash report in the session. Remaining HW item for this PR: none that this setup can produce; the wake issue is tracked separately. |
mhellevang
force-pushed
the
perf/sbp2-zero-copy
branch
2 times, most recently
from
October 22, 2026 11:32
53fc15c to
c01c1ea
Compare
This was referenced Oct 22, 2026
mhellevang
force-pushed
the
perf/sbp2-zero-copy
branch
from
October 23, 2026 07:44
c01c1ea to
c3c1116
Compare
mhellevang
marked this pull request as ready for review
October 23, 2026 08:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split of #213 (merge order):
Zero-copy, on top of #218 and #217; draft until they land. The diff shows their commits until then.
The kernel SCSI shim maps each task's buffer for our PCI device before
UserProcessParallelTaskand keeps it untilParallelTaskCompletion(fBufferIOVMAddr, one segment). WithUserGetDMASpecificationat 32 address bits that mapping lies belowPhysicalUpperBound, so the SBP-2 target reads and writes it directly, as Apple's SBP-2 does with the task's memory descriptor (IOFireWireSBP2ORB.cppprepareBufferAddressSpace).CommandRequest::dataIOVAcarries the address; the executor builds the page table from it and allocates nothing;CommandResult::inPlaceBytesreports the transfer.UserGetDataBufferis gone from the HBA: per the SDK it invalidates thefBufferIOVMAddrmapping, so the two are exclusive. The bounce buffer from #217 stays for the raw user client, which has no mapping of its own.Per READ this removes the bounce allocation, the
memset, the copy into astd::vector, thevalue_orcopy and thememcpyinto the task buffer, plus oneIOBufferMemoryDescriptorper task.Lifetime: the kernel reuses the task buffer at
ParallelTaskCompletion. A result after an unfetched LUN reset (the existing bus-reset escalation) is therefore held untilOnBusResetfor an in-place command; a bounce buffer is ours and its result still goes out at once. The same holds when no LUN reset can be issued because a client task-management ORB is already in flight: the in-place result waits for that status. Release at dext teardown is covered by #218 clearing the filter first; the other release cause is a device that has left the bus. Normal status, LUN-reset recovery (completion is deferred until its status) and bus reset are unchanged edges. Release at dext teardown completes tasks at once; #218 clears the physical request filter before the bridge shuts down, so the kernel can reuse those buffers safely. The other release cause is a device that left the bus.Host tests: in-place READ uses the caller's address and allocates no range, data-out needs no payload, page table covers the caller's range at 60 KiB boundaries. HW: the probe build with this exact data path ran a clean full LS-9000 scan with all tasks in place (
fBufferIOVMAddrin the0x801d8000range, see #217); see the run on this branch below.Two things stay as they are, stated so they are not missed: the transfer length handed to the target is
fRequestedTransferCount, the length the kernel mapped, and there is no second length to check it against withoutUserGetDataBuffer; andfBytesTransferredreports the full length on GOOD, as the bounce path did (SBP-2 carries no residual), the difference being that a short read now leaves the client's own buffer tail untouched instead of zero-filled.