tgt: Framework for Storage Target Drivers
Co-author: Mike Christie (michaelc@cs.wisc.edu)
In order to provide block I/O services, users have had to use modified kernel code, binary kernel modules, or specialized hardware. With Linux now having iSCSI, Fibre Channel, and RDMA initiator support, Linux target framework (tgt) aims to fill the gap in storage functionality by consolidating several storage target drivers and providing a protocol independent API that will simplify target driver creation and maintenance. Our key goal is implementing a great portion of tgt in user space. This conforms to the current trend of pushing code that can be implemented in user space out of the kernel. The tgt kernel component enables the target drivers to send the daemons a vectors of commands through a netlink interface. The daemons execute the commands and send the results back to the target drivers. To avoid kernel-user memory copies, the daemons map a buffer into user space and send the target drivers the address instead of the buffer contents. Tgt extends and utilizes the SCSI and block layer subsystems. The challenge has been in transforming designs which assumed requests would always be initiated from the top of the storage stack to an architecture that could efficiently handle asynchronous requests. This model shares many of the problems that the network subsystem has had to overcome, thus we have attempted to borrow several ideas from it. We describe the tgt design and techniques that achieve comparable performance to that of an in-kernel target driver. We also discuss the possible future evolutions such as the further integration of SCSI initiator and target drivers and similarities with network subsystem design.
|