nvme/util: don't chain a PRP list page that isn't actually needed - #67
Merged
Conversation
nvme_map_prp()/nvme_mapv_prp() build the PRP list through a cursor that chains onto the next page as soon as it reaches a page's last slot and another entry follows. It can't tell whether that next entry is really the last one overall, so whenever the transfer size lands exactly on a page boundary (e.g. a 2047K transfer at a 512B LBA size, which needs almost exactly one page's worth of PRP entries) and the caller provides more than one prplist page as a safety margin, the cursor spills the final entry onto the second page even though the first page had room for it. Thread through whether the entry being appended is truly the last one, so the cursor can place it directly instead of reserving a chain link that turns out to be unnecessary. Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
lsgunth
approved these changes
Jul 30, 2026
lsgunth
left a comment
Contributor
There was a problem hiding this comment.
I've reviewed the patch and it looks correct to me. Thanks!
iomartin
pushed a commit
to Eideticom/libvfn-pub
that referenced
this pull request
Aug 17, 2026
Add Job File Support
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.
nvme_map_prp()/nvme_mapv_prp() build the PRP list through a cursor that chains onto the next page as soon as it reaches a page's last slot and another entry follows. It can't tell whether that next entry is really the last one overall, so whenever the transfer size lands exactly on a page boundary (e.g. a 2047K transfer at a 512B LBA size, which needs almost exactly one page's worth of PRP entries) and the caller provides more than one prplist page as a safety margin, the cursor spills the final entry onto the second page even though the first page had room for it.
Thread through whether the entry being appended is truly the last one, so the cursor can place it directly instead of reserving a chain link that turns out to be unnecessary.