Re: [PATCH 1/4] rust: netlink: add raw netlink abstraction
From: Andrew Lunn
Date: Sat Mar 07 2026 - 10:44:05 EST
> diff --git a/rust/kernel/netlink.rs b/rust/kernel/netlink.rs
...
> +/// The default netlink message size.
> +pub const GENLMSG_DEFAULT_SIZE: usize = bindings::GENLMSG_DEFAULT_SIZE;
> +
> +/// A wrapper around `struct sk_buff` for generic netlink messages.
> +///
> +/// # Invariants
> +///
> +/// The pointer has ownership over a valid `sk_buff`.
> +pub struct SkBuff {
> + skb: NonNull<kernel::bindings::sk_buff>,
> +}
struct sk_buff is a core data structure which appears all over the
networking stack, but also other places like crypto, scsi, tty, file
systems, etc. Since it is a top level data structure, it seems odd
Rust puts it into netlink.rs.
How do you see the Rust SkBuff evolving to a general purpose data
structure which can be used everywhere?
Andrew