opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

0010-bundled-update-linux-io_uring.h-to-v7.0-rc3.patch (5724B)


      1 From 1dbddb172f6ab21504d462347c8fc8958a7590d2 Mon Sep 17 00:00:00 2001
      2 From: "Dmitry V. Levin" <ldv@strace.io>
      3 Date: Tue, 10 Mar 2026 08:00:00 +0000
      4 Subject: [PATCH] bundled: update linux/io_uring.h to v7.0-rc3
      5 
      6 * bundled/linux/include/uapi/linux/io_uring.h: Update to
      7 headers_install'ed Linux kernel v7.0-rc3.
      8 * src/io_uring.c (print_io_uring_zcrx_ifq_reg): Follow the rename
      9 of __resv2 field of struct io_uring_zcrx_ifq_reg to rx_buf_len.
     10 * tests/io_uring_register.c (test_IORING_REGISTER_ZCRX_IFQ): Update
     11 expected output.
     12 ---
     13  bundled/linux/include/uapi/linux/io_uring.h | 35 +++++++++++++++++++--
     14  src/io_uring.c                              |  7 ++---
     15  tests/io_uring_register.c                   |  8 ++---
     16  3 files changed, 39 insertions(+), 11 deletions(-)
     17 
     18 diff --git a/bundled/linux/include/uapi/linux/io_uring.h b/bundled/linux/include/uapi/linux/io_uring.h
     19 index b5b23c0d5..1ff16141c 100644
     20 --- a/bundled/linux/include/uapi/linux/io_uring.h
     21 +++ b/bundled/linux/include/uapi/linux/io_uring.h
     22 @@ -188,7 +188,8 @@ enum io_uring_sqe_flags_bit {
     23  /*
     24   * If COOP_TASKRUN is set, get notified if task work is available for
     25   * running and a kernel transition would be needed to run it. This sets
     26 - * IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
     27 + * IORING_SQ_TASKRUN in the sq ring flags. Not valid without COOP_TASKRUN
     28 + * or DEFER_TASKRUN.
     29   */
     30  #define IORING_SETUP_TASKRUN_FLAG	(1U << 9)
     31  #define IORING_SETUP_SQE128		(1U << 10) /* SQEs are 128 byte */
     32 @@ -237,6 +238,18 @@ enum io_uring_sqe_flags_bit {
     33   */
     34  #define IORING_SETUP_SQE_MIXED		(1U << 19)
     35  
     36 +/*
     37 + * When set, io_uring ignores SQ head and tail and fetches SQEs to submit
     38 + * starting from index 0 instead from the index stored in the head pointer.
     39 + * IOW, the user should place all SQE at the beginning of the SQ memory
     40 + * before issuing a submission syscall.
     41 + *
     42 + * It requires IORING_SETUP_NO_SQARRAY and is incompatible with
     43 + * IORING_SETUP_SQPOLL. The user must also never change the SQ head and tail
     44 + * values and keep it set to 0. Any other value is undefined behaviour.
     45 + */
     46 +#define IORING_SETUP_SQ_REWIND		(1U << 20)
     47 +
     48  enum io_uring_op {
     49  	IORING_OP_NOP,
     50  	IORING_OP_READV,
     51 @@ -700,6 +713,9 @@ enum io_uring_register_op {
     52  	/* auxiliary zcrx configuration, see enum zcrx_ctrl_op */
     53  	IORING_REGISTER_ZCRX_CTRL		= 36,
     54  
     55 +	/* register bpf filtering programs */
     56 +	IORING_REGISTER_BPF_FILTER		= 37,
     57 +
     58  	/* this goes last */
     59  	IORING_REGISTER_LAST,
     60  
     61 @@ -805,6 +821,13 @@ struct io_uring_restriction {
     62  	__u32 resv2[3];
     63  };
     64  
     65 +struct io_uring_task_restriction {
     66 +	__u16 flags;
     67 +	__u16 nr_res;
     68 +	__u32 resv[3];
     69 +	__DECLARE_FLEX_ARRAY(struct io_uring_restriction, restrictions);
     70 +};
     71 +
     72  struct io_uring_clock_register {
     73  	__u32	clockid;
     74  	__u32	__resv[3];
     75 @@ -1068,6 +1091,14 @@ enum zcrx_reg_flags {
     76  	ZCRX_REG_IMPORT	= 1,
     77  };
     78  
     79 +enum zcrx_features {
     80 +	/*
     81 +	 * The user can ask for the desired rx page size by passing the
     82 +	 * value in struct io_uring_zcrx_ifq_reg::rx_buf_len.
     83 +	 */
     84 +	ZCRX_FEATURE_RX_PAGE_SIZE	= 1 << 0,
     85 +};
     86 +
     87  /*
     88   * Argument for IORING_REGISTER_ZCRX_IFQ
     89   */
     90 @@ -1082,7 +1113,7 @@ struct io_uring_zcrx_ifq_reg {
     91  
     92  	struct io_uring_zcrx_offsets offsets;
     93  	__u32	zcrx_id;
     94 -	__u32	__resv2;
     95 +	__u32	rx_buf_len;
     96  	__u64	__resv[3];
     97  };
     98  
     99 diff --git a/src/io_uring.c b/src/io_uring.c
    100 index a479c9570..04de31651 100644
    101 --- a/src/io_uring.c
    102 +++ b/src/io_uring.c
    103 @@ -1254,11 +1254,8 @@ print_io_uring_zcrx_ifq_reg(struct tcb *tcp, const kernel_ulong_t addr)
    104  	print_io_uring_zcrx_offsets(tcp, &arg.offsets);
    105  	tprint_struct_next();
    106  	PRINT_FIELD_U(arg, zcrx_id);
    107 -
    108 -	if (arg.__resv2) {
    109 -		tprint_struct_next();
    110 -		PRINT_FIELD_X(arg, __resv2);
    111 -	}
    112 +	tprint_struct_next();
    113 +	PRINT_FIELD_U(arg, rx_buf_len);
    114  
    115  	if (!IS_ARRAY_ZERO(arg.__resv)) {
    116  		tprint_struct_next();
    117 diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c
    118 index cfaa93d20..9952f0370 100644
    119 --- a/tests/io_uring_register.c
    120 +++ b/tests/io_uring_register.c
    121 @@ -2058,7 +2058,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
    122  	       ", flags=" XLAT_FMT
    123  	       ", area_ptr=%#llx, region_ptr=%#llx"
    124  	       ", offsets={head=%u, tail=%u, rqes=%u}"
    125 -	       ", zcrx_id=%u}, 1) = %s\n",
    126 +	       ", zcrx_id=%u, rx_buf_len=0}, 1) = %s\n",
    127  	       fd_null, path_null,
    128  	       XLAT_SEL(zcrx_ifq_ops.val, zcrx_ifq_ops.str),
    129  	       zcrx_ifq->if_idx, zcrx_ifq->if_rxq, zcrx_ifq->rq_entries,
    130 @@ -2073,9 +2073,9 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
    131  	memset(zcrx_ifq, 0, sizeof(*zcrx_ifq));
    132  	zcrx_ifq->if_idx = 0xaaaa;
    133  	zcrx_ifq->offsets.__resv2 = 0xbbbb;
    134 -	zcrx_ifq->__resv2 = 0xcccc;
    135  	zcrx_ifq->offsets.__resv[0] = 0xddddddddddddddddULL;
    136  	zcrx_ifq->offsets.__resv[1] = 0xeeeeeeeeeeeeeeeeULL;
    137 +	zcrx_ifq->rx_buf_len = 0xcccc;
    138  	zcrx_ifq->__resv[0] = 0x1111111111111111ULL;
    139  	zcrx_ifq->__resv[1] = 0x2222222222222222ULL;
    140  	zcrx_ifq->__resv[2] = 0x3333333333333333ULL;
    141 @@ -2086,7 +2086,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
    142  	       ", area_ptr=NULL, region_ptr=NULL"
    143  	       ", offsets={head=0, tail=0, rqes=0, __resv2=%#x"
    144  	       ", __resv=[%#llx, %#llx]}"
    145 -	       ", zcrx_id=0, __resv2=%#x"
    146 +	       ", zcrx_id=0, rx_buf_len=%u"
    147  	       ", __resv=[%#llx, %#llx, %#llx]}, 1) = %s\n",
    148  	       fd_null, path_null,
    149  	       XLAT_SEL(zcrx_ifq_ops.val, zcrx_ifq_ops.str),
    150 @@ -2094,7 +2094,7 @@ test_IORING_REGISTER_ZCRX_IFQ(int fd_null)
    151  	       zcrx_ifq->offsets.__resv2,
    152  	       (unsigned long long) zcrx_ifq->offsets.__resv[0],
    153  	       (unsigned long long) zcrx_ifq->offsets.__resv[1],
    154 -	       zcrx_ifq->__resv2,
    155 +	       zcrx_ifq->rx_buf_len,
    156  	       (unsigned long long) zcrx_ifq->__resv[0],
    157  	       (unsigned long long) zcrx_ifq->__resv[1],
    158  	       (unsigned long long) zcrx_ifq->__resv[2],
    159 -- 
    160 2.49.0
    161