Please enable JavaScript.
Coggle requires JavaScript to display documents.
ublk-bpf - Coggle Diagram
ublk-bpf
bpf
call bpf prog to handle req in ublk_queue_rq()
prog returns successfully
bpf prog will complete the req
is it possible to look up remote table from prog in daemon context?
yes
great
no
do it in task_work
how to read userspace data from bpf prog?
prog isn't ready
complete ublk cmd to notify userspace
when userspace queue this cmd, try to call bpf prog to complete the req one more time
move IO fast code path from userspace to kernel prog
avoid one extra switch & zc
IO fast path is usually simple
qcow2
fuse rw
loop
prog is per device
one device just has one prog
but nr_progs is still much smaller than nr_device
jump type for choosing prog?
registering prog beforehand
attach prog with its type or key
prog reference
define kfuncs for prog
kfunc focues one basic IO handling
AIO in bpf prog
the biggest chanllenge
struct_ops
core idea
share io mapping to kernel
populate mapping in userspace
bpf arena
merged already
mmap way to share data between userspace and kernel(prog)
AIO kfunc
does bpf prog support callback?
callback points to one function in bpf prog
struct_ops
data structure
'struct file'
struct path
use fd
permission check
lock?
aio object
howt to shre it with bpf prog & kfunc
move fast io path to bpf prog
io error handling?
io timeout
others
rublk's async/awai may not be needed
races with userspace daemon
fmod_ret
sleepable?
yes
queue_rq() context can't sleep
task_work context is allowed to sleep
framework
ublk_drv kernel side
kfunc
submit_fs_io(req)
request bvec iterator
network
lock
define bpf_prog entry
define struct_ops
callback is positioned by image
single complete cb
argument is stored in request
request
areq
support chained requests
which one calls into prog struct_ops?
optional
kiocb like?
bpf prog side