__libeth_xdp_run_pass(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __libeth_xdp_run_pass(9) β€” like, the whole Kernel API Manual but make it make sense ✨

okay bestie, so this is a page straight out of the Kernel API Manual, and it's about one very specific little helper. no cap, it's a good one. let's get into it 🫢


🌸 NAME 🌸

__libeth_xdp_run_pass β€” the helper that runs your XDP program and deals with whatever chaotic verdict comes back. it's giving "you run it, i'll handle the fallout" energy πŸ’…


✨ SYNOPSIS ✨

void __libeth_xdp_run_pass (struct libeth_xdp_buff *xdp , struct
libeth_xdp_tx_bulk *bq , struct napi_struct *napi , struct
libeth_rq_napi_stats *rs , const void *md , void (*prep)(struct
libeth_xdp_buff *xdp, const void *md) , bool (*run)(struct
libeth_xdp_buff *xdp, struct libeth_xdp_tx_bulk *bq) , bool
(*populate)(struct sk_buff *skb, const struct libeth_xdp_buff *xdp,
struct libeth_rq_napi_stats *rs) );

like yes, that's a lot of parameters. breathe. we go through every single one below πŸ‘‡


πŸŽ€ ARGUMENTS πŸŽ€

  • xdp β€” the XDP buffer we're processing. the main character of this whole function tbh πŸ‘‘
  • bq β€” the XDP Tx bulk, where those XDP_TX frames get queued up. it's the outbox πŸ“€
  • napi β€” the NAPI instance, used to build an skb and pass it up the stack
  • rs β€” onstack libeth RQ stats. like, the stats live right there on the stack, comfy πŸ›οΈ
  • md β€” the metadata that should get filled into the XDP buffer
  • prep β€” callback for filling in that metadata
  • run β€” the driver wrapper that actually runs the XDP program
  • populate β€” driver callback that populates an skb with the HW descriptor data

πŸ¦‹ DESCRIPTION πŸ¦‹

so this is an inline abstraction, and here's literally everything it does β€” this is the non-XSk path, iykyk:

  1. adds frame size and frag number (if needed) to the onstack stats;
  2. fills the descriptor metadata into the onstack libeth_xdp_buff;
  3. runs the XDP program if present;
  4. handles all possible verdicts;
  5. on `XDP_PASS`, builds an skb from the buffer;
  6. populates it with the descriptor metadata;
  7. passes it up the stack.

and here's the lowkey important part πŸ‘€ β€” in most cases, step number 2 just means writing the pointer to the HW descriptor into the XDP buffer. and if that's all you need? please use the LIBETH_XDP_DEFINE_RUN{,_PASS}() wrappers to build a driver function. that's the slay move, don't hand-roll it πŸ’…

fr fr, step 2 being "just write a pointer" is the common case, and the wrappers exist exactly so you don't have to write this whole thing out yourself.

🌈 SEE ALSO 🌈

okay this list is long long, but every single one of these is iconic in its own way, so we're listing them all β€” no skips, periodt πŸŽ€

the xdpsq girlies πŸ’œ

timers & queues ⏰

mystery enums (yes, twice) πŸ™ˆ

  • enum (anonymous)(9), enum (anonymous)(9)

the structs 🧚

  • struct libeth_xdp_tx_frame(9), struct libeth_xdp_tx_bulk(9), LIBETH_XDP_ONSTACK_BULK(9), struct libeth_xdpsq(9), struct libeth_xdp_tx_desc(9)

pointer shuffling 🫢

the TX squad πŸ”₯

the XMIT squad ⭐

buff management, aka self-care 🌸

running the program (our cousins) πŸ‘‘

finalize & hashing πŸ¦‹

the wrapper macros (use these, bestie) πŸ’…

odds & ends πŸ“


and that's the page!! πŸŽ‰ it lives at ./include/net/libeth, and this version is dated October 2026 β€” ty for reading, mwah, go use the wrappers πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from