Skip to content

Commit c9b52ec

Browse files
committed
Merge branch 'for-7.1/io_uring' into for-next
* for-7.1/io_uring: io_uring/zcrx: rename zcrx [un]register functions io_uring/zcrx: check ctrl op payload struct sizes io_uring/zcrx: cache fallback availability in zcrx ctx io_uring/zcrx: warn on a repeated area append io_uring/zcrx: consolidate dma syncing io_uring/zcrx: netmem array as refiling format io_uring/zcrx: warn on alloc with non-empty pp cache io_uring/zcrx: move count check into zcrx_get_free_niov io_uring/zcrx: use guards for locking io_uring/zcrx: add a struct for refill queue io_uring/zcrx: use better name for RQ region io_uring/zcrx: implement device-less mode for zcrx io_uring/zcrx: extract netdev+area init into a helper io_uring/zcrx: always dma map in advance io_uring/zcrx: fully clean area on error in io_import_umem() io_uring/zcrx: return back two step unregistration
2 parents e7cbe11 + 623a6d4 commit c9b52ec

5 files changed

Lines changed: 259 additions & 157 deletions

File tree

include/uapi/linux/io_uring/zcrx.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ struct io_uring_zcrx_area_reg {
4949
};
5050

5151
enum zcrx_reg_flags {
52-
ZCRX_REG_IMPORT = 1,
52+
ZCRX_REG_IMPORT = 1,
53+
54+
/*
55+
* Register a zcrx instance without a net device. All data will be
56+
* copied. The refill queue entries might not be automatically
57+
* consumed and need to be flushed, see ZCRX_CTRL_FLUSH_RQ.
58+
*/
59+
ZCRX_REG_NODEV = 2,
5360
};
5461

5562
enum zcrx_features {

io_uring/io_uring.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
21562156
mutex_lock(&ctx->uring_lock);
21572157
io_sqe_buffers_unregister(ctx);
21582158
io_sqe_files_unregister(ctx);
2159-
io_unregister_zcrx_ifqs(ctx);
2159+
io_unregister_zcrx(ctx);
21602160
io_cqring_overflow_kill(ctx);
21612161
io_eventfd_unregister(ctx);
21622162
io_free_alloc_caches(ctx);
@@ -2308,6 +2308,10 @@ static __cold void io_ring_exit_work(struct work_struct *work)
23082308
struct io_tctx_node *node;
23092309
int ret;
23102310

2311+
mutex_lock(&ctx->uring_lock);
2312+
io_terminate_zcrx(ctx);
2313+
mutex_unlock(&ctx->uring_lock);
2314+
23112315
/*
23122316
* If we're doing polled IO and end up having requests being
23132317
* submitted async (out-of-line), then completions can come in while

io_uring/register.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
900900
ret = -EINVAL;
901901
if (!arg || nr_args != 1)
902902
break;
903-
ret = io_register_zcrx_ifq(ctx, arg);
903+
ret = io_register_zcrx(ctx, arg);
904904
break;
905905
case IORING_REGISTER_RESIZE_RINGS:
906906
ret = -EINVAL;

0 commit comments

Comments
 (0)