ntb_peer_db_addr(9)
๐ 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 ๐ซถ
enum ntb_topo(9)enum ntb_speed(9)enum ntb_width(9)enum ntb_default_port(9)struct ntb_client_ops(9)struct ntb_ctx_ops(9)struct ntb_dev_ops(9)struct ntb_client(9)struct ntb_dev(9)ntb_register_client(9)ntb_unregister_client(9)ntb_register_device(9)ntb_unregister_device(9)ntb_set_ctx(9)ntb_clear_ctx(9)ntb_link_event(9)ntb_db_event(9)ntb_msg_event(9)ntb_default_port_number(9)ntb_default_peer_port_count(9)ntb_default_peer_port_number(9)ntb_default_peer_port_idx(9)ntb_port_number(9)ntb_peer_port_count(9)ntb_peer_port_number(9)ntb_logical_port_number(9)ntb_peer_logical_port_number(9)ntb_peer_port_idx(9)ntb_link_is_up(9)ntb_link_enable(9)ntb_link_disable(9)ntb_mw_count(9)ntb_mw_get_align(9)ntb_mw_set_trans(9)ntb_mw_clear_trans(9)ntb_peer_mw_count(9)ntb_peer_mw_get_addr(9)ntb_peer_mw_set_trans(9)ntb_peer_mw_clear_trans(9)ntb_db_is_unsafe(9)ntb_db_valid_mask(9)ntb_db_vector_count(9)ntb_db_vector_mask(9)ntb_db_read(9)ntb_db_set(9)ntb_db_clear(9)ntb_db_read_mask(9)ntb_db_set_mask(9)ntb_db_clear_mask(9)ntb_peer_db_read(9)ntb_peer_db_set(9)ntb_peer_db_clear(9)ntb_peer_db_read_mask(9)ntb_peer_db_set_mask(9)ntb_peer_db_clear_mask(9)ntb_spad_is_unsafe(9)ntb_spad_count(9)ntb_spad_read(9)ntb_spad_write(9)ntb_peer_spad_addr(9)ntb_peer_spad_read(9)ntb_peer_spad_write(9)ntb_msg_count(9)ntb_msg_inbits(9)ntb_msg_outbits(9)ntb_msg_read_sts(9)ntb_msg_clear_sts(9)ntb_msg_set_mask(9)ntb_msg_clear_mask(9)ntb_msg_read(9)ntb_peer_msg_write(9)ntb_get_dma_dev(9)ntb_peer_resource_idx(9)ntb_peer_highest_mw_idx(9)
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
- 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