STRUCT VLAN_DEV_PRIV(9)
π 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 themselvesnr_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 flagsreal_devβ the underlying netdevice. the parent, the origin story π«Άdev_trackerβ refcount tracker for thereal_devreference. she's watching the refcount so you don't have to π§real_dev_addrβ address of the underlying netdevicedentβ proc dir entryvlan_pcpu_statsβ ptr to percpu rx stats. per-CPU, so every core gets her own stats, iconic βnetpollβ netpoll instance "propagated" down toreal_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: thatnetpollmember 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms