Skip to content

rust: virtio: add virtio support

Daniel Almeida lkml rust-for-linux virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 6 repliesIn review
  2. v11 patch 6 repliesSuperseded

Changes in v2 from the cover letter

- Addressed review comments by Miguel and Bjorn.
- Added a scatterlist abstraction
- Added a virtio-rng based sample

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: add scatterlist supportrust/kernel/lib.rs rust/kernel/scatterlist.rs+41 -01 reply
2/2rust: virtio: add virtio supportrust/bindings/bindings_helper.h rust/helpers.c rust/kernel/lib.rs +5 more+623 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] rust: virtio: add virtio support

This used to be a single patch, but I split it into two with the addition of struct Scatterlist.

Again a bit new with Rust submissions. I was told by Gary Guo to rebase on top of rust-next, but it seems *very* behind?

The first patch does not build on its own due to a dead_code warning. It is hard to not have dead code when one is adding infrastructure to be used by others at a later opportunity. Let me know if you would like to see the patches squashed into one to fix this.

As suggested by Bjorn, I added a small virtio-entropy based sample. It is a very bare-bones clone of virtio-rng.c that only sends a single request.

Changes from v1:

- Addressed review comments by Miguel and Bjorn.
- Added a scatterlist abstraction
- Added a virtio-rng based sample

Daniel Almeida (2):
rust: add scatterlist support
rust: virtio: add virtio support

 rust/bindings/bindings_helper.h |   3 +
 rust/helpers.c                  |  25 +++
 rust/kernel/lib.rs              |   3 +
 rust/kernel/scatterlist.rs      |  40 +++++
 rust/kernel/virtio.rs           | 261 ++++++++++++++++++++++++++++++++
 rust/kernel/virtio/virtqueue.rs | 126 +++++++++++++++
 samples/rust/Kconfig            |  10 ++
 samples/rust/Makefile           |   1 +
 samples/rust/rust_virtio.rs     | 195 ++++++++++++++++++++++++
 9 files changed, 664 insertions(+)
 create mode 100644 rust/kernel/scatterlist.rs
 create mode 100644 rust/kernel/virtio.rs
 create mode 100644 rust/kernel/virtio/virtqueue.rs
 create mode 100644 samples/rust/rust_virtio.rs
Signature · 6 lines
2.40.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization