libeth_xsk_xmit_do_bulk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… libeth_xsk_xmit_do_bulk β€” from the Kernel API Manual, bestie ✨

okay so picture this: you're deep in kernel land, section 9 of the manual, and you need to send XSk xmit frames. that's literally this function. let's get into it πŸŽ€


🌸 SYNOPSIS

bool libeth_xsk_xmit_do_bulk(struct xsk_buff_pool *pool, void *xdpsq,
                             u32 budget,
                             const struct xsk_tx_metadata_ops *tmo,
                             u32 (*prep)(void *xdpsq, struct libeth_xdpsq *sq),
                             void (*xmit)(struct libeth_xdp_tx_desc desc, u32 i,
                                          const struct libeth_xdpsq *sq, u64 priv),
                             void (*finalize)(void *xdpsq, bool sent, bool flush));

like yes she's a bool, yes she takes seven args, we don't gatekeep 🀌


πŸ¦‹ ARGUMENTS

  • pool β€” the XSk buffer pool holding the frames you're about to send. that's where your lil frames live πŸ’–
  • xdpsq β€” an opaque pointer to the driver's XDPSQ struct. don't peek inside, it's opaque for a reason πŸ™ˆ
  • budget β€” the maximum number of frames that can be sent. cap it, queen πŸ‘‘
  • tmo β€” optional XSk Tx metadata ops. optional means optional, no pressure 🫢
  • prep β€” driver callback that builds a libeth_xdpsq ✨
  • xmit β€” driver callback that puts frames to a HW queue. hardware time, slay πŸ”₯
  • finalize β€” driver callback that starts a transmission. the grand finale, periodt πŸ’…

πŸ’œ DESCRIPTION

so this bad boy implements generic XSk xmit. it always turns on XSk Tx wakeup, because the vibe is that lazy cleaning is used and interrupts are disabled for the queue. iykyk πŸ’€

HW descriptor filling is unrolled by LIBETH_XDP_TX_BATCH to optimize writes β€” the way that it just unrolls?? obsessed ⭐

ngl, here's the catch, bestie: unlike other XDP Tx ops, the queue must be locked and cleaned prior to calling this function so you already know the available budget. no skipping that step, fr fr 🚨

and prep must only build a libeth_xdpsq and return U32_MAX. that's it. that's the whole job 🧚


🌈 RETURN

false if the budget was exhausted, true otherwise. two moods, honestly 😭


πŸ“ SEE ALSO

kernel file ./include/net/libeth/xsk.h, plus the whole friend group:


and that's a wrap, bestie πŸ’– this lil page lives at ./include/net/libeth, dated October 2026, and she's filed under libeth_xsk_xmit_do_bulk(9) in the Kernel API Manual. go forth and xmit responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from