Merge tag 'io_uring-7.0-20260305' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux

Pull io_uring fixes from Jens Axboe:

 - Fix a typo in the mock_file help text

 - Fix a comment regarding IORING_SETUP_TASKRUN_FLAG in the
   io_uring.h UAPI header

 - Use READ_ONCE() for reading refill queue entries

 - Reject SEND_VECTORIZED for fixed buffer sends, as it isn't
   implemented. Currently this flag is silently ignored

   This is in preparation for making these work, but first we
   need a fixup so that older kernels will correctly reject them

 - Ensure "0" means default for the rx page size

* tag 'io_uring-7.0-20260305' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  io_uring/zcrx: use READ_ONCE with user shared RQEs
  io_uring/mock: Fix typo in help text
  io_uring/net: reject SEND_VECTORIZED when unsupported
  io_uring: correct comment for IORING_SETUP_TASKRUN_FLAG
  io_uring/zcrx: don't set rx_page_size when not requested
This commit is contained in:
Linus Torvalds
2026-03-06 08:31:36 -08:00
4 changed files with 10 additions and 5 deletions

View File

@@ -188,7 +188,8 @@ enum io_uring_sqe_flags_bit {
/* /*
* If COOP_TASKRUN is set, get notified if task work is available for * If COOP_TASKRUN is set, get notified if task work is available for
* running and a kernel transition would be needed to run it. This sets * running and a kernel transition would be needed to run it. This sets
* IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN. * IORING_SQ_TASKRUN in the sq ring flags. Not valid without COOP_TASKRUN
* or DEFER_TASKRUN.
*/ */
#define IORING_SETUP_TASKRUN_FLAG (1U << 9) #define IORING_SETUP_TASKRUN_FLAG (1U << 9)
#define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */ #define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */

View File

@@ -1902,7 +1902,7 @@ config IO_URING_MOCK_FILE
default n default n
depends on IO_URING depends on IO_URING
help help
Enable mock files for io_uring subststem testing. The ABI might Enable mock files for io_uring subsystem testing. The ABI might
still change, so it's still experimental and should only be enabled still change, so it's still experimental and should only be enabled
for specific test purposes. for specific test purposes.

View File

@@ -375,6 +375,8 @@ static int io_send_setup(struct io_kiocb *req, const struct io_uring_sqe *sqe)
kmsg->msg.msg_namelen = addr_len; kmsg->msg.msg_namelen = addr_len;
} }
if (sr->flags & IORING_RECVSEND_FIXED_BUF) { if (sr->flags & IORING_RECVSEND_FIXED_BUF) {
if (sr->flags & IORING_SEND_VECTORIZED)
return -EINVAL;
req->flags |= REQ_F_IMPORT_BUFFER; req->flags |= REQ_F_IMPORT_BUFFER;
return 0; return 0;
} }

View File

@@ -837,7 +837,8 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
if (ret) if (ret)
goto netdev_put_unlock; goto netdev_put_unlock;
mp_param.rx_page_size = 1U << ifq->niov_shift; if (reg.rx_buf_len)
mp_param.rx_page_size = 1U << ifq->niov_shift;
mp_param.mp_ops = &io_uring_pp_zc_ops; mp_param.mp_ops = &io_uring_pp_zc_ops;
mp_param.mp_priv = ifq; mp_param.mp_priv = ifq;
ret = __net_mp_open_rxq(ifq->netdev, reg.if_rxq, &mp_param, NULL); ret = __net_mp_open_rxq(ifq->netdev, reg.if_rxq, &mp_param, NULL);
@@ -926,11 +927,12 @@ static inline bool io_parse_rqe(struct io_uring_zcrx_rqe *rqe,
struct io_zcrx_ifq *ifq, struct io_zcrx_ifq *ifq,
struct net_iov **ret_niov) struct net_iov **ret_niov)
{ {
__u64 off = READ_ONCE(rqe->off);
unsigned niov_idx, area_idx; unsigned niov_idx, area_idx;
struct io_zcrx_area *area; struct io_zcrx_area *area;
area_idx = rqe->off >> IORING_ZCRX_AREA_SHIFT; area_idx = off >> IORING_ZCRX_AREA_SHIFT;
niov_idx = (rqe->off & ~IORING_ZCRX_AREA_MASK) >> ifq->niov_shift; niov_idx = (off & ~IORING_ZCRX_AREA_MASK) >> ifq->niov_shift;
if (unlikely(rqe->__pad || area_idx)) if (unlikely(rqe->__pad || area_idx))
return false; return false;