STRUCT LIBETH_SQE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct libeth_sqe(9) πŸ’…

okay bestie, buckle up β€” this is a page from the Kernel API Manual, and it's genuinely one of the cuter little structs in the networking corner of the kernel. it represents a Send Queue Element / Tx buffer, which is exactly what it sounds like: one entry in your Tx ring, holding everything the driver needs to send a thing and then clean up after itself. no cap. πŸŽ€


✨ NAME ✨

struct libeth_sqe β€” represents a Send Queue Element / Tx buffer πŸ¦‹


🌸 SYNOPSIS 🌸

struct libeth_sqe {
    enum libeth_sqe_type            type:32;
    u32 rs_idx;
    union {
      void *raw;
      struct sk_buff                  *skb;
      struct skb_shared_info          *sinfo;
      struct xdp_frame                *xdpf;
      struct libeth_xdp_buff          *xsk;
    };
    dma_addr_t dma;
    __u32 len;
    u32 nr_frags;
    u32 packets;
    u32 bytes;
    unsigned long                   priv;
 };

like… look at her. she's got range. πŸ˜­πŸ’–


πŸ‘‘ MEMBERS πŸ‘‘

  • type β€” the type of the buffer, see the enum above (enum libeth_sqe_type, iykyk). this is the field that tells you which member of the union down there is actually the real one. main character energy fr fr. ⭐
  • rs_idx β€” index of the last buffer from the batch this one was sent in 🌈
  • {unnamed_union} β€” anonymous. yeah, she has no name. mysterious. iconic. πŸ’…
    • raw β€” slab buffer to free via kfree πŸ“
    • skb β€” sk_buff to consume 🌸
    • sinfo β€” skb shared info of an XDP_TX frame πŸ”₯
    • xdpf β€” XDP frame from ::ndo_xdp_xmit ⚑
    • xsk β€” XSk Rx frame from XDP_TX action πŸ¦‹
  • dma β€” DMA address to unmap πŸŽ€
  • len β€” length of the mapped region to unmap πŸ’œ
  • nr_frags β€” number of frags in the frame this buffer belongs to ✨
  • packets β€” number of physical packets sent for this frame πŸ‘‘
  • bytes β€” number of physical bytes sent for this frame 🌟
  • priv β€” driver-private scratchpad πŸ™ˆ (the driver's own little diary entry, basically)
heads up bestie: type is the vibe check for the whole struct β€” it's what tells you which union member is valid. don't go reading skb when it's actually an xdpf, that's not slay behaviour. πŸ’€

πŸ” SEE ALSO πŸ”

go read those next, bestie, they're all part of the same little friend group 🫢🧚


and that's the page!! this one lives in ./include/net/libeth and it's dated October 2026 β€” so yeah, she's from the future, we stan a forward-thinking struct πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from