epf_ntb_alloc_peer_mem(9)
β¨ 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 ofntb_epcin for which memory has to be allocated (could beBAR_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 byntb_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):
epf_ntb_link_up(9)epf_ntb_configure_mw(9)epf_ntb_teardown_mw(9)epf_ntb_configure_msi(9)epf_ntb_configure_msix(9)epf_ntb_configure_db(9)epf_ntb_teardown_db(9)epf_ntb_cmd_handler(9)epf_ntb_peer_spad_bar_clear(9)epf_ntb_peer_spad_bar_set(9)epf_ntb_config_sspad_bar_clear(9)epf_ntb_config_sspad_bar_set(9)epf_ntb_config_spad_bar_free(9)epf_ntb_config_spad_bar_alloc(9)epf_ntb_config_spad_bar_alloc_interface(9)epf_ntb_free_peer_mem(9)epf_ntb_db_mw_bar_clear(9)epf_ntb_db_mw_bar_cleanup(9)epf_ntb_configure_interrupt(9)epf_ntb_db_mw_bar_init(9)epf_ntb_epc_create_interface(9)epf_ntb_epc_create(9)epf_ntb_init_epc_bar_interface(9)epf_ntb_init_epc_bar(9)epf_ntb_epc_init_interface(9)epf_ntb_epc_cleanup_interface(9)epf_ntb_epc_cleanup(9)epf_ntb_epc_init(9)epf_ntb_bind(9)epf_ntb_unbind(9)epf_ntb_add_cfs(9)epf_ntb_probe(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms