From: Daniel Almeida <daniel.almeida@collabora.com>
To: wedsonaf@gmail.com, ojeda@kernel.org
Cc: Daniel Almeida <daniel.almeida@collabora.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: [PATCH v2 0/2] rust: virtio: add virtio support
Date: Wed, 5 Apr 2023 17:14:14 -0300 [thread overview]
Message-ID: <20230405201416.395840-1-daniel.almeida@collabora.com> (raw)
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
--
2.40.0
next reply other threads:[~2023-04-05 20:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 20:14 Daniel Almeida [this message]
2023-04-05 20:14 ` [PATCH v2 1/2] rust: add scatterlist support Daniel Almeida
2023-04-06 14:21 ` Martin Rodriguez Reboredo
2023-04-05 20:14 ` [PATCH v2 2/2] rust: virtio: add virtio support Daniel Almeida
2023-04-06 14:22 ` Martin Rodriguez Reboredo
2023-04-06 18:26 ` Wedson Almeida Filho
2023-04-06 19:04 ` Wedson Almeida Filho
2023-04-07 23:36 ` Daniel Almeida
2023-04-05 23:19 ` [PATCH v2 0/2] " Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230405201416.395840-1-daniel.almeida@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).