fm10k_add_rx_frag(9)
π fm10k_add_rx_frag(9) β the group chat edition π
okay so real talk, bestie: we're in the fm10k section 9 kernel API manual, and today's main character is fm10k_add_rx_frag. she's a tiny little helper in drivers/net/ethernet/intel/fm10k/fm10k_main.c and honestly? she eats. let's get into it π
β¨ NAME β¨
fm10k_add_rx_frag β Add contents of Rx buffer to sk_buff
like, literally what it says on the tin: the Rx buffer's contents get added into the sk_buff. no cap. π¦
πΈ SYNOPSIS πΈ
bool fm10k_add_rx_frag (struct fm10k_rx_buffer *rx_buffer , unsigned int
size , union fm10k_rx_desc *rx_desc , struct sk_buff *skb );
she takes four things and gives you back a bool. iconic signature tbh. returns true/false, not a struct, not a pointer, just vibes and a boolean. π«Ά
π ARGUMENTS π
rx_bufferβ the buffer containing the page to add. that's her whole moment, she's holding a page and she's ready to hand it over πsizeβ packet size fromrx_desc. yes, the size comes from the descriptor, keep up bestie β¨rx_descβ the descriptor containing the length of the buffer written by hardware. hardware did the writing,rx_descis the receipt π₯skbβ thesk_buffto place the data into. this is the destination, the final boss, the place where the data lives π
π¦ DESCRIPTION π¦
okay so here's the tea. this function will add the data contained in rx_buffer->page to the skb. that's the whole assignment. π
how she does it is genuinely kind of clever β it depends:
- if the data in the buffer is less than the skb header size, she does a direct copy. simple, straightforward, no drama.
- otherwise, she just attaches the page as a frag to the
skb. not me avoiding the copyβ¦ lowkey efficient π
then, the function will update the page offset if necessary β like, if things shifted, she handles it, don't worry β and return true if the buffer can be reused by the interface. so that bool wasn't decorative! it's a whole vibe check on whether your buffer lives to see another packet. β
bestie psa: the return value is not a "did it work" β it's a "can the interface reuse this buffer now". read it right or you WILL be confused. π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/intel/fm10k/fm10k_main.c
and the whole extended fam, in the order they were listed (yes, all of them, I'm not skipping anyone, everyone gets their moment π):
fm10k_init_module(9), fm10k_exit_module(9), fm10k_alloc_rx_buffers(9), fm10k_reuse_rx_page(9), fm10k_process_skb_fields(9), fm10k_is_non_eop(9), fm10k_cleanup_headers(9), fm10k_receive_skb(9), fm10k_get_tx_pending(9), fm10k_tx_timeout_reset(9), fm10k_clean_tx_irq(9), fm10k_update_itr(9), fm10k_set_qos_queues(9), fm10k_set_rss_queues(9), fm10k_set_num_queues(9), fm10k_reset_num_queues(9), fm10k_alloc_q_vector(9), fm10k_free_q_vector(9), fm10k_alloc_q_vectors(9), fm10k_free_q_vectors(9), fm10k_reset_msix_capability(9), fm10k_init_msix_capability(9), fm10k_cache_ring_qos(9), fm10k_cache_ring_rss(9), fm10k_assign_rings(9), fm10k_init_queueing_scheme(9), fm10k_clear_queueing_scheme(9)
go read them. all of them. you'll be smarter, i promise. π
and that's the whole page, bestie!! π source is that lil abbreviated path ./drivers/net/ethernet/intel/f... and the date is October 2026 β so yes, this manual page is from the future, and she's still serving fm10k_add_rx_frag(9) realness. mwah ππ§ββοΈβ¨
π¦ 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