[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <01010186bea3a046-f1f68507-2d3c-41c3-9066-44199e2ce071-000000@us-west-2.amazonses.com>
Date: Wed, 8 Mar 2023 00:33:59 +0000
From: FUJITA Tomonori <tomo@...bit.dev>
To: bjorn3_gh@...tonmail.com
Cc: daniel.almeida@...labora.com, wedsonaf@...il.com, ojeda@...nel.org,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, kernel@...labora.com
Subject: Re: [PATCH] rust: virtio: add virtio support
On Tue, 07 Mar 2023 17:09:27 +0000
Björn Roy Baron <bjorn3_gh@...tonmail.com> wrote:
> On Tuesday, March 7th, 2023 at 14:03, Daniel Almeida <daniel.almeida@...labora.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@...labora.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?
Powered by blists - more mailing lists