A kind of method and system for polycaryon processor efficient access iscsi disk array
Technical field
The present invention relates to a kind of iSCSI originating end implementation method based on polycaryon processor and OS, tool
Body relates to a kind of method and system for polycaryon processor efficient access iscsi disk array.
Background technology
Along with computer technology and the development of network technology, conventional single-core processor is in power consumption, concurrent, heat radiation
Etc. the problem that exposes of aspect day by day serious, can not meet the disparate networks application urgent needs to processor,
Therefore have lower power consumption, higher concurrency performance polycaryon processor by more in the applications of computer network.
Owing to polycaryon processor is made up of multiple process cores of physical parallel, the most relatively conventional single core processor just has
Higher concurrency, what the most low-frequency process core can be simpler is integrated in same processor, and
Can preferably control the problems such as consumption heating, therefore the advantage of the relatively conventional general processor of polycaryon processor by
Flaring is big.So, computer networking technology starts use polycaryon processor all kinds of high performance to build widely
Network application.
In disparate networks Video Applications, Disk Array is all the core component of resource storage center, especially
It is that the characteristics such as iscsi disk array uses simply with it, performance is prominent are more widely used, so
It is calculating center based on polycaryon processor, based on the Novel video class application that iscsi disk array is storage center is
In system, the most reasonably combine polycaryon processor and iscsi disk array, and effectively improve the globality of system
Can, it is one of key strengthening Internet video application system service quality.Prior art is to iscsi disk array
Access the scsi command word needing to produce according to SCSI subsystem, and be packaged by iSCSI protocol, finally
The efficient data being realized iSCSI Host end and iSCSI Target end by ICP/IP protocol stack is mutual, and operates system
SCSI subsystem on system is by multiple ingredients, and therefore scsi command execution flow process redundancy is numerous and diverse, can cause many
Core processor processes the waste of resource, and the real-time execution environment execution efficiency of polycaryon processor is higher, but does not has
The support of various functions in operating system, it is impossible to be directly realized by scsi command, the process of iSCSI protocol and execution,
(SuSE) Linux OS and the advantage of real-time execution environment and feature on polycaryon processor is integrated it is thus desirable to effective,
Improve the treatment effeciency of scsi command.
Summary of the invention
It is an object of the invention to, for overcoming the problems referred to above, the present invention provides a kind of and efficiently visits for polycaryon processor
Ask the method and system of iscsi disk array.
For achieving the above object, the invention provides one for polycaryon processor efficient access iscsi disk array
System, described system comprises:
The Linux operation running on the mutually disjoint processor core different memory headroom of independently management in the heart is
System and real time operating system;
Described (SuSE) Linux OS comprises: upper layer application layer and Linux SCSI subsystem;And described Linux SCSI
Subsystem comprises the most successively:
SCSI higher level, this layer from the request on its upper strata and converts thereof into SCSI request for acceptance, completes
Scsi command by state information notification upper strata;
SCSI intermediate layer, this layer is used for submitting scsi command to;
Linux side interactive interface, for realizing the function of Linux SCSI subsystem lower level, described lower level merit
Can comprise: receive the scsi command word in intermediate layer, and the result of iSCSI subsystem is returned to intermediate layer,
And be responsible for carrying out core information interaction with real time operating system side interactive interface;
Described real time operating system comprises the most successively:
Real time operating system side interactive interface, for carrying out core information interaction with Linux side interactive interface;
ISCSI processing module, for being responsible for the process of iSCSI protocol;
ICP/IP protocol stack, for being responsible for realizing the transmitting-receiving of iscsi disk array data;
Wherein, described internuclear information is led to for setting up the data between (SuSE) Linux OS and real time operating system
Road and operating walk way.
Above-mentioned real time operating system side interactive interface comprises further:
Receiver module, for receiving the multinuclear inter-core message from Linux side interactive interface;With
Resolve and calling module, for parsing the scsi command that SCSI intermediate layer is submitted to, and call at iSCSI
Reason module processes.
Above-mentioned ICP/IP protocol stack is for realizing the process of layer 2-4 agreement in TCP/IP protocol suite;And this protocol stack carries
For interface for upper layer application, iSCSI subsystem realizes the transmitting-receiving of data by these interfaces.
Based on said system, the invention provides a kind of side for polycaryon processor efficient access iscsi disk array
Method, the method comprises based on the OS being positioned on polycaryon processor, described method:
Step 101) first, the solicited message of (SuSE) Linux OS received bit application layer thereon, and will request
Information encapsulation becomes scsi command word;Then, (SuSE) Linux OS is specified and is read or the equipment LUN letter of write data
Breath, is provided for the core of data channel and the operating walk way setting up between (SuSE) Linux OS and real time operating system
Between message;Finally, the inter-core message comprising scsi command word is sent to real time operating system by (SuSE) Linux OS;
Step 102) real time operating system receives inter-core message, and the scsi command comprised by inter-core message uses
ISCSI protocol processes, then will process after the iSCSI packet obtained submit in real time operating system
ICP/IP protocol stack, is completed transmission and the reception of iscsi disk array data by ICP/IP protocol stack.
Above-mentioned inter-core message comprises seven fields, and concrete form is:
First character section is the core mark sending message, and second field is the core mark receiving message, the 3rd word
Section is scsi command, and the 4th field is scsi command parameter, and the 5th field performs to return result for operation,
6th field is data block pointer, and the 7th field is reserved mode bit;
The core mark of described transmission message, for specify by which core of polycaryon processor send upper layer application reading or
The request message write;
The core mark of described reception message, is received inter-core message for specifying by which core of polycaryon processor;
Described scsi command parameter, for specifying the parameter required for scsi command;
Described operation performs to return result, is used for representing that real time operating system calls iSCSI after parsing scsi command
Return value after protocol processes.
When upper layer application initiates to read the operation of iscsi disk array data, described step 101) comprise further:
Step 101-1) application program on (SuSE) Linux OS submits disk read command to, through Linux operation system
The SCSI subsystem of system arrives after the process in SCSI higher level and SCSI intermediate layer Linux side interactive interface;
Step 101-2) disk read command is packaged into scsi command word by Linux side interactive interface, it is intended that read data
Equipment LUN and read data length;
Step 101-3) Linux side interactive interface fills in inter-core message, fills out according to interactive interface place, Linux side core
Write transmission message core to indicate, fill according to interactive interface place, the real time operating system side core in real time operating system and connect
Receiving message core to indicate, fill in scsi command and scsi command parameter according to action type, clear operation performs return
As a result, the memory block reading result is deposited in application, and is filled up in memory block pointer by the physical address of memory block,
The real time operating system side interactive interface after completing aforesaid operations, inter-core message being sent in real time operating system.
Above-mentioned steps 102) comprise further:
Step 102-1) real time operating system side interactive interface in real time operating system receives inter-core message, and will
Scsi command and scsi command parameter pass to the iSCSI processing module in real time operating system;
Step 102-2) iSCSI processing module in real time operating system completes iSCSI after iSCSI protocol processes
Packet submits to the ICP/IP protocol stack in real time operating system;
Step 102-4) ICP/IP protocol stack in real time operating system completes the transmission of iSCSI data, and waits
The return result of iscsi disk array;
Step 102-5) ICP/IP protocol stack in real time operating system receives the data of iscsi disk array, and
Return data to the iSCSI processing module in real time operating system, the iSCSI processing module in real time operating system
Write data in data block according to the data block pointer in inter-core message, and return result is returned to real-time operation
Real time operating system side interactive interface in system;
Step 102-6) real time operating system side interactive interface in real time operating system is according in real time operating system
Real time operating system side interactive interface fills in inter-core message, fills in reception according to interactive interface place, Linux side core and disappears
Breath core indicates, and fills in transmission message core according to interactive interface place, the real time operating system side core in real time operating system
Mark, fills in operation and performs to return result, inter-core message is sent to after completing aforesaid operations Linux top-cross mutual connection
Mouth 104;
Step 102-7) Linux side interactive interface parsing inter-core message, by the return result in inter-core message and data
Data in block 8 return to the application program in (SuSE) Linux OS.
When upper layer application initiates write iscsi disk array data operation, described step 101) comprise further:
Step 101-a) application program submits disk write order to, through (SuSE) Linux OS on (SuSE) Linux OS
SCSI subsystem in SCSI higher level and SCSI intermediate layer process after arrive Linux side interactive interface;
Step 101-b) disk write order is packaged into scsi command word by Linux side interactive interface, it is intended that write data
Equipment LUN;
Step 101-c) Linux side interactive interface fills in inter-core message, fills out according to interactive interface place, Linux side core
Write transmission message core mark, fill according to interactive interface place, the real time operating system side core in real time operating system and connect
Receiving message core to indicate, fill in scsi command and scsi command parameter according to action type, clear operation performs return
As a result, the memory block of write data is deposited in application, and is filled up in memory block pointer by the physical address of memory block,
The real time operating system side interactive interface 106 after completing aforesaid operations, inter-core message being sent in real time operating system;
Above-mentioned steps 102) comprise further:
Step 102-a) real time operating system side interactive interface in real time operating system receives inter-core message, and will
Scsi command and scsi command parameter pass to the iSCSI processing module in real time operating system;
Step 102-b) iSCSI processing module in real time operating system completes iSCSI after iSCSI protocol processes
Packet submits to the ICP/IP protocol stack in real time operating system;
Step 102-c) ICP/IP protocol stack in real time operating system completes the transmission of iSCSI data, and waits
The return result of iscsi disk array;
Step 102-d) ICP/IP protocol stack in real time operating system receives the return result of iscsi disk array,
And return to the iSCSI processing module in real time operating system, the iSCSI in real time operating system by returning result
Processing module processes and returns result, and returns to the real time operating system top-cross in real time operating system by returning result
Interface mutually;
Step 102-e) real time operating system side interactive interface in real time operating system is according in real time operating system
Real time operating system side interactive interface fills in inter-core message, fills in reception according to interactive interface place, Linux side core and disappears
Breath core mark, fills in transmission message core according to interactive interface place, the real time operating system side core in real time operating system
Mark, fills in operation and performs to return result, inter-core message is sent to after completing aforesaid operations Linux top-cross mutual connection
Mouthful;
Step 102-f) Linux side interactive interface parsing inter-core message, the return result in inter-core message is returned to
Application program in (SuSE) Linux OS.
Compared with prior art, the present invention's it is a technical advantage that:
A kind of based on polycaryon processor and OS the iSCSI originating end implementation method that the present invention provides,
Realized the unloading of iSCSI protocol stack by the method, and keep the SCSI calling interface to upper layer application compatibility, with
The iscsi disk array processing and the iscsi disk array data that realize efficient quick process.
Accompanying drawing explanation
Fig. 1 is present invention iSCSI based on polycaryon processor and OS originating end implementation method structure chart.
Fig. 2 be in present invention iSCSI based on polycaryon processor and OS originating end implementation method each
The message body structure chart used when module is mutual.
Detailed description of the invention
The present invention is further described with embodiment below in conjunction with the accompanying drawings.
A kind of based on polycaryon processor and OS the iSCSI originating end implementation method that the present invention provides,
By Linux side interactive interface, real time operating system side interactive interface, iSCSI processing module and ICP/IP protocol stack
Complete the whole of iSCSI originating end and process work, between operating system and between modules, use inter-core message to lead to
Letter.It is characterized in that: Linux side interactive interface runs on (SuSE) Linux OS, it is achieved Linux SCSI subsystem
The function of lower level, and be responsible for interacting with real time operating system interactive interface;Real time operating system interactive interface
Run in real time operating system, be responsible for and the mutual interactive interfacing of Linux top-cross;ISCSI processing module runs in real time
In operating system, it is responsible for the process of iSCSI protocol;ICP/IP protocol stack runs in real time operating system, is responsible for
Realize the transmitting-receiving of iSCSI data.
The function of the existing Linux SCSI subsystem lower level of Linux top-cross mutual connection cause for gossip, receives Linux SCSI subsystem
The scsi command in system intermediate layer, and scsi command is packaged into multinuclear inter-core message, it is sent to real time operating system
Side interactive interface.
Real time operating system side interactive interface runs in real time operating system, is responsible for reception mutual from Linux top-cross
The multinuclear inter-core message of interface, parses the scsi command that Linux SCSI subsystem intermediate layer is submitted to, and calls
ISCSI processing module processes.
ISCSI processing module runs in real time operating system, is responsible for the process of iSCSI protocol, and calls behaviour in real time
The ICP/IP protocol stack making system carries out network service with iSCSI target.
ICP/IP protocol stack runs in real time operating system, it is achieved that in prior art on (SuSE) Linux OS
The repertoire of ICP/IP protocol stack, and internuclear communication mechanism and the TCP/IP acceleration work of polycaryon processor offer are provided
ISCSI data transmit-receive function at a high speed can be realized.
Linux side interactive interface and real time operating system side interactive interface set up data and behaviour by multinuclear inter-core message
Make passage;Comprising seven fields in message, first character section is the core mark sending message, and second field is for connecing
Receiving the core mark of message, the 3rd field is scsi command, and the 4th field is scsi command parameter, the 5th
Field performs to return result for operation, and the 6th field is data block pointer, and the 7th field is reserved mode bit.
Send the core mark of message for specifying to be sent this message by which core of polycaryon processor.Receive the core mark of message
For specifying to be received this message by which core of polycaryon processor.
Scsi command is that Linux side interactive interface is submitted to downwards in Linux SCSI subsystem intermediate layer, mainly wraps
Include to issue orders: Test unit ready, Inquiry, Request sense, Read capacity, Read and Write.
Parameter required for each order is specific as follows:
Test unit ready order includes the LUN mark needing to check status devices;
Inquiry order includes the LUN mark needing to inquire about summary info equipment;
Request sense order includes the LUN mark needing to inquire about sense data equipment;
Read capacity order includes the LUN mark needing to inquire about heap(ed) capacity equipment;
Read order includes the data length read, and the physical address of the internal memory of reading data storage and read data are at magnetic
Positional information on dish;
Write order includes the data length write, and writes the physical address of internal memory of data storage and write data at magnetic
Positional information on dish;
The return result of each order is specific as follows:
The execution result of Test unit ready order, the normal and error reporting including state;
The execution result of Inquiry order, including SCSI mark inquiry data structure body;
The execution result of Request sense order, including SCSI sense data structure body;
The execution result of Read capacity order, including the structure of query facility heap(ed) capacity information;
The execution result of Read order, including performing result and data address, the structure of length;
The execution result of Write order, including the result performed and the structure of write length.
Embodiment
Embodiment selects the OCTEON series processors platform of Cavium Networks company.Use Linux behaviour
Make system 111 and run Linux side interactive interface 104, use the simple execution that CaviumNetworks company provides
Environment SE(Simple Executive) run real time operating system side as the real time operating system 110 in the present invention
Interactive interface 106, iSCSI processing module 107 and ICP/IP protocol stack 108.
The process core that (SuSE) Linux OS 111 and real time operating system 110 are run is mutually disjointed, and these 2
Operating system manages independent, nonoverlapping memory headroom respectively.
The Linux side interactive interface 104 run on (SuSE) Linux OS 111 completes in SCSI subsystem relatively low
The function of layer, and scsi command word is passed to real time operating system 110;Real-time in real time operating system 110
Operating system side interactive interface 106 completes the interactive function of inter-core message;ISCSI in real time operating system 110
Processing module 107 realizes unloading and the actual treatment work of iSCSI protocol stack;In real time operating system 110
ICP/IP protocol stack 108 realizes the high speed transmitting-receiving of iSCSI data.
On (SuSE) Linux OS 111, the step of application program initiation iscsi disk array read operations is:
On (SuSE) Linux OS 111, application program submits disk Read order to, through (SuSE) Linux OS 111
SCSI subsystem 101 in SCSI higher level 102 and SCSI intermediate layer 103 process after arrive Linux top-cross
Interface 104 mutually.
Disk Read order is packaged into scsi command word by Linux side interactive interface 104, it is intended that read setting of data
The information such as the length of standby LUN and reading data.
Linux side interactive interface 104 fills in inter-core message, and the composition of inter-core message is as in figure 2 it is shown, according to Linux
Side interactive interface 104 place core is filled in transmission message core and is indicated 201, according to the real-time behaviour in real time operating system 110
Make system side interactive interface 106 place core and fill in reception message core sign 202, fill in SCSI life according to action type
Making 203 and scsi command parameter 204, clear operation performs to return result 205, and application is deposited and read the interior of result
Counterfoil 208, and the physical address of memory block 208 is filled up in memory block pointer 206, will after completing aforesaid operations
The real time operating system side interactive interface 106 that inter-core message is sent in real time operating system 110.
Real time operating system side interactive interface 106 in real time operating system 110 receives inter-core message, and by SCSI
Order 203 and scsi command parameter 204 pass to the iSCSI processing module 107 in real time operating system 110.
ISCSI processing module 107 in real time operating system 110 completes iSCSI data after iSCSI protocol processes
The ICP/IP protocol stack 108 in real time operating system 110 submitted to by bag.
ICP/IP protocol stack 108 in real time operating system 110 completes the transmission of iSCSI data, and waits iSCSI
The return result of disk array.
ICP/IP protocol stack 108 in real time operating system 110 receives the data of iscsi disk array, and by number
According to the iSCSI processing module 107 returned in real time operating system 110, the iSCSI in real time operating system 110
Processing module 107 writes data in data block 208 according to the data block pointer 206 in inter-core message, and will return
Return result and return to the real time operating system side interactive interface 106 in real time operating system 110.
Real time operating system side interactive interface 106 in real time operating system 110 is according in real time operating system 110
Real time operating system side interactive interface 106 fill in inter-core message, according to interactive interface 104 place, Linux side core
Fill in reception message core and indicate 201, according to the real time operating system side interactive interface 106 in real time operating system 110
Place core is filled in transmission message core and is indicated 202, fills in operation and performs to return result 205, completes core after aforesaid operations
Between message be sent to Linux side interactive interface 104.
Linux side interactive interface 104 resolves inter-core message, by the return result 205 in inter-core message and data block
Data in 208 return to the application program in (SuSE) Linux OS 111.
On (SuSE) Linux OS 111, the step of application program initiation iscsi disk array write operation is:
On (SuSE) Linux OS 111, application program submits disk Write order to, through (SuSE) Linux OS 111
SCSI subsystem 101 in SCSI higher level 102 and SCSI intermediate layer 103 process after arrive Linux top-cross
Interface 104 mutually.
Disk Write order is packaged into scsi command word by Linux side interactive interface 104, it is intended that write data
The information such as equipment LUN.
Linux side interactive interface 104 fills in inter-core message, fills according to interactive interface 104 place, Linux side core and sends out
Message core is sent to indicate 201, according to interactive interface 106 place, the real time operating system side core in real time operating system 110
Fill in reception message core and indicate 202, fill in scsi command 203 and scsi command parameter 204 according to action type,
Clear operation performs to return result 205, and the memory block 208 of write data is deposited in application, and by the thing of memory block 208
Reason address is filled up in memory block pointer 206, after completing aforesaid operations, inter-core message is sent to real time operating system
Real time operating system side interactive interface 106 on 110.
Real time operating system side interactive interface 106 in real time operating system 110 receives inter-core message, and by SCSI
Order 203 and scsi command parameter 204 pass to the iSCSI processing module 107 in real time operating system 110.
ISCSI processing module 107 in real time operating system 110 completes iSCSI data after iSCSI protocol processes
The ICP/IP protocol stack 108 in real time operating system 110 submitted to by bag.
ICP/IP protocol stack 108 in real time operating system 110 completes the transmission of iSCSI data, and waits iSCSI
The return result of disk array.
ICP/IP protocol stack 108 in real time operating system 110 receives the return result of iscsi disk array, and
The iSCSI processing module 107 in real time operating system 110 is returned to, in real time operating system 110 by returning result
ISCSI processing module 107 process return result, and by return result return to the reality in real time operating system 110
Time operating system side interactive interface 106.
Real time operating system side interactive interface 106 in real time operating system 110 is according in real time operating system 110
Real time operating system side interactive interface 106 fill in inter-core message, according to interactive interface 104 place, Linux side core
Fill in reception message core and indicate 201, according to the real time operating system side interactive interface 106 in real time operating system 110
Place core is filled in transmission message core and is indicated 202, fills in operation and performs to return result 205, completes core after aforesaid operations
Between message be sent to Linux side interactive interface 104.
Linux side interactive interface 104 resolves inter-core message, and the return result 205 in inter-core message is returned to Linux
Application program in operating system 111.
In a word, a kind of based on polycaryon processor and OS the iSCSI initiator that the present invention provides realizes
Method, specifically refers to run (SuSE) Linux OS and real time operating system on a polycaryon processor simultaneously,
The iSCSI system interface compatibility to Linux SCSI subsystem is kept, in real time operating system on (SuSE) Linux OS
The iSCSI protocol process that upper realization is concrete.Method includes: implementation method is by Linux side interactive interface, real-time operation
System side interactive interface, iSCSI processing module and ICP/IP protocol stack composition;Linux side interactive interface runs on
On (SuSE) Linux OS, complete the function of Linux SCSI subsystem lower level, and provide (SuSE) Linux OS and
The interactive function of real time operating system;Real time operating system interactive interface and iSCSI processing module run on behaviour in real time
Make in system, it is provided that real time operating system and the interactive function of (SuSE) Linux OS.Linux side interactive interface and reality
Time operating system side interactive interface set up data and signalling path by multinuclear inter-core message.This iSCSI initiator's
Implementation method is compatible Linux SCSI subsystem interface, provides high performance iSCSI protocol disposal ability simultaneously.,
By Linux side interactive interface, real time operating system side interactive interface, iSCSI process in the method that the present invention provides
Module and ICP/IP protocol stack complete the whole of iSCSI originating end and process work, between operating system and modules
Between use inter-core message communication.Linux side interactive interface runs on (SuSE) Linux OS, it is achieved Linux SCSI
The function of subsystem lower level, and be responsible for interacting with real time operating system interactive interface;Real time operating system is handed over
Interface runs in real time operating system mutually, is responsible for and the mutual interactive interfacing of Linux top-cross;ISCSI processing module is run
In real time operating system, it is responsible for the process of iSCSI protocol;ICP/IP protocol stack runs in real time operating system,
It is responsible for realizing the transmitting-receiving of iSCSI data.
It should be noted last that, above example is only in order to illustrate technical scheme and unrestricted.Although
With reference to embodiment, the present invention is described in detail, it will be understood by those within the art that, to the present invention
Technical scheme modify or equivalent, without departure from the spirit and scope of technical solution of the present invention, it is equal
Should contain in the middle of scope of the presently claimed invention.