ntb_peer_db_addr(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… ntb_peer_db_addr(9) โ€” from the Kernel API Manual, bestie

okay so this is a page from the Kernel API Manual and it's literally about getting the address and size of the peer doorbell register. yes, doorbell, like ringing someone's door but in a computer way ๐Ÿ””โœจ


๐ŸŽ€ NAME ๐ŸŽ€

ntb_peer_db_addr โ€” address and size of the peer doorbell register


โœจ SYNOPSIS โœจ

int ntb_peer_db_addr (struct ntb_dev *ntb , phys_addr_t *db_addr ,
resource_size_t *db_size , u64 *db_data , int db_bit );

not me just dropping the function signature like it's nothing ๐Ÿ’… that's the whole vibe, keep it exact, don't touch it.


๐Ÿซถ ARGUMENTS ๐Ÿซถ

  • ntb โ€” the NTB device context. your main character struct, basically ๐Ÿ‘‘
  • db_addr โ€” OUT โ€” the address of the peer doorbell register. this one gets written out, so it's the answer spot ๐Ÿ“
  • db_size โ€” OUT โ€” the number of bytes to write the peer doorbell register. like, how big is this thing, we need the exact byte count ๐Ÿงฎ
  • db_data โ€” OUT โ€” the data of peer doorbell register. no notes, that's what it says ๐Ÿ“
  • db_bit โ€” door bell bit number. which specific bit, bestie, pick one ๐Ÿ”ข

๐ŸŒˆ DESCRIPTION ๐ŸŒˆ

so the function returns the address of the peer doorbell register. that's the whole job, and it does it slayfully ๐Ÿ’–

and like, who actually uses this? drivers that offload memory copy operations to a dma engine, that's who. those drivers may wish to ring the peer doorbell at the completion of memory copy operations โ€” literally "hey bestie, i'm done" but a register write ๐Ÿ“ฃ

the fun part is the efficiency trick. for efficiency, and to simplify ordering of operations between the dma memory copies and the ringing doorbell, the driver may append one additional dma memory copy with the doorbell register as the destination, after the memory copy operations. so you're not doing a separate doorbell thing โ€” you just yeet the doorbell into the copy queue as the destination and let the dma engine handle it. that's giving lowkey genius โœจ iykyk


โญ RETURN โญ

Zero on success, otherwise an error number. so 0 = slay, anything else = read the number and go fix something ๐Ÿ˜ญ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

Kernel file ./include/linux/ntb.h โ€” and here's the whole extended friend group, no one gets left out ๐Ÿซถ

that's the whole list, every single one, periodt ๐Ÿ’…


lowkey reminder: the OUT args are outputs, so the function is the one filling them in for you โ€” don't pre-fill them and expect the vibes to work out ๐Ÿ™ˆ

and that's the page, bestie ๐ŸŽ€ this one came from the source tree at ./include/linux, dated October 2026 โ€” go forth and ring those doorbells responsibly ๐Ÿ’œ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from