liburing icon indicating copy to clipboard operation
liburing copied to clipboard

accept operation errors out with "Bad file descriptor" when using IORING_SETUP_SQPOLL

Open fabiormoura opened this issue 6 years ago • 2 comments

Tested on: Ubuntu 20.04.1 LTS (kernel 5.8.10-050810-generic)

Similar to https://github.com/axboe/liburing/issues/168.

I'm facing the same issue as above but that one was closed without any further discussions.

My setup can be reproduced using the following commands:

git clone https://github.com/fabiormoura/io_uring_sqpoll_example.git
cd io_uring_sqpoll_example
make
sudo ./sqpoll_main

The program should error out with the message cqe->res:Bad file descriptor.

Removing IORING_SETUP_SQPOLL from io_uring_queue_init makes the program run then it can accept one request before exiting if we send one request through curl http://localhost:3000.

fabiormoura avatar Oct 17 '20 19:10 fabiormoura

SQPOLL only supports registered files, and it doesn't currently work with commands that instantiate file descriptors (like open, accept, etc). This will hopefully change for 5.11, but it will not work for your 5.8 kernel.

axboe avatar Oct 17 '20 19:10 axboe

Thanks for the explanation. This issue can be closed.

fabiormoura avatar Oct 17 '20 19:10 fabiormoura