1. Technical Field
The present invention relates generally to communication protocols between a host computer and an input/output (I/O) Adapter. More specifically, the present invention is directed to a system and method for enabling user space middleware or applications to pass block mode storage requests directly to a physical I/O adapter without run-time involvement from the local Operating System (OS), or, in a virtual system, the local hypervisor.
2. Description of Related Art
Operating systems, according to the present state of the art, do not permit user space middleware or applications, such as a database, to directly access persistent storage that is identified through the Operating System's Raw Mode Storage I/O interface or the Operating System's Logical Volume Storage I/O interface. As a result, the user space middleware must invoke an Operating System (OS) call and incur several task switches every time an I/O operation is performed. The first task switch is caused when the middleware or application transfers a storage request to the OS. A second task switch occurs when the OS passes control back to the user space middleware or application, after the OS completes processing the middleware or application storage request and passes the storage request to the storage adapter.
A third task switch occurs when the storage adapter completes the associated block mode I/O storage operations and interrupts the processing being performed by an application so that the OS may process the storage adapter's completion. The final task switch occurs when the OS finishes processing the storage adapter's completion and gives control back to the middleware or application that transferred the storage request to the OS. In addition to these task switches the storage adapter typically has a single request queue to process work from the operating system.
The four task switches described above may be considered wasted processor cycles, because all work on the thread being switched is stopped until the task switch is complete. On some servers, the number of storage operations performed by a user space middleware or application program may be quite large. Modern, high-end servers may have millions of these operations per second, resulting in several million task switches per second.
In view of the above, it would be beneficial to have a method, system and computer program product having computer readable instructions for handling I/O storage requests in which such task switches are minimized. Moreover, it would be advantageous to have an improved method, system, and computer instructions that enables user space middleware or applications to pass block mode I/O storage requests directly to a physical I/O adapter without any run-time involvement from the local Operating System (OS), or, in a virtual system, the local hypervisor. It would also be advantageous to have the mechanism apply for InfiniBand, TCP/IP Offload Engines, RDMA (Remote Direct Memory Access) enabled NICs (Network Interface Controllers), iSCSI adapters, iSER (iSCSI Extensions for RDMA) adapters, parallel SCSI adapters, Fibre Channel Adapters, Serial Attached SCSI Adapters, ATA Adapters, Serial ATA Adapters, and any other type of storage adapter.
Further, it would be advantageous to have an improved method, system, and computer instructions that enables protection mechanisms to ensure that block mode storage requests that are directly sent to a physical I/O adapter from an application instance are only completed to portions of the storage device that have been previously allocated for out of user space I/O with the application instance. Moreover, it would be beneficial to have a method, system and computer instructions for enabling the creation, modification, querying and deletion of data structure entries used to facilitate direct block mode I/O operations between an application instance and a physical I/O adapter. In addition, it would be beneficial to have a method, system and computer instructions for processing user space operations so as to perform storage device resource management and direct I/O operation data structure management.
The present invention provides a method, computer program product, and data processing system that enables user space middleware or applications to pass block mode storage requests directly to a physical I/O Adapter without run-time involvement from the local Operating System (OS), or, in a virtual system, the local Hypervisor. The mechanism described in this invention applies for InfiniBand Host Channel Adapters, TCP/IP Offload Engines, RDMA (Remote Direct Memory Access) enabled NICs (Network Interface Controllers), iSCSI adapters, iSER (iSCSI Extensions for RDMA) adapters, parallel SCSI adapters, Fibre Channel Adapters, Serial Attached SCSI Adapters, ATA Adapters, Serial ATA Adapters, and any other type of storage adapter.
Specifically, the present invention is directed to a mechanism for providing and using a linear block address (LBA) translation protection table (TPT) to control user space, and out of user space, Input/Output (I/O) operations. In one aspect of the present invention, the Linear Block Address Translation Protection Table (LBATPT) includes an adapter protection table that has entries for each portion of a storage device, e.g., logical volume, SCSI logical unit number, or the like. Each entry may include a key instance and protection domain, along with other protection table context information, against which I/O requests may be checked to determine if an application instance that submitted the I/O requests may access the LBAs identified in the I/O requests. In this way, only those portions of the storage device that have been allocated to the application instance may be accessed by the application instance. Moreover, only the application instance for which the portion of the storage device is allocated may access the portion of the storage device.
The LBATPT further includes an LBA table in which are LBA table entries identifying the logical block addresses associated with entries in the adapter protection table. The LBA table may be used to map LBAs referenced in block mode I/O requests to LBAs of the physical storage device. The present invention further provides mechanisms for processing user space operations so as to manage the creation, modification, querying and deletion of entries in the LBA table. Such mechanisms interface with a memory management interface of the physical I/O adapter so as to allocate, modify, query and de-allocate LBAs associated with an application instance.
In addition, the present invention provides mechanisms for processing user space operations so as to generate work queue entries for passing block mode I/O operations directly to a physical I/O adapter. Moreover, the present invention provides mechanisms for retrieving completion queue entries from the physical I/O adapter when a work queue entry has been processed by the physical I/O adapter so as to inform the application instance of the completion of the processing.
In one exemplary embodiment of the present invention, a method is provided in which an input/output (I/O) adapter receives, from an application instance, a user space operation requesting creation of a resource allocation for direct linear block address (LBA) based input/output (I/O) between the application instance and a physical storage device. The I/O adapter creates the resource allocation in a LBA table entry, of an LBA table, associated with the I/O adapter and the application instance and returns results of the creation of the resource allocation to the application instance.
The creation of the resource allocation in the LBA table entry may include using a memory management interface of the I/O adapter to create the LBA table entry. In addition, the creation may include determining if sufficient resources are available to create the resource allocation and returning an error message is there are not sufficient resources available to create the resource allocation.
In a further embodiment of the present invention, the I/O adapter may receive, from the application instance, a second user space operation requesting de-allocation of second resources. The I/O adapter may then delete a LBA table entry corresponding to the second resources from the LBA table. This deletion may include using a memory management interface of the I/O adapter to delete the LBA table entry. Moreover, the deletion may include determining if an I/O transaction is active on the LBA table entry and deleting the LBA table entry only if there are no I/O transactions active on the LBA table entry.
Furthermore, the deletion may include initiating a timer if there is an I/O transaction active on the LBA table entry and determining if a quiescent point is reached before the timer times out. If the quiescent point is reached before the timer times out, then the LBA table entry may be deleted. The quiescent point may be, for example, a point at which no I/O transactions are active on the LBA table entry.
In addition to the above, the LBA table entry that is created may include a pointer to one or more LBAs of the physical storage device. The LBA table entry may also be associated with an adapter protection table entry, in an adapter protection table, which is used by an application instance to access the one or more LBAs of the physical storage device.
These and other features and advantages of the present invention will be described in, or will become apparent to those of ordinary skill in the art in view of, the following detailed description of the exemplary embodiments of the present invention.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
The present invention applies to any general or special purpose host that uses an I/O adapter, such as a PCI family I/O adapter, virtual I/O adapter, endpoint device, virtual endpoint device or the like, to directly attach storage or to attach storage through a network. The network may consist of endnodes, switches, routers and links interconnecting these components. The network links may be Fibre Channel, Ethernet, InfiniBand, Advanced Switching Interconnect, another standard storage network interconnect, or a proprietary link that uses proprietary or standard protocols. While the depictions and description hereafter will make reference to particular arrangements of networks and host nodes, it should be appreciated that the following exemplary embodiments are only exemplary and modifications to the arrangements specifically depicted and described may be made without departing from the spirit and scope of the present invention.
It is important to note that the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In an exemplary embodiment, the present invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, and the like.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. Network adapters are coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters that may be used with the present invention.
With reference now to the figures, and in particular with reference to
As shown, processor I/O hierarchy 100 includes a processor chip 107 which includes one or more processors and their associated caches. Processor chip 107 is connected to memory 112 through a link 108. One of the links on the processor chip, such as link 120, connects to a PCI family I/O bridge 128. The PCI family I/O bridge 128 has one or more PCI family (PCI, PCI-X, PCI-Express, or any future generation of PCI) links that are used to connect other PCI family I/O bridges or a PCI family I/O adapter, such as PCI family adapter 1145 and PCI family adapter 2144, through a PCI link, such as links 132, 136, and 140. A PCI family adapter, such as PCI Family Adapter 1145, may be used to connect to a network attached storage 152 through a network link, such as link 156 to network 164, that connects to either a switch or router 160, which in turn connects to the network attached storage 152 via link 158. A PCI family adapter, such as PCI family adapter 2144, may also be used to connect a direct attached storage device 162 through a link 148.
It is important to note that a PCI Family Adapter, such as PCI Family Adapter 1145 or PCI Family Adapter 2144, may be integrated with other components on the host node 102. For example, PCI family adapter 1145 or PCI family adapter 2144, may be integrated with PCI family I/O bridge 128. Another example is that the PCI family adapter, such as PCI family adapter 1145 or PCI family adapter 2144, may be integrated with processor chip 107.
While the exemplary embodiments of the present invention will be described with regard to a PCI family adapter, it should be appreciated that the present invention is not limited to this type of adapter. Rather, the physical I/O adapter may be any type of I/O adapter including a PCI family adapter, a virtual I/O adapter, an endpoint device, a virtual endpoint device, a virtual I/O adapter endpoint device, or the like. One example of a virtual I/O adapter that may be used with the present invention is described in, for example, commonly assigned and co-pending U.S. patent application Ser. No. 11/065,829 entitled “Data Processing System, Method and Computer Program Product for Creation and Initialization of a Virtual Adapter on a Physical Adapter that Supports Virtual Adapter Level Virtualization, filed on Feb. 25, 2005, which is hereby incorporated by reference. Other types of I/O adapters may be used without departing from the spirit and scope of the present invention.
With reference now to
In this example, physical I/O adapter 200, shown in
The physical I/O adapter 200 also has a translation and protection table context, such as TPT context 208, which is used to contain the context for a host resident translation and protection table, such as TPT 232 or TPT 252. The TPT context 208 may also be used to contain the TPT 232 or 252 itself or a cache of entries from the host resident TPT 232 or TPT 252.
TPT 232 and 252 reside in an Operating System (OS), such as OS 1220 or OS 2240. The OS, e.g., OS 1220 or OS 2240, may reside above a hypervisor 216, which is software, firmware or a mix of the two that manages the partitioning and virtualization of physical hardware resources and controls the OS execution. The OS may host one or more middleware or application instances. In
A middleware or application instance, such as App 1224 uses a set of processing queues, such as processing queue set 236, to pass block mode I/O storage requests to the physical I/O adapters. The block mode I/O storage requests may be constructed as a SCSI command, as an ATA storage command, or the like. When the physical I/O adapter 200 processes a block mode I/O storage request, the physical I/O adapter 200 uses a key passed in the block mode I/O storage request to look up an entry in the TPT context 208. If the TPT context 208 is associated with the same protection domain as the PQ Context 204, used for the processing queue, then the block mode I/O storage request is processed. Otherwise, the block mode I/O storage request is completed in error.
Turning next to
The adapter protection table 302 may be segmented into a set of adapter protection table segments, such as adapter protection table segment 1304. The segments may be interconnected using several data structures, including a B-tree, a tree made up of pointers in non-leaf nodes and pointers in leaf nodes, simple linked list, or the like. In the depicted example, adapter protection table segment 1304 uses a simple linked list where the first entry in the table is a pointer to the next table that contains adapter protection table entries.
Protection table entry N 320 depicts an example entry in the adapter protection table segment, such as adapter protection table segment 1304. Each entry in the adapter protection table segment 1304 contains a set of fields that are used to define that entry. Protection table entry N 320 contains the following fields: Access Controls, Protection Domain, Key Instance, Logical Volume Number, SCSI Identifier Number, SCSI Logical Unit Number, LBA Table Size, Sector Size, Length, LBA Table pointer.
The adapter's S_Key mapping logic 386 performs all the checks of the fields in the protection table entry, e.g., protection table entry N 320. Any checks that are not passed by the S_Key mapping logic 386, result in an operation being completed in error. In the event of an error, the OS may either tear down the middleware or application instance that passed in the operation or take a less drastic measure, such as returning the operation with an error completion.
The Access Controls field describes whether the entry is valid or not and what type of operations may be performed on the entry. The possible operations that may be performed on the entry are: Read, Write, and Read/Write. If the block mode I/O storage request passed in by the middleware or application instance accesses a valid protection table entry, then the operation passes the valid/invalid check. If the block mode storage I/O request passed in by the middleware or application instance attempts to perform a Read access operation and the protection table entry has the valid bit set, then the operation passes this check. If the block mode storage I/O request passed in by the middleware or application instance attempts to perform a Write access operation and the protection table entry has the Read/Write bit set, then the operation passes this check.
The Protection Domain field is used to associate an adapter protection table entry with a PQ context. That is, if the PQ context, used by the middleware or application instance to pass in a block mode storage I/O requests, contains the same value in its protection domain field as the protection domain field of an adapter protection table entry, then the two are associated and the operation passes this check. If there is a mismatch between these protection domains in the PQ context and the adapter protection table entry, then the operation fails this check.
The Key Instance is used to compare the storage key passed in a block mode I/O storage request by the middleware or application instance to the storage key stored in the adapter protection table entry. If the two match, the operation passes this check. If the Key Instance does not match the storage key passed in the block mode storage I/O request, then the operation does not pass this check.
The storage key, or “S_Key”, has two fields—a first field is an index into the adapter protection table and the second field is a key instance which is to be compared with a key instance in the adapter protection table entry that is pointed to by the first field. When the middleware or application instance submits a block mode I/O storage request, the adapter uses the first field to obtain an entry from the adapter protection table. The adapter then compares the key instance inside the adapter protection table entry with the second field that was passed in by the middleware or application instance.
The Logical Volume Number is optional and, if included, it is used to compare the LV number passed in a block mode storage I/O request by the middleware or application instance to the LV number stored in the adapter LV protection table entry. If the two match, the operation passes this check. If the Logical Volume Number does not match the LV number passed in by the block mode storage I/O request, then the operation fails this check.
The SCSI Identifier Number (ID) and SCSI Logical Unit Number (LUN) are used to associate the entry with a specific SCSI device and a specific LUN within that device, respectively.
The LBA Table Size is used to define the maximum number of entries each LBA table segment that is associated with the adapter protection table entry, such as LBA table segment 1324, may contain. The Sector Size is used to define the size of each sector on the disk associated with the adapter protection table entry. The Length field is used to define the total length of the set of disk LBAs associated with the adapter protection table entry.
The LBA Table Pointer of the protection table entry 320 points to one or more corresponding LBA table entries in the LBA table 322. Thus, with the LBA Table Pointer field, the linear block addresses associated with a protection table entry in the adapter protection table 302 may be identified in order to provide access to linear block addresses of storage locations on the physical storage device associated with the processor queue from which a block mode I/O request is received in the adapter 316.
The LBA table 322 may also be segmented into a set of LBA table segments, such as LBA table segment 1324. The segments may be interconnected using several data structures, including a B-tree, a tree made up of pointers in non-leaf nodes and pointers in leaf nodes, a simple linked list, or the like. In the depicted example, LBA table segment 1324 uses a simple linked list where the first entry in the table is a pointer to the next table that contains LBA table entries.
Each entry in the LBA table segment, such as LBA table segment 1324, describes the range of disk Linear Block Addresses (LBAs) associated with that entry. For this description, the entry may use a starting LBA and a length, a starting LBA and an ending LBA, or the like.
The physical I/O adapter, such as adapter 316, may choose to store the entire adapter protection table, a portion of the adapter protection table, or none of the adapter protection table. Adapter 316 is shown with an adapter protection table cache that holds one segment, such as cached protection table segment 1390.
Similarly, the adapter 316 may choose to store the entire LBA table, a portion of the LBA table, or none of the LBA table. In the depicted example, adapter 316 is shown with an LBA table cache that holds one segment, such as cached LV LBA table segment 1398.
With reference next to
The system image, such as system image 1412, has a device driver, such as adapter driver 440, associated with the storage adapter 420. The adapter driver 440 may contain a processing queue (PQ) table backing store 444 which contains copies of the entries in the adapter's PQ table, e.g., system image l's processing queue table segment 1400.
When application instance X 432 performs a block mode I/O access, the application instance informs the associated adapter 420 through the use of a processing queue (PQ) doorbell 436. For example, PQ 1 Doorbell 436 informs the adapter 420 that there is a storage work request in the send queue 428 of the processing queue set used to communicate between application instance X 432 and adapter 420.
The data from PQ 1 Doorbell 436 provides the number of work requests that need to be added by an adder 422 to the current number of pending work requests in the adapter 420. That is, a block mode I/O request sent generated by middleware or an application instance may be comprised of a plurality of actual work requests that are stored in the send queue as work queue entries. The PQ 1 Doorbell 436 identifies the number of work requests that are part of the block mode I/O request.
The number of work requests is provided as a PQ Count field that is stored in the associated processing queue table entry PQ N associated with the system image, such as cached PQ entry N from system image l's PQ Segment 1424. Once the storage work request is completed, a message is added to a completion queue 450 which is used to inform the application that the work request has been completed.
As shown in
With reference next to
As shown in
When the application X 532 submits a block mode I/O storage request, such as block mode I/O storage request 536, part of the request will contain an S_Key. The S_Key is used by the adapter 516 to access a segment of the adapter protection table 502. This accessing of a segment of the adapter protection table 502 may involve accessing a cached adapter protection table segment 540 if the required segment is present in the adapter's protection table segment cache 550. If the required adapter protection table segment is not present within the adapter's protection table segment cache 550, a loading of the required adapter protection table segment, e.g., adapter protection table segment 504, from the system image 500 into the adapter's protection table segment cache 550 may be required, for example. Alternatively, the S_Key checking logic 519 may access the adapter protection table segment, e.g., adapter protection table segment 1504, in the system image 500 directly.
The S_Key is used to lookup an entry in the adapter protection table segment 1504, or cached adapter protection table segment 540, associated with the S_Key. For example, the S_Key may be compared against the key instance fields of the adapter protection table entries in the adapter protection table segment 504/540 to identify an entry that matches the S_Key.
S_Key checking logic 519 in the adapter 516 will then perform a protection domain check to verify that the protection domain coming from the PQ context 524 in adapter 516 matches the protection domain in the protection table entry N 520 that is pointed to by the S_Key in the block mode I/O storage request 536. Any checks that are not passed by the S_Key checking logic 519, result in an operation being completed in error. In such a case, the operating system, e.g., system image 1500, may either tear down the middleware or application instance, e.g., application instance X 532, that passed in the operation, or take a less drastic measure, such as returning the operation with an error completion.
Assuming that all of the checks previously discussed above are passed, the block mode I/O storage request is processed by the adapter 516 to either read, write or read/write data to/from the linear block addresses of the physical storage device 560, e.g., the hard disk, referenced by the entry in the cached LBA table segment 550, or alternatively the LBA table segment (not shown) associated with the system image 500, corresponding to the adapter protection table entry.
The present invention uses the adapter protection table and LBA table to manage the “user space” and “out of user space” block mode I/O operations. User space is the portion of system memory used to run user applications. Block mode I/O operations that are performed in “user space” include operations regarding the creation, modification, querying and deletion of LBA table entries, the submission and processing of work queue requests by applications, other I/O operations performed by a system image, and the like. With regard to the present invention, block mode I/O operations that are performed “out of user space” include operations performed in the I/O adapter to facilitate validation and execution of I/O requests to physical storage devices.
The data structures and mechanisms described above are used to control access to portions of storage by applications during linear block address (LBA) based direct I/O operations, or simply block mode I/O operations, between the application instance and the physical I/O adapter. The following description provides details regarding the way in which resources are allocated, work queue entries are created, and completion queue entries are processed in accordance with the mechanisms previously described above.
It will be understood that each block, and combination of blocks, of the flowchart illustration in
Accordingly, blocks of the flowchart illustrations support combinations of means for performing the specified functions, combinations of steps for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the flowchart illustrations, and combinations of blocks in the flowchart illustrations, can be implemented by special purpose hardware-based computer systems which perform the specified functions or steps, or by combinations of special purpose hardware and computer instructions.
As shown in
A determination is made as to whether the user space operation that is being invoked is a resource management operation (step 615). The operating system is there to restrict access to the underlying hardware so that an application cannot access resources associated with another application. Thus, a resource management operation is one that must be performed by the operating system because there is no other alternative for restricting the application's access to the resources it owns. Examples of such operations include create volume, query volume, destroy volume. A non-resource management operation is one where, through the mechanisms of the present invention, a physical adapter can restrict the application's access to the resources it owns. Examples of non-resource management operations are read and write operations.
If the operation is not a resource management operation, then the operation is a processor queue processing operation. As a result, a determination is made as to whether the operation is for work queue processing, e.g., processing associated with an entry in a send queue (step 620). If so, a work queue entry insertion process is invoked for creating a work queue entry (step 630). This work queue entry insertion process is used to submit work requests to the I/O adapter as discussed previously and outlined hereafter in
If the operation is not for work queue processing, then a completion queue entry retrieval process is invoked (step 630). The completion queue entry retrieval process is used to retrieve completion queue entries from the physical I/O adapter for work requests that have been completed by the physical I/O adapters, as described in greater detail hereafter.
If the user space operation is a resource management operation (step 615), then a determination is made as to whether the operation is a resource query operation (step 640). If the operation is a resource query operation, then the system image/operating system retrieves the attributes of the resource from the physical I/O adapter and returns the results to the element, e.g., system image or application instance, that invoked the user space operation (step 645). This operation is used to obtain attribute information from, for example, LBA table entries and adapter protection table entries, as discussed in greater detail hereafter.
If the operation is not a resource query operation, then a determination is made as to whether the operation is a resource create operation (step 650). If the operation is a resource create operation, a determination is made as to whether the physical I/O adapter has resources available to allocate to the element invoking the user space operation (step 660). For example, as discussed above, each adapter protection table entry in the adapter protection table contains a LBA table size, sector size and length. These parameters may limit the number of resources available by the adapter for allocation. Thus, the physical I/O adapter may determine that sufficient resources are not available for allocation to the element invoking the user space operation.
If there are sufficient resources available to allocate, then these resources are allocated on the physical I/O adapter and the physical I/O adapter returns the results of this allocation to the invoking element (step 665). If there are not sufficient resources available to allocate, then an error record may be generated and returned to the element invoking the user space operation (step 670).
If the operation is not a resource create operation (step 650), then a determination is made as to whether the operation is a resource destroy operation, also referred to herein as a “delete” or “de-allocation” operation (step 675). If the operation is a resource destroy operation, then the resource is destroyed on the physical I/O adapter and the results of the operation are returned to the element invoking the user space operation (step 680). If the operation is not a resource destroy operation, then the operation is a resource modify operation and the attributes of the designated resource are modified on the physical I/O adapter (step 685). The operation then terminates.
As shown in
A processing queue doorbell message is sent from the application instance to the physical I/O adapter to inform the physical I/O adapter of the newly posted work request (step 715). In one exemplary embodiment of the present invention, the sending of the processor queue doorbell message involves performing a programmed I/O write to a doorbell address associated with the work queue. As discussed above, the doorbell message is used to add additional work requests to the processor queue count in the cached processor queue entry of the physical I/O adapter.
Thereafter, the physical I/O adapter performs validation checks of the information stored in the work queue entry or entries against the data stored in the adapter protection table entries (step 720). As discussed above, these checks may include, for example, checking for matches between protection domains, logical volume numbers, SCSI identification numbers, SCSI logical unit numbers, and the like. These checks will be described in greater detail hereafter.
A determination is made as to whether all of the checks are completed successfully (step 725). If all of the checks complete successfully, the physical I/O adapter uses the LBA table to translate the LBAs referenced within the work queue entry and performs LBA containment checks (step 730). Because the application instance operates in a different space than the storage device, the addresses referenced by the block mode I/O storage request generated by the application instance may differ from the actual physical addresses of the storage device. The LBA table entries provide information regarding the actual physical LBAs for the storage device that are allocated to a particular application instance, as determined from the corresponding adapter protection table entry. Thus, a mapping between the LBAs referenced in the block mode I/O storage request, and thus the work queue entries, and the LBAs referenced in the LBA table may be performed in order to determine the actual physical LBAs to which the block mode I/O operations are to be directed.
For example, the LBA table pointer in the adapter protection table entry may be used to access one or more entries in the LBA table that correspond to the adapter protection table entry. From the LBA table entries corresponding to the adapter protection table entry, the range of disk Linear Block Addresses (LBAs) corresponding to the adapter protection table entry may be identified. These LBAs may then be used to map the LBAs referenced in the work queue entry to LBAs of the physical storage device.
Returning to
If the validation and containment checks complete successfully, the physical I/O adapter marks the work queue entry as valid (step 750) and performs all functions, e.g., read, write, read/write, associated with the work queue entry (step 755). Thereafter, or after the generation of an error result in step 740, the physical I/O adapter creates a completion queue entry associated with the work queue entry and performs a direct memory access (DMA) operation to send the completion queue entry to the application instance (step 760).
A determination is then made as to whether a complete queue event was requested (step 765). If so, the physical I/O adapter generates a completion queue event (step 770) and the operation terminates. That is, after work requests that were posted to the send and receive queues of the processor queue are completed, a completion message is put into the completion queue and if the application requests it, an event may be generated.
It is important to note in
Exemplary validation checks that are performed to determine if a work queue entry is valid and may be processed by the physical I/O adapter are illustrated in
As shown in
A determination is made as to whether a valid adapter protection table entry has been found by the above lookup operation (step 830). If not, an error result is generated and returned (step 840). As mentioned above, this error result may be, for example, tearing down the middleware or application instance that passed in the work request that generated the work queue entry, or may take a less drastic measure such as returning the operation with an error completion.
If a valid adapter protection table entry has been found, a check is then made as to whether the I/O operation that is to be performed in association with the work queue entry is supported by the associated adapter protection table entry (step 850). For example, the access controls of the adapter protection table entry are compared against the I/O operation identifier in the work queue entry to determine if the adapter protection table entry indicates that the I/O operation may be performed or not.
If the I/O operation cannot be performed based on the setting of the access controls in the adapter protection table entry, then the operation generates and returns an error result (step 840). If the I/O operation can be performed as indicated by the adapter protection table entry, then a determination is made as to whether the protection domain of the work queue entry corresponds to the protection domain of the adapter protection table entry (step 860). If the protection domains do not match, then the operation generates and returns an error result (step 840). If the protection domains do match, and the work queue entry has an associated LV number identifier and/or a SCSI LUN identifier, then additional checks of this information are made (steps 870). As with the previous checks, if these checks result in a mismatch between the work queue entry and the adapter protection table entry, then an error result is generated and returned (step 840).
If all checks are passed, the work queue entry is preliminarily marked as a valid work queue entry that may be processed by the physical I/O adapter (step 880). This preliminary marking of validity only means that the work queue entry has passed the first set of validity checks. As described above, the work queue entry must also pass containment checks before being processed by the physical I/O adapter. Following step 880, the operation ends with regard to the validity checks but, as shown in
It should be appreciated that while
As shown in
It should be noted that the above operations described in
As discussed above, with regard to the operation outlined in
Moreover, it should be appreciated that while the operations outlined in
As shown in
A determination is then made as to whether the I/O adapter has sufficient resources to complete the request (step 1030). This determination may involve, for example, using the adapter protection table entry corresponding to the application instance, as determined by the S_Key mapping logic, to identify a LBA table segment associated with the application instance. A determination may then be made, based on the LBA table size, sector size, length, and current available space in the LBA table segment whether there are sufficient resources for allocating additional LBAs to the application instance.
For example, each LBA table segment can fit a fixed number of entries. When that number of entries is reached, a new LBA table segment needs to be added and linked via the LBA table pointer. The operating system, or system image, determines if there are free pages available that can be pinned and used to hold a new LBA table segment. If there are free pages available, the operating system or system image, uses those pages, pins them, and successfully completes the request; otherwise, the request fails. LBAs must also be available on the disk for use by the application instance. The operating system or system image determines if there are LBAs available on the disk that can be used by the application and if there are, the operating system or system image uses those LBAS, and references them through the LBA table segment entry; otherwise, the request fails.
If there are sufficient resources available to allocate the requested LBAS to the application instance, then a LBA entry is created in the LBA table segment corresponding to the application instance (step 1040). The LBA entry identifies the physical storage device LBAs that map to the LBAs requested by the application instance. The physical I/O adapter then returns the results of the creation user space operation to the application instance so as to inform the application instance of the LBAs that may be used by the application instance to perform block mode direct I/O to the physical I/O adapter (step 1050).
If there are not sufficient resources to allocate the requested LBAs, then the physical I/O adapter does not create the LBA entry (step 1060). The resulting error is then returned by the physical I/O adapter to the application instance as the results of the creation user space operation (step 1050). The operation then terminates.
As shown in
If there are sufficient resources available, a determination is made as to whether there are any active I/O transactions on the LBA entry that is being modified (step 1150). If there are active I/O transactions on the LBA entry that is being modified, the physical I/O adapter initiates a timer and waits for a quiescent point to be reached (step 1160). The quiescent point is a point at which there are no I/O transactions active on the LBA entry being modified. This check and waiting for a quiescent point are necessary so that modifications are not made to an LBA entry that would result in corruption of the system due to the active I/O transactions operating under the previous LBA entry attributes.
A determination is then made as to whether the quiescent point is reached before a timeout of the timer (step 1170). If not, an error message is returned to the application instance indicating an inability to complete the modifications (step 1140). If a quiescent point is reached before timeout of the timer, the physical I/O adapter modifies the attributes of the LBA entry (step 1180) and returns the attributes of the modified resource to the application instance (step 1190). The operation then terminates.
As shown in
As shown in
If an I/O transaction is active on the LBA entry, the physical I/O adapter initiates a timer and waits for a quiescent point to be reached (step 1340). A determination is then made as to whether the quiescent point is reached before the timer times out (step 1350). If not, the physical I/O adapter creates an error result and returns the error result to the application instance (step 1360). If the quiescent point is reached before the timer times out, or if there is no active I/O transaction on the LBA entry, the physical I/O adapter destroys or deletes the existing LBA entry (step 1370) and returns the result to the application instance (step 1380). When an LBA entry is destroyed or deleted by the operating system or system image, an entry is removed from the LBA table segment and the LBAs in the disk are freed and made available for use of other applications.
It should be noted that the operations outlined in the flowcharts described above make reference to the operations performed on the LBA table entries. In addition, changes to the LBA table may further require changes to the adapter protection table. For example, for the query operation, the operating system or system image will check if the middleware or application instance that submits the query request is associated by the adapter protection table entry referenced by the query operation. If so, the query is allowed; otherwise, an error is reported. During the creation and modification operations, the middleware or application instance requests the Read and Write Access Control field values and the Length field value that is to be stored in an associated protection table entry and the operating system or system image inserts these values into the appropriate fields of the adapter protection table entry along with the rest of the fields. During the delete or destroy operation, the operating system or system image destroys the associated LBA table segment(s) and then sets the access control fields of associated protection table entries to invalid.
Thus, with the present invention, an invoked user space operation is checked to see if the operation is a resource query, resource create, resource destroy, resource modify, work queue, or completion queue operation. Based on this determination, corresponding operations for querying, creating, destroying, and modifying resource allocations, work queue entries, and completion queue entries are performed. Thus, if an application requires resources in order to perform linear block address (LBA) based direct I/O operations, needs to modify an allocation of resources in order to perform such direct I/O operations, or needs to destroy resource allocations, the present invention provides mechanisms to achieve these purposes. In addition, the application may submit work queue entries for processing, and process completion queue entries to obtain information regarding work queue entries whose processing by the physical I/O adapter has been completed. In this way, LBA based direct I/O operations, i.e. block mode I/O operations, are managed by the mechanisms of the present invention.
Moreover, as illustrated in the exemplary embodiments described above, the present invention provides a plurality of data structures and mechanisms for handling LBA based I/O operations. These data structures and mechanisms processor queue to linear block address translation using protection table access control. This mechanism ensures that only an application associated with the portion of the storage device being accessed may actually access the portion of the storage device. A plurality of validation checks, including a key check and a protection domain check, are used to maintain this level of security. These checks ensure that the application instance is accessing a valid adapter protection table entry and that the application has permission to access portions of the storage device associated with a valid protection table entry.
It should be noted that, while the above mechanisms of the exemplary embodiments of the present invention make use of the operating system or system image to perform a number of operations with regard to the creation and management of the adapter protection table entries and LBA table entries, these operations are not generally performed with each work request processed by the adapter. That is, the operating system or system image is only involved in the setup of the adapter protection table entries and the LBA table entries and the registration of the application instances/middleware with the associated LBAs. The operating system or system image is not required in order to process each actual work request submitted by the middleware or application instance since the application and adapter can use the transaction protection table and mechanisms described above to process the work requests. As a result, the present invention eliminates the context switches, and their associated overhead, required by prior art mechanisms, as explained in the background of the invention above.
It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
Number | Date | Country | |
---|---|---|---|
Parent | 11135539 | May 2005 | US |
Child | 12269419 | US |