epf_ntb_configure_msi(9)
π epf_ntb_configure_msi β a Kernel API Manual moment
okay bestie, buckle up, because we're diving into epf_ntb_configure_msi(9) and honestly? it's giving "plumbing but make it PCIe" π this one lives in the Kernel API Manual, so you know it's official.
β¨ NAME β¨
epf_ntb_configure_msi β maps the OB address space over to the MSI address, periodt π
π¦ SYNOPSIS π¦
int epf_ntb_configure_msi (struct epf_ntb *ntb , enum
pci_epc_interface_type type , u16 db_count );
πΈ ARGUMENTS πΈ
ntbβ the NTB device, aka the little matchmaker that lets HOST1 and HOST2 actually talk to each other π«Άtypeβ which interface you're on: thePRIMARYinterface or theSECONDARYinterfacedb_countβ how many doorbell interrupts you wanna map, no more no less
π DESCRIPTION π
okay so first, the vibe check diagram, because a picture is worth a thousand words and this one is worth at least a thousand *nano*words π
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BAR0 Doorbell 1 +---+-------> MSI ADDRESS β
β BAR1 Doorbell 2 +---+ β
β BAR2 Doorbell 3 +---+ β
β BAR3 Doorbell 4 +---+ β
β BAR4 β
β BAR5 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
EP CONTROLLER 1 | | |
| | | | | (A) EP
CONTROLLER 2 | | (OB SPACE) |
| | MW1 | | | | | (B)
+-----------------+ | | | | |
| | | | | PCI Address Space (Managed by
HOST2)
so what's actually happening here? this function does stage (B) in that diagram up there β you know, the one with Doorbell 1, Doorbell 2, Doorbell 3 and Doorbell 4? yeah. it maps the OB address space that corresponds to the doorbell over to the MSI address in the PCI address space. literally the glow-up from "outbound" to "MSI" β¨
this operation needs 3 parameters, and we're doing them as a numbered list because they deserve it:
- the address that's reserved for the doorbell in the outbound address space
- the MSI-X address living in the PCIe Address space
- the number of MSI-X interrupts that have to be configured
the address in the outbound address space (for the Doorbell, bestie, keep up π) is stored in the epf_bar corresponding to BAR_DB_MW1 of epf_ntb_epc, and that one is connected to HOST1. it gets populated in epf_ntb_alloc_peer_mem in this driver, right alongside the address for MW1. two birds, one function, iconic.
then pci_epc_map_msi_irq comes in and does its thing: it takes the MSI address from the MSI capability register and maps the OB address (the one we got from epf_ntb_alloc_peer_mem) onto that MSI address. chef's kiss π€
and epf_ntb_configure_msi isn't done, because it also stores the MSI data needed to raise each interrupt in the db_data of the peer's control region. why? so the peer can raise the doorbell of the other host by writing db_data to the BAR corresponding to BAR_DB_MW1. that's the whole point, that's main character energy π₯
ngl there's no return-value drama spelled on the page, but the signature says int β so, you know, read your return codes, bestie π
π§ SEE ALSO π§
the kernel file in question, before we get to the friend group:
- Kernel file
./drivers/pci/endpoint/functions/pci-epf-ntb.c
and now the full squad, nobody gets left out, this is a group chat invite list π«Ά
epf_ntb_link_up(9)epf_ntb_configure_mw(9)epf_ntb_teardown_mw(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_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)
and that's the page, bestie β¨ sourced straight from ./drivers/pci/endpoint/functions, dated October 2026 β go map those MSI addresses, you absolute icon ππ
π¦ 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