libeth_xdp_buff_to_rq(9)
π 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β thelibeth_xdp_buffthat corresponds to the queue. It's the main character here, obviously. πtypeβtypeofof the driver Rx queue structure. Like, what kind of queue are we talking about, bestie.memberβ the name of thexdp_rxq_infoinsidetype. 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):
struct libeth_xdp_buff(9)__LIBETH_XDP_ONSTACK_BUFF(9)LIBETH_XDP_ONSTACK_BUFF(9)libeth_xdpsq_num(9)libeth_xdpsq_shared(9)libeth_xdpsq_id(9)libeth_xdpsq_get(9)libeth_xdpsq_put(9)libeth_xdpsq_lock(9)libeth_xdpsq_unlock(9)libeth_xdpsq_deinit_timer(9)libeth_xdpsq_queue_timer(9)libeth_xdpsq_run_timer(9)enum (anonymous)(9)enum (anonymous)(9)β yes, she's listed twice. We don't ask questions. π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)libeth_xdp_ptr_to_priv(9)libeth_xdp_priv_to_ptr(9)libeth_xdp_tx_xmit_bulk(9)libeth_xdp_tx_queue_head(9)libeth_xdp_tx_queue_frag(9)libeth_xdp_tx_queue_bulk(9)libeth_xdp_tx_fill_stats(9)libeth_xdp_tx_fill_buf(9)__libeth_xdp_tx_flush_bulk(9)libeth_xdp_tx_flush_bulk(9)libeth_xdp_xmit_init_bulk(9)libeth_xdp_xmit_frame_dma(9)libeth_xdp_xmit_queue_head(9)libeth_xdp_xmit_queue_frag(9)libeth_xdp_xmit_queue_bulk(9)libeth_xdp_xmit_fill_buf(9)libeth_xdp_xmit_flush_bulk(9)__libeth_xdp_xmit_do_bulk(9)libeth_xdp_xmit_do_bulk(9)libeth_xdp_tx_init_bulk(9)libeth_xdp_init_buff(9)libeth_xdp_save_buff(9)libeth_xdp_return_stash(9)libeth_xdp_return_buff(9)libeth_xdp_prepare_buff(9)libeth_xdp_process_buff(9)libeth_xdp_buff_stats_frags(9)__libeth_xdp_run_prog(9)__libeth_xdp_run_flush(9)libeth_xdp_run_prog(9)__libeth_xdp_run_pass(9)libeth_xdp_run_pass(9)libeth_xdp_finalize_rx(9)LIBETH_XDP_DEFINE_TIMER(9)LIBETH_XDP_DEFINE_FLUSH_TX(9)LIBETH_XDP_DEFINE_FLUSH_XMIT(9)LIBETH_XDP_DEFINE_RUN_PROG(9)LIBETH_XDP_DEFINE_RUN_PASS(9)LIBETH_XDP_DEFINE_RUN(9)LIBETH_XDP_DEFINE_FINALIZE(9)libeth_xdpmo_rx_hash(9)__libeth_xdp_complete_tx(9)libeth_xdp_set_features(9)libeth_xdp_set_features_noredir(9)
π«Ά 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
- 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