fl_cap(9)
πΈ fl_cap(9) β the Kernel API Manual moment πΈ
okay so bestie, we're in the Kernel API Manual today and the star of the show is fl_cap, no cap β¨
β¨ NAME β¨
fl_cap β returns the capacity of a Free List π
π SYNOPSIS π
unsigned int fl_cap (const struct sge_fl *fl );
like... that's the whole vibe. one function. one pointer. iconic. π
π¦ ARGUMENTS π¦
flβ the Free List. yes queen, that's the one we're measuring π
π DESCRIPTION π
Returns the capacity of a Free List. that's it, that's the function, and yet π
here's the tea though β the capacity is less than the size, and there's a whole reason for that, so listen up. an Egress Queue Index Unit worth of descriptors has to be left unpopulated π«Ά otherwise the Producer and Consumer indices PIDX and CIDX will match, and the hardware will think the FL is empty. like, it will literally look at two equal numbers and go "empty bestie π" and that's a whole problem we do not want. so we hold back that little buffer zone. slay for defensive engineering β¨
ngl this is one of those "small detail, huge consequences" situations.PIDX==CIDXmeans empty to the hardware, periodt. π₯
π§ SEE ALSO π§
so you want the whole friend group? here's the whole friend group, grab a snack π
- Kernel file
./drivers/net/ethernet/chelsio/cxgb4vf/sge.c
and the rest of the crew, all in (9) section:
get_buf_addris_buf_mappedneed_skb_unmaptxq_availfl_starvingmap_skbfree_tx_descreclaim_completed_txget_buf_sizefree_rx_bufsunmap_rx_bufring_fl_dbset_rx_sw_descrefill_flalloc_ringsgl_lenflits_to_descis_eth_immcalc_tx_flitswrite_sglring_tx_dbinline_tx_skbt4vf_eth_xmitcopy_fragst4vf_pktgl_to_skbt4vf_pktgl_freedo_grot4vf_ethrx_handleris_new_responserestore_rx_bufsrspq_nextprocess_responsesnapi_rx_handlert4vf_intr_handlersge_rx_timer_cbsge_tx_timer_cbbar2_addresst4vf_sge_alloc_rxqt4vf_sge_alloc_eth_txqt4vf_free_sge_resourcest4vf_sge_startt4vf_sge_stopt4vf_sge_init
mwah π go read them, iykyk.
and that's the page, bestie π«Ά brought to you by ./drivers/net/ethernet/chelsio... β the source/version line, cutest little ellipsis in the whole kernel β dated October 2026. see you in the next manpage, stay hydrated πβ¨
π¦ 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