Skip to content

Conversation

ShadowCurse
Copy link
Contributor

@ShadowCurse ShadowCurse commented Aug 16, 2024

Changes

Add support for INDIRECT_DESC for IoVecBuff/Mut and enabled VIRTIO_RING_F_INDIRECT_DESC flag for virtio-net device. This feature allows guest to create more buffers for packets which in turn should help with throughput when all available descriptors are used.

Note that indirect descriptors can only be enabled for TX queue. This is a linux virtio-net driver behavior.

Reason

Should help with network performance.

Note

This PR is built on top of #4658, so needs to be merged after it.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

VIRTIO_RING_F_INDIRECT_DESC is declared in the virtio_ring.h,
so modify bindgen to parse all `VIRTIO_RING_` constants.

Signed-off-by: Egor Lazarchuk <[email protected]>
Now IoVecBuffer/Mut can be built from descriptor chains
utilizing VIRTQ_DESC_F_INDIRECT flag.
The way indirect descriptors work is:
- Descriptors from descriptor table instead of pointing
to the buffers where data needs to be written to/read from
now can point to buffers that contain other descriptor table.
That 'indirect' descriptor table contains descriptor which
point to actual buffers for data.
- All descriptor in the 'indirect' descriptor table are
processed sequentially.
- The `VIRTQ_DESC_F_WRITE` flag is ignored for the main descriptor
(the one from original descriptor table)

Signed-off-by: Egor Lazarchuk <[email protected]>
@ShadowCurse
Copy link
Contributor Author

After doing performance testing there is no impact from indirect descriptors, closing.

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.

1 participant