Xen scsifront/back drivers FUJITA Tomonori tomof@acm.org NTT Cyber - - PowerPoint PPT Presentation

xen scsifront back drivers
SMART_READER_LITE
LIVE PREVIEW

Xen scsifront/back drivers FUJITA Tomonori tomof@acm.org NTT Cyber - - PowerPoint PPT Presentation

Xen scsifront/back drivers FUJITA Tomonori tomof@acm.org NTT Cyber Solutions Laboratories Xen Summit 2006 Current Block I/O: blkfront/back (or blktap) Beauty Simple and fast (Xen origianl protocol) Issues Extra effort for some


slide-1
SLIDE 1

Xen scsifront/back drivers

FUJITA Tomonori

tomof@acm.org NTT Cyber Solutions Laboratories Xen Summit 2006

slide-2
SLIDE 2

2

Current Block I/O: blkfront/back (or blktap)

  • Beauty

– Simple and fast (Xen origianl protocol)

  • Issues

– Extra effort for some software

  • Journaling file systems, udev, installer, etc

– Possible improvement

  • Error handling
  • Dynamic device management
  • Other virtual storage drivers: tape, CD-ROM/DVD, etc
slide-3
SLIDE 3

3

scsifront/back drivers

  • SCSI-level device channel protocol

– The frontend and backend drivers use SCSI RDMA

Protocol (SRP) through the ring buffer

  • SCSI protocol processing in user space

– User-space daemon in dom0 does SCSI protocol

processing and I/O executions (similar to blktap)

  • SCSI protocol saves lots of work

– The exisiting software just works – Linux SCSI mid-layer provides error handling,

dynamic management, various device suport, etc

slide-4
SLIDE 4

4

scsifront/back overview

target entity target entity logical unit logical unit file file file-backed VM1 VM2 Xen VMM scsifront driver VM0 scsiback driver SCSI RDMA Commands through ring buffer looks like a SCSI host bus adapter user-space daemon kernel/user communication through shared memory DomU Initiator devies (client) sends requests Dom0 Target devies (server) receives requests Inside the daemon

slide-5
SLIDE 5

5

scsifront/back design

  • I/O execution in user space (like blktap)

– Exports whatever you want to VMs: raw partitions,

regular files, LVM, files over network, etc

– Easily nice tricks like metadata disk format

  • Zero-copy of data pages (like blktap)

– scsifront grants pages – scsiback maps the pages to user space

  • Fits well in the existing Linux facilities

– scsifront is a simple SCSI Virtual HBA driver – scsiback exploits SCSI target framework (tgt)

slide-6
SLIDE 6

6

tgt: framework target drivers

User Space Kernel Space tgt daemon tgt core SCSI Mid layer Xen scsiback driver IBM pSeries target driver Qlogic FC target driver Shared memory tgt kernel API System calls tgtadm Transport class Unix socket Target driver libraries Disk drives management tool User-space daemon

tgt can simplify SCSI target drivers by providing SCSI protocol processing, target and logical unit management, etc

Various target drivers

Xen scsiback only handles low level details

tgt support various SCSI transport protocol target drivers, fibre channel, SRP, iSCSI, etc

slide-7
SLIDE 7

7

How scsiback works? Write command case

  • scsiback gets a SCSI command through ring buffer and

maps the pages to tgtd's address space

  • scsiback passes the command to tgt core via tgt

kernel APIs

  • scsiback sends the mapped address information to

tgtd via scsiback and tgtd

  • tgt core sends them to tgtd through shared buffer

between tgt-core and tgtd

  • tgtd performs the command, does AIO write, and

sends the resutls to scsiback via tgt core

  • scsiback sends the result to scsifront
slide-8
SLIDE 8

8

tgt status

  • tgt, ibmvstgt driver, and libsrp are in the -mm

tree

– ibmvstgt driver

  • SCSI target driver for IBM pSeries VM environments
  • Plays the same role as scsiback driver
  • VMs communicates each other by using RDMA

– libsrp

  • Provides common features for SRP target drivers like

Xen scsiback and ibmvstgt drivers

slide-9
SLIDE 9

9

scsifront/scsiback status

  • Previous version (submitted 2006/08/02)

– DomU can fdisk, mkfs, read/write with virtual disk

  • Current

– Added AIO support to user-space daemon (tgtd) for

better performance

  • The majority of the target drivers doesn't needs AIO

– Modified libsrp for scsiback driver

  • It was designed for ibmstgt driver initially

I'll release the next version soon (and performance results)

slide-10
SLIDE 10

10

Next steps

  • Add more support for scsiback to tgt

– Use tgt's shared buffer to send the mapped page

info and remove scsiback's own shared buffer

  • SRP transport library

– scsifront is the third SRP initiator driver in Linux

  • ibmvscsi (pSeries) and srp_ib (infiniband)
  • Needs SRP transport class (scsi_transport_srp) that

provides common features for SRP initiator drivers

– SCSI-ml already has SPI, FC, iSCSI, SAS transport classes

– libsrp provides common features SRP target drivers

  • Merge scsi_transport_srp and libsrp?
slide-11
SLIDE 11

11

Next steps (cont.)

  • AIO and non-AIO event notification facility

– tgtd needs to wait on AIO and non-AIO file

discriptors, however, no handy interface for that.

– blktap daemon needs it too and uses a kernel

patch to add AIO event support to select interface

  • But probably the patch would not go into mainline

– Short term solution is adding non-AIO event

support to AIO interface (under development)

– Long term solution is unified event notification

facility such as kevent (still no agreement on the design)

slide-12
SLIDE 12

12

Next steps (fun stuff finally)

  • Add metadata disk format support

– easily takes blktap code

  • tgtd only supports disk now, but there are

many SCSI virtualization possibilities

– A tape drive by using a file – A cdrom drive by using an iso image file

  • Direct access to SCSI hardware (passthrough)

– tgtd executes SCSI commands via SG_IO

slide-13
SLIDE 13

13

Further information

  • scsifront/back drivers (2006/08/02)

– http://lists.xensource.com/archives/html/x

en-devel/2006-08/msg00096.html

  • tgt website

– http://stgt.berlios.de/

  • OLS2006 paper and slides are available

Thanks !