STRUCT VIRTCHNL2_PROTO_HDRS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct virtchnl2_proto_hdrs (9) β€” the Kernel API manual, but make it make sense

okay bestie so listen, this one lives in the Linux kernel API manual gang, and it's lowkey the blueprint for how the kernel matches packets. it's the struct that says what a packet should look like β€” like a vibe check but for network traffic. let's get into it πŸ’–


✨ NAME ✨

struct virtchnl2_proto_hdrs β€” literally the struct that represents match criteria. that's it, that's the whole job. it holds the rules for what counts as a match 🎯


πŸ¦‹ SYNOPSIS πŸ¦‹

struct virtchnl2_proto_hdrs {
    u8 tunnel_level;
    u8 pad[3];
    __le32 count;
    union {
      struct virtchnl2_proto_hdr
proto_hdr[VIRTCHNL2_MAX_NUM_PROTO_HDRS];
      struct {
        __le16 pkt_len;
        u8 spec[VIRTCHNL2_MAX_SIZE_RAW_PACKET];
        u8 mask[VIRTCHNL2_MAX_SIZE_RAW_PACKET];
      } raw;
    };
 };

look at that union doing its little shape-shifter moment 🧚 it's giving "i contain multitudes" and honestly? iconic.


πŸŽ€ Members πŸŽ€

okay so here's the member-by-member breakdown, no notes, all facts:

  • tunnel_level β€” this one specifies where the protocol header(s) start from. ⚠️ and listen: it must be 0 when sending a raw packet request β€” that's not a suggestion, that's the rule. the levels go like this:
    • 0 β€” from the outer layer
    • 1 β€” from the first inner layer
    • 2 β€” from the second inner layer

so it's basically counting how deep into the tunnel situation we're going πŸŒ€

  • pad β€” padding bytes. that's it. it's just there holding space, main character energy of the filler episode πŸ™ˆ
  • count β€” the total number of protocol headers in proto_hdr. and heads up: it's 0 for raw packet. so if you're raw-packet-ing, the count is a whole zero, understood? πŸ’€
  • {unnamed_union} β€” anonymous. literally no name. mysterious. unnamed union just vibing 🎭
  • proto_hdr β€” the array of protocol headers. this is the actual lineup of headers you're matching against πŸ“‹
  • raw β€” the struct holding the raw packet buffer when count is 0. so when count dips to zero, THIS is the one carrying the payload β€” featuring pkt_len, spec[] and mask[] πŸ“
quick recap so nothing gets lost: count is 0 for raw packet, tunnel_level must be 0 when sending a raw packet request, and raw is the struct that holds the raw packet buffer when count is 0. the trio is entangled, bestie, don't forget it 🫢

🌈 SEE ALSO 🌈

the whole friend group, ok. the kernel file is ./include/linux/net/intel/virtchnl2.h πŸ‘‘

and here's every single one of the neighbors β€” yes, all of them, i'm not skipping a single one, we don't do that here ✨:

  • enum virtchnl2_vport_type(9)
  • enum virtchnl2_queue_model(9)
  • enum virtchnl2_action_types(9)
  • enum virtchnl2_txq_sched_mode(9)
  • enum virtchnl2_rxq_flags(9)
  • enum virtchnl2_mac_addr_type(9)
  • struct virtchnl2_edt_caps(9)
  • struct virtchnl2_version_info(9)
  • struct virtchnl2_get_capabilities(9)
  • struct virtchnl2_queue_reg_chunk(9)
  • struct virtchnl2_queue_reg_chunks(9)
  • enum virtchnl2_vport_flags(9)
  • struct virtchnl2_create_vport(9)
  • struct virtchnl2_vport(9)
  • struct virtchnl2_txq_info(9)
  • struct virtchnl2_config_tx_queues(9)
  • struct virtchnl2_rxq_info(9)
  • struct virtchnl2_config_rx_queues(9)
  • struct virtchnl2_add_queues(9)
  • struct virtchnl2_vector_chunk(9)
  • struct virtchnl2_vector_chunks(9)
  • struct virtchnl2_alloc_vectors(9)
  • struct virtchnl2_rss_lut(9)
  • struct virtchnl2_rss_hash(9)
  • struct virtchnl2_sriov_vfs_info(9)
  • struct virtchnl2_ptype(9)
  • struct virtchnl2_get_ptype_info(9)
  • struct virtchnl2_vport_stats(9)
  • struct virtchnl2_event(9)
  • struct virtchnl2_rss_key(9)
  • struct virtchnl2_queue_chunk(9)
  • struct virtchnl2_del_ena_dis_queues(9)
  • struct virtchnl2_queue_vector(9)
  • struct virtchnl2_queue_vector_maps(9)
  • struct virtchnl2_loopback(9)
  • struct virtchnl2_mac_addr_list(9)
  • struct virtchnl2_promisc_info(9)
  • enum virtchnl2_ptp_caps(9)
  • struct virtchnl2_ptp_clk_reg_offsets(9)
  • struct virtchnl2_ptp_cross_time_reg_offsets(9)
  • struct virtchnl2_ptp_clk_adj_reg_offsets(9)
  • struct virtchnl2_ptp_tx_tstamp_latch_caps(9)
  • struct virtchnl2_ptp_get_vport_tx_tstamp_caps(9)
  • struct virtchnl2_ptp_get_caps(9)
  • struct virtchnl2_ptp_tx_tstamp_latch(9)
  • struct virtchnl2_ptp_get_vport_tx_tstamp_latches(9)
  • struct virtchnl2_ptp_get_dev_clk_time(9)
  • struct virtchnl2_ptp_get_cross_time(9)
  • struct virtchnl2_ptp_set_dev_clk_time(9)
  • struct virtchnl2_ptp_adj_dev_clk_fine(9)
  • struct virtchnl2_ptp_adj_dev_clk_time(9)
  • struct virtchnl2_mem_region(9)
  • struct virtchnl2_get_lan_memory_regions(9)
  • struct virtchnl2_proto_hdr(9)
  • struct virtchnl2_rule_action(9)
  • struct virtchnl2_rule_action_set(9)
  • struct virtchnl2_flow_rule(9)
  • struct virtchnl2_flow_rule_info(9)
  • struct virtchnl2_flow_rule_add_del(9)

like i said. the whole group chat πŸ’…πŸ”₯


and that's the page bestie!! this one's brought to you straight out of ./include/linux/net/intel, dated October 2026, signed sealed and delivered by the struct virtchnl2_proto_hdrs(9) manual itself 🌸 periodt, go read the other ones now πŸ’œ

πŸ“¦ where this page comes from