libeth_xsk_xmit_do_bulk(9)
π 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 alibeth_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:
libeth_xsk_tx_queue_head(9)libeth_xsk_tx_queue_frag(9)libeth_xsk_tx_queue_bulk(9)libeth_xsk_tx_fill_buf(9)libeth_xsk_tx_flush_bulk(9)libeth_xsktmo_req_csum(9)__libeth_xsk_xmit_fill_buf_md(9)__libeth_xsk_xmit_fill_buf(9)libeth_xsk_xmit_fill_buf(9)libeth_xsk_tx_init_bulk(9)libeth_xsk_process_buff(9)__libeth_xsk_run_prog(9)libeth_xsk_run_prog(9)__libeth_xsk_run_pass(9)libeth_xsk_run_pass(9)libeth_xsk_finalize_rx(9)LIBETH_XSK_DEFINE_FLUSH_TX(9)LIBETH_XSK_DEFINE_RUN_PROG(9)LIBETH_XSK_DEFINE_RUN_PASS(9)LIBETH_XSK_DEFINE_RUN(9)LIBETH_XSK_DEFINE_FINALIZE(9)struct libeth_xskfq(9)libeth_xsk_buff_xdp_get_dma(9)libeth_xskfqe_alloc(9)
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
- 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