epf_ntb_configure_msix(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… epf_ntb_configure_msix β€” from the Kernel API Manual, bestie πŸŽ€

ok so picture this: you're deep in the kernel, specifically in the Kernel API Manual, and you've found epf_ntb_configure_msix. Buckle up, she's a baddie with a job to do. ✨


🌸 NAME 🌸

epf_ntb_configure_msix β€” literally maps the OB address space over to the MSI-X address. that's the whole vibe. πŸ’«


✨ SYNOPSIS ✨

int epf_ntb_configure_msix (struct epf_ntb *ntb , enum
       pci_epc_interface_type type , u16 db_count );

three args, no drama, we love to see it 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • ntb β€” the NTB device doing the whole "let HOST1 and HOST2 talk to each other" thing. she's the main character of this friendship πŸ”₯
  • type β€” which interface we're on: PRIMARY interface or SECONDARY interface. pick your lane, queen πŸ‘‘
  • db_count β€” how many doorbell interrupts you want mapped. yes, number of doorbells. iykyk πŸ””

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the diagram, and ngl it's giving "abstract art in a museum" but i promise it's useful. drink some water first:

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚ 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 epf_ntb_configure_msix handles stage (B) in that diagram up there (peep Doorbell 1, Doorbell 2, Doorbell 3, Doorbell 4). in human words: she maps the OB address space that corresponds to the doorbell over to the MSI-X address in the PCI address space. periodt. πŸ’…

this operation needs 3 parameters:

  1. the address reserved for the doorbell in the outbound address space
  2. the MSI-X address 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) lives in the epf_bar corresponding to BAR_DB_MW1 of epf_ntb_epc that's connected to HOST1. that gets populated in epf_ntb_alloc_peer_mem in this driver, right alongside the address for MW1. like they're holding hands 🫢

the MSI-X address is chilling in the MSI-X table of EP CONTROLLER 2, and the count of doorbells is in ctrl->argument of epf_ntb_epc that's connected to HOST2. the MSI-X table is stored memory mapped to ntb_epc->msix_bar, and the offset lives in ntb_epc->msix_table_offset. from all that, epf_ntb_configure_msix pulls out the MSI-X address and data. she's thorough 🀌

she also stores the MSI-X data to raise each interrupt into db_data of the peer's control region. that's the whole point: it helps the peer raise the doorbell of the other host by writing db_data to the BAR corresponding to BAR_DB_MW1. teamwork makes the dream work 🌈

🌟 SEE ALSO 🌟

kernel file ./drivers/pci/endpoint/functions/pci-epf-ntb.c β€” the icon herself πŸ’–

and the whole friend group, no one gets left out:


aaaand that's the page, bestie!! πŸ“ straight from ./drivers/pci/endpoint/functions, dated October 2026 β€” mwah, go touch some grass, then come back and read your MSI-X tables πŸ’œπŸ§š

πŸ“¦ where this page comes from