epf_ntb_alloc_peer_mem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ epf_ntb_alloc_peer_mem(9) ✨

okay so this is a page straight out of the Kernel API Manual (epf_ntb_alloc_peer_mem(9), yes the whole name is the flex) and it's all about grabbing memory inside the peer's outbound address space 🫢 stay with me bestie, it's giving PCI endpoint realness.


πŸ’– NAME πŸ’–

epf_ntb_alloc_peer_mem β€” allocate memory in the peer's outbound address space. that's it, that's the whole vibe ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int epf_ntb_alloc_peer_mem (struct device *dev , struct epf_ntb_epc
*ntb_epc , enum epf_ntb_bar bar , struct epf_ntb_epc *peer_ntb_epc ,
size_t size );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the PCI device. the main character of this whole call, lowkey πŸ’…
  • ntb_epc β€” the EPC associated with one of the HOST whose BAR holds peer's outbound address. yes it's a mouthful, no we're not skipping it πŸ™ˆ
  • bar β€” the BAR of ntb_epc in for which memory has to be allocated (could be BAR_DB_MW1, BAR_MW2, BAR_MW3, BAR_MW4) β€” pick your fighter ⭐
  • peer_ntb_epc β€” the EPC associated with HOST whose outbound address space is used by ntb_epc. that's the peer, that's who we're shopping for πŸ›οΈ
  • size β€” the size of the address region that has to be allocated in peers OB SPACE. no cap, size matters here πŸ”₯

🌸 DESCRIPTION 🌸

okay bestie, the manpage hits you with the diagram first, so here it is in all its chaotic glory πŸ‘‘ (yes it is exactly this, we do not edit art):

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚ BAR0           Doorbell 1   +-----------> MSI   X ADDRESS 1 β”‚
       β”‚ BAR1           Doorbell 2   +---------+                     β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       |       BAR2      |          |   Doorbell 3   +-------+ |
       +-----------------+ |       BAR3      |    |     |   Doorbell 4
       +-----+ |   +-----------------+ |       BAR4      |    |     |
       |     | |   +-----------------+ |       BAR5      |    |     |
       |   | |     +-----------------+ EP CONTROLLER 1            |
       |   | |     +-----------------+ |                |   | +---->+ MSI|X
       ADDRESS 4 | (A)      EP CONTROLLER 2     |       |                 | (OB
       SPACE)        |       |                 | +------->      MW1        | |
       | |                 | (B)     +-----------------+ |                 | |
       | |                 | |                 | |                 | PCI
       Address Space (Managed by HOST2)

so what are we actually doing? we're allocating memory in the OB space of EP CONTROLLER 2 in the diagram above ⬆️ literally that controller, that space.

and we allocate for Doorbell 1, Doorbell 2, Doorbell 3, Doorbell 4, MW1 (and MW2, MW3, MW4) β€” the whole squad, nobody gets left out πŸ’œ


🌈 SEE ALSO 🌈

the kernel file, iykyk:

  • Kernel file ./drivers/pci/endpoint/functions/pci-epf-ntb.c

and the entire friend group (all 32 of them, we're not cutting anybody, periodt):


okay that's the whole page, you ate that πŸ“ mwah πŸ’‹

sign-off time: this gorgeous little page lives in ./drivers/pci/endpoint/functions, dated October 2026, and it's filed under epf_ntb_alloc_peer_mem(9) β€” go forth and allocate, bestie πŸ§šπŸ’–

πŸ“¦ where this page comes from