epf_ntb_peer_spad_bar_set(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… epf_ntb_peer_spad_bar_set πŸ’…

okay so real quick, bestie β€” this is a page from the Kernel API Manual, section 9, and it's all about epf_ntb_peer_spad_bar_set. no cap, it's niche but it's iconic.


✨ NAME ✨

epf_ntb_peer_spad_bar_set β€” literally just Set peer scratchpad BAR. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

int epf_ntb_peer_spad_bar_set (struct epf_ntb *ntb , enum
pci_epc_interface_type type );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ntb β€” the NTB device that facilitates communication between HOST1 and HOST2. she's the matchmaker fr fr 🫢
  • type β€” PRIMARY interface or SECONDARY interface. pick your fighter πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

ok so picture this. here's the layout, and yes i'm showing you the diagram because it ate:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ BAR0                  CONFIG REGION                       BAR0 β”‚
β”‚ BAR1                                  SCRATCHPAD REGION        β”‚
β”‚ BAR2   Local Memory   BAR2                                     β”‚
β”‚ BAR3                  BAR3                                     β”‚
β”‚ BAR4                  BAR4                                     β”‚
β”‚ BAR5                  BAR5                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
EP CONTROLLER 1                                        EP CONTROLLER 2

so what this function does is set BAR1 of EP CONTROLLER 2, which contains HOST2's peer scratchpad region. ✨

now here's the tea: while BAR1 is the default peer scratchpad BAR, an NTB could have other BARs for peer scratchpad (because of 64-bit BARs or reserved BARs β€” yeah, it's giving chaos 😭). this function can get the exact BAR used for peer scratchpad from epf_ntb_bar[BAR_PEER_SPAD].

and since HOST2's peer scratchpad is also HOST1's self scratchpad, this function gets the address of peer scratchpad from peer_ntb_epc->epf_ntb_bar[BAR_CONFIG]. iykyk 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file: ./drivers/pci/endpoint/functions/pci-epf-ntb.c

and the whole friend group, no one left out:


this page lives in ./drivers/pci/endpoint/functions, dropped October 2026, and it's part of the Kernel API Manual (section 9, epf_ntb_peer_spad_bar_set(9)). kbye, go read some kernel source πŸ’–πŸŒˆβ­
πŸ“¦ where this page comes from