ntb_peer_port_number(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ntb_peer_port_number(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” today's main character is ntb_peer_port_number(9), and she is literally the friend who knows everyone at the party and can tell you exactly who's who. πŸŽ€


✨ NAME ✨

ntb_peer_port_number β€” get the peer port by given index

(it's giving "you give me a number, I give you a number" but make it kernel πŸ’«)


🌸 SYNOPSIS 🌸

int ntb_peer_port_number (struct ntb_dev *ntb , int pidx );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ntb β€” NTB device context. this is the whole device situation you're working with, your main character struct 🫢
  • pidx β€” Peer port index. the little slot number you're asking about ✨

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: peer ports are continuously enumerated by the NTB API logic β€” like, the API is always out here keeping count, no cap πŸ”₯ β€” so this method lets you retrieve a port's real number by its index. iykyk πŸ’…

(index in, real port number out. that's the whole vibe. 🧚)


⭐ RETURN ⭐

the peer device port, or a negative value indicating an error 😭 (so like… vibe check the return value before you trust it, fr fr)


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/ntb.h and honestly the whole NTB friend group showed up to the group chat:

like… the whole extended family. iconic behavior, honestly 🌈


πŸ’€ reminder bestie: a negative return means error, so don't go treating it like a port number or you WILL be debugging at 3am 😭

and that's the page! this lil gem lives over in ./include/linux and the version stamp is October 2026 β€” so yeah, she's fresh, she's current, and she ate. periodt. πŸ“πŸ’–

πŸ“¦ where this page comes from