rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomo@exabit.dev>
To: rust-for-linux@vger.kernel.org
Cc: aliceryhl@google.com, andrew@lunn.ch,
	FUJITA Tomonori <fujita.tomonori@gmail.com>
Subject: [PATCH v2 0/5] add abstractions for network device drivers
Date: Sat, 10 Jun 2023 07:20:13 +0000	[thread overview]
Message-ID: <01010188a42d5244-fffbd047-446b-4cbf-8a62-9c036d177276-000000@us-west-2.amazonses.com> (raw)

From: FUJITA Tomonori <fujita.tomonori@gmail.com>

This patchset adds minimum abstractions for network device drivers and
Rust dummy network device driver, a simpler version of drivers/net/dummy.c.

The dummy network device driver doesn't attach any bus such as PCI so
the dependency is minimum. Hopefully, it would make reviewing easier.

Changes since v1:
- avoids listing all the operations in net_device_ops and ethtool_ops
- renames the dummy device driver (rust_dummy to rust_net_dummy)
- removes atomic ops in the dummy device driver
- uses Opaque for rtnl_link_stats64 instead of raw pointer
- simplifies the code (cast, static, etc)

Thanks a lot for the comments on v1!


FUJITA Tomonori (5):
  rust: core abstractions for network device drivers
  rust: add support for ethernet operations
  rust: add support for get_stats64 in struct net_device_ops
  rust: add methods for configure net_device
  samples: rust: add dummy network driver

 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          | 514 ++++++++++++++++++++++++++++++++
 samples/rust/Kconfig            |  11 +
 samples/rust/Makefile           |   1 +
 samples/rust/rust_net_dummy.rs  |  85 ++++++
 scripts/Makefile.build          |   2 +-
 9 files changed, 646 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: d09a61024f6b78c6a08892fc916cdafd87b50365
-- 
2.34.1


             reply	other threads:[~2023-06-10  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10  7:20 FUJITA Tomonori [this message]
2023-06-10  9:52 ` [PATCH v2 0/5] add abstractions for network device drivers Miguel Ojeda
2023-06-10 10:09   ` FUJITA Tomonori
2023-06-10 11:24     ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01010188a42d5244-fffbd047-446b-4cbf-8a62-9c036d177276-000000@us-west-2.amazonses.com \
    --to=tomo@exabit.dev \
    --cc=aliceryhl@google.com \
    --cc=andrew@lunn.ch \
    --cc=fujita.tomonori@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).