STRUCT VLAN_DEV_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct vlan_dev_priv(9) β€” Kernel API Manual, but make it make sense

okay bestie, so this one's from the Kernel API Manual section struct vlan_dev_priv(9), and it's literally the private data blob that lives inside every VLAN device. think of it as the VLAN device's little diary πŸŽ€ β€” everything it needs to remember about itself, its parent, and its tag mappings lives right here.


✨ NAME ✨

struct vlan_dev_priv β€” VLAN private device data. that's it, that's the vibe. it's the private stash of stuff hanging off a VLAN netdevice πŸ¦‹


🌸 SYNOPSIS 🌸

here's the whole struct, copied exactly, no cap:

struct vlan_dev_priv {
    unsigned int                            nr_ingress_mappings;
    u32 ingress_priority_map[8];
    unsigned int                            nr_egress_mappings;
    struct vlan_priority_tci_mapping *egress_priority_map[16];
    __be16 vlan_proto;
    u16 vlan_id;
    u16 flags;
    struct net_device                       *real_dev;
    netdevice_tracker dev_tracker;
    unsigned char                           real_dev_addr[ETH_ALEN];
    struct proc_dir_entry                   *dent;
    struct vlan_pcpu_stats __percpu         *vlan_pcpu_stats;
  #ifdef CONFIG_NET_POLL_CONTROLLER;
    struct netpoll                          *netpoll;
  #endif;
 };

πŸ‘‘ Members πŸ‘‘

okay so every field, one by one, and what it's giving:

  • nr_ingress_mappings β€” the number of ingress priority mappings. literally just the count, keeping tally πŸ”₯
  • ingress_priority_map β€” the ingress priority mappings themselves
  • nr_egress_mappings β€” number of egress priority mappings. again: just the count, bestie 🌈
  • egress_priority_map β€” a hash of egress priority mappings (yes, a hash, she's organized)
  • vlan_proto β€” the VLAN encapsulation protocol πŸ‘‘
  • vlan_id β€” the VLAN identifier. the whole point tbh πŸ’…
  • flags β€” device flags
  • real_dev β€” the underlying netdevice. the parent, the origin story 🫢
  • dev_tracker β€” refcount tracker for the real_dev reference. she's watching the refcount so you don't have to 🧚
  • real_dev_addr β€” address of the underlying netdevice
  • dent β€” proc dir entry
  • vlan_pcpu_stats β€” ptr to percpu rx stats. per-CPU, so every core gets her own stats, iconic ⭐
  • netpoll β€” netpoll instance "propagated" down to real_dev. note the quotes, that's how the original says it πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

all the related reading, fr fr β€” go touch these next:

Kernel file ./include/linux/if_vlan.h: struct vlan_ethhdr(9), struct vlan_pcpu_stats(9), struct vlan_priority_tci_mapping(9), eth_type_vlan(9), __vlan_insert_inner_tag(9), __vlan_insert_tag(9), vlan_insert_inner_tag(9), vlan_insert_tag(9), vlan_insert_tag_set_proto(9), __vlan_hwaccel_clear_tag(9), __vlan_hwaccel_copy_tag(9), __vlan_hwaccel_put_tag(9), __vlan_get_tag(9), __vlan_hwaccel_get_tag(9), vlan_get_tag(9), vlan_get_protocol_offset_inline(9), vlan_get_protocol(9), vlan_remove_tag(9), skb_vlan_tagged(9), skb_vlan_tagged_multi(9), vlan_features_check(9), compare_vlan_header(9)


heads up bestie: that netpoll member is wrapped in #ifdef CONFIG_NET_POLL_CONTROLLER β€” so if your kernel isn't built with that, she literally doesn't exist in the struct πŸ’€ don't go reaching for her.

and that's the whole page!! sourced from ./include/linux, dated October 2026, filed under struct vlan_dev_priv(9) β€” mwah, go read the actual header, ily, bye πŸ“πŸ’œ

πŸ“¦ where this page comes from