The hot-swap system of high speed perimeter component jointing interface device and method thereof
Technical field
The present invention relates to a kind of system and method thereof that realizes equipment hot swap, relate in particular to a kind of hot-swap system and method thereof of high speed perimeter component jointing interface device.
Background technology
High speed perimeter component connecting interface (Peripheral Component Interface Express, be called for short PCI-E) as perimeter component connecting interface (Peripheral Component Interface, abbreviation PCI) innovation of bus, it has kept the compatibility of software and pci bus, and has replaced parallel bus with high-speed serial bus.
Hot plug (Hot Plug) is that a kind of kernel is used the mechanism that circular takes place about some incidents of hot-plug equipment to user's attitude, and under the state that does not shut down, desktop operating system can utilize it that equipment is effectively managed.
Recall in the past pci bus and the development course of PCI-E bus, originally not at the application of hot plug,, support that the mechanism of hot plug is just occurred afterwards owing to the needs of commercial Application, but in the certain operations system, still can not support the hot plug of PCI-E equipment well.
Though the PCI-E bus is supported the hot plug function, under the situation of not shutting down, directly puts adapter into slot, will make motherboard or adapter be absorbed in the situation of easy damage.Therefore add if desired during to server maintenance or remove PCI-E equipment, current way is shutdown, PCI-E equipment is inserted or extracts the PCI-E bus, restarts machine then.Because need restart machine, the service that system provided is interrupted, and has reduced system availability, reliability and extensibility.
Summary of the invention
In order to solve above-mentioned the problems of the prior art and defective, the object of the present invention is to provide a kind of hot-swap system and method thereof of PCI-E equipment.
The hot-swap system of a kind of PCI-E equipment provided by the present invention comprises: several PCI-E equipment slots, corresponding to each PCI-E bus, for several PCI-E equipment hot swaps in several PCI-E buses; Several PCI-E equipment slot circuit boards, corresponding to each PCI-E equipment slot, in order to connect several PCI-E equipment to several PCI-E equipment slots and module in order to auxiliary hot-plug equipment is provided, wherein each PCI-E equipment slot circuit board comprises several manual fit and fastens and fasten lock, is connected on each PCI-E equipment slot circuit board in order to guarantee several PCI-E equipment; Several note button, are arranged at correspondingly on several PCI-E equipment slot circuit boards, in order to send the equipment hot swap request of PCI-E equipment slot to monitor module; Control module is in order to state and the attention button of control linkage at several PCI-E equipment slot circuit boards of several PCI-E equipment slots; Supply module is in order to provide the independent current source support and to carry out power state detection several PCI-E equipment slots; Monitor module in order to the state that monitors that several note button, is controlled described high speed perimeter component jointing interface device slot circuit board according to the state of described attention button for described control module; And PCI-E hot plug core operation module, in order to finish Initiation and release to several PCI-E equipment, and in order to finish release PCI resource, wherein the control procedure of this control module is: when one notices that button is pressed, remove the state of this attention button; Whether check has an adapter to insert in this high speed perimeter component connecting interface slot; If no adapter inserts, write down an error messages; If there is adapter to insert, whether inspection one manual adapter is fixedly fastened lock and is locked; If this manual fit fastens and fastens the lock non-locking, write down an error messages; If this manual fit fasten fasten the lock locked, send a prompting message to the user; If after this prompting message sent, this attention button was pressed once more, then removes the state of this attention button and removes this prompting message; If after this prompting message sent, this attention button was not pressed once more, then powers up or cut off the power supply according to the state of this high speed perimeter component connecting interface slot.
The hot-plug method of a kind of PCI-E equipment provided by the present invention comprises following steps: when PCI-E equipment inserts, and being set to the PCI-E device power-on and discharging the PCI resource, the startup driver according to the user; The control module and the supply module of Initiation PCI-E equipment; Start the thread of several PCI-E equipment slots, wherein further comprise following steps: note button by next; Remove the state of this attention button; Whether check has an adapter to insert in this high speed perimeter component connecting interface slot; If no adapter inserts, then write down an error messages; If there is adapter to insert, check that then a manual adapter fixedly fastens lock and whether lock; If this manual fit fastens and fastens the lock non-locking, then write down an error messages; If this manual fit fasten fasten the lock locked, then send a prompting message to the user; If after this prompting message sends, press this attention button once more, then remove the state of this attention button and remove this prompting message; If after this prompting message sends, do not press this attention button once more, then power up or cut off the power supply according to the state of this high speed perimeter component connecting interface slot; Start monitor thread, wherein further comprise following steps: the state of inquiring about corresponding this attention button of this high speed perimeter component jointing interface device slot; If the state of this attention button after then waiting for a period of time, is confirmed the state of this attention button, and is recorded as the original state of this attention button for being pressed; If the original state of this attention button is then removed the state of corresponding this attention button of this high speed perimeter component jointing interface device slot, and is inquired about the state of corresponding this attention button of next high speed perimeter component jointing interface device slot for being pressed; If the original state of this attention button is then inquired about the current state of this attention button for being lifted; If the current state of this attention button is then inquired about the state of corresponding this attention button of next high speed perimeter component jointing interface device slot for being lifted; If the current state of this attention button is for being pressed, the state that corresponding this attention button of this high speed perimeter component jointing interface device slot then is set is for being pressed; And when removing PCI-E equipment, according to user's the PCI-E equipment that is set to release PCI resource and outage.
The present invention combines with software by hardware, has realized the hot plug of PCI-E equipment, and when needs add or remove PCI-E equipment, need not restart machine, has increased availability, reliability and the extensibility of system.
Describe the present invention below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
Description of drawings
Fig. 1 is the system block diagrams of the hot-swap system of PCI-E equipment of the present invention;
Fig. 2 is the structural representation of the PCI-E equipment slot circuit board of one embodiment of the invention;
Fig. 3 is the method flow diagram of the hot-plug method of PCI-E equipment of the present invention;
Fig. 4 is for starting the method flow diagram of the thread of several PCI-E equipment slots among the present invention;
The method flow diagram of Fig. 5 for powering up or cut off the power supply according to the state of PCI-E slot among the present invention;
Fig. 6 is for starting the method flow diagram of monitor thread among the present invention.
Wherein, Reference numeral
1 SM bus
2 PCI-E buses
3 servers
10 slots
20 circuit boards
21 note button
22 manual fit fasten fastens lock
23 reminding modules
24 manual fit fasten fastens lock sensor
30 control modules
40 supply modules
50 monitor modules
60 core operation modules
When step 100 is inserted as PCI-E equipment, being set to the PCI-E device power-on and discharging the PCI resource, the startup driver according to the user
The control module and the supply module of step 200 Initiation PCI-E equipment
Step 300 starts the thread of several PCI-E equipment slots
Step 400 starts monitor thread
Step 500 is when removing PCI-E equipment, according to user's the PCI-E equipment that is set to release PCI resource and outage
Whether step 310 has the button of attention to press
Step 320 is removed and is noted key-press status
Whether step 330 has adapter to insert the PCI-E slot
Step 331 record error message
Whether step 340 is checked that manual fit fastens and is fastened lock and lock
Step 341 record error message
Step 350 is sent prompting message
Whether step 360 has the button of attention to press
Step 361 is removed and is noted key-press status
Step 362 is removed prompting message
Step 370 powers up according to the state of PCI-E slot or cuts off the power supply
Read the state of PCI-E slot in the step 3701 automatic control molding piece
Whether step 3702 PCI-E slot powers up
Step 3703 is called out PCI-E hot plug core operation module
Whether step 3704 calls out successful
Step 3705 discharges the PCI-E equipment resource needed on the PCI-E slot
Step 3706 is extinguished power supply prompting LED
Step 3707 record error message
Step 3708 is called out the PCI-E equipment resource needed on the PCI-E hot plug core operation module release PCI-E slot
Whether step 3709 calls out successful
Step 3710 is lighted power supply prompting LED
Step 3711 is removed information in control module and the supply module
Step 3712 record error message
The state of the corresponding attention button of step 410 inquiry PCI-E equipment slot
Step 420 waits for a period of time
Step 430 confirms to note the state of button, is recorded as the original state of noting button
The current state of button is noted in step 440 inquiry
Step 450 is removed the corresponding attention key-press status of PCI-E equipment slot
Step 460 is provided with the state of the corresponding attention button of PCI-E equipment slot for pressing
Embodiment
About feature of the present invention and embodiment, conjunction with figs. is described in detail as follows as most preferred embodiment now.
Please refer to Fig. 1, represented the system block diagrams of the hot-swap system of PCI-E equipment of the present invention among the figure, this system comprises: several PCI-E equipment slots 10, for several PCI-E equipment hot swaps in several PCI-E buses 2; Several PCI-E equipment slot circuit boards 20, corresponding to each PCI-E equipment slot 10, in order to connect several PCI-E equipment to several PCI-E equipment slots 10 and module in order to auxiliary hot-plug equipment is provided, now please refer to Fig. 2, the structural representation of having represented the PCI-E equipment slot circuit board of one embodiment of the invention among the figure, each PCI-E equipment slot circuit board 20 comprises: note button 21, correspondence is arranged on each PCI-E equipment slot circuit board 20 one by one, in order to send the equipment hot swap request of PCI-E equipment slot to monitor module 50; Manual fit fastens fastens lock 22 (Manually-operatedRetention Latch, be called for short MRL) and is connected on each PCI-E equipment slot circuit board 20 in order to guarantee several PCI-E equipment; Reminding module 23 is in order to the hot pluggable condition that shows current each PCI-E equipment and the power supply status of current each PCI-E equipment; Whether correctly manual fit fastens fastens lock sensor 24, fasten the state of fastening lock 22 in order to the detection manual fit and fasten lock 22 closure to confirm that several manual fit fasten; Control module 30 is noted button in order to state and corresponding several of controlling several PCI-E equipment slot circuit boards 20; Supply module 40 is in order to provide the independent current source support and to carry out power state detection several PCI-E equipment slots 10; System Management Bus (System Management Bus is called for short SM Bus) 1 is located on server 3 ends with PCI-E bus 2 one, in order to receive the information of control module 30 and supply module 40; Monitor module 50 is in order to the state of the module that monitors several auxiliary hot-plug equipments; And PCI-E hot plug core operation module 60, in order to Initiation and release and the release PCI resource of finishing several PCI-E equipment.
Please refer to Fig. 3 now, this figure is the method flow diagram of the hot-plug method of PCI-E equipment of the present invention, as shown in the figure, the hot-plug method of PCI-E equipment of the present invention comprises following steps: when PCI-E equipment inserts, being set to the PCI-E device power-on and discharging the PCI resource, startup driver (step 100) according to the user; The control module of Initiation PCI-E equipment and supply module (step 200); Start the thread (step 300) of several PCI-E equipment slots, step 300 will be done further explanation hereinafter; Simultaneously, start monitor thread (step 400), step 400 will be done further explanation hereinafter; When removing PCI-E equipment, according to user's the PCI-E equipment that is set to release PCI resource and outage (step 500).
In one embodiment of this invention, the function that said method is mainly realized is device power-on, release PCI resource, load driver program for when the user inserts PCI-E equipment.When removing PCI-E equipment, for equipment discharges the PCI resource, outage etc.To be responsible for control in addition, correctly tell the user with the form of panel leds PCI-E equipment current state to each information.
Please refer to Fig. 4 now, this figure is the method flow diagram that starts the thread of several PCI-E equipment slots among the present invention, as shown in the figure, the method for the thread of several PCI-E equipment slots of startup of the present invention comprises following steps: whether inquiry has the button of attention to press (step 310); If not having the button of attention restarts by next; If there is the button of attention to press, then remove the state (step 320) of noting button; Whether monitoring has adapter to insert PCI-E slot (step 330); If no adapter insertion PCI-E slot, record error message (step 331) and restarting then; If there is adapter to insert the PCI-E slot, check then that manual fit fastens to fasten lock and whether lock (step 340); If manual fit fastens and fastens the lock non-locking, record error message (step 341) and restarting then; If manual fit fasten fasten the lock locked, then send prompting message (step 350); Whether inquiry has the button of attention to press (step 360) once more; If there is the button of attention to press, then removes state (step 361) and the removing prompting message (step 362) of noting button and restart then; Do not press if note button, then the state according to the PCI-E slot powers up or cut off the power supply (step 370), and step 370 will be done further explanation hereinafter.
In one embodiment of this invention, above-mentioned thread adopts polling mechanism that the state of specific PCI-E slot is monitored, after the attention button on the pairing PCI-E equipment slot circuit board panel on the slot is pressed, this thread will check on this slot in the PCI-E equipment slot circuit board whether adapter is arranged, and whether manual fit to fasten lock closed if fastening, if fastening to fasten to lock, manual fit is in closure state, and adapter is arranged, then the LED (light emitting diode) of the attention button on the pairing PCI-E equipment of this slot slot circuit board begins flicker, after 5 seconds, if the user does not press the attention button once more, this thread will power up or cut off the power supply according to this slot current state, otherwise, the operation cancellation, this slot state is constant.After this slot is powered up, this thread can send an information to PCI-E hot plug core operation module, be this PCI-E equipment and discharge resource and Initiation, before outage, the PCI-E hot plug core of can giving advance notice operation module, after treating that it is with this PCI-E equipment resource needed release, can cut off the power supply.
Please refer to Fig. 5 now, this figure is the method flow diagram that powers up or cut off the power supply according to the state of PCI-E slot among the present invention, as shown in the figure, power up according to the state of PCI-E slot or the method for cutting off the power supply comprises following steps: the state (step 3701) that reads the PCI-E slot in the automatic control molding piece; Judge whether the PCI-E slot powers up (step 3702); If the PCI-E slot powers up, then call out PCI-E hot plug core operation module (step 3703); Judge calling whether successfully (step 3704); If access success then discharges the PCI-E equipment resource needed (step 3705) on the PCI-E slot; And extinguish power supply prompting LED (step 3706); If call out not success, then record error message (step 3707); If the PCI-E slot does not power up, then call out the PCI-E equipment resource needed (step 3708) on the PCI-E hot plug core operation module release PCI-E slot; Judge calling whether successfully (step 3709); If access success is then lighted power supply prompting LED (step 3710); If call out not success, then remove information (step 3711) in control module and the supply module; And record error message (step 3712).
Above-mentioned thread is arranged in the thread that starts several PCI-E equipment slots, the thread that the state according to the PCI-E slot is powered up or cuts off the power supply.After definite will the operation to certain slot, at first from control module, read the current state of slot, if this slot is current not to be powered up, then power up operation, if this slot powers up, then carry out power operation.In one embodiment of this invention, powering up operating process is: power up for this slot, and light power LED on the corresponding PCI-E equipment slot circuit board, send message to PCI-E hot plug core operation module, being PCI-E equipment discharges resource and carries out Initiation, if discharge the resource failure, with this power off slot and extinguish power LED.The power operation process is: notice PCI-E hot plug core operation module discharges the PCI-E equipment resource needed on this slot, if success, then with PCI-E equipment power off slot and extinguish power LED, otherwise does not cut off the power supply, and does not change this slot state.
Please refer to Fig. 6 now, this figure is the method flow diagram that starts monitor thread among the present invention, and as shown in the figure, the method for startup monitor thread of the present invention comprises following steps: the state (step 410) of the corresponding attention button of inquiry PCI-E equipment slot; If this state of noting button is then removed the PCI-E equipment corresponding attention key-press status of slot (step 450) and is returned step 410 for lifting.If this state of noting button then waits for a period of time (step 420) for pressing; Confirm to note the state of button then, be recorded as the original state (step 430) of noting button; If this original state of noting button is for lifting, then the current state (step 440) of button is noted in inquiry; If this current state of noting button is for pressing, the state that the corresponding attention button of PCI-E equipment slot then is set is for pressing (step 460), if this original state of noting button is then removed the state (step 450) of the corresponding attention button of PCI-E equipment slot and is returned step 410 for pressing; If this original state of noting button is for lifting, and the current state of attention button is then removed the PCI-E equipment corresponding attention key-press status of slot (step 450) and is returned step 410 also for lifting.
Above-mentioned monitor thread mainly is responsible for monitoring the state of noting button, because the design on the hardware makes the buffer that stores the attention key-press status show as when the attention button is pressed and presses, be not pressed and after it lifts, show as, in other words, press action and show as a pulse for one of the attention button, this has caused difficulty to program to noting the identification whether button is pressed, so otherwise stop the state of noting button is carried out poll, just can correctly inquire about the state of noting button.Monitor thread always stores the state of last poll, and itself and the resulting result of current poll compared, if the state of last poll is to lift, and this is for pressing, think that then the user supresses the attention button really, other situation neglects, thereby having avoided effectively pressing for a long time notes button and repeatedly be polled as and press the situation of noting button and take place.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.