Re: [PATCH liburing 1/1] tests: fix zcrx tests

Pavel Begunkov
2026-04-14T11:32:03Z

On 4/12/26 15:17, Pavel Begunkov wrote:
> zcrx.c is broken and clearly nobody is running it, do a complete
> rewrite. It covers most of the cases it was supposed to check,
> especially around invalid parameters, but also adds tests for different
> control commands like rq flush and export. It relies on ZCRX_REG_NODEV
> and doesn't require real hardware. It can get !NODEV support later, but
> at least it allows to exercise most of paths on any machine.
>
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> src/include/liburing/io_uring.h | 6 +
> test/zcrx.c | 1561 ++++++++++++++++++-------------
> 2 files changed, 913 insertions(+), 654 deletions(-)
>
> diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
> index 1e58bc72..983aa265 100644
> --- a/src/include/liburing/io_uring.h
> +++ b/src/include/liburing/io_uring.h
> @@ -1054,6 +1054,12 @@ struct io_uring_zcrx_area_reg {
>
> enum zcrx_reg_flags {
> ZCRX_REG_IMPORT = 1,
> + /*
> + * Register a zcrx instance without a net device. All data will be
> + * copied. The refill queue entries might not be automatically
> + * consumed and need to be flushed, see ZCRX_CTRL_FLUSH_RQ.
> + */
> + ZCRX_REG_NODEV = 2,
> };
>
> enum zcrx_features {
> diff --git a/test/zcrx.c b/test/zcrx.c
> index 572e1185..04add8ce 100644
> --- a/test/zcrx.c
> +++ b/test/zcrx.c
> @@ -1,6 +1,6 @@
> /* SPDX-License-Identifier: MIT */
> /*
> - * Simple test case showing using send and recv through io_uring
> + * Zero copy receive tests
> */
> #include <errno.h>
> #include <stdio.h>
> @@ -17,69 +17,111 @@
> #include "liburing.h"
> #include "helpers.h"

It also needs:

#include <linux/mman.h>

I'll resend later unless you can add it while applying.

--
Pavel Begunkov