diff --git a/include/spdk_internal/uring.h b/include/spdk_internal/uring.h index ff22f11d4..86c39945c 100644 --- a/include/spdk_internal/uring.h +++ b/include/spdk_internal/uring.h @@ -36,16 +36,4 @@ #include -#ifndef __NR_sys_io_uring_enter -#define __NR_sys_io_uring_enter 426 -#endif - -static int -spdk_io_uring_enter(int ring_fd, unsigned int to_submit, - unsigned int min_complete, unsigned int flags) -{ - return syscall(__NR_sys_io_uring_enter, ring_fd, to_submit, - min_complete, flags, NULL, 0); -} - #endif /* SPDK_INTERNAL_URING_H */ diff --git a/module/bdev/uring/bdev_uring.c b/module/bdev/uring/bdev_uring.c index 494cc4794..e11783ea9 100644 --- a/module/bdev/uring/bdev_uring.c +++ b/module/bdev/uring/bdev_uring.c @@ -244,26 +244,20 @@ bdev_uring_group_poll(void *arg) int count, ret; to_submit = group_ch->io_pending; - to_complete = group_ch->io_inflight; - ret = 0; if (to_submit > 0) { /* If there are I/O to submit, use io_uring_submit here. * It will automatically call spdk_io_uring_enter appropriately. */ ret = io_uring_submit(&group_ch->uring); + if (ret < 0) { + return SPDK_POLLER_BUSY; + } + group_ch->io_pending = 0; group_ch->io_inflight += to_submit; - } else if (to_complete > 0) { - /* If there are I/O in flight but none to submit, we need to - * call io_uring_enter ourselves. */ - ret = spdk_io_uring_enter(group_ch->uring.ring_fd, 0, 0, - IORING_ENTER_GETEVENTS); - } - - if (ret < 0) { - return SPDK_POLLER_BUSY; } + to_complete = group_ch->io_inflight; count = 0; if (to_complete > 0) { count = bdev_uring_reap(&group_ch->uring, to_complete); @@ -426,7 +420,9 @@ bdev_uring_group_create_cb(void *io_device, void *ctx_buf) { struct bdev_uring_group_channel *ch = ctx_buf; - if (io_uring_queue_init(SPDK_URING_QUEUE_DEPTH, &ch->uring, IORING_SETUP_IOPOLL) < 0) { + /* Do not use IORING_SETUP_IOPOLL until the Linux kernel can support not only + * local devices but also devices attached from remote target */ + if (io_uring_queue_init(SPDK_URING_QUEUE_DEPTH, &ch->uring, 0) < 0) { SPDK_ERRLOG("uring I/O context setup failure\n"); return -1; }