rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomo@exabit.dev>
To: bjorn3_gh@protonmail.com
Cc: daniel.almeida@collabora.com, wedsonaf@gmail.com,
	ojeda@kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, kernel@collabora.com
Subject: Re: [PATCH] rust: virtio: add virtio support
Date: Wed, 8 Mar 2023 00:33:59 +0000	[thread overview]
Message-ID: <01010186bea3a046-f1f68507-2d3c-41c3-9066-44199e2ce071-000000@us-west-2.amazonses.com> (raw)
In-Reply-To: <OBVROfBri9SuVdfyos-71URYovcNLhbDb_50cECWMwhycY2sHH90w28f0qlJ_q_dMuCnOD_4nQCVUnwOkgyCEH1298nsVLW0YFuuiIlLPow=@protonmail.com>

On Tue, 07 Mar 2023 17:09:27 +0000
Björn Roy Baron <bjorn3_gh@protonmail.com> wrote:

> On Tuesday, March 7th, 2023 at 14:03, Daniel Almeida <daniel.almeida@collabora.com> wrote:
> 
>> This patch adds virtIO support to the rust crate. This includes the
>> capability to create a virtIO driver (through the module_virtio_driver
>> macro and the respective Driver trait) as well as initial virtqueue
>> support.
>> 
>> A sample virtIO module is included for conveninence.
>> 
>> Signed-off-by: Daniel Almeida daniel.almeida@collabora.com
>> 
>> ---
>> 
>> Ok so this is my first Rust contribution here. It's part of a virtIO
>> driver I was originally writing. Both the probing and the virtqueue
>> support in here were confirmed as working in said prototype driver, and
>> the pieces were picked separately into this patch.
>> 
>> Feel free to point me to the best practices around Rust patch
>> submission, as the C stuff like checkpatch etc probably does not apply
>> yet. I did take care to run clippy though.
>> 
> 
> Great to see Rust support for the driver side of VirtIO! I've got a couple of review comments, but I don't see any big issues. Maybe you could write an actual driver which uses add_sgs though? It doesn't have to be complicated, but just something to show how it will work. That may help with checking if the api is usable. You might try something like virtio-console or virtio-entropy I think.

There was an attempt to implement virtio-net, which might be useful:

https://github.com/Rust-for-Linux/linux/pull/886

C versions of virtio-console, virtio-rng, and virtio-net exists. Both
C and Rust versions in mainline?

Are there guidelines on pushing a Rust driver in mainline?

  reply	other threads:[~2023-03-08  0:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 13:03 [PATCH] rust: virtio: add virtio support Daniel Almeida
2023-03-07 16:46 ` Gary Guo
2023-03-08  4:08   ` Wedson Almeida Filho
2023-03-07 17:09 ` Björn Roy Baron
2023-03-08  0:33   ` FUJITA Tomonori [this message]
2023-03-08  3:36     ` Miguel Ojeda
2023-03-07 18:08 ` 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=01010186bea3a046-f1f68507-2d3c-41c3-9066-44199e2ce071-000000@us-west-2.amazonses.com \
    --to=tomo@exabit.dev \
    --cc=bjorn3_gh@protonmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=kernel@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).