Tgt: Framework Target Drivers FUJITA Tomonori NTT Cyber Solutions Laboratories Mike Christie Red Hat, Inc Ottawa Linux.

Slides:



Advertisements
Similar presentations
14 Macintosh OS X Internals. © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit.
Advertisements

OFED TCP Port Mapper Proposal June 15, Overview Current NE020 Linux OFED driver uses host TCP/IP stack MAC and IP address for RDMA connections Hardware.
STGT/iSER Target Overview
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
1 I/O Management in Representative Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Design and Implementation of a Linux SCSI Target for Storage Area Networks Ashish A. PalekarAnshul Chaddha, Trebia Networks Narendran Ganapathy, 33 Nagog.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Device Drivers.
Slide 1 DESIGN, IMPLEMENTATION, AND PERFORMANCE ANALYSIS OF THE ISCSI PROTOCOL FOR SCSI OVER TCP/IP By Anshul Chadda (Trebia Networks)-Speaker Ashish Palekar.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
MATSUMOTO Hitoshi SCSI support on Xen MATSUMOTO Hitoshi Fujitsu Ltd.
UNIX Unit 1- Architecture of Unix - By Pratima.
1.4 Open source implement. Open source implement Open vs. Closed Software Architecture in Linux Systems Linux Kernel Clients and Daemon Servers Interface.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
I/O Software CS 537 – Introduction to Operating Systems.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 5.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Advisor: Hung Shi-Hao Presenter: Chen Yu-Jen
Modifications to the storage stack to better support tgt, sg, st and bsg. ● Scatterlist building and userspace kernel data transfer. ● Userspace interface.
Introduction to Operating Systems Concepts
Computer System Structures
Introduction to threads
Chapter 13: I/O Systems.
Chapter 2: Operating-System Structures
Introduction to Kernel
Kernel Design & Implementation
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
Tape Drive Testing.
Direct Attached Storage and Introduction to SCSI
Lecture 4: Operating System Structures
Operating System Structure
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
CS703 - Advanced Operating Systems
KERNEL ARCHITECTURE.
Chapter 3: Windows7 Part 4.
Direct Attached Storage and Introduction to SCSI
CSCI 315 Operating Systems Design
Storage Networks and Storage Devices
CPSC 457 Operating Systems
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Chapter 1 Introduction to Operating System Part 5
Linux Architecture Overview.
Chapter 2: The Linux System Part 5
Linux and TCP/IP Networking
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems: A Modern Perspective, Chapter 3
Outline Operating System Organization Operating System Examples
Operating Systems Structure
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

tgt: Framework Target Drivers FUJITA Tomonori NTT Cyber Solutions Laboratories Mike Christie Red Hat, Inc Ottawa Linux Symposium 2006

Ottawa Linux Symposium 2006 July 20, Outline ● What is a target and target driver. ● tgt design. ● Problems. ● Future work.

Ottawa Linux Symposium 2006 July 20, SCSI Client Server Model ● Initiator device (client) – Sends SCSI requests ● Target device (server) – Receives requests – Sends responses

Ottawa Linux Symposium 2006 July 20, Target drivers allow a Linux box to provide device services ● Current focus in tgt is SCSI Targets. – Many SCSI Host Bus Adapters have a initiator and target mode. – Most of the infrastructure can be used by other block layer drivers with minor modifications.

Ottawa Linux Symposium 2006 July 20, Monolithic Target Driver ● Interact with hardware. – Initialization, interrupt, etc ● Handle transport protocol. – FCP, iSCSI, SRP network packets and errors ● Execute SCSI commands. – Accessing local devices

Ottawa Linux Symposium 2006 July 20, Stop Reinventing the Wheel ● tgt, SCSI subsystem and transport classes can provide support for common tasks. – Linux SCSI and transport classes provide library functions for hardware and transport management. – tgt provides library functions for executing requests. – Drivers that were monolithic now only handle low level details.

Ottawa Linux Symposium 2006 July 20, Low Level Target drivers in tgt ● Hardware drivers – Handle the major part of the transport and interconnect processing. – Target drivers directly access hardware. ● Software drivers – Handle the transport protocol processing and access low-level hardware through another subsystems like the networking or Infiniband stack.

Ottawa Linux Symposium 2006 July 20, How target drivers fit in.

Ottawa Linux Symposium 2006 July 20, Our key goal is implementing a great portion of tgt in user space ● Command execution. ● Device management. ● The kernel-space tgt is just a connector between Low Level Target drivers and Transport Classes and user space.

Ottawa Linux Symposium 2006 July 20, tgt design User Space Kernel Space tgt daemon tgt core SCSI Mid layer Target driver Netlink socket tgt API System calls tgtadm Transport libraries Transport class Unix socket Target driver libraries Disk drives management tool Single process tgt core is integrated with SCSI-mid layer with minor modifications

Ottawa Linux Symposium 2006 July 20, Let's take a look at the details

Ottawa Linux Symposium 2006 July 20, Target Driver Initialization ● During driver or device initialization we allocate a scsi_host structure. ● If a HBA supports an initiator and target mode we sneak ourselves into the initiator setup. ● scsi_host structure is bound to userspace target entity through hotplug events or tgt netlink events.

Ottawa Linux Symposium 2006 July 20, Kernel and User Space binding target entity logical unit file file- backed tgt daemon User Space Kernel Space scsi_host 0 scsi_host 1 scsi_host 2 Initiator An initiator is bonded to a target entity though the Linux SCSI scsi_host data structure. Target driver A Target driver B

Ottawa Linux Symposium 2006 July 20, tgt daemon (tgtd) ● Contains SCSI state machine, IO execution, and device binding code. ● Behavior can be extended by driver and transport libraries. ● Single process design. – Simplifies Task Management – Potential Bottleneck

Ottawa Linux Symposium 2006 July 20, Sending SCSI Command to tgtd ● tgt provides library functions to get a scsi_cmnd structure and pass it to user space. ● tgt passes the following to users space ● SCSI command (SCSI control block) ● LUN buffer (represents logical unit number) ● tag (unique value to identify this SCSI command) ● task attribute ● buffer length (expected number of data bytes to transfer)

Ottawa Linux Symposium 2006 July 20, SCSI Read/Write Commands ● tgtd uses mmap to map part of the device. ● tgtd passes the address returned by mmap to the tgt kernel component. ● tgt maps the data into the kernel using the kernel's BIO map functions and then asks the target driver to transfer the data. ● When the target driver has completed the transfer the driver notifies tgt. ● tgt runs the driver's the transfer response callback

Ottawa Linux Symposium 2006 July 20, Other Requests ● tgtd builds a response in a malloced buffer. ● tgtd passes the address to the tgt kernel component. ● tgt maps the data into the kernel using the kernel's BIO map functions and then asks the target driver to transfer the data. ● When the target driver has completed the transfer scsi_done is called and commands resources are releases.

Ottawa Linux Symposium 2006 July 20, Why go to all this trouble? ● Drawbacks – Requires a high performance interface. ● Currently using netlink. – Cannot pass pointers. – Passing Read/Write data buffers would require large memory copies. ● Looking into shared memory schemes. – mmapped packet socket (AF_PACKET) and Relayfs are only for kernel to userspace traffic.

Ottawa Linux Symposium 2006 July 20, Why go to all this trouble? ● More Drawbacks – Taking a trip to userspace on every request can become expensive. – Zero copy difficult to support for the software target driver model. ● Benefits – Reduced kernel code makes many kernel developers happy. – Flexibility.

Ottawa Linux Symposium 2006 July 20, Target Driver Status ● FC – Qlogic Fibre Channel support being worked on. – Worked based on Emulex's target mode reference driver is planned. ● iSCSI – Software iSCSI over TCP/IP and Infinniband has been started.

Ottawa Linux Symposium 2006 July 20, Target Driver Status Continued ● XEN – A target mode driver using the SRP protocol has been implemented. ● SRP – Virutual machine environments (IBM pSeries) support is in the -mm tree.

Ottawa Linux Symposium 2006 July 20, Difficulties Adding Target Drivers ● Linux SCSI, Transport Classes and the Block Layer are designed for initiators. – tgt attempts to reuse as much mainline code as possible so the kernel and userspace interfaces require many changes.

Ottawa Linux Symposium 2006 July 20, Future ● tgtd only supports disks, but there are many virtualization possibilities. – A tape drive by using a file – A cdrom drive by using an iso image file ● Accessing SCSI hardware directly (passthrough) – Executes SCSI commands via SG_IO. ● Benchmarking, testing, userspace cleanup and documentation. ● Move tgtd back into the kernel and merge SCST.

Ottawa Linux Symposium 2006 July 20, Questions ● ???