get_packet(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– get_packet β€” the manual formerly known as get_packet(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual entry for get_packet(9) β€” yes the manual name is literally that, we're in the kernel section now, put your seatbelt on πŸŽ€


✨ NAME ✨

get_packet β€” grab the next ingress packet buffer off a free list and hand it over, slay πŸ’…


🌸 SYNOPSIS 🌸

struct sk_buff * get_packet (struct adapter *adap , struct sge_fl *fl ,
unsigned int len , unsigned int drop_thres );

like, that's the whole signature, no cap β€” memorise it and you're iconic ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • adap β€” the adapter that caught the packet in the first place, the one who received it πŸ‘‘
  • fl β€” the SGE free list that's currently holding said packet πŸŽ€
  • len β€” the packet length, and yes bestie that includes any SGE padding, don't forget it 😭
  • drop_thres β€” the number of remaining buffers you've got left before we just start dropping packets, i.e. the "uh oh" line πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

So here's the vibe: we take the next packet off the free list and finish setting up the sk_buff. That's the mission, fr fr.

Small packet? Cute. We make a copy and recycle the original buffer β€” no harm done, everybody wins 🌈

Not small? Then we just use the original buffer itself, the whole thing, main character energy πŸ”₯

Now the spicy part: if a positive drop threshold is supplied, packets get dropped and their buffers recycled in either of these two situations:

  1. the number of remaining buffers is under the threshold and the packet is too big to copy 🫠
  2. the packet should be copied but there's literally no memory for the copy 😭
drop_thres = the "start dropping" line. Under it, and things get real. Stay safe out there πŸ’€

🌟 SEE ALSO 🌟

Kernel file ./drivers/net/ethernet/chelsio/cxgb3/sge.c, plus the whole friend group β€” like, the entire extended family shows up here, bestie:

refill_rspq(9), need_skb_unmap(9), unmap_skb(9), free_tx_desc(9), reclaim_completed_tx(9), should_restart_tx(9), free_rx_bufs(9), add_one_rx_buf(9), refill_fl(9), recycle_rx_buf(9), alloc_ring(9), t3_reset_qset(9), t3_free_qset(9), init_qset_cntxt(9), sgl_len(9), flits_to_desc(9), get_packet_pg(9), get_imm_packet(9), calc_tx_descs(9), write_sgl(9), check_ring_tx_db(9), write_wr_hdr_sgl(9), write_tx_pkt_wr(9), t3_eth_xmit(9), write_imm(9), check_desc_avail(9), reclaim_completed_tx_imm(9), ctrl_xmit(9), restart_ctrlq(9), deferred_unmap_destructor(9), write_ofld_wr(9), calc_tx_descs_ofld(9), ofld_xmit(9), restart_offloadq(9), queue_set(9), is_ctrl_pkt(9), t3_offload_tx(9), offload_enqueue(9), deliver_partial_bundle(9), ofld_poll(9), rx_offload(9), restart_tx(9), cxgb3_arp_process(9), rx_eth(9), lro_add_page(9), handle_rsp_cntrl_info(9), check_ring_db(9), is_new_response(9), process_responses(9), napi_rx_handler(9), process_pure_responses(9), handle_responses(9), t3_intr_handler(9), t3_sge_err_intr_handler(9), sge_timer_tx(9), sge_timer_rx(9), t3_update_qset_coalesce(9), t3_sge_alloc_qset(9), t3_start_sge_timers(9), t3_stop_sge_timers(9), t3_free_sge_resources(9), t3_sge_start(9), t3_sge_stop_dma(9), t3_sge_stop(9), t3_sge_init(9), t3_sge_prep(9)

iykyk 🧚 β€” go read them, they're all literally right there πŸ’–


πŸŽ€ the sign-off πŸŽ€

mwah, that's the page πŸ’‹ this lil beauty lives at ./drivers/net/ethernet/chelsio... and it's dated October 2026, so mark your calendars bestie and go get those packets πŸ“πŸ’…βœ¨

πŸ“¦ where this page comes from