[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a47f7bd8-57fc-4255-9329-6b4129ce8d36@lunn.ch>
Date: Fri, 15 Aug 2025 21:23:26 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Guilherme Novaes Lima <acc.guilhermenl@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: Seeking guidance on Rust porting for network driver as a
learning project
On Fri, Aug 15, 2025 at 09:10:34PM +0200, Andrew Lunn wrote:
> > If there are any maintainers or experienced folks willing to offer
> > guidance or suggest a suitable driver for this kind of project, I’d
> > be very grateful.
>
> The problem is, network devices make use of a very large number of
> APIs into core Linux. It is hard to write a Rust networking driver
> until there are rust bindings for all these APIs.
>
> To stand any chance of writing a networking driver in Rust, you need
> to find a really simple device. How far has Rust got with I2C or SPI?
> Is it possible to write a simple Rust I2C or SPI client driver? If so,
> maybe look for an I2C or SPI network device which is currently
> unsupported. That will simplify things a lot.
>
> Or maybe see if you can find a USB Ethernet dongle which is currently
> unsupported, that would make use of usbnet to provide most of the
> code. You then need a Rust binding onto usbnet, plus a number of other
> Rust bindings onto anything else needed.
Another idea might be an Ethernet switch which is not supported by DSA
at the moment. Such drivers tend to only call a few APIs. You need to
be able to read/write registers in the switch, which is generally
MDIO, SPI, or I2C. And you need to implement a subset of struct
dsa_switch_ops. DSA switch drivers don't actually handle frames, which
makes them a lot simpler in terms of Rust bindings.
Andrew
Powered by blists - more mailing lists