STRUCT VPORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

struct vport β€” literally one port inside a datapath, that's the whole vibe πŸ’…

(this is a page from the struct vport(9) manual, bestie, section 9, Kernel API Manual energy ✨)


✨ SYNOPSIS ✨

ok so here's the whole struct, no cap, copy it exactly:

struct vport {
    struct net_device *dev;
    netdevice_tracker dev_tracker;
    struct datapath *dp;
    struct vport_portids *upcall_portids;
    u16 port_no;
    struct hlist_node hash_node;
    struct hlist_node dp_hash_node;
    const struct vport_ops *ops;
    struct vport_upcall_stats_percpu __percpu *upcall_stats;
    struct list_head detach_list;
    struct rcu_head rcu;
 };

πŸ’… MEMBERS πŸ’…

bestie, let's go through every single field one by one, because they ALL matter 🫢

  • dev β€” a pointer to a net_device. yeah. that's it. iconic.
  • dev_tracker β€” a netdevice_tracker β€” it's the refcount tracker for the dev reference, so we know who's holding on to it πŸ‘€
  • dp β€” the datapath that this port belongs to. its home. its main character datapath 🏠
  • upcall_portids β€” an RCU protected struct vport_portids ⭐ (RCU protected, remember that, it's important)
  • port_no β€” the index into dp's ports array. a u16, tiny but mighty πŸŽ€
  • hash_node β€” this is the element in the dev_table hash table in vport.c πŸ’–
  • dp_hash_node β€” and THIS one is the element in datapath->ports hash table in datapath.c. two hash nodes, two files, iykyk 🌈
  • ops β€” the class structure. slay.
  • upcall_stats β€” upcall stats of every ports πŸ”₯ (yes, "every ports", that's the original wording, we don't gatekeep)
  • detach_list β€” the list used for detaching vport in the net-exit call. bye bestie πŸ‘‹
  • rcu β€” RCU callback head for deferred destruction. it's giving cleanup era πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

go read these too, they're all in the family:

  • Kernel file ./net/openvswitch/vport.h
  • struct vport_portids(9)
  • struct vport_parms(9)
  • struct vport_ops(9)
  • struct vport_upcall_stats_percpu(9)
  • vport_priv(9)
  • vport_from_priv(9)

ok that's the whole page, mwah πŸ’‹ this one comes from ./net/openvswitch and it's dated October 2026 β€” so future-y, so cunty, so struct vport(9) β­πŸ¦‹βœ¨

πŸ“¦ where this page comes from