STRUCT TB_PATH_HOP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct tb_path_hop(9) β€” she’s from the Kernel API Manual, bestie ✨

Okay so this is the manual page for struct tb_path_hop, and it’s literally all about routing information for a tb_path. Iconic little routing struct, no cap πŸŽ€


πŸ’– NAME πŸ’–

struct tb_path_hop β€” routing information for a tb_path πŸ¦‹


✨ SYNOPSIS ✨

       struct tb_path_hop {
           struct tb_port *in_port;
           struct tb_port *out_port;
           int in_hop_index;
           int in_counter_index;
           int next_hop_index;
           unsigned int initial_credits;
           unsigned int nfc_credits;
           bool pm_support;
        };

🫢 Members 🫢

  • in_port β€” ingress port of a switch, bestie πŸ’–
  • out_port β€” egress port of a switch where the packet is routed out; it must be on the same switch as in_port πŸ‘‘
  • in_hop_index β€” the HopID where the path configuration entry is placed in the path config space of in_port ✨
  • in_counter_index β€” the used counter index; not used in the driver currently, and -1 disables it πŸ™ˆ
  • next_hop_index β€” the HopID of the packet when it is routed out from out_port πŸ¦‹
  • initial_credits β€” number of initial flow control credits allocated for the path πŸ’«
  • nfc_credits β€” number of non-flow controlled buffers allocated for the in_port 🌸
  • pm_support β€” set the path PM packet support bit to 1; this is for USB4 v2 routers πŸ”₯

🌈 Description 🌈

Hop configuration is always done on the IN port of a switch, periodt. in_port and out_port have to be on the same switch β€” no sneaky cross-switch glow-ups here πŸ’…

Packets arriving on in_port with "hop" = in_hop_index get routed through out_port. The next hop to take on out_port->remote is determined by next_hop_index. When routing a packet to another switch (out->remote is set), next_hop_index must match the in_hop_index of that next hop, or routing literally cannot happen 😭

in_counter_index is the index of a counter (in TB_CFG_COUNTERS) on the in port. Lowkey important to know 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/thunderbolt/tb.h plus struct tb_nvm(9), enum tb_switch_tmu_mode(9), struct tb_switch_tmu(9), struct tb_switch(9), struct tb_bandwidth_group(9), struct tb_port(9), struct usb4_port(9), struct tb_retimer(9), enum tb_path_port(9), struct tb_path(9), struct tb_cm_ops(9), tb_upstream_port(9), tb_is_upstream_port(9), tb_port_has_remote(9), tb_domain_event(9), tb_switch_for_each_port(9), tb_switch_downstream_port(9), tb_switch_depth(9), tb_switch_is_icm(9), tb_switch_tmu_is_configured(9), tb_switch_tmu_is_enabled(9), tb_switch_clx_is_enabled(9), tb_port_path_direction_downstream(9), tb_for_each_port_on_path(9), tb_for_each_upstream_port_on_path(9), tb_path_for_each_hop(9), tb_downstream_route(9), tb_xdomain_downstream_port(9), usb4_switch_version(9), tb_switch_is_usb4(9), enum usb4_sb_target(9), enum usb4_margin_sw_error_counter(9), and struct usb4_port_margining_params(9) 🌈⭐


Cute little sign-off: this page lives under ./drivers/thunderbolt, it’s dated October 2026, and it’s serving struct tb_path_hop(9) realness πŸ’ŒπŸ’…

πŸ“¦ where this page comes from