The copy fallback path doesn't care about the actual niov size and only
uses first PAGE_SIZE bytes, and any additional space will be wasted.
Since ZCRX_REG_NODEV solely relies on the copy path, it doesn't make
sense to support non-standard rx_buf_len. Reject it for now, and
re-enable once improved.
Fixes: c11728021d5cd ("io_uring/zcrx: implement device-less mode for zcrx")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/3e7652d9c27f8ac5d2b141e3af47971f2771fb05.1774780198.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
return -EINVAL;
buf_size_shift = ilog2(reg->rx_buf_len);
}
+ if (!ifq->dev && buf_size_shift != PAGE_SHIFT)
+ return -EOPNOTSUPP;
ret = -ENOMEM;
area = kzalloc_obj(*area);
if (ifq->dev)
area->is_mapped = true;
- if (buf_size_shift > io_area_max_shift(&area->mem)) {
+ if (ifq->dev && buf_size_shift > io_area_max_shift(&area->mem)) {
ret = -ERANGE;
goto err;
}