Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DMA message size calculation #788

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

mnissler-rivos
Copy link
Contributor

When performing DMA via VFIO-user commands over the socket, vfu_dma_transfer breaks large requests into chunks according to the client's maximum data transfer size negotiated at connection setup time. This change fixes the calculation of the chunk size for the case where the last chunk is less than the maximum transfer size.

Unfortunately, the existing test didn't catch this due to the request size being a multiple of that maximum data transfer size. Adjust the test to make the last chunk size a true remainder.

@mnissler-rivos
Copy link
Contributor Author

FWIW, the arch-202307 failure looks unrelated to this change.

@jlevon
Copy link
Collaborator

jlevon commented Jan 24, 2024

arch appears to be fundamentally unstable, see #770

@jlevon
Copy link
Collaborator

jlevon commented Jan 24, 2024

please add your signed-off-by

@jlevon
Copy link
Collaborator

jlevon commented Jan 24, 2024

LGTM otherwise

@mnissler-rivos
Copy link
Contributor Author

Thanks for the quick reply!

please add your signed-off-by

Gah, my favorite mistake. Fixed now.

When performing DMA via VFIO-user commands over the socket,
vfu_dma_transfer breaks large requests into chunks according to the
client's maximum data transfer size negotiated at connection setup time.
This change fixes the calculation of the chunk size for the case where
the last chunk is less than the maximum transfer size.

Unfortunately, the existing test didn't catch this due to the request
size being a multiple of that maximum data transfer size. Adjust the
test to make the last chunk size a true remainder.

Signed-off-by: Mattias Nissler <[email protected]>
@jlevon jlevon merged commit 6f6fdc5 into nutanix:master Jan 24, 2024
7 of 8 checks passed
@mnissler-rivos
Copy link
Contributor Author

Thanks for the quick turnaround, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants