* Seeking guidance on Rust porting for network driver as a learning project
@ 2025-08-15 15:05 Guilherme Novaes Lima
2025-08-15 17:11 ` Jakub Kicinski
2025-08-15 19:10 ` Andrew Lunn
0 siblings, 2 replies; 7+ messages in thread
From: Guilherme Novaes Lima @ 2025-08-15 15:05 UTC (permalink / raw)
To: netdev
Hello everyone,
I’m a computer science student working on a graduation project focused on learning more about the Linux kernel and Rust. I understand that the kernel maintainers have been cautious about integrating Rust, and my intention is not to push for any immediate changes, but rather to explore Rust porting as a learning exercise.
Specifically, I’m interested in working with a network driver to get hands-on experience. My goal is to comply fully with the community’s expectations and guidelines, and to better understand the technical and cultural aspects before considering any real contributions in the future.
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. I’m not asking anyone to do the work, just hoping to learn and engage respectfully with the community.
Thanks for your time and any advice you can share.
Best regards,
Guilherme Lima
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Seeking guidance on Rust porting for network driver as a learning project
2025-08-15 15:05 Seeking guidance on Rust porting for network driver as a learning project Guilherme Novaes Lima
@ 2025-08-15 17:11 ` Jakub Kicinski
2025-08-15 19:10 ` Andrew Lunn
1 sibling, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2025-08-15 17:11 UTC (permalink / raw)
To: Guilherme Novaes Lima; +Cc: netdev
On Fri, 15 Aug 2025 12:05:14 -0300 Guilherme Novaes Lima wrote:
> I’m a computer science student working on a graduation project
> focused on learning more about the Linux kernel and Rust. I
> understand that the kernel maintainers have been cautious about
> integrating Rust, and my intention is not to push for any immediate
> changes, but rather to explore Rust porting as a learning exercise.
>
> Specifically, I’m interested in working with a network driver to get
> hands-on experience. My goal is to comply fully with the community’s
> expectations and guidelines, and to better understand the technical
> and cultural aspects before considering any real contributions in the
> future.
>
> 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. I’m not asking anyone to do the work, just hoping
> to learn and engage respectfully with the community.
You are specifically asking about in-kernel network driver code,
which, well, perhaps this is too blunt but personally feels like
a significant waste of community/reviewer time.
If you're open to kernel-related but user space coding - a port of YNL
to Rust would be most useful:
https://docs.kernel.org/next/userspace-api/netlink/intro-specs.html#ynl-lib
We have sort-of-a-port from C to C++ here:
https://github.com/linux-netdev/ynl-cpp
But nobody to my knowledge attempted a Rust version.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Seeking guidance on Rust porting for network driver as a learning project
2025-08-15 15:05 Seeking guidance on Rust porting for network driver as a learning project Guilherme Novaes Lima
2025-08-15 17:11 ` Jakub Kicinski
@ 2025-08-15 19:10 ` Andrew Lunn
2025-08-15 19:23 ` Andrew Lunn
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2025-08-15 19:10 UTC (permalink / raw)
To: Guilherme Novaes Lima; +Cc: netdev
> 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.
This is not a simple problems space. It is going to need a lot of time
and effort to do anything useful.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Seeking guidance on Rust porting for network driver as a learning project
2025-08-15 19:10 ` Andrew Lunn
@ 2025-08-15 19:23 ` Andrew Lunn
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2025-08-15 19:23 UTC (permalink / raw)
To: Guilherme Novaes Lima; +Cc: netdev
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Seeking guidance on Rust porting for network driver as a learning project
@ 2025-08-15 23:27 Guilherme Novaes Lima
2025-08-16 0:30 ` Andrew Lunn
0 siblings, 1 reply; 7+ messages in thread
From: Guilherme Novaes Lima @ 2025-08-15 23:27 UTC (permalink / raw)
To: andrew; +Cc: acc.guilhermenl, netdev
Hi Andrew,
> Another idea might be an Ethernet switch which is not supported by DSA
> at the moment.
Thank you for your reply. The ideal would be to do something simple, the actual implementation of the driver would be the secondary focus of the research. What I originally intended to do was to port over r8169, I didn’t have switches in mind. Do you think that would be too hard? Sorry for my inexperience, I’m a complete noob when it comes to kernel / driver development, so I thank you again for your patience and generosity.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Seeking guidance on Rust porting for network driver as a learning project
2025-08-15 23:27 Guilherme Novaes Lima
@ 2025-08-16 0:30 ` Andrew Lunn
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2025-08-16 0:30 UTC (permalink / raw)
To: Guilherme Novaes Lima; +Cc: netdev
On Fri, Aug 15, 2025 at 08:27:53PM -0300, Guilherme Novaes Lima wrote:
> Hi Andrew,
>
> > Another idea might be an Ethernet switch which is not supported by DSA
> > at the moment.
>
> Thank you for your reply. The ideal would be to do something simple, the actual implementation of the driver would be the secondary focus of the research. What I originally intended to do was to port over r8169, I didn’t have switches in mind. Do you think that would be too hard? Sorry for my inexperience, I’m a complete noob when it comes to kernel / driver development, so I thank you again for your patience and generosity.
Any code you produce for the r8169 will not be merged. We don't want
reimplementations of existing drivers. r8169 is widely used, and
currently Rust only supports a subset of architectures. It makes no
sense to have a minimal Rust driver for a few architectures and a full
featured driver for all architectures. This is why i suggested writing
a driver for something which currently does not have a driver. If
Linux currently does not support some hardware, we don't care too much
that a Rust driver works for a subset of architectures. Its better
than nothing.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Seeking guidance on Rust porting for network driver as a learning project
@ 2025-08-15 14:27 Guilherme Novaes Lima
0 siblings, 0 replies; 7+ messages in thread
From: Guilherme Novaes Lima @ 2025-08-15 14:27 UTC (permalink / raw)
To: linux-hams
Hello everyone,
I’m a computer science student working on a graduation project focused on learning more about the Linux kernel and Rust. I understand that the kernel maintainers have been cautious about integrating Rust, and my intention is not to push for any immediate changes, but rather to explore Rust porting as a learning exercise.
Specifically, I’m interested in working with a network driver to get hands-on experience. My goal is to comply fully with the community’s expectations and guidelines, and to better understand the technical and cultural aspects before considering any real contributions in the future.
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. I’m not asking anyone to do the work, just hoping to learn and engage respectfully with the community.
Thanks for your time and any advice you can share.
Best regards,
Guilherme Lima
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-08-16 0:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 15:05 Seeking guidance on Rust porting for network driver as a learning project Guilherme Novaes Lima
2025-08-15 17:11 ` Jakub Kicinski
2025-08-15 19:10 ` Andrew Lunn
2025-08-15 19:23 ` Andrew Lunn
-- strict thread matches above, loose matches on Subject: below --
2025-08-15 23:27 Guilherme Novaes Lima
2025-08-16 0:30 ` Andrew Lunn
2025-08-15 14:27 Guilherme Novaes Lima
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.