Closed g2px1 closed 6 months ago
I'm ran provided program on Ubuntu Server 22.04.3 with Kernel version 5.15.0-94-generic (I'm getting Failed to get SQE):
Ubuntu Server 22.04.3
5.15.0-94-generic
Failed to get SQE
#include <liburing.h> #include <liburing/io_uring.h> #include <stdio.h> int main() { struct io_uring ring; int ret; // Initialize io_uring ret = io_uring_queue_init(32, &ring, 0); if (ret) { fprintf(stderr, "Failed to initialize io_uring: %s\n", strerror(-ret)); return 1; } struct io_uring_sqe *sqe = io_uring_get_sqe(&ring); if (!sqe) { fprintf(stderr, "Failed to get SQE\n"); io_uring_queue_exit(&ring); return 1; } // Setup a no-op operation (does nothing) io_uring_prep_nop(sqe); // Submit the SQE ret = io_uring_submit(&ring); if (ret < 0) { fprintf(stderr, "Failed to submit SQE: %s\n", strerror(-ret)); io_uring_queue_exit(&ring); return 1; } // Wait for completion struct io_uring_cqe *cqe; ret = io_uring_wait_cqe(&ring, &cqe); if (ret < 0) { fprintf(stderr, "Failed to wait for CQE: %s\n", strerror(-ret)); io_uring_queue_exit(&ring); return 1; } // Check result if (cqe->res < 0) { fprintf(stderr, "No-op operation failed: %s\n", strerror(-cqe->res)); io_uring_cqe_seen(&ring, cqe); io_uring_queue_exit(&ring); return 1; } // Mark this CQE as seen io_uring_cqe_seen(&ring, cqe); printf("SQE operations are supported.\n"); // Cleanup io_uring_queue_exit(&ring); return 0; }
For the first time, I found this problem in a web server example from here.
I'm ran provided program on
Ubuntu Server 22.04.3
with Kernel version5.15.0-94-generic
(I'm gettingFailed to get SQE
):For the first time, I found this problem in a web server example from here.