mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
io_uring-6.18-20251106
-----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmkNN50QHGF4Ym9lQGtl cm5lbC5kawAKCRD301j7KXHgpv4cD/4tGXmgNcKDidyOKBy8ylY/BxTkZOVc1ZnX TXyrKYmzrgezgjY9sHQ0xBJTaDNN+8flMlRJs+eSUBZtQ+inoD6hF8t8bQg7zD79 SY/cdKUyC+hZINSNamy7k1ARqVfK/oyIZ1tYC5MEg/dWacW3BjV5P+AO5YIIyB4R tQjz4rXwHg+i8xqxQDaZLVYhY3VC5C3tl3zyxeykhoUsUeGEXNpiqKGP/3LMyFzc T+0IfBrZl7DXNv1+vpVfNspNekZrP+3qWkjQwvA+7DMrUhtnTNbmtsKRJDLK8afI Hq+7Rk6LCp7ibTY6AhNS7LMX4beQwPSIZ0tkvmqcvszyBI3Dsjc6bNu0GfylDJLU zk74gyflbOsCBIV4yhByiA8mooDRfPMH6vqfb3XQfxfPJKxgHC89EpLlgKBLnoXt Kcnj7UbnayneTVRNF8b9HuORBloI4S90cCMExXRza/v8wsLp+nbfLgqkb3CVBRKJ dTeitMKYsganwNH3dXT9BsY7UTK2EvziV8nDQtzP7Yn38VC8x+7wg5yV7+vjoQvV sI0GnrVIDPWDaxQ0HM5tSgXO4mbErV4FQs0Soad7/9fMHU3SLzW9Z61kv797RNCw AcUdfC1kZqXC2x1DeIrEPXBUMKYI27JCzvPcgNMzFrWxrnfeIQUZKE00IDG4iY9p wZhFNNo/Ww== =D3Vm -----END PGP SIGNATURE----- Merge tag 'io_uring-6.18-20251106' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux Pull io_uring fixes from Jens Axboe: - Remove the sync refill API that was added in this release, in anticipation of doing it in a better way for the next release - Fix type extension for calculating size off nr_pages, like we do in other spots * tag 'io_uring-6.18-20251106' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux: io_uring: fix types for region size calulation io_uring/zcrx: remove sync refill uapi
This commit is contained in:
commit
9dc520632a
|
|
@ -689,9 +689,6 @@ enum io_uring_register_op {
|
|||
/* query various aspects of io_uring, see linux/io_uring/query.h */
|
||||
IORING_REGISTER_QUERY = 35,
|
||||
|
||||
/* return zcrx buffers back into circulation */
|
||||
IORING_REGISTER_ZCRX_REFILL = 36,
|
||||
|
||||
/* this goes last */
|
||||
IORING_REGISTER_LAST,
|
||||
|
||||
|
|
@ -1073,15 +1070,6 @@ struct io_uring_zcrx_ifq_reg {
|
|||
__u64 __resv[3];
|
||||
};
|
||||
|
||||
struct io_uring_zcrx_sync_refill {
|
||||
__u32 zcrx_id;
|
||||
/* the number of entries to return */
|
||||
__u32 nr_entries;
|
||||
/* pointer to an array of struct io_uring_zcrx_rqe */
|
||||
__u64 rqes;
|
||||
__u64 __resv[2];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ static int io_region_pin_pages(struct io_ring_ctx *ctx,
|
|||
struct io_mapped_region *mr,
|
||||
struct io_uring_region_desc *reg)
|
||||
{
|
||||
unsigned long size = mr->nr_pages << PAGE_SHIFT;
|
||||
unsigned long size = (size_t) mr->nr_pages << PAGE_SHIFT;
|
||||
struct page **pages;
|
||||
int nr_pages;
|
||||
|
||||
|
|
|
|||
|
|
@ -827,9 +827,6 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
|
|||
case IORING_REGISTER_QUERY:
|
||||
ret = io_query(ctx, arg, nr_args);
|
||||
break;
|
||||
case IORING_REGISTER_ZCRX_REFILL:
|
||||
ret = io_zcrx_return_bufs(ctx, arg, nr_args);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -928,74 +928,6 @@ static const struct memory_provider_ops io_uring_pp_zc_ops = {
|
|||
.uninstall = io_pp_uninstall,
|
||||
};
|
||||
|
||||
#define IO_ZCRX_MAX_SYS_REFILL_BUFS (1 << 16)
|
||||
#define IO_ZCRX_SYS_REFILL_BATCH 32
|
||||
|
||||
static void io_return_buffers(struct io_zcrx_ifq *ifq,
|
||||
struct io_uring_zcrx_rqe *rqes, unsigned nr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr; i++) {
|
||||
struct net_iov *niov;
|
||||
netmem_ref netmem;
|
||||
|
||||
if (!io_parse_rqe(&rqes[i], ifq, &niov))
|
||||
continue;
|
||||
|
||||
scoped_guard(spinlock_bh, &ifq->rq_lock) {
|
||||
if (!io_zcrx_put_niov_uref(niov))
|
||||
continue;
|
||||
}
|
||||
|
||||
netmem = net_iov_to_netmem(niov);
|
||||
if (!page_pool_unref_and_test(netmem))
|
||||
continue;
|
||||
io_zcrx_return_niov(niov);
|
||||
}
|
||||
}
|
||||
|
||||
int io_zcrx_return_bufs(struct io_ring_ctx *ctx,
|
||||
void __user *arg, unsigned nr_arg)
|
||||
{
|
||||
struct io_uring_zcrx_rqe rqes[IO_ZCRX_SYS_REFILL_BATCH];
|
||||
struct io_uring_zcrx_rqe __user *user_rqes;
|
||||
struct io_uring_zcrx_sync_refill zr;
|
||||
struct io_zcrx_ifq *ifq;
|
||||
unsigned nr, i;
|
||||
|
||||
if (nr_arg)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(&zr, arg, sizeof(zr)))
|
||||
return -EFAULT;
|
||||
if (!zr.nr_entries || zr.nr_entries > IO_ZCRX_MAX_SYS_REFILL_BUFS)
|
||||
return -EINVAL;
|
||||
if (!mem_is_zero(&zr.__resv, sizeof(zr.__resv)))
|
||||
return -EINVAL;
|
||||
|
||||
ifq = xa_load(&ctx->zcrx_ctxs, zr.zcrx_id);
|
||||
if (!ifq)
|
||||
return -EINVAL;
|
||||
nr = zr.nr_entries;
|
||||
user_rqes = u64_to_user_ptr(zr.rqes);
|
||||
|
||||
for (i = 0; i < nr;) {
|
||||
unsigned batch = min(nr - i, IO_ZCRX_SYS_REFILL_BATCH);
|
||||
size_t size = batch * sizeof(rqes[0]);
|
||||
|
||||
if (copy_from_user(rqes, user_rqes + i, size))
|
||||
return i ? i : -EFAULT;
|
||||
io_return_buffers(ifq, rqes, batch);
|
||||
|
||||
i += batch;
|
||||
|
||||
if (fatal_signal_pending(current))
|
||||
return i;
|
||||
cond_resched();
|
||||
}
|
||||
return nr;
|
||||
}
|
||||
|
||||
static bool io_zcrx_queue_cqe(struct io_kiocb *req, struct net_iov *niov,
|
||||
struct io_zcrx_ifq *ifq, int off, int len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ struct io_zcrx_ifq {
|
|||
};
|
||||
|
||||
#if defined(CONFIG_IO_URING_ZCRX)
|
||||
int io_zcrx_return_bufs(struct io_ring_ctx *ctx,
|
||||
void __user *arg, unsigned nr_arg);
|
||||
int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
|
||||
struct io_uring_zcrx_ifq_reg __user *arg);
|
||||
void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx);
|
||||
|
|
@ -97,11 +95,6 @@ static inline struct io_mapped_region *io_zcrx_get_region(struct io_ring_ctx *ct
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline int io_zcrx_return_bufs(struct io_ring_ctx *ctx,
|
||||
void __user *arg, unsigned nr_arg)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
|
||||
int io_recvzc(struct io_kiocb *req, unsigned int issue_flags);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user