alloc_ltb_set(9)
π
alloc_ltb_set β NAME
okay so bestie, welcome to the Kernel API Manual entry for alloc_ltb_set β a.k.a. the function that goes and allocates a set of long term buffers, which we're gonna call LTBs from here on out because life is short and so is that acronym. β¨
πΈ SYNOPSIS
int alloc_ltb_set (struct ibmvnic_adapter *adapter , struct
ibmvnic_ltb_set *ltb_set , int num_buffs , int buff_size );
that's the whole vibe: returns an int, takes four things, and honestly? it's giving "small function, big responsibility". π«Ά
π ARGUMENTS
adapterβ the ibmvnic adapter that's associated with the LTB. like, whose LTB is this? this one's. πltb_setβ the container object for the set of LTBs. think of it as the cute little bag that holds all the buffers. πnum_buffsβ how many buffers are in the LTB. literally the count. that's it. that's the number.buff_sizeβ the size of each buffer in the LTB. every single one of them. no cap. β
π¦ DESCRIPTION
okay so here's what's actually happening β alloc_ltb_set allocates a set of LTBs so the system can accommodate num_buffs buffers of buff_size each. π
and rn? we cap the size of each LTB to IBMVNIC_ONE_LTB_SIZE. that's the ceiling, bestie, nobody's going above it. π₯
now for the clever part, because this function is genuinely an icon:
- if the new set of LTBs has fewer LTBs than the old set, it frees the excess LTBs β bye, don't need you anymore π
- if the new set needs more than the old set, it allocates the remaining ones β making room, we love to see it π
and the whole strategy is: try and reuse as many LTBs as possible and avoid reallocation. like, why re-allocate when you can recycle? environmentally conscious queen behavior honestly. β»οΈβ¨
β οΈ okay but for real, important warning time: any changes to this allocation strategy must be reflected inmap_rxpool_buff_to_ltbandmap_txpool_buff_to_ltb. if you change this and forget those two, that's not slay, that's a bug. don't do that to me. π
π SEE ALSO
the whole friend group, assembled:
- Kernel file
./drivers/net/ethernet/ibm/ibmvnic.cβ the source, the origin, the mothership π ibmvnic_wait_for_completion(9)reuse_ltb(9)alloc_long_term_buff(9)free_ltb_set(9)map_rxpool_buf_to_ltb(9)map_txpool_buf_to_ltb(9)release_rx_pools(9)reuse_rx_pools(9)init_rx_pools(9)release_tx_pools(9)reuse_tx_pools(9)init_tx_pools(9)get_hdr_lens(9)create_hdr_descs(9)build_hdr_descs_arr(9)do_passive_init(9)
okay that's seventeen cross-references, i counted, you're welcome. iykyk. π
π§ sign-off
and that's the whole page, bestie!! π this iconic little writeup lives at ./drivers/net/ethernet/ibm, and it's dated October 2026 β so mark your calendar, screenshot it, send it to the group chat, whatever you gotta do. alloc_ltb_set(9) said periodt. π
β¨π
π¦ 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