Rust Code Updated For The Linux Kernel - Networking & Async Support Started
Written by Michael Larabel in Programming on 7 May 2022 at 06:26 AM EDT. 26 Comments
PROGRAMMING --
Making for an exciting Saturday morning, Miguel Ojeda has posted the latest patch series plumbing Rust language support into the Linux kernel. The "Rust for the Linux kernel" patches are now up to their sixth version for adding the necessary infrastructure for this second, optional language to the kernel plus continuing to add more sample code / basic functionality for showing off use of this memory-safety-focused language for kernel purposes.

The Rust for Linux effort continues running strong with many developers and organizations interested in seeing the ability to begin making use of Rust code in the kernel especially for areas prone to memory safety issues. With the v6 patches out today, the toolchain support has been updated against Rust 1.60, support for running documentation tests in-kernel, and other Rust infrastructure improvements.


When it comes to Rust code usage within the kernel, the start of networking support is found with this patch series. The "net" module has support for types like Namespace, SkBuff, Ipv4Addr, SocketAddrV4, TcpListener, and more. There is also the start of "async" support for asynchronous kernel programming. The current state already is working for allowing asynchronous TCP socket code. The new Rust code also adds support for network packet filters and other new features.

As of this Rust for Linux v6 series, the Rust support is still considered "experimental" but good enough that kernel developers can begin working on Rust abstractions for other kernel subsystems and porting more drivers over to Rust, if desired.

More details on the updated Rust code for the Linux kernel via this patch series. The Rust kernel effort currently amounts to 37.9k lines of code including the infrastructure, subsystem abstractions started so far, sample code, and converting some Android and GPIO driver code to Rust as additional examples.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week