epf_ntb_configure_msi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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: the PRIMARY interface or the SECONDARY interface
  • db_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:

  1. the address that's reserved for the doorbell in the outbound address space
  2. the MSI-X address living in the PCIe Address space
  3. 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 🫢


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