STRUCT EFX_RX_BUFFER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 be NULL if the buffer slot is currently free. So if you're out here dereferencing a NULL page, 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