LIO AND TCMU 1
LIO and the TCMU Userspace Passthrough: The Best of Both Worlds
Andy Grover <agrover@redhat.com> @iamagrover March 11, 2015
LIO and the TCMU Userspace Passthrough: The Best of Both Worlds - - PowerPoint PPT Presentation
LIO and the TCMU Userspace Passthrough: The Best of Both Worlds Andy Grover <agrover@redhat.com> @iamagrover March 11, 2015 1 LIO AND TCMU What is LIO? Multi-protocol in-kernel SCSI target 2 LIO AND TCMU Multi-protocol in - kernel
LIO AND TCMU 1
LIO and the TCMU Userspace Passthrough: The Best of Both Worlds
Andy Grover <agrover@redhat.com> @iamagrover March 11, 2015
LIO AND TCMU 2
What is LIO?
Multi-protocol in-kernel SCSI target
LIO AND TCMU 3
Multi-protocol in-kernel SCSI target Unlike other targets like IET, tgt, and SCST, LIO is entirely kernel code.
LIO AND TCMU 4
iSCSI commands
User Kernel disk.img /dev/vg0/vol0 Configuration Fabrics
tcm_fc iscsi
/dev/sdc
block file pscsi rtslib targetcli
LIO core
/sys/kernel/config/target
Backstores
LIO AND TCMU 5
Why add userspace command handling?
kernel code
Ceph, GlusterFS, & other things that have shared libraries available
vmdk for more interesting features & compatibility
fjlesystems
LIO AND TCMU 6
Userspace handling challenges: perf
LIO AND TCMU 7
Userspace handling challenges: usability
LIO AND TCMU 8
iSCSI commands
User Kernel disk.img /dev/vg0/vol0 Configuration Fabrics
tcm_fc iscsi
/dev/sdc
block file pscsi rtslib targetcli
LIO core
/sys/kernel/config/target
tcm-user
uio0 uio1
cmd handling daemon
SCSI Command processing Backstores
N E W ! N E W !
LIO AND TCMU 9
tcm-user cmd handling daemon
/dev/uio0 /sys/class/uio/uio0 uio0
configuration
from LIO core Shared Memory Region Layout
(not to scale)
Mailbox Mailbox Command Ring Command Ring Data Area Data Area
cmdr_off cmdr_size cmd_head cmd_tail cmd_entry ...
iovec[] in/out data
User/Kernel Communication
... dev add/remove (netlink)
LIO AND TCMU 10
tcm-user merged in 3.18
fmexible enough to not block likely perf
usability pieces
LIO AND TCMU 11
Performance Opportunities for Later
LIO AND TCMU 12
Our user-kernel API ended up fmexible, but fraught with danger!
LIO AND TCMU 13
tcmu-runner: A standard handler daemon
code, e.g. mandatory SCSI commands
LIO AND TCMU 14
iSCSI commands
User Kernel disk.img /dev/vg0/vol0 Configuration Fabrics
tcm_fc iscsi
/dev/sdc
block file pscsi rtslib targetcli
LIO core
/sys/kernel/config/target
tcm-user
uio0 uio1 Backstores
tcmu-runner tape vmdk mmc smc glfs
N E W ! N E W !
LIO AND TCMU 15
Handlers Need Confjg Info
standard LIO mechanisms (i.e. targetcli)
“confjgstring” that gives handler and per-device handler-specifjc stuf
add_device message
to matching LIO backstore
LIO AND TCMU 16
Confjg tools need Info on Handlers Too!
not “backstores/user <confjgstring>”
creating the device
LIO AND TCMU 17
iSCSI commands
User Kernel disk.img /dev/vg0/vol0 Configuration Fabrics
tcm_fc iscsi
/dev/sdc
block file pscsi rtslib targetcli
LIO core
/sys/kernel/config/target
tcm-user
uio0 uio1 Backstores
tcmu-runner tape vmdk mmc smc glfs
N E W ! N E W !
DBus
LIO AND TCMU 18
The QEMU Question
formats and other backstores
integrate as a tcmu-runner handler?
possibly also enable it to confjgure LIO exports?
LIO AND TCMU 19
Getting Involved
https://github.com/agrover/tcmu-runner and its included sample handlers.
libraries to use, or weird things to do with a SCSI command sandbox
LIO AND TCMU 20
LIO AND TCMU 21
ISCSI commands
User Kernel disk.img /dev/vg0/vol0 Fabrics
tcm_fc iscsi
/dev/sdc
file pscsi
LIO core
/sys/kernel/config/target
tcm-user tcmu-runner block rtslib targetcli targetd liblvm lsmcli (libstoragemgmt)
Remote Local
N E W ! N E W !
LIO AND TCMU 22
tcm-user tcmu-runner
/dev/uio0 /sys/class/uio/uio0 uio0
configuration
from LIO core Shared Memory Region Layout
(not to scale)
Mailbox Mailbox Command Ring Command Ring Data Area Data Area
cmdr_off cmdr_size cmd_head cmd_tail cmd_entry ...
iovec[] in/out data
User/Kernel Communication
...
LIO AND TCMU 23
SCSI A set of standards for physically connecting and transferring data between computers and peripheral devices*
* http://en.wikipedia.org/wiki/SCSI
LIO AND TCMU 24
SCSI target Initiator sends commands, Target handles them
LIO AND TCMU 25
Multi-protocol SCSI target SCSI commands & data can be sent over many types of physical links and protocols. e.g:
LIO AND TCMU 26
tgtd
iSCSI commands from initiator
User Kernel
Backed by local files
libglfs librbd
N E W ! N E W !
disk.img /dev/vg0/vol0
tgtadm
Configuration
LIO AND TCMU 27
ISCSI commands
User Kernel disk.img /dev/vg0/vol0 Fabrics
tcm_fc iscsi
/dev/sdc
file pscsi
LIO core
/sys/kernel/config/target
tcm-user tcmu-runner
librbd libglfs qemu-lio-tcmu
block
qcow2 vmdk vdi rbd* glfs*
C
i n g S
! C
i n g S
!