STRUCT EFX_RX_BUFFER(9)
π struct efx_rx_buffer(9) π
okay bestie, welcome to the Kernel API Manual β yes, the actual kernel API manual, and yes we're reading it for fun, don't @ me. Today's main character is struct efx_rx_buffer, aka An Efx RX data buffer. She's a humble little struct but she's holding the whole receive path together, no cap. π
β¨ NAME β¨
struct efx_rx_buffer β An Efx RX data buffer. That's it, that's her. Literally the data buffer for RX, and she ate. π
πΈ SYNOPSIS πΈ
Here's the shape of her, character for character, because we do NOT paraphrase struct definitions in this house:
struct efx_rx_buffer {
dma_addr_t dma_addr;
struct page *page;
u16 page_offset;
u16 len;
u16 flags;
};
Look at those five members. Iconic. Balanced. The way she's just five fields and zero drama. π¦
π§ Members π§
okay so let's go member by member, because each one is doing her own little job and we respect the hustle:
dma_addrβ DMA base address of the buffer. Simple, gorgeous, does exactly what it says on the tin. βpageβ The associated page buffer. Big caveat incoming bestie: this will beNULLif the buffer slot is currently free. So if you're out here dereferencing aNULLpage, that's a you problem, and the manpage did warn you. πpage_offsetβ she's got two moods, and it depends on the state:- If pending: offset in page of DMA base address.
- If completed: offset in page of Ethernet header.
Same field, different meaning, depending on where you're at. The duality. The range. π
lenβ also living a double life, love that for her:- If pending: length for DMA descriptor.
- If completed: received length, excluding hash prefix. Do not forget the hash prefix exclusion, I'm begging. π₯
flagsβ Flags for buffer and packet state. Important vibe check: these are only set on the first buffer of a scattered packet. So don't go looking for your flags on buffer #2 of a scatter, they're not there, they never were. π
Real talk: those "if pending / if completed" splits and the "only on the first buffer" rule are load-bearing. Misread them and your scatter-gather logic will simply not slay.
π SEE ALSO π
All of these live in the kernel file ./drivers/net/ethernet/sfc/siena/net_driver.h β go read the source, it's giving lore. The whole friend group:
struct efx_buffer(9)struct efx_special_buffer(9)struct efx_tx_buffer(9)struct efx_tx_queue(9)struct efx_rx_page_state(9)struct efx_rx_queue(9)struct efx_channel(9)struct efx_msi_context(9)struct efx_channel_type(9)struct efx_link_state(9)enum efx_phy_mode(9)struct efx_hw_stat_desc(9)struct efx_rss_context(9)struct efx_arfs_rule(9)struct efx_async_filter_insertion(9)struct efx_nic(9)struct efx_nic_type(9)
That's seventeen entries, all present and accounted for, we do not leave the girls behind. π
β¨ and that's the whole page, bestie β¨ sourced fresh from ./drivers/net/ethernet/sfc/siena, dated October 2026, and yes we're all gonna pretend that date is normal. 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