CN106982176A - A kind of data transmission method and equipment - Google Patents
A kind of data transmission method and equipment Download PDFInfo
- Publication number
- CN106982176A CN106982176A CN201710174539.2A CN201710174539A CN106982176A CN 106982176 A CN106982176 A CN 106982176A CN 201710174539 A CN201710174539 A CN 201710174539A CN 106982176 A CN106982176 A CN 106982176A
- Authority
- CN
- China
- Prior art keywords
- main frame
- interruption
- ancillary equipment
- chains
- buffer area
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/901—Buffering arrangements using storage descriptor, e.g. read or write pointers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The present invention provides a kind of data transmission method and equipment, wherein, the data transmission method for uplink of the ancillary equipment of Intrusion Detection based on host includes:First BD available to the ancillary equipment is read from the first BD chains, wherein, during the first BD chains are located in the host memory and send ether network packet to the main frame applied to the ancillary equipment, the first BD is unavailable to the main frame;Ether network packet is write in the corresponding cachings of the first BD, and the first BD, which is updated, enables the first BD to be used to the main frame and unavailable to the ancillary equipment;Completed if the first BD updates, generation is sent completely the interruption buffer area for interrupting and writing positioned at the main frame;Notify to be sent completely interruption described in the host process.The present invention can improve the transmission speed of ether network packet, efficiency of transmission, and especially under the larger scene of Ethernet message amount, the effect of the embodiment of the present invention is more obvious.
Description
Technical field
The present invention relates to technical field of data transmission, more particularly to a kind of data transmission method and equipment.
Background technology
At present, in Ethernet data transmitting procedure, the ether network packet of the ancillary equipment Receiving Host transmission of main frame
Mode is:
Main frame peripheral device sends BD (Buffer Descriptor, buffer descriptor);Ancillary equipment Receiving Host is sent out
The BD sent, and the message length in the corresponding physical buffer addresses of the BD and the BD, from the slow of the corresponding main frames of the BD
Deposit middle reading ether network packet.
Ancillary equipment to main frame send ether network packet mode be:
Ancillary equipment is used for the memory headroom for writing ether network packet to main frame application;Main frame is that ancillary equipment distributes its Shen
Memory headroom please;Ancillary equipment writes ether network packet the memory headroom of host assignment, and by the storage of ether network packet
In the specified register of the length write-in ancillary equipment of address and message.
It is that to send BD or main frame be outer to ancillary equipment that the mode that above-mentioned ancillary equipment carries out data transmission, which all relies on main frame,
Peripheral equipment storage allocation space, i.e. when ancillary equipment performs reception or sends the operation of ether network packet every time, be required to master
Machine is participated in the distribution the caching for receiving ether network packet or the memory headroom for sending ether network packet, and this will result in
The problem of transmission speed of ether network packet is slow, efficiency of transmission is low, under the larger scene of Ethernet message amount, Ethernet report
The problem of literary transmission speed is slow, efficiency of transmission is low is more protruded.
The content of the invention
The present invention provides a kind of data transmission method and equipment, to solve ether network packet present in prior art
The problem of transmission speed is slow, efficiency of transmission is low.
The embodiment of the present invention provides a kind of data transmission method for uplink, applied to the ancillary equipment of main frame, including:
First BD available to the ancillary equipment is read from the first BD chains, wherein, the first BD chains are located at
During ether network packet being sent in the host memory and applied to the ancillary equipment to the main frame, the first BD
It is unavailable to the main frame;Ether network packet is write in the corresponding cachings of the first BD, and the first BD is carried out more
The first BD is newly set to be used to the main frame and unavailable to the ancillary equipment;Completed if the first BD updates, generation
It is sent completely the interruption buffer area for interrupting and writing positioned at the main frame;Notify to be sent completely interruption described in the host process.
The embodiment of the present invention also provides a kind of data receiver method, applied to the ancillary equipment of main frame, including:
Twoth BD available to the ancillary equipment is read from the 2nd BD chains, wherein, the 2nd BD chains are located at
During the ether network packet that the main frame is sent being received in the host memory and applied to the ancillary equipment, described the
Two BD are unavailable to the main frame;Ether network packet is extracted from the corresponding cachings of the 2nd BD, and by the ether extracted
Network packet writes the spatial cache of the ether network packet sent for storage host;2nd BD, which is updated, makes described
Two BD are unavailable to the ancillary equipment and available to the main frame;Completed if the 2nd BD updates, during generation is finished receiving
Break and write the interruption buffer area positioned at the main frame;Notify to finish receiving interruption described in the host process.
The embodiment of the present invention also provides a kind of data receiver method, applied to main frame, including:
When the interrupt processing for receiving the ancillary equipment transmission of the main frame is notified, the interruption for writing the main frame is cached
The interruption in area is polled processing;If the interruption being currently polled to is is sent completely interruption, reading one is right from the first BD chains
Available first BD of main frame, wherein, the first BD chains are located in the host memory and received applied to the main frame
During the ether network packet that the ancillary equipment is sent, the first BD is unavailable to the ancillary equipment;From described
In the corresponding cachings of one BD extract ether network packet, and the first BD is updated make the first BD to the main frame not
It can use and available to the ancillary equipment.
The embodiment of the present invention also provides a kind of data transmission method for uplink, applied to main frame, including:
Twoth BD available to the main frame is read from the 2nd BD chains, wherein, the 2nd BD chains are located at described
During sending ether network packet to the ancillary equipment in host memory and applied to the main frame, the 2nd BD is to institute
State ancillary equipment unavailable;Ether network packet is write in the corresponding cachings of the 2nd BD, and the 2nd BD is carried out more
The 2nd BD is newly set to be used to the ancillary equipment and unavailable to the main frame;And, receive the ancillary equipment and send
Finish receiving interrupt notification, if the interruption being polled to discharges interior in the corresponding cachings of the 2nd BD to finish receiving interruptions
Hold, wherein, when the interrupt processing for receiving the ancillary equipment transmission of the main frame is notified, the interruption for writing the main frame is cached
The interruption in area is polled processing.
The embodiment of the present invention also provides a kind of ancillary equipment sent for data, and the ancillary equipment is the periphery of main frame
Equipment, including:
Read module, for reading first BD available to the ancillary equipment from the first BD chains, wherein, it is described
First BD chains are located in the host memory and send the process of ether network packet to the main frame applied to the ancillary equipment
In, the first BD is unavailable to the main frame;Writing module, it is corresponding slow for ether network packet to be write into the first BD
In depositing;Update module, enables the first BD to be used to the main frame and to the periphery for being updated to the first BD
Equipment is unavailable;Generation module, is completed if being updated for the first BD, and generation, which is sent completely, to be interrupted and write positioned at the master
The interruption buffer area of machine;Notification module, for notifying to be sent completely interruption described in the host process.
The embodiment of the present invention also provides a kind of ancillary equipment for data receiver, and the ancillary equipment is the periphery of main frame
Equipment, including:
Read module, for reading twoth BD available to the ancillary equipment from the 2nd BD chains, wherein, it is described
2nd BD chains are located in the host memory and receive the ether network packet that the main frame is sent applied to the ancillary equipment
During, the 2nd BD is unavailable to the main frame;Writing module, for extracted from the corresponding cachings of the 2nd BD with
Too network packet, and the ether network packet extracted is write to the spatial cache of the ether network packet sent for storage host;More
New module, makes the 2nd BD unavailable to the ancillary equipment and can to the main frame for being updated to the 2nd BD
With;Generation module, is completed if being updated for the 2nd BD, and generation finishes receiving the interruption interrupted and write positioned at the main frame
Buffer area;Notification module, for notifying to finish receiving interruption described in the host process.
The embodiment of the present invention also provides a kind of main frame for data receiver, including:
Processing module, it is described to write-in when being notified for receiving the interrupt processing that the ancillary equipment of the main frame is sent
The interruption of the interruption buffer area of main frame is polled processing;Read module, if in being currently polled to for the processing module
Break to be sent completely interruption, first BD available to the main frame is read from the first BD chains, wherein, the first BD chains
During the ether network packet that the ancillary equipment is sent being received in the host memory and applied to the main frame, institute
State the first BD unavailable to the ancillary equipment;Extraction module, for extracting Ethernet from the corresponding cachings of the first BD
Message;Update module, makes the first BD unavailable to the main frame and to described outer for being updated to the first BD
Peripheral equipment can use.
The embodiment of the present invention also provides a kind of main frame sent for data, including:
Read module, for reading twoth BD available to the main frame from the 2nd BD chains, wherein, described second
During BD chains are located in the host memory and send ether network packet to the ancillary equipment applied to the main frame, institute
State the 2nd BD unavailable to the ancillary equipment;Writing module, it is corresponding slow for ether network packet to be write into the 2nd BD
In depositing;Update module, enables the 2nd BD to be used to the ancillary equipment and to described for being updated to the 2nd BD
Main frame is unavailable;Processing module, finishes receiving interrupt notification, if the interruption being polled to for receive that the ancillary equipment sends
To finish receiving interruption, content in the corresponding cachings of the 2nd BD is discharged, wherein, receive the ancillary equipment hair of the main frame
When the interrupt processing sent is notified, processing is polled to writing the interruption of interruption buffer area of the main frame.
Using data transmission method provided in an embodiment of the present invention and equipment, have the advantages that:In main frame in advance
The first BD chains or the 2nd BD chains are stored, ancillary equipment is when carrying out the transmission of ether network packet or receiving, from positioned at host memory
In the first BD chains or the 2nd BD chains read first BD or twoth BD available to ancillary equipment, ether network packet is write first
In the corresponding cachings of BD, or, ether network packet, i.e. ancillary equipment are read from the corresponding cachings of the 2nd BD can be actively from main frame
Middle reading BD, it is to avoid by main frame be ancillary equipment storage allocation space, so as to improving Ethernet report to a certain extent
Transmission speed, the efficiency of transmission of text, especially under the larger scene of Ethernet message amount, the effect of the embodiment of the present invention is more
Substantially.In addition, the embodiment of the present invention, it is to avoid during transmitting ether network packet between main frame and ancillary equipment, main frame quilt
The phenomenon that ancillary equipment is frequently interrupted, can also be prevented because of packet loss phenomenon caused by the interruption that drain process ancillary equipment is sent
Occur.
Brief description of the drawings
Fig. 1 is the flow chart schematic diagram for the data transmission method for uplink that the embodiment of the present invention one is provided;
Fig. 2 is the method flow schematic diagram for the first BD of reading corresponding with Fig. 1 that the embodiment of the present invention one is provided;
Fig. 3 is the method flow diagram that will interrupt write-in interruption buffer area corresponding with Fig. 1 that the embodiment of the present invention one is provided
Schematic diagram;
Fig. 4 is the application scenarios schematic diagram of the embodiment of the present invention;
Fig. 5 is the flow signal of transmission state machine in the dma controller corresponding with Fig. 4 that the embodiment of the present invention one is provided
Figure;
Fig. 6 is the schematic flow sheet for the data receiver method that the embodiment of the present invention two is provided;
Fig. 7 is that the method flow that processing is polled to interruption corresponding with Fig. 6 that the embodiment of the present invention two is provided is illustrated
Figure;
Fig. 8 is the schematic flow sheet for the data receiver method that the embodiment of the present invention three is provided;
Fig. 9 is the method flow schematic diagram for the 2nd BD of reading corresponding with Fig. 8 that the embodiment of the present invention three is provided;
Figure 10 is the method flow diagram that will interrupt write-in interruption buffer area corresponding with Fig. 8 that the embodiment of the present invention three is provided
Schematic diagram;
Figure 11 is the flow signal of user equipment in the dma controller corresponding with Fig. 4 that the embodiment of the present invention three is provided
Figure;
Figure 12 is the schematic flow sheet for the data transmission method for uplink that the embodiment of the present invention four is provided;
Figure 13 is the BD schematic diagrames after the BD provided in an embodiment of the present invention in the first BD chains is updated;
Figure 14 is the BD schematic diagrames after the BD provided in an embodiment of the present invention in the 2nd BD chains is updated;
Figure 15 is the interruption schematic diagram provided in an embodiment of the present invention to interrupting after being write and being handled;
Figure 16 is the structural representation for the ancillary equipment that the embodiment of the present invention five is provided;
Figure 17 is the structural representation for the main frame that the embodiment of the present invention six is provided;
Figure 18 is the structural representation for the ancillary equipment that the embodiment of the present invention seven is provided;
Figure 19 is the structural representation for the main frame that the embodiment of the present invention eight is provided.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.With reference to specific embodiment to transmission side data provided in an embodiment of the present invention
Method and equipment are described in detail.
Embodiment one
The embodiment of the present invention one provides a kind of data transmission method for uplink, applied to the ancillary equipment of main frame, is applied particularly to master
The ancillary equipment of machine sends the process of ether network packet to main frame, as shown in figure 1, including:
Step 101, first BD available to the ancillary equipment is read from the first BD chains, wherein, described first
During BD chains are located in the host memory and send ether network packet to the main frame applied to the ancillary equipment, institute
State the first BD unavailable to the main frame.
In the embodiment of the present invention, ancillary equipment reads rule according to default, and one is read from the first BD chains to periphery
The available BD of equipment, is used as the first BD.Wherein, the first BD chains be located at host memory in, and applied to main frame ancillary equipment to
It is unavailable to main frame when the BD in the first BD chains is available to the ancillary equipment of main frame during main frame sends ether network packet,
It is available to main frame when BD in first BD chains is unavailable to the ancillary equipment of main frame.
When it is implemented, pre-setting the first BD (Buffer Descriptor, buffer descriptor) chain in main frame, this
One BD chains include at least two BD, are available for ancillary equipment to send ether network packet to main frame.First BD chains are arranged in main frame
In depositing, main frame and ancillary equipment are accessed and safeguarded jointly.Preferably, in the first BD chains in two BD of arbitrary neighborhood, previous BD
End physical base address and latter BD beginning physical base address it is continuous.
Step 102, ether network packet is write in the corresponding cachings of the first BD, and the first BD is updated
The first BD is set to be used to the main frame and unavailable to the ancillary equipment.
When it is implemented, the physical buffer addresses in the first BD, the physics that ether network packet is write into the first BD delays
Deposit in the corresponding caching in address.Meanwhile, it will be used to represent that the whether available fields of the BD are updated to can use main frame in the first BD
And it is unavailable to ancillary equipment.Wherein, it can represent available and unavailable to ancillary equipment to main frame with 0, be represented with 1 to main frame not
It can use and available to ancillary equipment.It should be noted that the corresponding cachings of each BD are the caching in main frame in the first BD chains.
It should be noted that BD available to the ancillary equipment acquiescences referred in the embodiment of the present invention are unavailable to main frame,
It is i.e. available and unavailable to main frame to ancillary equipment;BD acquiescences available to main frame are unavailable to ancillary equipment, i.e., periphery is set
It is standby unavailable and available to main frame, wherein, BD available to ancillary equipment represents that ancillary equipment can be by Ethernet in the first BD chains
Message is write in the corresponding cachings of available BD.
Preferably, the first BD is updated makes the message length in the first BD be BD pairs of write-in the described first
The length of ether network packet in the caching answered.
When it is implemented, will be used to represent that the field contents of Ethernet message length are updated to write the first BD in the first BD
The length of ether network packet in corresponding caching, so that ensure the integrality of information in the first BD, it is accurate to enable the host to
From the corresponding cachings of the first BD read ether network packet.
Step 103, completed if the first BD updates, generation is sent completely the interruption interrupted and write positioned at the main frame
Buffer area.Wherein, interrupting buffer area is used for the interruption that caching peripheral equipment writes.
When it is implemented, ancillary equipment writes ether network packet after the corresponding cachings of the first BD, the first BD is carried out
Update, after the first BD updates completion, generation is sent completely interruption to notify main frame ether network packet to be sent completely.Main frame can
It is sent completely to interrupt according to this and ether network packet for being successfully written the first BD is extracted and subsequent treatment.
Step 104, notify to be sent completely interruption described in the host process.
The first BD chains are prestored in the embodiment of the present invention, main frame, ancillary equipment is carrying out the transmission of ether network packet
When, the first BD chains from positioned at host memory read first BD available to ancillary equipment, and ether network packet is write into first
In the corresponding cachings of BD, i.e., ancillary equipment actively can read BD from main frame, it is to avoid by main frame be ancillary equipment storage allocation
Space, so as to improve transmission speed, the efficiency of transmission of ether network packet to a certain extent, especially in ether network packet number
Under the larger scene of amount, the effect of the embodiment of the present invention is more obvious.In addition, the embodiment of the present invention writes by ether network packet
After first BD, generation is sent completely the interruption buffer area and notice main frame for interrupting and writing positioned at main frame, so that host process
It is sent completely interruption.
Mode is preferably carried out as one kind, one available to the ancillary equipment first is read from the first BD chains
BD, as shown in Fig. 2 specifically including:
Step 201, according to the index of the BD that nearest one is read in the first BD chains, working as in the first BD chains is read
Preceding BD, the current BD are adjacent with the nearest BD being read.
It should be noted that the BD that nearest one is read in the first BD chains is that read access time is nearest apart from current time
One BD for being read.In the first BD chains, current BD is adjacent with a nearest BD being read, and current BD is located at recently
After the BD that one is read.
Step 202, judge whether the current BD read is available to the ancillary equipment, if so, step 204 is performed, otherwise,
Perform step 203.
When it is implemented, in the case of the current BD of reading is available to ancillary equipment, step 204 is performed, in reading
In the case of current BD is disabled to ancillary equipment, step 203 is performed.
Step 203, the generation current BD is unavailable interrupts and writes the interruption buffer area positioned at the main frame;Notify institute
State the current unavailable interruptions of BD described in host process;And, continue executing with step 201.
In this step, current BD interruptions unavailable to ancillary equipment are specifically generated, because the current BD of reading is set to periphery
It is standby unavailable, then step 201 is continued executing with, and continue the deterministic process of step 202, until the current BD read can be used as
Only.Illustrate:Assuming that the first BD chains include three BD, these three BD index is respectively 1,2,3, nearest one in the first BD chains
The individual BD being read index is 1, then reads the current BD (BD that i.e. index is 2) in the first BD chains, now, if read
Index it is unavailable to ancillary equipment for 2 BD, then now, in the first BD chains the index for the BD that nearest one is read be 2, this
When, it is 3 current BD to read index according to index 2.
Step 204, it regard the current BD of reading as the first BD.
In this step, reading current BD available to ancillary equipment is regard as the first BD.
Using the embodiment of the present invention, in the case of the current BD of reading is disabled to ancillary equipment, current BD is generated not
Interruption can be used, and continues to read BD from the first BD chains, when reading BD available to ancillary equipment, by the external of reading
The available BD of peripheral equipment is as the first BD, so as to ensure to read first BD available to ancillary equipment.Preferably, first
BD chains are ring data structure, and such ancillary equipment is recyclable to read BD from the first BD chains.
When it is implemented, the current BD in the first BD chains can be read in such a way:
Mode one:It is the different numberings of each BD settings in the first BD chains in advance, wherein, adjacent BD numbering is continuous, will
The each BD index numbered as correspondence BD;It is determined that adjacent with nearest one BD being read the first numbering and than nearest one
Second that the individual BD being read numbering is big is numbered, and is read the corresponding BD of the second numbering and is used as current BD;If in the first BD chains most
The nearly one BD numbering being read is the largest number of BD in the first BD chains, then reads and the BD of minimum is numbered in the first BD chains make
For current BD;Wherein, the BD that ascending order is successively read in the first BD chains is numbered according to BD, is the BD in the first BD chains
Setting the rule of numbering can be:The BD smaller numbering of starting physical base address is smaller.
Mode two:The starting physical base address for determining the BD that nearest one is read in the first BD chains is plus setting value ought
Preceding BD starting physical base address, reads current BD, if the first BD according to current BD starting physical base address and setting value
The starting physical base address for the BD that nearest one is read in chain adds the end physical base address that setting value is the first BD chains, then
It is determined that current BD starting physical base address is the starting physical base address of the first BD chains;Wherein, ancillary equipment is according to the first BD
The ascending order of physical base address is successively read the BD in the first BD chains in chain, and the space size shared by each BD is identical,
Setting value is equal to the space size shared by single BD, and the physical base address of the first BD chains is previously written in ancillary equipment.Preferably,
Setting value is equal to 2K, and setting value can also be other values, not limit here.With BD starting physical base address in mode two
It is used as BD index.
Illustrate the BD in the first BD chains recycles process:Assuming that BD number is numbered for 3, BD in the first BD chains
(index) is followed successively by 1,2,3, and ancillary equipment numbers ascending order according to BD and reads BD, and the BD numberings read first are 1,
Secondly the BD numberings read are 2, and the BD numberings again read off are 3, when ancillary equipment needs to continue to read the BD in the first BD chains,
It is determined that the last BD read numbering is 3 (the largest number of BD in the first BD chains), then continue since numbering 1,
According to ascending order is numbered, the BD in the first BD chains is successively read.
Preferably, if between ancillary equipment and main frame PCI (Peripheral Component Interconnect, outside
If component connection standard) bus by time-out take, generation pci bus it is occupied interrupt and write positioned at the main frame interruption delay
Deposit area;Notify the occupied interruption of pci bus described in the host process.
When it is implemented, ancillary equipment from the first BD chains before BD is read, check whether pci bus is accounted for by time-out
With, or, if the continuous number of times that same BD failures are read from the first BD chains determines pci bus quilt more than the first frequency threshold value
Time-out takes, or, if the continuous number of times that same ether network packet is write into the corresponding cache failures of same BD exceedes second
Number threshold value, determines that pci bus is taken by time-out, or, if the continuous number of times that failure is updated to same BD exceedes third time
Number threshold value, determines that pci bus is taken by time-out.Wherein, the first frequency threshold value, the second frequency threshold value and third time number threshold value
Size can be the same or different, it is preferable that the size of the first frequency threshold value, the second frequency threshold value and third time number threshold value
It is identical, such as it is equal to 14.Wherein, it can be provided for judging what whether pci bus was taken by time-out according to practical application scene
Time threshold, such as the time threshold may be set to 1000*30ns, when the occupied duration of pci bus is more than 1000*30ns
When, determine that pci bus is taken by time-out, time threshold can also be other numerical value, not limit here.
In specific implementation process, any interruption of the generation is write position by any interruption generated for ancillary equipment
In the interruption buffer area of the main frame, as shown in figure 3, specifically including:
Step 301, determine to specify the index for interrupting caching in the interruption buffer area, wherein, the interruption buffer area bag
Include multiple interrupt to cache, one interrupts caching and interrupts for caching one, the specified caching that interrupts is the interruption buffer area
Interior nearest one interruption for being written into interruption is cached.
It should be noted that interrupt buffer area in nearest one be written into interruption interruption caching for write-in the break period away from
The interruption caching that one nearest from current time has been written into interruption.Preferably, interrupt buffer area and interrupted including 128 and delay
Deposit, the interruption that can also include other numerical value is cached, and is not repeated here.
Wherein, it is the region dedicated for caching the interruption from ancillary equipment that main frame is pre-set to interrupt buffer area,
Specifically, will interrupt buffer area is divided into many sub- buffer areas in advance, a sub- buffer area is interrupted as one and cached, also, one
It is individual interrupt caching be used for cache one interruption, when it is previous interruption caching be written into interruption after, ancillary equipment generation it is next in
It is disconnected then be written into and previous interrupt after caching and interrupt the adjacent next interruption of caching with previous and cache.Preferably, it is each to interrupt
The size for caching corresponding spatial cache is identical, such as each size for interrupting the corresponding spatial cache of caching is 64 bits,
Or other sizes, do not limit here.
Step 302, according to it is described it is specified interrupt caching index, it is determined that positioned at it is described it is specified interrupt caching after and with institute
State to specify and interrupt the adjacent Current interrupt caching of caching.
Wherein, interrupting in buffer area, the interruption caching that Current interrupt caching is written into interruption with nearest one it is adjacent and
After nearest one interruption for being written into interruption caching.
Step 303, any interruption of the generation is write into the Current interrupt to cache.
Preferably, it is ring data structure to interrupt buffer area, and such ancillary equipment is cyclically using interrupting in buffer area
Interruption caching.Cached when it is implemented, being interrupted for two of arbitrary neighborhood, the previous end physical address for interrupting caching with
The latter start physical address for interrupting caching is continuous, i.e., each interrupts caching and keeps the continuous of physical address in interruption buffer area,
So it is easy to ancillary equipment to recycle the interruption caching interrupted in buffer area.
The mode of the Current interrupt caching interrupted in buffer area is read in the embodiment of the present invention with reading in the first BD chains
Current BD mode is similar, does not repeat here.
The mode for recycling interruption caching in interruption buffer area is similar with the mode for recycling the BD in the first BD chains,
Such as:If the nearest one interruption caching for being written into interruption caches to interrupt the largest number of interrupt in buffer area, slow by interrupting
The minimum interruption caching of numbering in area is deposited to cache as Current interrupt.
The embodiment of the present invention, determines to be located at this nearest one according to the index of the nearest one interruption caching for being written into interruption
It is written into after the interruption caching of interruption and caches adjacent Current interrupt with the interruption and cache, so that order, circulation makes
Cached with the interruption interrupted in buffer area.
As shown in figure 4, application scenarios schematic diagram for data transmission method for uplink provided in an embodiment of the present invention is, it is necessary to note
It is that above-mentioned application scenarios are for only for ease of to understand spirit and principles of the present invention and show, embodiments of the present invention are herein
Aspect is unrestricted.On the contrary, embodiments of the present invention can apply to applicable any scene.In Fig. 4, FPGA
(Field-Programmable Gate Array, field-programmable gate array) is set equivalent to the periphery in the embodiment of the present invention
Standby, FPGA includes DMA (Direct Memory Access, direct memory access) controller, MAC (Physical
Access Control, physical access controller) and pci controller.Dma controller is connected by pci bus with main frame, MAC
Entered by GMII (Gigabit Medium Independent Interface, gigabit GMII) interface with Ethernet
The transmission of row ether network packet, dma controller sends the ether network packet from main frame to Ethernet, dma controller through MAC
The ether network packet from Ethernet is obtained from MAC and is sent to main frame;Wherein, dma controller can include send caching and
Order caching, send caching be used for cache from MAC obtain ether network packet, order caching be used for cache from main frame receive with
Too network packet, sending caching may include two son caching RAM0 and RAM1, order caching may include two son caching RAM2 and
RAM3。
When it is implemented, during dma controller sends ether network packet to main frame, a transmission state can be safeguarded
Machine, as shown in figure 5, the schematic flow sheet to send state machine in dma controller, wherein, except the DMA controls shown in Fig. 5
Except in the case of device is in empty state (wait state), in pci bus reset, system reset, sends state machine and be also at empty state;When
When storing complete ether network packet in the transmission caching in dma controller, send state machine and enter transmission beginning state and by sending out
Send beginning state to enter and send inspection state;Inspection state is being sent, whether dma controller checks pci bus by time-out occupancy,
If it is not, then entering to study in current BD states, frame losing state is sent if it is, entering;Wherein, asked in the case where sending frame losing state
The ether network packet sent in caching is removed, and is transferred to empty state;Current BD states are being read, are being judged whether in the first frequency threshold value
Current BD is inside read, if not, being taken into pci bus by time-out, status of fail is sent and is transferred to empty state, if it is,
Judge whether current BD can use, if it is available, into Ethernet message status is write, if it is not then going successively to read current
BD states;Ethernet message status is being write, is judging whether to be successfully written ether network packet in second defeated threshold value of number, if
It is no, taken into pci bus by time-out, send status of fail and be transferred to empty state, BD states are updated if it is, entering;If more
The number of times newly failed exceedes third time number threshold value, then enters pci bus and taken by time-out, sends status of fail and is transferred to empty state,
Completed if BD updates, it is determined that ether network packet is sent completely and enters empty state.
Embodiment two
The embodiment of the present invention two provides a kind of data receiver method, applied to main frame, is applied particularly to main frame Receiving Host
Ancillary equipment send ether network packet process, as shown in fig. 6, including:
Step 601, when the interrupt processing for receiving the ancillary equipment transmission of the main frame is notified, to writing the main frame
The interruption for interrupting buffer area is polled processing.
When it is implemented, the principle that main frame can first be handled according to the interruption first write, enters to interrupting the interruption in buffer area
Road wheel inquiry is handled.
Step 602, if the interruption being currently polled to is is sent completely interruption, one is read from the first BD chains to the master
Available first BD of machine, wherein, the first BD chains are located in the host memory and receive described outer applied to the main frame
During the ether network packet that peripheral equipment is sent, the first BD is unavailable to the ancillary equipment.
If when it is implemented, main frame be polled to the ancillary equipment write-in of main frame be sent completely interruption, main frame is from first
First BD available to main frame is read in BD chains, the first BD is available to main frame and to the disabled BD of ancillary equipment.
It should be noted that BD available to the ancillary equipment acquiescences referred in the embodiment of the present invention are unavailable to main frame,
It is i.e. available and unavailable to main frame to ancillary equipment;BD acquiescences available to main frame are unavailable to ancillary equipment, i.e., periphery is set
It is standby unavailable and available to main frame, wherein, BD available to main frame represents that main frame can be corresponding from the available BD in the first BD chains
Ether network packet is extracted in caching.
Step 603, ether network packet is extracted from the corresponding cachings of the first BD, and the first BD is updated
Enable the first BD unavailable to the main frame and the ancillary equipment is used.
When it is implemented, the physical buffer addresses in the first BD, corresponding slow from the first BD physical buffer addresses
Deposit middle extraction ether network packet.Meanwhile, will be used to representing the whether available fields of the BD are updated in the first BD can not to main frame
It can use with and to ancillary equipment, so that ancillary equipment reuses the BD.
It should be noted that the first BD chains in the embodiment of the present invention and the first BD chains in embodiment one are same BD
Chain, for ancillary equipment, the first BD chains are the BD chains for sending ether network packet to main frame, for main frame, the
One BD chains are the BD chains for receiving the ether network packet of ancillary equipment transmission, wherein, BD available to main frame in the first BD chains
Represent that main frame can extract the ether network packet of ancillary equipment write-in from the corresponding cachings of available BD.
The embodiment of the present invention, the interruption that main frame is generated to ancillary equipment is polled processing, if the poll in processing procedure
To interruption to be sent completely interruptions, then according to first BD available to main frame, extract the ether network packet of ancillary equipment transmission
So as to receive the ether network packet of ancillary equipment transmission, and the first BD is updated, so that ancillary equipment can be recycled the
BD in one BD chains.
In the embodiment of the present invention, one available to the main frame first is read from the first BD chains in such a way
BD:According to the index of the BD that nearest one is read in the first BD chains, read the current BD in the first BD chains, current BD with
A nearest BD being read is adjacent, and current BD is located at after nearest one BD being read;If current BD can use, ought
Preceding BD is used as the first BD;If current BD is unavailable, it is determined that do not read the first BD, now main frame can continue poll it is next in
Break and carry out corresponding interrupt processing.
Preferably, when the interrupt processing for receiving the ancillary equipment transmission of the main frame is notified, to writing the main frame
The interruption for interrupting buffer area is polled processing, as shown in fig. 7, specifically including:
Step 701, when receiving the interrupt processing notice that the ancillary equipment is sent, judge whether main frame just performs periphery
Device interrupt processing routine, if so, performing step 702, otherwise, performs step 703 to 705.
If main frame is just performing peripheral interrupts processing routine, step 702 is performed;If the main frame is not carried out periphery
Device interrupt processing routine, performs following steps 703 to step 705.Peripheral interrupts processing described in the embodiment of the present invention
The effect of program is that the interruption that interruption buffer area is write to ancillary equipment is polled processing, until interrupting all of buffer area
Interrupt processing is completed.
Step 702, wait by peripheral interrupts processing routine poll.
Step 703, triggering main frame enters peripheral interrupts processing routine, and closes interruption.
When it is implemented, ancillary equipment is interrupted write-in is interrupted after buffer area, interrupt processing can be sent to main frame and notified, it is main
Machine is received after the interrupt processing notice of ancillary equipment transmission, and a kind of situation is that main frame is carrying out peripheral interrupts processing journey
Sequence, that is, the interruption write to interrupting buffer area peripheral devices are polled processing, then interrupt processing notice pair
The interrupt latency answered is by the poll of peripheral interrupts processing routine, and another situation is that main frame is not carried out peripheral interrupts
Processing routine, that is, main frame do not enter into peripheral interrupts processing routine but are performing other programs, now, the interruption
Processing notice can trigger main frame into peripheral interrupts processing routine.Main frame enters peripheral interrupts processing routine, closes
Interrupt, closing interruption can make main frame not interrupted by any interruption and enter another interrupt handling routine so that main frame pair
The interruption that buffer area is interrupted in write-in is polled processing, until all interrupt processings for interrupting buffer area are completed.
Step 704, the interruption of the interruption buffer area to writing the main frame is polled processing, wherein, interrupt buffer area
Caching is interrupted including multiple, one interrupts caching and is used to cache an interruption.
When it is implemented, being polled processing to interrupting the interruption in buffer area in such a way:According in upper one
The index of disconnected caching, obtains after upper one interruption caching and interrupts the adjacent Current interrupt caching of caching with upper one;
Read from Current interrupt caching and interrupt and handled;And Current interrupt caching is interrupted into caching as upper one, continue
Perform and obtain the step of Current interrupt is cached, wherein, during upper one interrupts caching belonging to a nearest processed interruption
Disconnected caching.In the embodiment of the present invention, the mode of the Current interrupt caching interrupted in buffer area is obtained with reading in the first BD chains
Current BD mode is similar, does not repeat here.Recycle and interrupt the mode that caching is interrupted in buffer area and recycle the
The mode of BD in one BD chains is similar, does not repeat here.
Preferably, it is ring data structure to interrupt buffer area, so cyclically slow using the interruption interrupted in buffer area
Deposit.When it is implemented, interrupting caching for two of arbitrary neighborhood, the previous end physical address for interrupting caching is interrupted with latter
The start physical address of caching is continuous, that is, interrupts each interruption caching in buffer area and keep the continuous of physical address.
Step 705, if all interrupt processings interrupted in buffer area are completed, peripheral interrupts processing journey is exited
Sequence, and open interruption.
When it is implemented, the down trigger main frame that ancillary equipment is sent enters after peripheral interrupts processing routine,
Host Shutdown is interrupted, after Host Shutdown is interrupted, and ancillary equipment may also write new interruption to buffer area is interrupted, still,
Main frame will not be interrupted again enters new interrupt handling routine, but is interrupting buffer area according to the interruption of ancillary equipment
Sequentially, processing is polled to interrupting all interruptions in buffer area, until interrupting in buffer area does not have accessible interruption.This
Sample, main frame is in processes during the interruption of disconnected buffer area, and ancillary equipment writes new interruption and can also arrived by host computer polls, reaches
The purpose of the interruption of batch processing ancillary equipment has been arrived, rather than main frame is frequently interrupted in the interruption of ancillary equipment, enters main frame
To new interrupt handling routine.Interrupt (interrupt processing interrupted in buffer area is completed) when not interrupted in buffer area, exit
Peripheral interrupts processing routine, and open interruption.If ancillary equipment produces new interruption, main frame is again introduced into ancillary equipment
Interrupt handling routine, closing is interrupted, and processing is polled to the interruption for interrupting buffer area, until no in interruption buffer area can locate
The interruption of reason, i.e., complete until interrupting the interrupt processing in buffer area.
The embodiment of the present invention, not only main frame will not because non-ancillary equipment send interruption stop processing ancillary equipment send
Interruption, moreover, main frame handle ancillary equipment some interruption when, also will not the interruption of ancillary equipment newly arrival and stop
It is currently processed.It is that road wheel is entered in the interruption in the interruption caching write to ancillary equipment because main frame enters after interrupt handling routine
Inquiry is handled, and realizes the interruption of batch processing ancillary equipment transmission, it is to avoid Ethernet report is transmitted between main frame and ancillary equipment
In the process of text, the phenomenon that main frame is frequently interrupted by ancillary equipment can be also prevented because of the interruption that drain process ancillary equipment is sent
Caused by packet loss phenomenon appearance.
Preferably, determine that all interrupt processings in the interruption buffer area are completed in the following way:
If being interrupted used in the ancillary equipment write-in interruption belonging to the index of caching and the interruption of the host process
Interruption caching index it is identical, determine it is described interruption buffer area in all interrupt processings complete.
When it is implemented, during interruption used in writing and interrupt when ancillary equipment is cached belonging to the interruption with host process
When disconnected caching is same interruption caching, illustrate that all interruptions interrupted in buffer area have been polled to, if now host process is complete
Completed into the same all interrupt processings in then explanation interruption buffer area of interrupting interrupted in caching, that is, illustrate that host computer polls are arrived
Ancillary equipment write last interrupt used in interrupt caching, if now host process complete this last interrupt it is slow
Interruption in depositing, the then all interrupt processings interrupted in buffer area are completed.
Whether the embodiment of the present invention, the interruption that main frame accurate can judge to interrupt in buffer area is processed into making
Interrupt handling routine can just be exited after all interruptions for interrupting buffer area are all processed by obtaining, and received and sent out so as to improve main frame
Send the efficiency of ether network packet.
Embodiment three
The embodiment of the present invention three provides a kind of data receiver method, applied to the ancillary equipment of main frame, is applied particularly to master
The ancillary equipment of machine receives the process of ether network packet from main frame.As shown in figure 8, including:
Step 801, twoth BD available to the ancillary equipment is read from the 2nd BD chains, wherein, described second
BD chains are located in the host memory and the process for the ether network packet that the main frame is sent are received applied to the ancillary equipment
In, the 2nd BD is unavailable to the main frame.
In the embodiment of the present invention, the 2nd BD chains are arranged in host memory, and main frame and ancillary equipment are accessed and safeguarded jointly.
Ancillary equipment reads rule according to default, and a BD available to ancillary equipment is read from the 2nd BD chains, the 2nd BD is used as.
Wherein, the 2nd BD chains are located in host memory, and are applied to the ether network packet that the ancillary equipment Receiving Host of main frame is sent
During, when the BD in the 2nd BD chains is available to the ancillary equipment of main frame, unavailable to main frame, the BD in the 2nd BD chains is to main frame
Ancillary equipment it is unavailable when, it is available to main frame.
When it is implemented, pre-setting the 2nd BD chains in main frame, the 2nd BD chains include at least two BD and are available for periphery to set
The ether network packet that standby Receiving Host is sent.Preferably, in the 2nd BD chains in two BD of arbitrary neighborhood, previous BD end thing
Manage base address and latter BD beginning physical base address is continuous.
Step 802, ether network packet is extracted from the corresponding cachings of the 2nd BD, and by the ether network packet extracted
Write the spatial cache of the ether network packet sent for storage host.
When it is implemented, ancillary equipment according to the physical buffer addresses and message length recorded in the 2nd BD from the 2nd BD
Extract ether network packet in the corresponding caching of physical buffer addresses of record, and by the Ethernet packet storage extracted to being used for
The spatial cache for the ether network packet that storage host is sent, wherein, the caching of the ether network packet sent for storage host is empty
Between be exactly the order caching being mentioned above.
Step 803, the 2nd BD is updated makes the 2nd BD unavailable to the ancillary equipment and to described
Main frame can use.
Specifically, will be used to represent that the whether available fields of the BD are updated to available to main frame and set periphery in the 2nd BD
It is standby unavailable.Wherein, it can represent available and unavailable to ancillary equipment to main frame with 0, represent unavailable to main frame and external with 1
Peripheral equipment can use.The corresponding cachings of each BD are the caching in main frame in 2nd BD chains.
It should be noted that BD available to the ancillary equipment acquiescences referred in the embodiment of the present invention are unavailable to main frame,
It is i.e. available and unavailable to main frame to ancillary equipment;BD acquiescences available to main frame are unavailable to ancillary equipment, i.e., periphery is set
It is standby unavailable and available to main frame, wherein, BD available to ancillary equipment represents that ancillary equipment can be BD pairs from this in the 2nd BD chains
Ether network packet is extracted in the caching answered.
Step 804, completed if the 2nd BD updates, generation finishes receiving the interruption interrupted and write positioned at the main frame
Buffer area.Wherein, interrupting buffer area is used for the interruption that caching peripheral equipment writes.
When it is implemented, after ancillary equipment extraction ether network packet, being updated, having been updated in the 2nd BD to the 2nd BD
After, generation finishes receiving interruption, and main frame can finish receiving interruption selection according to this and re-use the 2nd BD.
Step 805, notify to finish receiving interruption described in the host process.
The 2nd BD chains are prestored in the embodiment of the present invention, main frame, ancillary equipment is carrying out the reception of ether network packet
When, the 2nd BD chains from positioned at host memory read twoth BD available to ancillary equipment, from the corresponding cachings of the 2nd BD
Read ether network packet, i.e. ancillary equipment actively can read BD from main frame, it is to avoid by main frame be that ancillary equipment sends BD, from
And transmission speed, the efficiency of transmission of ether network packet can be improved to a certain extent, it is especially larger in Ethernet message amount
Scene under, the effect of the embodiment of the present invention is more obvious.In addition, ether network packet is being write the 2nd BD by the embodiment of the present invention
Afterwards, generation finishes receiving the interruption buffer area and notice main frame for interrupting and writing positioned at main frame, so that host process has been received
Into interruption.
Wherein, the end physical base address of the first BD chains can be continuous with the starting physical base address of the 2nd BD chains, and second
The end physical base address of BD chains can be continuous with the starting physical base address of the first BD chains.
If when it is implemented, the free space of the spatial cache of the ether network packet sent for storage host is when default
Do not occur the situation more than pre-set space threshold value in long, generation free space deficiency is interrupted and writes the interruption positioned at the main frame
Buffer area;Notify that free space deficiency is interrupted described in the host process.
Wherein, before BD is read from the 2nd BD chains, by the caching of the ether network packet sent for storage host
The full signal that space is sent determines whether free space is more than pre-set space threshold value, if free space is not more than pre-set space threshold
Value, continues to determine whether free space is more than pre-set space threshold value, if not occurring free space in preset duration more than pre-
If the situation of capacity-threshold, then generate free space deficiency and interrupt, and write the interruption buffer area of main frame and notify at main frame
Free space deficiency is managed to interrupt.Wherein, preset duration can be 1000*30ns, or other numerical value, not limit here
It is fixed.
Preferably, twoth BD available to the ancillary equipment is read from the 2nd BD chains, as shown in figure 9, specifically
Including:
Step 901, according to the index of the BD that nearest one is read in the 2nd BD chains, working as in the 2nd BD chains is read
Preceding BD, the current BD are adjacent with the nearest BD being read.
Step 902, judge whether the current BD is available to the ancillary equipment, if it is, step 904 is performed, otherwise,
Perform step 903.
Step 903, the current BD of generation is unavailable interrupts and writes the interruption buffer area positioned at the main frame;Notify the master
The machine processing current BD is unavailable to interrupt;And, continue executing with step 901.
Step 904, it regard the current BD of reading as the 2nd BD.
Wherein, it is similar with the similar explanation of Fig. 2 embodiments provided for explaining in detail for Fig. 9 embodiments provided, this
In do not repeat.
The embodiment of the present invention, in the case of the current BD of reading is disabled to ancillary equipment, generates current BD unavailable
Interrupt, and continue to read BD from the 2nd BD chains, when reading BD available to ancillary equipment, reading is set to periphery
Standby available BD is as the 2nd BD, so as to ensure to read twoth BD available to ancillary equipment.
Preferably, the 2nd BD chains are ring data structure, and such ancillary equipment is recyclable to read BD from the 2nd BD chains.Tool
When body is implemented, the mode of the current BD in the 2nd BD chains of reading is similar with the mode for reading the current BD in the first BD chains, here
Do not repeat, the mode that BD in the 2nd BD chains is read in circulation recycles similar with the BD in the first BD chains, and process is not done here
Repeat.
Preferably, if the Peripheral Component Interconnect standard PCI bus between the ancillary equipment and the main frame is accounted for by time-out
With generation pci bus is occupied to interrupt and write the interruption buffer area positioned at the main frame;Notify described in the host process
Pci bus is occupied to interrupt.
When it is implemented, ancillary equipment from the 2nd BD chains before BD is read, check whether pci bus is accounted for by time-out
With, or, if the continuous number of times that same BD failures are read from the 2nd BD chains determines pci bus quilt more than the 4th frequency threshold value
Time-out takes, or, if the continuous number of times that the failure of ether network packet is extracted from same BD is more than the 5th frequency threshold value, it is determined that
Pci bus is taken by time-out, or, if the continuous number of times that failure is updated to same BD is more than the 6th frequency threshold value, it is determined that
Pci bus is taken by time-out.Wherein, the size of the 4th frequency threshold value, the 5th frequency threshold value and the 6th frequency threshold value can phase
Together can also be different, it is preferable that the size of the 4th frequency threshold value, the 5th frequency threshold value and the 6th frequency threshold value is identical, such as
It is equal to 14.Wherein, whether it can be provided for judging pci bus according to practical application scene by the time threshold of time-out occupancy,
Such as the time threshold may be set to 1000*30ns, when the occupied duration of pci bus is more than 1000*30ns, determine PCI
Bus is taken by time-out, and time threshold can also be other numerical value, not limit here.
In specific implementation process, for any interruption of generation, any interruption write-in of the generation is located at the master
The interruption buffer area of machine, as shown in Figure 10, is specifically included:
Step 1001, determine to specify the index for interrupting caching in the interruption buffer area, wherein, the interruption buffer area bag
Include multiple interrupt to cache, one interrupts caching and interrupts for caching one, the specified caching that interrupts is the interruption buffer area
Interior nearest one interruption for being written into interruption is cached.
Step 1002, according to it is described it is specified interrupt caching index, it is determined that positioned at it is described it is specified interrupt caching after and with
The specified adjacent Current interrupt of caching that interrupts is cached.
Step 1003, any interruption of the generation is write into the Current interrupt to cache.
The embodiment that the detailed implementation process and its advantage of the embodiment that Figure 10 is provided are provided Fig. 3 in seeing above
Detailed description and beneficial effect description, do not repeat here.
The application scenarios of the embodiment of the present invention are as shown in Figure 4, it should be noted that above-mentioned application scenarios are for only for ease of
Understand spirit and principles of the present invention and show, embodiments of the present invention are unrestricted in this regard.On the contrary, of the invention
Embodiment can apply to applicable any scene.
When it is implemented, during the ether network packet that dma controller Receiving Host is sent, a reception shape can be safeguarded
State machine, is the schematic flow sheet of user equipment in dma controller as shown in figure 11, wherein, except the DMA shown in Figure 11
Except in the case of controller is in empty state, in pci bus reset, system reset, user equipment is also at empty state;When PC passes through
The register that is ready to complete in dma controller notifies dma controller to receive after ether network packet, and user equipment is opened into reception
Beginning state;User equipment state by reception is transferred to free space inspection state, in free space inspection state, judges to use
Whether the free space of the spatial cache of the ether network packet sent in storage host is more than pre-set space threshold in preset duration
The situation of value, if it is, enter to study in BD states, if not, into empty state;BD states are being read, are being judged whether in the 4th number threshold
Current BD is successfully read in value, if not, being taken into pci bus by time-out, reception failure state is simultaneously transferred to empty state, if
It is to judge whether current BD can use, if current BD can use, into Ethernet message status is extracted, if current BD is unavailable,
Into current BD down states, and it is transferred to the current BD states of reading;Ethernet message status is being extracted, is being judged whether at the 5th time
Ether network packet is read in number threshold value, BD states are updated if it is, entering, if not, it is occupied into pci bus, receive
Status of fail is simultaneously transferred to empty state;BD states are being updated, if BD successes are updated in the 6th frequency threshold value, it is determined that finishing receiving simultaneously
Into empty state, if the number of times of renewal BD failures is more than the 6th frequency threshold value, reception failure state occupied into PC buses
And it is transferred to empty state.
Example IV
The embodiment of the present invention four provides a kind of data transmission method for uplink, applied to main frame, is applied particularly to main frame and sets to the periphery
Preparation send the process of ether network packet, as shown in figure 12, including:
Step 1201, twoth BD available to the main frame is read from the 2nd BD chains, wherein, the 2nd BD chains
During ether network packet being sent in the host memory and applied to the main frame to the ancillary equipment, described the
Two BD are unavailable to the ancillary equipment.
Specifically, main frame reads twoth BD available to main frame from the 2nd BD chains, the 2nd BD be it is available to main frame and
BD disabled to ancillary equipment.
It should be noted that BD available to the ancillary equipment acquiescences referred in the embodiment of the present invention are unavailable to main frame,
It is i.e. available and unavailable to main frame to ancillary equipment;BD acquiescences available to main frame are unavailable to ancillary equipment, i.e., periphery is set
It is standby unavailable and available to main frame, wherein, BD available to main frame represents that main frame should by the write-in of ether network packet in the 2nd BD chains
It can use in the corresponding cachings of BD.
Step 1202, ether network packet is write in the corresponding cachings of the 2nd BD, and the 2nd BD is carried out more
The 2nd BD is newly set to be used to the ancillary equipment and unavailable to the main frame.
When it is implemented, the physical buffer addresses in the 2nd BD, the physics that ether network packet is write into the 2nd BD delays
Deposit the corresponding caching in address.Meanwhile, will be unavailable to main frame for representing that the whether available fields of the BD are updated in the 2nd BD
And it is available to ancillary equipment, so that ancillary equipment reuses the BD.
Preferably, the 2nd BD is updated makes the message length in the 2nd BD be BD pairs of write-in the described 2nd
The length of ether network packet in the caching answered.
When it is implemented, will be used to represent that the field contents of Ethernet message length are updated to write the 2nd BD in the 2nd BD
The length of ether network packet in corresponding caching, so as to ensure the integrality of information in the 2nd BD, so that ancillary equipment can
Ether network packet is accurately extracted from the corresponding cachings of the 2nd BD.
It should be noted that the 2nd BD chains in the embodiment of the present invention and the 2nd BD chains in embodiment three are same BD
Chain, for ancillary equipment, the 2nd BD chains be for Receiving Host send ether network packet BD chains, for main frame come
Say, the 2nd BD chains are the BD chains that ether network packet is sent for peripheral device, wherein, BD available to main frame in the 2nd BD chains
Represent that main frame writes ether network packet in the corresponding cachings of available BD.
Step 1203, receive ancillary equipment transmission finishes receiving interrupt notification, if the interruption being polled to is to finish receiving
Interrupt, discharge content in the corresponding cachings of the 2nd BD.
When it is implemented, the principle that main frame can first be handled according to the interruption first write, enters to interrupting the interruption in buffer area
Road wheel inquiry is handled.It should be noted that the sequencing that step 1201 and step 1203 are performed is not limited, the two can be parallel
Perform, step 1203 can also be first carried out and perform step 1201 again.Wherein, in the ancillary equipment transmission for receiving the main frame
When disconnected processing is notified, processing is polled to writing the interruption of interruption buffer area of the main frame.It is described to write-in on main frame
The interruption of the interruption buffer area of main frame is polled the embodiment of processing, identical with the method that the corresponding embodiments of Fig. 7 are described, please
Referring to the description of Fig. 7 correspondence embodiments, it will not be repeated here.
The embodiment of the present invention, twoth BD of the main frame in the 2nd BD chains will be sent to the Ethernet report of ancillary equipment in advance
In the corresponding cachings of text the 2nd BD of write-in, and the 2nd BD is updated to can use ancillary equipment, so that ancillary equipment Receiving Host
The ether network packet of transmission, in addition, main frame is also polled processing to the interruption that ancillary equipment is generated.
It should be noted that the interruption buffer area being related in the various embodiments described above is same interruption buffer area.Need explanation
, the BD being related in the various embodiments described above form can as shown in Table 1, wherein, single BD accounts for four double words altogether, and one is double
Word includes 32 bits.
Table one
When it is implemented, the string of binary characters that each BD correspondences one include 128 bits, different bits can
" -- " represents that ancillary equipment is not available for any operation in the different implication for identifying, table one, and " RO " represents ancillary equipment only
Read operation can be carried out, " RW " represents that ancillary equipment can carry out read or write." unused " and " reservation " is represented in present invention implementation
In example, the bit is not used by.In the embodiment of the present invention, the BD in the first BD chains and the BD in the 2nd BD chains form phase
Together, the implication of bit different in the BD in BD and the 2nd BD chains only in the first BD chains may be different.Wherein,
When BD is the BD in the first BD chains, if BD available flag position is 0, show that the BD is unavailable to ancillary equipment and to main frame
It can use, if the available flag position of the BD is 1, show that the BD is available and unavailable to main frame to ancillary equipment;When BD is second
During BD in BD chains, if the available flag position of the BD is 0, show that the BD is unavailable to ancillary equipment and available to main frame, if
The available flag position of the BD is 1, then shows that the BD is available and unavailable to main frame to ancillary equipment.When it is implemented, by first
In BD chains in specific BD (physical base address maximum a BD or a largest number of BD are originated in such as the first BD chains)
25th bit position of the 0th double word is 1, last BD in representing the BD as the first BD chains, when in the BD read
For representing that the bit position whether BD is last BD in the first BD chains is high, then from first BD (ratios of the first BD chains
Such as starting physical base address in the first BD chains a minimum BD or a minimum BD of numbering) start to read BD, the first BD
The 25th bit position of nonspecific BD the 0th double word is 0 in chain, to represent that the BD is not last in the first BD chains
BD;Similarly, specific BD in the 2nd BD chains (is originated into a maximum BD of physical base address or numbering in such as the 2nd BD chains
A maximum BD) in the 25th bit position of the 0th double word be 1, last BD in representing the BD as the 2nd BD chains,
When being used for representing that the bit position whether BD is last BD in the 2nd BD chains is high in the BD read, then from the 2nd BD chains
First BD (a minimum BD of a physical base address or minimum BD of numbering is originated in such as the first BD chains) start
The 25th bit position for reading nonspecific BD the 0th double word in BD, the 2nd BD chains is 0, to represent that the BD is not the 2nd BD
The BD of last in chain.
The BD provided based on table one form, main frame is in advance by the interruption enabler flags position of each BD in the first BD chains
Height, so that the interruption of ancillary equipment generation can be triggered, and, by the interruption enabler flags position of each BD in the 2nd BD chains
Height, so that the interruption of ancillary equipment generation can be triggered.The BD that the embodiment of the present invention utilizes table one to provide is exemplified below
Form, BD renewals are carried out to BD:
During illustration ancillary equipment sends ether network packet to main frame, the side that ancillary equipment is updated to BD
Formula:As shown in figure 13, it is assumed that ancillary equipment is in the first BD chains read during sending ether network packet to main frame
First BD is that (the available flag position of the BD is 1, unavailable to main frame and to periphery for identifying by BD in Figure 13 shown in host computer side
Equipment can use), ancillary equipment writes message in the corresponding physical cache of second double word of the BD, and by first of the BD
The available flag position of double word is updated to 0, for representing that the BD is unavailable to ancillary equipment and available to main frame, meanwhile, by ether
The length of network packet is updated in first double word of the BD, i.e., the length of ether network packet is filled in bit 0- bits 10, such as
In Figure 13, the length of ether network packet is [10:0]=00 0,100 1100;
For example, main frame is during the ether network packet that ancillary equipment is sent is received, main frame is updated to BD
Mode:If the first BD of the first BD chains that main frame is got is the BD of Figure 13 peripheral devices side, main frame is according in the BD
The Ethernet message length of record, extracts ether network packet from the corresponding physical cache of the second double word of the BD, and by the BD
Available flag position be updated to 1, for representing that the BD is unavailable to main frame and available to ancillary equipment, wherein, main frame can incite somebody to action this
The corresponding bit of Ethernet message length in BD is to be set to 0, the BD such as corresponding BD of main frame in Figure 13 after main frame renewal, its
In, main frame can not be also updated to the corresponding bit of Ethernet message length, treat that ancillary equipment again reads off the BD
When, the length for the ether network packet for being updated to newly write by the corresponding bit of ether network packet by ancillary equipment.
During illustrating the ether network packet that ancillary equipment Receiving Host is sent, ancillary equipment is updated to BD
Mode:As shown in figure 14, it is assumed that ancillary equipment read during the ether network packet that Receiving Host is sent second
The 2nd BD in BD chains is that (the available flag position of the BD is 1, unavailable to main frame for identifying by BD in Figure 14 shown in host computer side
And it is available to ancillary equipment, the corresponding binary string of bit 0- bits 10 is in the corresponding physical cache of the BD in first double word
The length of the message of preservation), ancillary equipment is according to the length of the ether network packet recorded in the BD, from second double word of the BD
Ether network packet is extracted in the corresponding physical caches of the BD of middle record, and by the available flag position of first double word of the BD more
New is 0, for representing that the BD is unavailable to ancillary equipment and main frame can use, the peripheral device side pair of BD such as Figure 14 after renewal
The BD answered;
For example, main frame is during the ether network packet that ancillary equipment is sent is received, main frame is updated to BD
Mode:If the 2nd BD of the 2nd BD chains that main frame is got is the corresponding BD in Figure 14 peripheral devices side, main frame is by ether
Network packet is write in second double word of the BD and recorded in physical cache, and Ethernet message length is updated into the first of the BD
In individual double word, i.e., filled in bit 0- bits 10 in the length of ether network packet, such as Figure 14, the length of ether network packet is [10:
0] 1=0001111100, and by the available flag of BD position is updated to, for representing that the BD is unavailable to main frame and to periphery
Equipment can use.
In the embodiment of the present invention, the interruption of ancillary equipment generation is write in the form of the string of binary characters including 32 bits
Enter to interrupt buffer area, each bit is defaulted as 0 in the string of binary characters of 32, different bit positions height is represented into difference
Interruption, be the different interruptions of different bit bit identifications as shown in Table 2.
Table two
Bit order | Bit wide | Read-write | Interrupt |
0 | bit[0] | WO | It is sent completely |
1 | bit[1] | WO | Finish receiving |
2 | bit[2] | WO | Free space is not enough |
3 | bit[3] | WO | BD is unavailable |
4 | bit[4] | WO | Pci bus is taken by time-out |
5 | bit[5] | WO | Retain |
6 | bit[6] | WO | Retain |
7 | bit[7] | WO | Retain |
8 | bit[8] | WO | Retain |
9 | bit[9] | WO | Retain |
… | … | WO | Retain |
31 | bit[31] | WO | Retain |
When it is implemented, bit position High Availabitity different in table two is in the different interruptions of mark, wherein, " RO " represents outer
The value that peripheral equipment only carries out the bit retained in write operation, table two is defaulted as 0, and the bit of reservation can also be used for identifying it
The interruption of its type, such as receive or send check errors and interrupt, the interruption being likely to occur after BD asynchronous interrupts etc..
The different of the different bit bit identifications provided based on table two are interrupted, and illustrate peripheral devices of the embodiment of the present invention
Interrupted to buffer area write-in is interrupted, and the process that host process is interrupted, as shown in figure 15, buffer area will be interrupted in advance and is divided into
128 interrupt each interrupt in caching, Figure 15 and cache one interruption cashing indication of correspondence, after ancillary equipment generation is interrupted, therefrom
A minimum interruption caching of cashing indication is interrupted in disconnected buffer area to start, and will be interrupted write-in and is designated in " INT_INFO0 "
In disconnected caching, the interruption of write-in for " 32 ' h0000_0001 ", that is, the interruption write is that ether network packet is sent completely interruption, its
In, the next interruption for the interruption caching that ancillary equipment every time used the interruption write-in last time of generation, when ancillary equipment write-in
When being designated last interruption in interruption buffer area of caching is interrupted used in interrupting, then ancillary equipment continues therefrom next time
First of disconnected buffer area interrupts caching and starts write-in interruption.Ancillary equipment write-in is notified after interrupting in its write-in of host process
Disconnected, the interruption that main machine centering breaks in buffer area is polled processing, is had been processed until interrupting all interruptions in buffer area
Into main frame often handles one interruption of completion, by all bits in the interruption buffer area where the interruption to be set to 0, such as Figure 15
Shown, host process completes ether network packet and is sent completely after interruption, and the interruption for being designated " INT_INFO0 " is cached from " 32 '
H0000_0001 " is revised as " 32 ' h0000_0000 ", so as to reach that the purpose of caching is interrupted in release.
Embodiment five
Based on the inventive concept same with embodiment one, the embodiment of the present invention five provides a kind of periphery sent for data
Equipment, ancillary equipment is the ancillary equipment of main frame, as shown in figure 16, including:
Read module 1601, for reading first BD available to ancillary equipment from the first BD chains, wherein, first
BD chains be located at host memory in and applied to ancillary equipment to main frame send ether network packet during, the first BD to main frame not
It can use;Writing module 1602, for ether network packet to be write in the corresponding cachings of the first BD;Update module 1603, for pair
First BD, which is updated, enables the first BD to be used to main frame and unavailable to ancillary equipment;Generation module 1604, if for the first BD
Update and complete, generation is sent completely the interruption buffer area for interrupting and writing positioned at main frame;Notification module 1605, for notifying main frame
Processing is sent completely interruption.
Alternatively, ancillary equipment, in addition to judge module 1606, wherein:Read module is specifically for according to the first BD chains
In the nearest one BD index that is read, read the current BD in the first BD chains, current BD and nearest one BD being read
It is adjacent;Whether judge module, the current BD for judging to read is available to ancillary equipment;Generation module is additionally operable to, and is judging mould
Block judge it is no in the case of, generate that current BD is unavailable to interrupt and write the interruption buffer area positioned at main frame;Notification module is also used
In the current BD of notice host process is unavailable to interrupt;And, notify read module to continue executing with according to nearest one in the first BD chains
The individual BD being read index, the step of reading the current BD in the first BD chains;Read module is additionally operable to, and is judged in judge module
In the case of being, the current BD of reading is regard as the first BD.
Alternatively, in ancillary equipment, update module is additionally operable to:First BD, which is updated, makes the message length in the first BD
For the length of the ether network packet in the corresponding cachings of the first BD of write-in.
Alternatively, in ancillary equipment, generation module is additionally operable to, if the Peripheral Component Interconnect mark between ancillary equipment and main frame
Quasi- pci bus is taken by time-out, and generation pci bus is occupied to interrupt and write the interruption buffer area positioned at main frame;Notification module
It is additionally operable to, notifies host process pci bus is occupied to interrupt.
Alternatively, in ancillary equipment, any interruption write-in of generation is being located at the interruption buffer area of main frame by generation module
When, specifically for:It is determined that the index that interruption caching is specified in buffer area is interrupted, wherein, interruption buffer area includes multiple interrupt and delayed
Deposit, an interruption is cached to be interrupted for caching one, specified interruption caches is written into interruption for nearest one in interruption buffer area
Interruption caching;According to the specified index for interrupting caching, it is determined that interrupting caching phase after interruption caching is specified and with specified
Adjacent Current interrupt caching;By any interruption write-in Current interrupt caching of generation.
Embodiment six
Based on the inventive concept same with embodiment two, the embodiment of the present invention six also provides a kind of master for data receiver
Machine, as shown in figure 17, including:
Processing module 1701, when being notified for receiving the interrupt processing that the ancillary equipment of main frame is sent, to write-in main frame
The interruption of interruption buffer area be polled processing.Read module 1702, if being for the interruption that processing module is currently polled to
Interruption is sent completely, first BD available to main frame is read from the first BD chains, wherein, the first BD chains are located at host memory
In and applied to main frame receive ancillary equipment send ether network packet during, the first BD is unavailable to ancillary equipment.Carry
Modulus block 1703, for extracting ether network packet from the corresponding cachings of the first BD.Update module 1704, for entering to the first BD
Row renewal enables the first BD unavailable to main frame and ancillary equipment is used.
Alternatively, in main frame, processing module, specifically for:When the interrupt processing for receiving ancillary equipment transmission is notified, close
Close interruption;The interruption of interruption buffer area to writing main frame is polled processing;If interrupting all interrupt processings in buffer area
Complete, open and interrupt;Wherein, interrupting buffer area includes multiple interruption cachings, and one interrupts caching and is used for one interruption of caching.
Alternatively, in main frame, processing module is used to determine to interrupt all interrupt processings in buffer area in the following way
Complete:If the interruption caching belonging to the interruption of the used index for interrupting caching and host process is interrupted in ancillary equipment write-in
Index is identical, it is determined that all interrupt processings interrupted in buffer area are completed.
Embodiment seven
Based on the inventive concept same with embodiment three, the embodiment of the present invention seven also provides a kind of for the outer of data receiver
Peripheral equipment, ancillary equipment is the ancillary equipment of main frame, as shown in figure 18, including:
Read module 1801, for reading twoth BD available to ancillary equipment from the 2nd BD chains, wherein, second
During the ether network packet that BD chains are located in host memory and sent applied to ancillary equipment Receiving Host, the 2nd BD is to master
Machine is unavailable.Writing module 1802, for extracting ether network packet from the corresponding cachings of the 2nd BD, and by the ether extracted
Network packet writes the spatial cache of the ether network packet sent for storage host.Update module 1803, for entering to the 2nd BD
Row renewal enables the 2nd BD unavailable to ancillary equipment and main frame is used.Generation module 1804, is completed if being updated for the 2nd BD,
Generation finishes receiving the interruption buffer area for interrupting and writing positioned at main frame.Notification module 1805, for notifying host process to receive
Complete to interrupt.
Alternatively, in ancillary equipment, generation module is additionally operable to, if the caching of the ether network packet sent for storage host
The free space in space does not occur the situation more than pre-set space threshold value in preset duration, and generation free space deficiency is interrupted simultaneously
Interruption buffer area of the write-in positioned at main frame;Notification module is additionally operable to, and notifies host process free space deficiency to interrupt.
Alternatively, ancillary equipment, in addition to judge module 1806, wherein:Read module is specifically for according to the 2nd BD chains
In the nearest one BD index that is read, read the current BD in the 2nd BD chains, current BD and nearest one BD being read
It is adjacent.Judge module, for judging whether current BD is available to ancillary equipment.Generation module is additionally operable to, and is judged in judge module
In the case of no, the current BD of generation is unavailable to interrupt and writes the interruption buffer area positioned at main frame.Notification module is additionally operable to, and is notified
The current BD of host process is unavailable to interrupt;And, notify the second read module to continue executing with according to nearest one in the 2nd BD chains
The index for the BD being read, the step of reading the current BD in the 2nd BD chains.Read module is additionally operable to, and is in judge module judgement
In the case of, it regard the current BD of reading as the 2nd BD.
Alternatively, in ancillary equipment, generation module is additionally operable to, if the Peripheral Component Interconnect mark between ancillary equipment and main frame
Quasi- pci bus is taken by time-out, and generation pci bus is occupied to interrupt and write the interruption buffer area positioned at main frame;Notification module
It is additionally operable to, notifies host process pci bus is occupied to interrupt.
Alternatively, in ancillary equipment, any interruption write-in of generation is being located at the interruption buffer area of main frame by generation module
When, specifically for:It is determined that the index that interruption caching is specified in buffer area is interrupted, wherein, interruption buffer area includes multiple interrupt and delayed
Deposit, an interruption is cached to be interrupted for caching one, specified interruption caches is written into interruption for nearest one in interruption buffer area
Interruption caching.According to the specified index for interrupting caching, it is determined that interrupting caching phase after interruption caching is specified and with specified
Adjacent Current interrupt caching;By any interruption write-in Current interrupt caching of generation.
Embodiment eight
Based on the inventive concept same with example IV, the embodiment of the present invention also provides a kind of master sent for data
Machine, as shown in figure 19, including:
Read module 1901, for reading twoth BD available to main frame from the 2nd BD chains, wherein, the 2nd BD chains
In host memory and applied to main frame peripheral device send ether network packet during, the 2nd BD to ancillary equipment not
It can use.Writing module 1902, for ether network packet to be write in the corresponding cachings of the 2nd BD.Update module 1903, for pair
2nd BD, which is updated, enables the 2nd BD to be used to ancillary equipment and unavailable to main frame.Processing module 1904, it is described for receiving
What ancillary equipment was sent finishes receiving interrupt notification, if the interruption being polled to is to finish receiving interruption, BD pairs of release the described 2nd
Content in the caching answered, wherein, when the interrupt processing for receiving the ancillary equipment transmission of main frame is notified, the interruption to writing main frame
The interruption of buffer area is polled processing.
Alternatively, in main frame, update module is additionally operable to:2nd BD, which is updated, to be made the message length in the 2nd BD to write
Enter the length of the ether network packet in the corresponding cachings of the 2nd BD.
Alternatively, in main frame, processing module, specifically for:When the interrupt processing for receiving ancillary equipment transmission is notified, such as
Fruit main frame is just performing peripheral interrupts processing routine, waits by peripheral interrupts processing routine poll;If main frame is not held
Row peripheral interrupts processing routine, performs following steps:The main frame is triggered into peripheral interrupts processing routine, and is closed
Close interruption;The interruption of interruption buffer area to writing main frame is polled processing;If interrupting all interrupt processings in buffer area
Complete, exit peripheral interrupts processing routine, and open interruption;Wherein, interrupting buffer area includes multiple interruption cachings, one
Interrupting caching is used to cache an interruption.
Alternatively, in main frame, processing module is used to determine to interrupt all interrupt processings in buffer area in the following way
Complete:If the interruption caching belonging to the interruption of the used index for interrupting caching and host process is interrupted in ancillary equipment write-in
Index is identical, it is determined that all interrupt processings interrupted in buffer area are completed.
Using data transmission method provided in an embodiment of the present invention and equipment, have the advantages that:Ancillary equipment can
BD is actively read from main frame, it is to avoid by main frame be ancillary equipment storage allocation space, so as to carry to a certain extent
Transmission speed, the efficiency of transmission of high ether network packet, especially under the larger scene of Ethernet message amount, the embodiment of the present invention
Effect it is more obvious.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
Claims (15)
1. a kind of data transmission method for uplink, it is characterised in that applied to the ancillary equipment of main frame, including:
First BD available to the ancillary equipment is read from the first BD chains, wherein, the first BD chains are located at described
During sending ether network packet to the main frame in host memory and applied to the ancillary equipment, the first BD is to institute
State main frame unavailable;
Ether network packet is write in the corresponding caching of the first BD, and the first BD is updated makes the first BD
It is available and unavailable to the ancillary equipment to the main frame;
Completed if the first BD updates, generation is sent completely the interruption buffer area for interrupting and writing positioned at the main frame;
Notify to be sent completely interruption described in the host process.
2. according to the method described in claim 1, it is characterised in that reading one from the first BD chains can to the ancillary equipment
First BD, is specifically included:
According to the index of the BD that nearest one is read in the first BD chains, the current BD in the first BD chains is read, it is described to work as
Preceding BD is adjacent with the nearest BD being read;
Judge whether the current BD read is available to the ancillary equipment;
Interrupt if it is not, the generation current BD is unavailable and write the interruption buffer area positioned at the main frame;Notify the main frame
Handle the unavailable interruptions of the current BD;And, the index according to the BD that nearest one is read in the first BD chains is continued executing with,
The step of reading the current BD in the first BD chains;
If so, regarding the current BD of reading as the first BD.
3. a kind of data receiver method, it is characterised in that applied to the ancillary equipment of main frame, including:
Twoth BD available to the ancillary equipment is read from the 2nd BD chains, wherein, the 2nd BD chains are located at described
During the ether network packet that the main frame is sent being received in host memory and applied to the ancillary equipment, the 2nd BD
It is unavailable to the main frame;
Ether network packet is extracted from the corresponding cachings of the 2nd BD, and the ether network packet extracted is write for storing
The spatial cache for the ether network packet that main frame is sent;
2nd BD, which is updated, to be enable the 2nd BD unavailable to the ancillary equipment and the main frame is used;
Completed if the 2nd BD updates, generation finishes receiving the interruption buffer area for interrupting and writing positioned at the main frame;
Notify to finish receiving interruption described in the host process.
4. method according to claim 3, it is characterised in that reading one from the 2nd BD chains can to the ancillary equipment
2nd BD, is specifically included:
According to the index of the BD that nearest one is read in the 2nd BD chains, the current BD in the 2nd BD chains is read, it is described to work as
Preceding BD is adjacent with the nearest BD being read;
Judge whether the current BD is available to the ancillary equipment;
If it is not, generating, current BD is unavailable to interrupt and writes the interruption buffer area positioned at the main frame;Notify the host process
The current BD is unavailable to interrupt;And, the index according to the BD that nearest one is read in the 2nd BD chains is continued executing with, is read
The step of current BD in the 2nd BD chains
If so, regarding the current BD of reading as the 2nd BD.
5. according to any described methods of claim 1-4, it is characterised in that any interruption to generation, by the generation
Any interruption buffer area for interrupting write-in positioned at the main frame, is specifically included:
The index for specifying interruption to cache in the interruption buffer area is determined, wherein, the interruption buffer area includes multiple interrupt and delayed
Deposit, one interrupts caching and is used to cache an interruption, and the specified caching that interrupts is a nearest quilt in the interruption buffer area
The interruption caching that write-in is interrupted;
According to the index of the specified interruption caching, it is determined that after the specified interruption caching and slow with the specified interruption
Deposit adjacent Current interrupt caching;
Any interruption of the generation is write into the Current interrupt caching.
6. a kind of data receiver method, it is characterised in that applied to main frame, including:
When receiving the interrupt processing that the ancillary equipment of the main frame sends and notifying, the interruption buffer area to writing the main frame
Interruption is polled processing;
If the interruption being currently polled to is is sent completely interruption, one available to the main frame first is read from the first BD chains
BD, wherein, the first BD chains are located in the host memory and receive what the ancillary equipment was sent applied to the main frame
During ether network packet, the first BD is unavailable to the ancillary equipment;
Ether network packet is extracted from the corresponding cachings of the first BD, and the first BD is updated makes the first BD
It is unavailable to the main frame and available to the ancillary equipment.
7. a kind of data transmission method for uplink, it is characterised in that applied to main frame, including:
Twoth BD available to the main frame is read from the 2nd BD chains, wherein, the 2nd BD chains are located at the main frame
During sending ether network packet to the ancillary equipment in internal memory and applied to the main frame, the 2nd BD is to described outer
Peripheral equipment is unavailable;
Ether network packet is write in the corresponding caching of the 2nd BD, and the 2nd BD is updated makes the 2nd BD
It is available and unavailable to the main frame to the ancillary equipment;And
Receive the ancillary equipment transmission finishes receiving interrupt notification, if the interruption being polled to discharges to finish receiving interruption
Content in the corresponding caching of 2nd BD, wherein, when receiving the interrupt processing that the ancillary equipment of the main frame sends and notifying,
The interruption of interruption buffer area to writing the main frame is polled processing.
8. according to any described methods of claim 6-7, it is characterised in that receive the ancillary equipment transmission of the main frame
When interrupt processing is notified, processing is polled to writing the interruption of interruption buffer area of the main frame, is specifically included:
When receiving the interrupt processing notice that the ancillary equipment is sent, if the main frame is just performing peripheral interrupts processing
Program, is waited by the peripheral interrupts processing routine poll;
If the main frame is not carried out peripheral interrupts processing routine, following steps are performed:
The main frame is triggered into the peripheral interrupts processing routine, and closes interruption;
The interruption of interruption buffer area to writing the main frame is polled processing;
If all interrupt processings interrupted in buffer area are completed, the peripheral interrupts processing routine is exited, and open
Interrupt;
Wherein, the interruption buffer area includes multiple interruption cachings, and one interrupts caching and is used for one interruption of caching.
9. according to any described methods of claim 6-7, it is characterised in that determine all interruptions in the interruption buffer area
Processing is completed, and is specifically included:
If in being interrupted used in the ancillary equipment write-in interruption belonging to the index of caching and the interruption of the host process
The index of disconnected caching is identical, determines that all interrupt processings in the interruption buffer area are completed.
10. a kind of ancillary equipment sent for data, it is characterised in that the ancillary equipment is the ancillary equipment of main frame, bag
Include:
Read module, for reading first BD available to the ancillary equipment from the first BD chains, wherein, described first
During BD chains are located in the host memory and send ether network packet to the main frame applied to the ancillary equipment, institute
State the first BD unavailable to the main frame;
Writing module, for ether network packet to be write in the corresponding cachings of the first BD;
Update module, enables the first BD to be used and be set to the periphery to the main frame for being updated to the first BD
It is standby unavailable;
Generation module, is completed if being updated for the first BD, and generation, which is sent completely, to be interrupted and write in the main frame
Disconnected buffer area;
Notification module, for notifying to be sent completely interruption described in the host process.
11. a kind of ancillary equipment for data receiver, it is characterised in that the ancillary equipment is the ancillary equipment of main frame, bag
Include:
Read module, for reading twoth BD available to the ancillary equipment from the 2nd BD chains, wherein, described second
BD chains are located in the host memory and the process for the ether network packet that the main frame is sent are received applied to the ancillary equipment
In, the 2nd BD is unavailable to the main frame;
Writing module, for extracting ether network packet from the corresponding cachings of the 2nd BD, and by the Ethernet report extracted
Text writes the spatial cache of the ether network packet sent for storage host;
Update module, makes the 2nd BD unavailable to the ancillary equipment and to described for being updated to the 2nd BD
Main frame can use;
Generation module, is completed if being updated for the 2nd BD, and generation, which is finished receiving, to be interrupted and write in the main frame
Disconnected buffer area;
Notification module, for notifying to finish receiving interruption described in the host process.
12. a kind of main frame for data receiver, it is characterised in that including:
Processing module, when being notified for receiving the interrupt processing that the ancillary equipment of the main frame is sent, to writing the main frame
The interruption of interruption buffer area be polled processing;
Read module, if being to be sent completely interruption for the interruption that the processing module is currently polled to, reads from the first BD chains
First BD available to the main frame is taken, wherein, the first BD chains are located in the host memory and applied to described
During main frame receives the ether network packet that the ancillary equipment is sent, the first BD is unavailable to the ancillary equipment;
Extraction module, for extracting ether network packet from the corresponding cachings of the first BD;
Update module, makes the first BD unavailable to the main frame and to the periphery for being updated to the first BD
Equipment can use.
13. a kind of main frame sent for data, it is characterised in that including:
Read module, for reading twoth BD available to the main frame from the 2nd BD chains, wherein, the 2nd BD chains
During ether network packet being sent in the host memory and applied to the main frame to the ancillary equipment, described the
Two BD are unavailable to the ancillary equipment;
Writing module, for ether network packet to be write in the corresponding cachings of the 2nd BD;
Update module, enables the 2nd BD to be used to the ancillary equipment and to the master for being updated to the 2nd BD
Machine is unavailable;
Processing module, interrupt notification is finished receiving for receive that the ancillary equipment sends, if the interruption being polled to is receives
Complete to interrupt, discharge content in the corresponding cachings of the 2nd BD, wherein, in the ancillary equipment transmission for receiving the main frame
When disconnected processing is notified, processing is polled to writing the interruption of interruption buffer area of the main frame.
14. according to any described main frames of claim 12-13, it is characterised in that the processing module, specifically for:
When receiving the interrupt processing notice that the ancillary equipment is sent, if the main frame is just performing peripheral interrupts processing
Program, is waited by the peripheral interrupts processing routine poll;
If the main frame is not carried out peripheral interrupts processing routine, following steps are performed:
The main frame is triggered into the peripheral interrupts processing routine, and closes interruption;
The interruption of interruption buffer area to writing the main frame is polled processing;
If all interrupt processings interrupted in buffer area are completed, the peripheral interrupts processing routine is exited, and open
Interrupt;
Wherein, the interruption buffer area includes multiple interruption cachings, and one interrupts caching and is used for one interruption of caching.
15. according to any described main frames of claim 12-13, it is characterised in that the processing module is used for using such as lower section
Formula determines that all interrupt processings in the interruption buffer area are completed:
If in being interrupted used in the ancillary equipment write-in interruption belonging to the index of caching and the interruption of the host process
The index of disconnected caching is identical, determines that all interrupt processings in the interruption buffer area are completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174539.2A CN106982176B (en) | 2017-03-22 | 2017-03-22 | Data transmission method and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174539.2A CN106982176B (en) | 2017-03-22 | 2017-03-22 | Data transmission method and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106982176A true CN106982176A (en) | 2017-07-25 |
CN106982176B CN106982176B (en) | 2020-09-11 |
Family
ID=59339539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710174539.2A Active CN106982176B (en) | 2017-03-22 | 2017-03-22 | Data transmission method and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106982176B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532205A (en) * | 2019-07-17 | 2019-12-03 | 浙江大华技术股份有限公司 | Data transmission method, device, computer equipment and computer readable storage medium |
CN110784289A (en) * | 2019-10-31 | 2020-02-11 | 海光信息技术有限公司 | Data retransmission method and data retransmission device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101094183A (en) * | 2007-07-25 | 2007-12-26 | 杭州华三通信技术有限公司 | Buffer memory management method and device |
CN101158930A (en) * | 2007-11-19 | 2008-04-09 | 中兴通讯股份有限公司 | Method and device for external controlling DMA controller |
CN101202707A (en) * | 2007-12-03 | 2008-06-18 | 杭州华三通信技术有限公司 | Method for transmitting message of high speed single board, field programmable gate array and high speed single board |
CN101222430A (en) * | 2008-01-24 | 2008-07-16 | 中兴通讯股份有限公司 | High-speed multi-protocol data transmission system and method |
CN103685068A (en) * | 2013-12-06 | 2014-03-26 | 杭州华三通信技术有限公司 | Method and device for maintaining receiving BD array |
US20150281109A1 (en) * | 2014-03-30 | 2015-10-01 | Sachin Saxena | System for en-queuing and de-queuing data packets in communication network |
-
2017
- 2017-03-22 CN CN201710174539.2A patent/CN106982176B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101094183A (en) * | 2007-07-25 | 2007-12-26 | 杭州华三通信技术有限公司 | Buffer memory management method and device |
CN101158930A (en) * | 2007-11-19 | 2008-04-09 | 中兴通讯股份有限公司 | Method and device for external controlling DMA controller |
CN101202707A (en) * | 2007-12-03 | 2008-06-18 | 杭州华三通信技术有限公司 | Method for transmitting message of high speed single board, field programmable gate array and high speed single board |
CN101222430A (en) * | 2008-01-24 | 2008-07-16 | 中兴通讯股份有限公司 | High-speed multi-protocol data transmission system and method |
CN103685068A (en) * | 2013-12-06 | 2014-03-26 | 杭州华三通信技术有限公司 | Method and device for maintaining receiving BD array |
US20150281109A1 (en) * | 2014-03-30 | 2015-10-01 | Sachin Saxena | System for en-queuing and de-queuing data packets in communication network |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532205A (en) * | 2019-07-17 | 2019-12-03 | 浙江大华技术股份有限公司 | Data transmission method, device, computer equipment and computer readable storage medium |
CN110784289A (en) * | 2019-10-31 | 2020-02-11 | 海光信息技术有限公司 | Data retransmission method and data retransmission device |
CN110784289B (en) * | 2019-10-31 | 2022-04-05 | 海光信息技术股份有限公司 | Data retransmission method and data retransmission device |
Also Published As
Publication number | Publication date |
---|---|
CN106982176B (en) | 2020-09-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107209724B (en) | Data processing method, memory management unit and memory control equipment | |
CN104111870B (en) | Interrupt processing device and method | |
CN101000596A (en) | Chip and communication method of implementing communicating between multi-kernel in chip and communication method | |
JP2011024209A5 (en) | ||
CN106326145A (en) | Control method and device for memory | |
CN108829613A (en) | Date storage method and storage equipment | |
CN103064807A (en) | Multi-channel direct memory access controller | |
CN101877666B (en) | Method and device for receiving multi-application program message based on zero copy mode | |
CN106982176A (en) | A kind of data transmission method and equipment | |
CN103841562B (en) | A kind of time interval resource takes processing method and processing device | |
CN109558348A (en) | Data-moving method, apparatus and system | |
CN105095104B (en) | Data buffer storage processing method and processing device | |
CN113590512A (en) | Self-starting DMA device capable of directly connecting peripheral equipment and application | |
CN104363581B (en) | A kind of the determination method and relevant device of associated terminal | |
CN102833088B (en) | A kind of interruption processing method and device | |
CN112040001A (en) | Request processing method and device based on distributed storage | |
US10482027B2 (en) | Cache management method and apparatus | |
CN103885900B (en) | Data access processing method, PCIe device and user equipment | |
CN108132811A (en) | A kind of loading method and device of FPGA program datas | |
CN106535353A (en) | Random backoff method and device | |
CN104394099B (en) | A kind of message transmitting method and device | |
US9483428B2 (en) | Storage apparatus, and system and method for executing access operations | |
CN107861895B (en) | Programmable input and output PIO based on distributed arbitration program writes merging device and method | |
CN106202374A (en) | A kind of data processing method and device | |
JP2005293427A (en) | Data transfer processing apparatus and data transfer processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |