restore_rx_bufs(9)
πΈ restore_rx_bufs(9) β the Kernel API Manual, bestie edition πΈ
okay so real talk, we're in restore_rx_bufs(9) today, and it's honestly such a glow-up of a cleanup function. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
restore_rx_bufs β it puts back a packet's RX buffers. that's it, that's the whole job π
β¨ SYNOPSIS β¨
void restore_rx_bufs (const struct pkt_gl *gl , struct sge_fl *fl , int
frags );
like, copy it exactly, no cap, the spacing is part of the look π
β¨ ARGUMENTS β¨
glβ the packet gather list. yes bestie, the gather list. the whole little lineup of buffers.flβ the SGE Free List. this is the icon we're returning things to πfragsβ how many fragments in si. (yes, "si" β that's what the page says, I don't make the rules π«Ά)
β¨ DESCRIPTION β¨
so here's the vibe: we call this when we find out that the current packet, si, can't be processed right away for some reason. and honestly? it's a very rare event, and the page is real about it β there's no effort made to make this suspension/resumption process particularly efficient. it's giving "we didn't optimize this and we're not sorry" π
we implement the suspension by putting all of the RX buffers associated with the current packet back on the original Free List. all of them. every last one π¦
important detail, don't skip it: the buffers have already been unmapped and are left unmapped, and we mark them as unmapped specifically to prevent further unmapping attempts. so like, don't try to unmap them again, we already handled it π
(effectively this function undoes the series of unmap_rx_buf calls which were done to create the current packet's gather list β it's a full rewind, literally.)
and then? we're left ready to restart processing of the packet the next time we start processing the RX Queue ... periodt. β
β¨ SEE ALSO β¨
π§ the source file
- Kernel file
./drivers/net/ethernet/chelsio/cxgb4vf/sge.c
π¦ the whole friend group (yes, all of them)
get_buf_addr(9), is_buf_mapped(9), need_skb_unmap(9), txq_avail(9), fl_cap(9), fl_starving(9), map_skb(9), free_tx_desc(9), reclaim_completed_tx(9), get_buf_size(9), free_rx_bufs(9), unmap_rx_buf(9), ring_fl_db(9), set_rx_sw_desc(9), refill_fl(9), alloc_ring(9), sgl_len(9), flits_to_desc(9), is_eth_imm(9), calc_tx_flits(9), write_sgl(9), ring_tx_db(9), inline_tx_skb(9), t4vf_eth_xmit(9), copy_frags(9), t4vf_pktgl_to_skb(9), t4vf_pktgl_free(9), do_gro(9), t4vf_ethrx_handler(9), is_new_response(9), rspq_next(9), process_responses(9), napi_rx_handler(9), t4vf_intr_handler(9), sge_rx_timer_cb(9), sge_tx_timer_cb(9), bar2_address(9), t4vf_sge_alloc_rxq(9), t4vf_sge_alloc_eth_txq(9), t4vf_free_sge_resources(9), t4vf_sge_start(9), t4vf_sge_stop(9), t4vf_sge_init(9)
ngl, this one's short and sweet, but every buffer counts. treat the Free List right and it'll treat you right π
and that's the page!! cute sign-off time: this came out of ./drivers/net/ethernet/chelsio... and it's dated October 2026 β so like, mark your calendars, bestie πβ¨π¦
π¦ 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