| From: |
| FUJITA Tomonori <fujita.tomonori-AT-gmail.com> |
| To: |
| rust-for-linux-AT-vger.kernel.org, netdev-AT-vger.kernel.org |
| Subject: |
| [PATCH v2 0/5] Rust abstractions for network device drivers |
| Date: |
| Mon, 10 Jul 2023 16:36:58 +0900 |
| Message-ID: |
| <20230710073703.147351-1-fujita.tomonori@gmail.com> |
| Cc: |
| kuba-AT-kernel.org, andrew-AT-lunn.ch, aliceryhl-AT-google.com, miguel.ojeda.sandonis-AT-gmail.com, benno.lossin-AT-proton.me |
| Archive-link: |
| Article |
This patchset adds minimum Rust abstractions for network device
drivers and an example of a Rust network device driver, a simpler
version of drivers/net/dummy.c.
The major change is a way to drop an skb (1/5 patch); a driver needs
to explicitly call a function to drop a skb. The code to let a skb
go out of scope can't be compiled.
I dropped get_stats64 support patch that the current sample driver
doesn't use. Instead I added a patch to update the NETWORKING DRIVERS
entry in MAINTAINERS.
Changes since v1 [1]:
- a driver must explicitly call a function to drop a skb.
- simplify the code (thanks to Benno Lossin).
- update MAINTAINERS file.
[1] https://lwn.net/ml/netdev/20230613045326.3938283-1-fujita...
FUJITA Tomonori (5):
rust: core abstractions for network device drivers
rust: add support for ethernet operations
rust: add methods for configure net_device
samples: rust: add dummy network driver
MAINTAINERS: add Rust network abstractions files to the NETWORKING
DRIVERS entry
MAINTAINERS | 2 +
rust/bindings/bindings_helper.h | 3 +
rust/helpers.c | 23 ++
rust/kernel/lib.rs | 3 +
rust/kernel/net.rs | 5 +
rust/kernel/net/dev.rs | 598 ++++++++++++++++++++++++++++++++
samples/rust/Kconfig | 13 +
samples/rust/Makefile | 1 +
samples/rust/rust_net_dummy.rs | 75 ++++
scripts/Makefile.build | 2 +-
10 files changed, 724 insertions(+), 1 deletion(-)
create mode 100644 rust/kernel/net.rs
create mode 100644 rust/kernel/net/dev.rs
create mode 100644 samples/rust/rust_net_dummy.rs
base-commit: d2e3115d717197cb2bc020dd1f06b06538474ac3
--
2.34.1