io_uring_register_ifq(3)

πŸ’– io_uring_register_ifq β€” the liburing manual, bestie edition πŸ’–

okay so you're in the liburing Manual and this is the page for io_uring_register_ifq(3) πŸŽ€

✨ NAME ✨

io_uring_register_ifq β€” register a zero-copy receive interface queue πŸ¦‹


🌸 SYNOPSIS 🌸

#include <liburing.h>

int io_uring_register_ifq(struct io_uring *ring,
                          struct io_uring_zcrx_ifq_reg *reg);

πŸ’… DESCRIPTION πŸ’…

so io_uring_register_ifq(3) registers a zero-copy receive interface queue with the io_uring instance you pass in as ring. and why do we care? because zero-copy receive lets the kernel drop incoming network data straight into memory your app provided β€” no copying, none, zero, it's giving efficiency ✨

the reg argument is a pointer to a struct io_uring_zcrx_ifq_reg, and it's basically the little description card for the interface queue you wanna register πŸ“ if you wanna know about the IORING_REGISTER_ZCRX_IFQ operation and all the struct fields, go read io_uring_register(2), it's all in there.

🚨 ok now the rules, and these are NOT optional bestie: - your io_uring ring must have been created with IORING_SETUP_DEFER_TASKRUN and either IORING_SETUP_CQE32 or IORING_SETUP_CQE_MIXED flags set. both. the defer one and one of the other two. no shortcuts πŸ’€ - the caller must have the CAP_NET_ADMIN capability. like, actually. πŸ‘‘

πŸ‘‘ RETURN VALUE πŸ‘‘

returns 0 on success πŸŽ‰ on error, you get a negative errno value back. sad but informative 😭


🫢 SEE ALSO 🫢


ok that's the whole page, you ate it πŸ’…βœ¨ this was liburing-2.10, dated January 18, 2025 β€” go register something iconic bestie, iykyk πŸ¦‹πŸŒΈπŸŽ€

πŸ“¦ where this page comes from