libeth_xdp_buff_to_rq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… libeth_xdp_buff_to_rq(9) β€” the Kernel API Manual, bestie edition πŸŽ€

Okay so real talk, this whole page lives in the Kernel API Manual and it's about one (1) macro that saves your life when you're digging around in driver Rx code. Buckle up, it's short but it slaps. ✨


🌸 NAME 🌸

libeth_xdp_buff_to_rq β€” get RQ pointer from an XDP buffer pointer

Like, you have an XDP buffer, you want the RQ. This is the girl that does that. Periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

libeth_xdp_buff_to_rq (xdp , type , member );

That spacing though β€” yes, we keep it exactly as-is. No cap. πŸ™ˆ


✨ ARGUMENTS ✨

  • xdp β€” the libeth_xdp_buff that corresponds to the queue. It's the main character here, obviously. πŸ‘‘
  • type β€” typeof of the driver Rx queue structure. Like, what kind of queue are we talking about, bestie.
  • member β€” the name of the xdp_rxq_info inside type. Point her to the right field. 🎯

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: often times β€” and I mean often β€” you need a pointer to the RQ while you're reading or filling metadata from HW descriptors. Annoying, right? 😭

That's where this helper comes in. You use it to quickly jump from an XDP buffer straight to the queue corresponding to its xdp_rxq_info, and the whole point is that it does this without introducing additional fields. Not one extra field. Zero. Nothing. 🫢

And why does that matter? Because libeth_xdp_buff is precisely 1 cacheline long on x64. Exactly one. She's compact, she's efficient, she's iconic, and this helper means she gets to stay that way. 🌈


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/net/libeth/xdp.h, plus this absolutely stacked roster of siblings β€” go say hi, they're all in the family (iykyk):


🫢 That's the whole page, bestie. It's short, it's sweet, it's one cacheline of pure efficiency. Go forth and jump to your RQ. πŸ’œ

Mwah πŸ’‹ β€” this one came from ./include/net/libeth, dated October 2026, and yes she is still called libeth_xdp_buff_to_rq(9). Slay. ⭐

πŸ“¦ where this page comes from