Skip to content

devices/vsock: support multi-descriptor TX chains#680

Open
slp wants to merge 1 commit into
containers:mainfrom
slp:vsock-multi-desc
Open

devices/vsock: support multi-descriptor TX chains#680
slp wants to merge 1 commit into
containers:mainfrom
slp:vsock-multi-desc

Conversation

@slp
Copy link
Copy Markdown
Collaborator

@slp slp commented May 14, 2026

from_tx_virtq_head assumed a fixed 2-descriptor layout (header + one data descriptor), which breaks with newer kernels that may combine header and data in a single descriptor (Linux 6.2+) or split data across multiple descriptors.

Handle three cases: single combined descriptor (zero-copy), classic two-descriptor (zero-copy, unchanged), and multi-descriptor data (copied into an owned contiguous buffer). The RX path already handled the combined case; this brings the TX path to parity and beyond.

Assisted-by: <anthropic/claude-opus-4.6>

@slp
Copy link
Copy Markdown
Collaborator Author

slp commented May 14, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the VsockPacket implementation to support multiple data regions by introducing an owned_buf for cases where packet data is non-contiguous in guest memory. It adds logic to handle single combined descriptors, classic two-descriptor zero-copy packets, and complex multi-descriptor chains that require copying into the new owned buffer. Feedback was provided regarding a behavioral inconsistency in buf_mut(): for multi-descriptor packets, modifications to the returned mutable slice will only affect the local owned_buf and will not be reflected back in guest memory, unlike the zero-copy implementation.

Comment thread src/devices/src/virtio/vsock/packet.rs
@mtjhrc
Copy link
Copy Markdown
Collaborator

mtjhrc commented May 14, 2026

Just a nitpick, FYI the Assisted-by: <anthropic/claude-opus-4.6> tag doesn't match the CONTRIBUTING.md format.

anthropic is not a name of a coding agent harness, (did you mean Claude Code or perhaps OpenCode?)
Also according to the merged CONTRIBUTING.md the format should be Assisted-by: Claude Code:claude-opus-4.6 I suppose. (yeah the space is weird, but it is technically called "Claude Code" with a space...)

Maybe I'll try creating a CI check for this...

@nohajc
Copy link
Copy Markdown
Contributor

nohajc commented May 14, 2026

@mtjhrc I was amending one of my commits to use the prescribed format and there's actually an issue that sometimes you might not know what the model was.

For example Copilot only puts the harness name to its own commits and it's possible to use model "auto". I'm not sure if you can always retrieve information about the exact model used in that case.

@lstocchi
Copy link
Copy Markdown
Contributor

Maybe I'll try creating a CI check for this...

My .02 cents ... I wonder if we should be a bit elastic around the naming and avoid adding a deep CI check.
The RH guidelines (here) just mention we should use the labels Assisted-by/Generated-by but then there is no a strict rule how the value must be formatted. I see in some projects there is a preference to use tool (model) (e.g. Assisted-by: OpenCode (Claude Opus 4.6)), in others just model (context) (e.g. Claude Opus 4.6 (1M context)). Also, as said by @nohajc you may not know exactly the model you used. In some cases i saw Co-authored-by: Claude <noreply@anthropic.com> without any model mention.

Idk if you received other direction but AFAIK for statistical measurements they're just detecting the Assisted-by label.

from_tx_virtq_head assumed a fixed 2-descriptor layout (header + one
data descriptor), which breaks with newer kernels that may combine
header and data in a single descriptor (Linux 6.2+) or split data
across multiple descriptors.

Handle three cases: single combined descriptor (zero-copy), classic
two-descriptor (zero-copy, unchanged), and multi-descriptor data
(copied into an owned contiguous buffer). The RX path already handled
the combined case; this brings the TX path to parity and beyond.

Assisted-by: Claude Code:claude-opus-4.6
Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp slp force-pushed the vsock-multi-desc branch from 05f5b45 to 76a77db Compare May 14, 2026 15:05
@slp
Copy link
Copy Markdown
Collaborator Author

slp commented May 14, 2026

Just a nitpick, FYI the Assisted-by: <anthropic/claude-opus-4.6> tag doesn't match the CONTRIBUTING.md format.

anthropic is not a name of a coding agent harness, (did you mean Claude Code or perhaps OpenCode?) Also according to the merged CONTRIBUTING.md the format should be Assisted-by: Claude Code:claude-opus-4.6 I suppose. (yeah the space is weird, but it is technically called "Claude Code" with a space...)

Fixed, thanks!

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.

4 participants