epf_ntb_init...ar_interface(9)
π epf_ntb_init_epc_bar_interface(9) β aka the BAR-matchmaker function
okay so real talk, this is a page from the Kernel API Manual, section 9, and the full title in the header is epf_ntb_init...ar_interface(9) (yes it's truncated, yes it's iconic, we don't question the header generator's choices π). The actual function we're obsessing over is epf_ntb_init_epc_bar_interface. Let's get into it bestie π
β¨ NAME β¨
epf_ntb_init_epc_bar_interface β the function that goes "which BARs are free?? bestie I need one for each NTB construct" and figures out which BARs to use for the scratchpad region, the doorbell, and the memory window. literally the matchmaker of PCIe BARs π
πΈ SYNOPSIS πΈ
int epf_ntb_init_epc_bar_interface (struct epf_ntb *ntb , enum
pci_epc_interface_type type );
that's it, that's the whole vibe. it returns an int, no cap.
π¦ ARGUMENTS π¦
ntbβ thestruct epf_ntb *, i.e. the NTB device that facilitates communication between HOST1 and HOST2. it's the main character of this whole function ngl, HOST1 and HOST2 are literally talking through it π«Άtypeβ anenum pci_epc_interface_type. it's either the PRIMARY interface or the SECONDARY interface. that's the whole choice, pick your fighter π
β DESCRIPTION β
So what does it actually do? It identifies the free BARs to be used for each of the following, and this list is sacred so here it is, every single one, no skips:
BAR_CONFIGBAR_PEER_SPADBAR_DB_MW1BAR_MW2BAR_MW3BAR_MW4
six BARs, six slots, and this function is out here doing the vibes-based BAR assignment β except it's not vibes, it's free-BAR detection, which is honestly even better π€β¨
π SEE ALSO π
first up, the kernel file this all lives in β go read it, it's giving source of truth:
./drivers/pci/endpoint/functions/pci-epf-ntb.c
and now the full friend group, all of them, in order, because we do not leave anyone out of the group chat π«Ά:
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_alloc_peer_mem(9), epf_ntb_db_mw_bar_init(9), epf_ntb_epc_create_interface(9), epf_ntb_epc_create(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)
iykyk π₯
lowkey a reminder: everything above is straight from the page, so if you're gonna go poke at BARs, go read ./drivers/pci/endpoint/functions/pci-epf-ntb.c fr fr π§
okay that's the page!! sign-off time bestie: this one lives in the ./drivers/pci/endpoint/functions directory, dated October 2026, and its manual-page name is epf_ntb_init...ar_interface(9) β slay, drink water, and may all your BARs be free πππ
π¦ 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