Closed gaowayne closed 1 year ago
Hello,
Can you disable selinux(setenforce 0) before running ublk?
Thanks,
Also the build failure is caused because your liburing doesn't support net send zc, and it has been addressed by commit ba83b49
Hello,
Can you disable selinux(setenforce 0) before running ublk?
Thanks,
thank you so much. I will try disable selinux. build issue is already fixed when I install latest liburing. :)
Hello, Can you disable selinux(setenforce 0) before running ublk? Thanks,
thank you so much. I will try disable selinux. build issue is already fixed when I install latest liburing. :)
ublksrv requires liburing 2.2+(2.2 is included), but net send zc is added to liburing 2.3.
commit ba83b49 has fixed this issue, so if you build the latest ublksrv against liburing 2.2, it still works, but nbd send zc won't be supported.
@ming1 I already fix the setenforce 0, actually it is never enabled in my VM. and I also get liburing tag 2.2, build and install. then I try to add null device with below, still have the same error.
wayne@wayne-VirtualBox:~$ setenforce 0
setenforce: SELinux is disabled
root@wayne-VirtualBox:/home/wayne/wayne/ubdsrv# ./ublk add -t null
can't get sqe ret -22
can't add dev -1, ret -22
@ming1 I already fix the setenforce 0, actually it is never enabled in my VM. and I also get liburing tag 2.2, build and install. then I try to add null device with below, still have the same error.
wayne@wayne-VirtualBox:~$ setenforce 0 setenforce: SELinux is disabled root@wayne-VirtualBox:/home/wayne/wayne/ubdsrv# ./ublk add -t null can't get sqe ret -22 can't add dev -1, ret -22
Can you share how to get the ubuntu kernel 6.1.9? Is it one cloud image? I will try to see if I can reproduce it.
The 1st failure message just means that there isn't sqe from the ring, not get idea how it is triggered, and not see such issue before.
thanks,
BTW, follows the whole build step
1) if liburing is built from source, build & install liburing; other install liburing2.2+ directly:
2) build ublksrv
@ming1 I already fix the setenforce 0, actually it is never enabled in my VM. and I also get liburing tag 2.2, build and install. then I try to add null device with below, still have the same error.
wayne@wayne-VirtualBox:~$ setenforce 0 setenforce: SELinux is disabled root@wayne-VirtualBox:/home/wayne/wayne/ubdsrv# ./ublk add -t null can't get sqe ret -22 can't add dev -1, ret -22
Can you share how to get the ubuntu kernel 6.1.9? Is it one cloud image? I will try to see if I can reproduce it.
The 1st failure message just means that there isn't sqe from the ring, not get idea how it is triggered, and not see such issue before.
thanks,
hello buddy, I follow this link guide to get 6.1.9 https://dev.to/amarjargal/testing-ublk-on-ubuntu-2204-9pe
- if liburing is built from source, build & install liburing; other install liburing2.2+ directly:
- cd liburing
- ./configure&& ./make && make install
actually I follow this steps already. for liburing, I build the source code(tag 2.2) and install it.
- if liburing is built from source, build & install liburing; other install liburing2.2+ directly:
- cd liburing
- ./configure&& ./make && make install
actually I follow this steps already. for liburing, I build the source code(tag 2.2) and install it.
OK, can you run some liburing tests and see if io_uring works? such as:
cd liburing ./test/nop ./examples/io_uring-test ./examples/io_uring-test
- ./configure&& ./make && make install
thank you so much for help. my io_uring-test works fine. I do not have test/nop anyway.
root@wayne-VirtualBox:/home/wayne/wayne/liburing/test# ./nop
-bash: ./nop: No such file or directory
root@wayne-VirtualBox:/home/wayne/wayne/liburing/test# cd ..
root@wayne-VirtualBox:/home/wayne/wayne/liburing# ./examples/io_uring-test ./examples/io_uring-test
Submitted=4, completed=4, bytes=16384
root@wayne-VirtualBox:/home/wayne/wayne/liburing#
Can you build the raw ublk test code in the following link and see if ublk device can be created?
https://lore.kernel.org/linux-block/78E62777-98A7-4D19-9608-D8A3412D9800@intel.com/
Suppose you name it as raw_ublk.c, then run the following steps and see if /dev/ublkc0 can be created.
[root@ktest-36 ublksrv]# gcc -g -o raw_ublk raw_ublk.c -luring [root@ktest-36 ublksrv]# ./raw_ublk [root@ktest-36 ublksrv]# ls -l /dev/ublk* crw-------. 1 root root 236, 0 Feb 5 07:48 /dev/ublkc0 crw-rw-rw-. 1 root root 10, 123 Feb 5 07:48 /dev/ublk-control
I follow the instruction to build this raw ublk test, it works fine as below
the only thing I hacked is that when I build raw_ublk.c, gcc cannot find ublk_cmd.h automatically, I copy this file from kernel source tree in my local, then in my code, I point it to this local .h file, now it works.
I did not see any build error when I build ubdsrv
root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux# ls -l /dev/ublk*
crw------- 1 root root 236, 0 2月 5 17:28 /dev/ublkc0
crw------- 1 root root 10, 119 2月 5 17:13 /dev/ublk-control
root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux#
I follow the instruction to build this raw ublk test, it works fine as below
the only thing I hacked is that when I build raw_ublk.c, gcc cannot find ublk_cmd.h automatically, I copy this file from kernel source tree in my local, then in my code, I point it to this local .h file, now it works.
I did not see any build error when I build ubdsrv
root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux# ls -l /dev/ublk* crw------- 1 root root 236, 0 2月 5 17:28 /dev/ublkc0 crw------- 1 root root 10, 119 2月 5 17:13 /dev/ublk-control root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux#
That is weird.
I just tried to build ublksrv on ubuntu 22.10, and can't reproduce the issue.
What is your ubuntu distribution release?
Thanks,
I follow the instruction to build this raw ublk test, it works fine as below the only thing I hacked is that when I build raw_ublk.c, gcc cannot find ublk_cmd.h automatically, I copy this file from kernel source tree in my local, then in my code, I point it to this local .h file, now it works. I did not see any build error when I build ubdsrv
root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux# ls -l /dev/ublk* crw------- 1 root root 236, 0 2月 5 17:28 /dev/ublkc0 crw------- 1 root root 10, 119 2月 5 17:13 /dev/ublk-control root@wayne-VirtualBox:/home/wayne/wayne/linux-6.1.9/include/uapi/linux#
That is weird.
I just tried to build ublksrv on ubuntu 22.10, and can't reproduce the issue.
What is your ubuntu distribution release?
Thanks,
I switch root account and build install for both liburing and ubdsrv, now it works from my side now. :) thank you so much!~
root@wayne-VirtualBox:/home/wayne/wayne/ubdsrv# ./ublk add -t null
dev id 1: nr_hw_queues 1 queue_depth 128 block size 512 dev_capacity 524288000
max rq size 524288 daemon pid 8690 flags 0x2 state LIVE
queue 0: tid 8691 affinity(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 )
target {"dev_size":268435456000,"name":"null","type":0}
root@wayne-VirtualBox:/home/wayne/wayne/ubdsrv#
@ming1 buddy, I found that I failed to update my custom build 6.1.9 headers into system, could you please share me how to make it for sure happen? that is why I cannot build raw_ublk.c naturally.
make -j$(nproc) all sudo make modules_install sudo make install
If you have trouble to install headers, maybe you can try to run the last two steps in root session(sudo su and not use sudo).
make -j$(nproc) all sudo make modules_install sudo make install
If you have trouble to install headers, maybe you can try to run the last two steps in root session(sudo su and not use sudo).
thank you so much man!~ I used run these steps. I found it fix things if I just manually copy that header file into below location. /usr/include/linux 👍
OK, looks it is one build environment issue, close it now. If turns out it is one ublksrv problem, feel free to re-open this ticket.
here is build error on ubuntu kernel 6.19. I also build and install latest liburing.
but when I try to add loop null, it shows below error, could you please shed light?