CN101788888A - Method for realizing target end driver and target end driver - Google Patents

Method for realizing target end driver and target end driver Download PDF

Info

Publication number
CN101788888A
CN101788888A CN201010113814A CN201010113814A CN101788888A CN 101788888 A CN101788888 A CN 101788888A CN 201010113814 A CN201010113814 A CN 201010113814A CN 201010113814 A CN201010113814 A CN 201010113814A CN 101788888 A CN101788888 A CN 101788888A
Authority
CN
China
Prior art keywords
command
destination end
data
storing communication
communication protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201010113814A
Other languages
Chinese (zh)
Inventor
周洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201010113814A priority Critical patent/CN101788888A/en
Publication of CN101788888A publication Critical patent/CN101788888A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for realizing a target end driver, which comprises the following steps: a hardware interface driver sends the received storage communication protocol command to a target end uniform driving platform; the target end uniform driving platform carries out visit control processing on the storage communication protocol command according to the types of the received storage communication protocol command; and the storage communication protocol command is executed for operating block equipment after the visit control processing is completed. The invention realizes the public part of the target end driver of various transmission protocols and hardware interfaces through the target end uniform platform, and the simplification and the speed acceleration of the target end driver development are realized, so the compatibility and the expansibility of the system are ensured.

Description

A kind of realization destination end method of driving and this destination end drive
Technical field
The present invention relates to the block device technical field, relate in particular to a kind of realization destination end method of driving and this destination end and drive.
Background technology
Block device comprises memory devices such as CD, hard disk, storage card and tape, for I/O (input and output) interactive operation that realizes block device, system user has to by retouching operation system kernel module, or buys the operation that method such as special hardware is implemented in these block devices of support corresponding system under.
In present certain operations system, realized the kernel code support that the originating end (Initiator end) of multiple storage transportation protocol drives, and to the support of destination end (target end) driving seldom.
SCSI (Small Computer System Interface, small computer system interface) is the same with other interfaces, is actually a cover agreement of the intercommunication of originating end and destination end in the storage system.(Host Bus Adaptor HBA) is linked into the I/O bus of main frame with memory device or other external units, and uses SCSI consultative management, control and these external units of operation SCSI host computer using SCSI host bus adaptor.
In present most of storage systems, the function that destination end drive to realize has: and originating end carries out mutual between host-host protocol; The realization hardware interface drives; Handle main and proprietary device command sets driver; Corresponding host-host protocol, hardware interface and destination end as shown in Figure 1 drives three subsystems.
In the existing storage system, destination end can adopt different host-host protocols with the data interaction that originating end carries out according to demand, with reference to figure 1, as FCP (Fibre Channel Protocol, netted channel agreement), iSCSI (Internet Small Computer System Interface, the Internet small computer system interface), SRP (SCSI RDMA protocol, the long-range direct access protocal of SCSI) etc., every kind of host-host protocol all needs proprietary hardware interface, and because the uniqueness of hardware interface, need drive for each hardware interface provides a corresponding cover destination end, both comprised in destination end drives: transport protocol command processing and the proprietary command process of hardware interface etc. comprise again: functions such as local device are handled and visited to the SCSI generic command.
In existing storage system realized, a kind of new host-host protocol of every employing and hardware interface all needed to repeat to realize that the destination end with above-mentioned all functions drives.Yet, handle except transport protocol command during destination end drives and the proprietary command process of hardware interface, other parts all are independently and functional similarity, and in the performance history of target drives, the overlapping development of similar part has caused the raising of cost and the prolongation of construction cycle.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of realization destination end method of driving and this destination end drives, the problem of the partial content overlapping development that the destination end of solution differing transmission protocols and hardware interface drives, realize shared public part, to save cost of development and cycle.
For solving the problems of the technologies described above, a kind of realization destination end method of driving of the present invention comprises:
Hardware interface drives the storing communication protocol command that receives is sent to the unified platform that drives of destination end;
The unified type that drives platform according to received storing communication protocol command of destination end to this storing communication protocol command control and treatment that conducts interviews, after finishing access control and handling, is carried out this storing communication protocol command, and block device is operated.
Further, if the storing communication protocol command is the order that writes data to block device, then this destination end is unified drive platform this order that writes data finished access control and handled after, for data write the memory allocated space, and memory space address is returned to the originating end main frame;
After receiving the storing communication protocol command that carries address pointer and data to be written of originating end main frame, the unified platform that drives of destination end carries out data processing to data to be written, after finishing data processing, the indication of data according to address pointer is written in the corresponding space of block device.
Further, if the storing communication protocol command is the order from the block device reading of data, after then the unified driving of this destination end platform is finished the access control processing to the order of this reading of data, according to indication reading of data from relevant block equipment of the order of this reading of data, and the data that read out are returned to the originating end main frame.
Further, the storing communication agreement is the small computer system interface agreement.
Further, a kind of destination end drives, comprise: hardware interface drives and the unified platform that drives of destination end, the unified platform that drives of this destination end comprises: the destination end core processing module of Xiang Lianing, block device processing layer and storing communication agreement middle layer successively, also comprise: command process daemon thread and unified platform function library, this command process daemon thread link to each other with unified platform function library with the destination end core processing module respectively;
Hardware interface drives, and the storing communication protocol command that is used for receiving sends to the destination end core processing module;
The destination end core processing module, the storing communication protocol command that is used for receiving sends to the command process daemon thread, and the basic IO Command that this command process daemon thread that will receive returns sends to the block device processing layer;
The command process daemon thread, be used for type, call the built-in function in the unified platform function library when needed, to the storing communication protocol command control and treatment that conducts interviews according to the storing communication protocol command that receives, generate basic IO Command, and send to the destination end core processing module;
The block device processing layer is used for the basic IO Command that receives is carried out pre-service, will finish pretreated basic IO Command and send to storing communication agreement middle layer;
Storing communication agreement middle layer, the basic IO Command that is used for receiving is converted to the storing communication protocol command, according to this storing communication protocol command block device is operated.
Further, if the storing communication protocol command is the order that writes data to block device, after then the command process daemon thread is finished the access control processing, be the data allocations storage space, and memory space address is returned to the originating end main frame by the destination end core processing module; And,
After receiving the storing communication protocol command that carries address pointer and data to be written of originating end main frame, data to be written are carried out data processing, generate basic IO Command, carry the data after the processing, send to the destination end core processing module, this destination end core processing module should basic IO Command send to the block device processing layer;
After the block device processing layer carries out pre-service to the basic IO Command that receives, send to storing communication agreement middle layer, command conversion is carried out in this storing communication agreement middle layer, with the data of carrying in the storing communication protocol command that is converted to, be written in the corresponding space of block device according to the indication of address pointer.
Further, if the storing communication protocol command is the order from the block device reading of data, then storing communication agreement middle layer is according to the indication of the storing communication protocol command that is converted to, reading of data from relevant block equipment, and, the data that read out are returned to the originating end main frame by block device processing layer and destination end core processing layer.
Further, destination end core processing module, block device processing layer and storing communication agreement middle layer are positioned at the kernel state space of operating system; Command process daemon thread and unified platform function library are positioned at user's state space of operating system.
Further, preserve the shared function that host-host protocol and hardware interface drive in the unified platform function library.
Further, this destination end drives and also comprises administration module, and this administration module is connected with the command process daemon thread, is used for by the command process daemon thread built-in function of unified platform function library being managed maintenance.
In sum, the present invention realizes the public part of the destination end driving of various host-host protocols and hardware interface by the destination end unified platform, realized that destination end drives the simplification of exploitation and rapid, thereby the compatibility and the extensibility of system have been guaranteed, the present invention can be applicable to various host-host protocols and hardware interface, and may add the host-host protocol and the hardware interface of other types at any time, at the unified interface function that only needs in the platform to increase to new host-host protocol and hardware interface that drives of destination end, just can compatible well New Deal and the use of hardware interface, and a large amount of Processing tasks that repeat are all in the inner realization of the unified platform, system's index word seldom, the development time that destination end is driven shortens greatly, most of function all realizes in operating system user state space among the present invention, can make full use of user's attitude abundant built-in function and debugging acid, make the development simple and fast.
Description of drawings
Fig. 1 is the mutual Organization Chart of block device of the prior art;
Fig. 2 is the Organization Chart of block device exchange of the present invention;
Fig. 3 is the unified structural drawing that drives platform of destination end among the present invention;
Fig. 4 realizes the process flow diagram of destination end method of driving for the present invention.
Embodiment
Consider that destination end comprises independently and intimate part in driving, therefore, total part is abstract comes out present embodiment with repeating of driving of destination end under the variety of protocol, realize a unified platform that drives, as the unified platform that drives of destination end among Fig. 2, adopt the unified mode that drives platform to help the exploitation of new product, shorten the construction cycle, improve the reusability of module.
The destination end of present embodiment drives and comprises: hardware interface drives and the unified platform that drives of destination end, destination end is unified to drive that processing section that platform repeats during every kind of hardware interface and the pairing destination end of host-host protocol are driven is abstract comes out, realize a shared API (Application ProgrammingInterface, application programming interface) collection of functions, this unified driving in the platform, the core that destination end drives is major part to be handled operation put into the realization of operating system user state space, the function of comparing present destination end driving mostly realizes at the operating system nucleus state space, can make exploitation more convenient, and can use built-in function abundant in the operating system user state space and exploitation debugging acid, the simplification that has improved the compatible of destination end driving and safeguarded.
Below in conjunction with accompanying drawing the specific embodiment of the present invention is elaborated.
Figure 3 shows that the unified platform that drives of destination end of present embodiment, suppose that the storing communication agreement is the SCSI agreement, the unified platform that drives of this destination end comprises: the destination end core processing module that is arranged in the operating system nucleus state space, block device processing layer and SCSI middle layer, and the administration module that is arranged in operating system user state space, command process daemon thread and the unified stage function storehouse that drives, wherein: the destination end core processing module, the block device processing layer links to each other successively with the SCSI middle layer, the destination end core processing module also links to each other with the command process daemon thread, and the command process daemon thread also links to each other with unified platform function library with administration module respectively.
The main task of destination end core processing module is that the order that will receive sends to the command process daemon thread, and BIO (basic input and output) order of being responsible for the command process daemon thread is returned sends to the block device processing layer.
Mainly responsible BIO is ordered of block device processing layer carried out pre-service, after pre-service is finished, the BIO order sent to the SCSI middle layer, and the SCSI middle layer is a scsi command with the BIO command conversion, and block device is carried out read-write operation.
Administration module mainly is to realize some administration order instruments, with realization systemic-function is configured, as the configuration of access rights, the configuration of the size of Logical Disk etc., administration module manages maintenance by the command process daemon thread to the built-in function in the unified platform function library.
The command process daemon thread mainly is to be used for carrying out treatment S CSI order and administration order, when each concrete scsi command is handled, according to the needs of different scsi commands, the built-in function that calls in the unified platform function library is realized the access control of order and the processing of data.
The various host-host protocols that provide in the system and the realization collection of functions of hardware interface have been provided in the unified platform function library, and this collection of functions has improved reusability and stability that system realizes.
Figure 4 shows that present embodiment realizes that destination end unifies method of driving, comprising:
401: hardware interface parses scsi command according to host-host protocol, and sends to the destination end core processing module after driving the packet that comprises scsi command that receives the transmission of originating end main frame;
402: the destination end core processing module sends to scsi command by the network interface in the operating system nucleus command process daemon thread of user's state space after receiving scsi command;
403: the command process daemon thread is behind the scsi command that receives the transmission of destination end core processing module, type according to scsi command, then call the built-in function in the unified platform function library if desired, to the scsi command control and treatment that conducts interviews, the data of carrying in the scsi command are carried out data processing;
For example, the command process daemon thread receives the scsi command of giving the originating end main frame from the hard disk reading of data, the one piece of data that begins from certain address of certain Logical Disk is read in the scsi command indication, the command process daemon thread judges whether the Logical Disk that will read is in normal operating conditions, and whether the originating end main frame has the authority that reads this Logical Disk and the legitimacy of data address such as is judged at the access control processing.
If the command process daemon thread receives the scsi command that writes data to hard disk, then the scsi command that writes data is carried out handling as above-mentioned access control, and the distribute data storage space, and memory space address returned to the originating end main frame by the destination end core processing module.
After the originating end main frame receives memory space address, send and carry the scsi command of address pointer and data to be written, address pointer points to memory space address, and the command process daemon thread carries out different data processing operations according to the Logical Disk that will write data.As, the type of Logical Disk is raid0, raid1 and raid5, raid5 is made up of three physical disks, if write data to raid5, then the command process daemon thread is divided into two data blocks with data, these two data blocks are carried out xor operation, and the result who generates two data blocks and XOR is written to three BIO orders in the physical disks respectively.
Preserve in the unified platform function library: XOR function, SCSI analytical function, generate the various host-host protocols such as access control function of BIO command functions and Logical Disk and the shared function that hardware interface drives.Unified platform function library realizes at operating system user state space, conveniently calls and realizes.
404: after the command process daemon thread is finished the access control and data processing of scsi command, generate the BIO order of carrying out the block device operation, the BIO order is sent to the destination end core processing module;
405: the destination end core processing module sends to the block device processing layer with the BIO order that receives;
406: after the block device processing layer receives BIO order,, whether legal etc. to the operation of physical disks as the BIO order to BIO order carrying out pre-service;
The BIO order is the order of block device being carried out physical operations.
407: the block device processing layer will be finished pretreated BIO order and send to SCSI agreement middle layer;
408:SCSI agreement middle layer is a scsi command with the BIO command conversion, according to scsi command block device is operated.
If the scsi command of reading of data, then SCSI agreement middle layer from the block device reading of data, and sends to the originating end main frame by block device processing layer and destination end core processing module with the data that read according to data address.
If write the scsi command of data,, be written in the appropriate address space of block device according to the indication of this scsi command then with the data of carrying in the scsi command.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. realize the destination end method of driving for one kind, comprising:
Hardware interface drives the storing communication protocol command that receives is sent to the unified platform that drives of destination end;
The unified type that drives platform according to received storing communication protocol command of described destination end to this storing communication protocol command control and treatment that conducts interviews, after finishing access control and handling, is carried out this storing communication protocol command, and block device is operated.
2. the method for claim 1 is characterized in that:
If described storing communication protocol command is the order that writes data to described block device, after then the unified driving of this destination end platform is finished the access control processing to this order that writes data, for data write the memory allocated space, and memory space address is returned to the originating end main frame;
After receiving the storing communication protocol command that carries address pointer and data to be written of described originating end main frame, the unified platform that drives of described destination end carries out data processing to data to be written, after finishing data processing, the indication of described data according to described address pointer is written in the corresponding space of described block device.
3. the method for claim 1 is characterized in that:
If described storing communication protocol command is the order from described block device reading of data, after then the unified driving of this destination end platform is finished the access control processing to the order of this reading of data, according to indication reading of data from relevant block equipment of the order of this reading of data, and the data that read out are returned to the originating end main frame.
4. the method for claim 1 is characterized in that:
Described storing communication agreement is the small computer system interface agreement.
5. a destination end drives, comprise: hardware interface drives and the unified platform that drives of destination end, the unified platform that drives of this destination end comprises: the destination end core processing module of Xiang Lianing, block device processing layer and storing communication agreement middle layer successively, also comprise: command process daemon thread and unified platform function library, this command process daemon thread link to each other with unified platform function library with described destination end core processing module respectively;
Described hardware interface drives, and the storing communication protocol command that is used for receiving sends to described destination end core processing module;
Described destination end core processing module, the storing communication protocol command that is used for receiving sends to described command process daemon thread, and the basic IO Command that this command process daemon thread that will receive returns sends to described block device processing layer;
Described command process daemon thread, be used for type according to the storing communication protocol command that receives, call the built-in function in the described unified platform function library when needed, to the described storing communication protocol command control and treatment that conducts interviews, generate basic IO Command, and send to described destination end core processing module;
Described block device processing layer is used for the basic IO Command that receives is carried out pre-service, will finish pretreated basic IO Command and send to described storing communication agreement middle layer;
Described storing communication agreement middle layer, the basic IO Command that is used for receiving is converted to the storing communication protocol command, according to this storing communication protocol command block device is operated.
6. destination end as claimed in claim 5 drives, and it is characterized in that:
If described storing communication protocol command is the order that writes data to described block device, after then described command process daemon thread is finished the access control processing, be the data allocations storage space, and memory space address is returned to the originating end main frame by described destination end core processing module; And,
After receiving the storing communication protocol command that carries address pointer and data to be written of described originating end main frame, described data to be written are carried out data processing, generate basic IO Command, carry the data after the processing, send to described destination end core processing module, this destination end core processing module should basic IO Command send to described block device processing layer;
After described block device processing layer carries out pre-service to the basic IO Command that receives, send to described storing communication agreement middle layer, command conversion is carried out in this storing communication agreement middle layer, with the described data of carrying in the storing communication protocol command that is converted to, be written in the corresponding space of described block device according to the indication of described address pointer.
7. destination end as claimed in claim 5 drives, and it is characterized in that:
If described storing communication protocol command is the order from described block device reading of data, then described storing communication agreement middle layer is according to the indication of the storing communication protocol command that is converted to, reading of data from relevant block equipment, and, the data that read out are returned to described originating end main frame by described block device processing layer and destination end core processing layer.
8. destination end as claimed in claim 5 drives, and it is characterized in that:
Described destination end core processing module, block device processing layer and storing communication agreement middle layer are positioned at the kernel state space of operating system; Described command process daemon thread and unified platform function library are positioned at user's state space of operating system.
9. destination end as claimed in claim 5 drives, and it is characterized in that: preserve the shared function that host-host protocol and hardware interface drive in the described unified platform function library.
10. destination end as claimed in claim 9 drives, it is characterized in that, this destination end drives and also comprises administration module, and this administration module is connected with described command process daemon thread, is used for by described command process daemon thread the built-in function of described unified platform function library being managed maintenance.
CN201010113814A 2010-02-09 2010-02-09 Method for realizing target end driver and target end driver Pending CN101788888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010113814A CN101788888A (en) 2010-02-09 2010-02-09 Method for realizing target end driver and target end driver

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010113814A CN101788888A (en) 2010-02-09 2010-02-09 Method for realizing target end driver and target end driver

Publications (1)

Publication Number Publication Date
CN101788888A true CN101788888A (en) 2010-07-28

Family

ID=42532117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010113814A Pending CN101788888A (en) 2010-02-09 2010-02-09 Method for realizing target end driver and target end driver

Country Status (1)

Country Link
CN (1) CN101788888A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571925A (en) * 2011-12-19 2012-07-11 华中科技大学 RDMA (Remote Direct Memory Access)-based data access method in fiber channel environment
CN105243166A (en) * 2015-11-10 2016-01-13 浪潮(北京)电子信息产业有限公司 Data management device and system, and data writing and reading methods
CN105183367B (en) * 2015-08-06 2018-07-03 曙光信息产业(北京)有限公司 The implementation method and device of small computer system interface SCSI
CN109918209A (en) * 2019-01-28 2019-06-21 深兰科技(上海)有限公司 A kind of method and apparatus of inter-thread communication
CN117033107A (en) * 2023-09-28 2023-11-10 成都佰维存储科技有限公司 Debugging method, device, storage medium and equipment supporting different interfaces

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571925A (en) * 2011-12-19 2012-07-11 华中科技大学 RDMA (Remote Direct Memory Access)-based data access method in fiber channel environment
CN102571925B (en) * 2011-12-19 2014-08-27 华中科技大学 RDMA (Remote Direct Memory Access)-based data access method in fiber channel environment
CN105183367B (en) * 2015-08-06 2018-07-03 曙光信息产业(北京)有限公司 The implementation method and device of small computer system interface SCSI
CN105243166A (en) * 2015-11-10 2016-01-13 浪潮(北京)电子信息产业有限公司 Data management device and system, and data writing and reading methods
CN109918209A (en) * 2019-01-28 2019-06-21 深兰科技(上海)有限公司 A kind of method and apparatus of inter-thread communication
CN117033107A (en) * 2023-09-28 2023-11-10 成都佰维存储科技有限公司 Debugging method, device, storage medium and equipment supporting different interfaces

Similar Documents

Publication Publication Date Title
CN101356506B (en) Smart scalable storage switch architecture
CN101939730B (en) Bi-directional data transfer within a single I/O operation
JP5149912B2 (en) Selective use of multiple disparate solid-state storage locations
CN101615106B (en) Method and system for virtualizing SAS storage adapter
US8639898B2 (en) Storage apparatus and data copy method
CN100377065C (en) Super large capacity virtual magnetic disk storage system
KR102358477B1 (en) Electronic system with interface control mechanism and method of operation thereof
US20080195833A1 (en) Systems, methods and computer program products for operating a data processing system in which a file system's unit of memory allocation is coordinated with a storage system's read/write operation unit
CN101789019B (en) Method for controlling removable disk under Windows
CN101939731A (en) Processing a variable length device command word at a control unit in an I/O processing system
CN104603739A (en) Block-level access to parallel storage
CN102576329B (en) In storage area network, the active-active of virtual memory management is supported
CN101710270A (en) High-speed mass memory based on flash memory and chip data management method
CN102123176A (en) Space distribution and management method and device for network storage system
CN101788888A (en) Method for realizing target end driver and target end driver
CN117355817A (en) Zone segment driver management
CN104281413A (en) Command queue management method, memorizer controller and memorizer storage device
CN108304142A (en) A kind of data managing method and device
CN102929813B (en) The method of design of a kind of PCI-E interface solid-state hard disk controller
CN103929475A (en) Hard disk storage system of Ethernet framework and hard disk data operation method
CN102393838A (en) Data processing method and device, PCI-E (peripheral component interface-express) bus system, and server
CN101626403B (en) Magnetic disc virtualization method of iSCSI service
CN101266541A (en) ISCSI target device and memory apparatus interface method
CN101859232A (en) Variable length data memory interface
CN103780634B (en) Data interaction method and data interaction device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20100728