CN102185770A - Multi-core-architecture-based batch message transmitting and receiving method - Google Patents
Multi-core-architecture-based batch message transmitting and receiving method Download PDFInfo
- Publication number
- CN102185770A CN102185770A CN2011101151946A CN201110115194A CN102185770A CN 102185770 A CN102185770 A CN 102185770A CN 2011101151946 A CN2011101151946 A CN 2011101151946A CN 201110115194 A CN201110115194 A CN 201110115194A CN 102185770 A CN102185770 A CN 102185770A
- Authority
- CN
- China
- Prior art keywords
- identification information
- message
- formation
- buffer
- buffer memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a multi-core-architecture-based batch message transmitting and receiving method, which relates to the technical field of data communication. The method comprises the following steps of: 1, calling a network adaptor driver transmission function by using an upper-layer protocol stack; 2, caching the identification information of messages to be transmitted to a transmitted message caching queue by using the function, and starting a timer, wherein the amount of the identification information in the queue is progressively increased; 3, detecting the amount of the identification information in the queue by using the network adaptor driver transmission function, turning to the step 4 if the amount of the identification information is more than or equal to a preset value, otherwise quitting the network adaptor driver transmission function and turning to the step 5; 4, transmitting the messages corresponding to the identification information in the queue, clearing the amount of the cached identification information, and stopping the timer; and 5, judging whether the timer expires, turning to the step 4 if the timer is judged to expire, otherwise performing circular waiting. In the method, the messages are transmitted in batches so as to reduce times for fighting for a bus by the transmission of a network adaptor, further increase the bus use probability of the bus in the reception of the network adaptor and improve the message receiving capability and system throughput of a system.
Description
Technical field
The present invention relates to data communication technology field, particularly a kind of batch type packet sending and receiving method based on multicore architecture.
Background technology
Data communications equipment with the reception of data message, handle, be sent as main handling process, the receiving ability of message, disposal ability, transmitting capacity have comprehensively determined the throughput of system, and possess the wooden barrel effect, the shortest plate has determined throughput of system.Under the monokaryon system, disposal ability becomes short slab usually.Multiple nucleus system is compared the disposal ability that has improved whole system with the monokaryon system, and can support a plurality of network interface cards simultaneously.
The throughput of multiple nucleus system is determined comprehensively by receiving ability, disposal ability, transmitting capacity that also its short slab is the receiving ability of message, and promptly throughput of system is determined by receiving ability.At present, message sends one by one in the multiple nucleus system, and each transmit a request to and reaches network interface card, all can increase the intention that network interface card is attempted contention bus.Below be to influence the factor that message receives:
1, message copies internal memory to from network interface card hardware cache district;
2, message sends the contention to memory bus bandwidth;
3, to the timely distribution of internal memory buffer area message;
4, from the kernel state memory copying to user's attitude application program internal memory.
Therefore, the throughput of system that improve multiple nucleus system must improve the message receiving ability of multiple nucleus system.
How improving the message receiving ability becomes the key of elevator system throughput.
Main 1~3 point of analyzing, the 4th has different manifestations in different operating system and system's realization, some operating system is not distinguished kernel state internal memory and user's attitude internal memory, even in the system of distinguishing kernel state and user's attitude, also have method to avoid message to copy user's attitude to, and the logical product protocol stack of logarithm all is self-defined realization usually, needn't depends on the operating system protocol stack from kernel state, so the 4th is not problem, not impact analysis.
1, have only could be by software processes after depositing internal memory in through DMA (Direct Memory Access) interface for the message that enters network interface card hardware cache district, so this is first key point that improves receiving ability, the factor that influences this point mainly is the contentions of other elements to memory bus bandwidth.It is strong contender to memory bus bandwidth that message sends.So the contention that the reduction message sends memory bus bandwidth is first task that improves receiving ability.
2 and the 1st description similar.
3, have only the message to memory field buffer memory in time to clean out, subsequent packet just can enter.The factor that influences this point relates to software efficiency, thread scheduling, buffer size or the like.Experimental results show that, certain at buffer area, under software efficiency one stable condition, scheduling receiving thread as much as possible allows receiving thread occupy the more cpu time and still can't improve receiving ability, because message is to enter internal memory in batches, thread does not have message, message when idle and possibly can't in time be handled (not scheduling has in time perhaps been dispatched but batch is too big), cause the message accumulation, bigger buffer area also has the time of overflowing.So it is necessary improving the efficient of receiving software, but the end is always arranged when improved efficiency, key is that once to enter the message of internal memory too big with respect to receiving ability in batches.So reduce the once message that enters internal memory of network interface card in right amount is second task that improves receiving ability in batches.
Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is: how to improve the message receiving ability with the elevator system throughput.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides a kind of batch type packet sending and receiving method based on multicore architecture, may further comprise the steps:
S1: the upper-layer protocol stack calls network interface card and drives the transmission function;
S2: described network interface card drive send function with the identification information buffer memory of message to be sent to sending the packet buffer formation, the identification information number of described transmission packet buffer formation buffer memory increases progressively, and described identification information comprises: the pointer of the address of message to be sent and message descriptor;
S3: described network interface card driving transmission function detects the identification information number in the formation of described transmission packet buffer, if the identification information number of buffer memory then changes step S4, otherwise do not send more than or equal to predetermined value;
S4: send the message to be sent of all identification information correspondences of buffer memory in the formation of described transmission packet buffer, and the identification information number of buffer memory is returned 0, change step S2.
Wherein, when receiving the identification information of first message, also comprise the step that starts timer among the described step S2;
Among the described step S3 if the identification information number that sends buffer memory in the packet buffer formation less than described predetermined value, and timer expiry then changes step S4, otherwise circular wait;
After described step S4 sent the message of identification information correspondence of buffer memory in the packet buffer formation, timer resetted.
Wherein, during execution in step S2, do not send the packet buffer formation, then set up earlier and send the packet buffer formation, and the identification information number of buffer memory is set to 0 if do not exist.
Wherein, described transmission packet buffer queue size is total size of the identification information of 1~n message to be sent, and described predetermined value is smaller or equal to sending the packet buffer queue size.
Wherein, described n is to be arbitrarily the value of 2 power in 1 to 256.
(3) beneficial effect
The mode of the present invention by the transmission message in the multiple nucleus system being taked send in batches, disposable batch is mapped to network interface card, compare with message of each transmission, send the number of times that message has reduced network interface card transmission contention bus in batches, thereby increased the use probability of network interface card reception, improved the message receiving ability and the throughput of system of system bus.
Description of drawings
Fig. 1 is a kind of batch type packet sending and receiving method flow diagram based on multicore architecture of the embodiment of the invention;
Fig. 2 is the batch type packet sending and receiving method flow diagram of the another kind of the embodiment of the invention based on multicore architecture.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used to illustrate the present invention, but are not used for limiting the scope of the invention.
Embodiment 1
The realization of the inventive method is positioned at the Ethernet card driver, needs to revise NIC driver.At first this paper method drives initialization flow process end at network interface card, sets up one and sends the packet buffer formation, and the identification information that is used for caching protocol stack request transmission message (specifically refers to: the pointer of the address of message to be sent and message descriptor).Revise NIC driver and send function, will directly send and change transmissions of having ready conditions into, condition 1: in the formation of transmission packet buffer buffer memory the identification information of message to be sent of scheduled volume, this scheduled volume is determined according to the test of concrete system, usually can select 16,64,128 etc.
As shown in Figure 1, the batch type packet sending and receiving method based on multicore architecture of the present invention comprises:
Step S201, upper-layer protocol stack call network interface card and drive the transmission function.
Step S202, network interface card drive to send function with the identification information buffer memory of message to be sent to sending the packet buffer formation, the identification information number that sends packet buffer formation buffer memory increases progressively.Before this, do not send the packet buffer formation if create, then create sending the packet buffer formation, its size is total size of the identification information of 1~n message to be sent, and the identification information number of buffer memory is set to 0, and the preferred value of n is: the value that in 1 to 256 is 2 power arbitrarily.
Step S103, network interface card driving transmission function detects the identification information number in the formation of described transmission packet buffer, if the identification information number of buffer memory then changes step S4, otherwise do not send more than or equal to predetermined value;
Step S104 sends the message to be sent of all identification information correspondences of buffer memory in the formation of described transmission packet buffer, and the identification information number of buffer memory is returned 0, changes step S2.
The present invention increases and sends size in batches, and the identification information of the message that the upper layer software (applications) request is sent is joined the team, and saves bit by bit the literary composition to be transmitted messages of some, and disposable batch is mapped to network interface card, because nearly all network interface card commonly used is all supported to send in batches.Compare with message of each transmission, send the number of times that has reduced network interface card transmission contention bus in batches, this is to be based upon network interface card to send on the actual high efficiency certainly.So naturally, increased the use probability of network interface card reception to bus.It is from circuit the message bit stream to be cached to card to go up the buffer memory that network interface card receives, wait for then bus idle opportunity with the message batch DMA of buffer memory to internal memory.
Embodiment 2
Further, meet the following conditions 2 during transmission:
Condition 2: timer expiry, the effect of this timer be, avoids not sending for a long time request, and condition 1 can't satisfy for a long time, and the message that causes being buffered in the identification information correspondence in the formation can't send.
As shown in Figure 2, the batch type packet sending and receiving method based on multicore architecture of the present invention comprises:
Step S201, upper-layer protocol stack call network interface card and drive the transmission function.
Step S202, network interface card drive to send function with the identification information buffer memory of message to be sent to sending the packet buffer formation, the identification information number that sends packet buffer formation buffer memory increases progressively, and starts timer.Before this, do not send the packet buffer formation if create, then create sending the packet buffer formation, its size is total size of the identification information of 1~n message to be sent, and the identification information number of buffer memory is set to 0, and the preferred value of n is: the value that in 1 to 256 is 2 power arbitrarily.
Step S203, described network interface card drive the transmission function and detect the identification information number that sends buffer memory in the packet buffer formation, if the identification information number of buffer memory then changes step S204 greater than predetermined value, drive the transmission function otherwise withdraw from network interface card, change step S205.This predetermined value is determined according to the test of concrete system, can select 16,64,128 etc. usually, but smaller or equal to the size that sends the packet buffer formation.
Step S204 starts the message to be sent of all identification information correspondences of buffer memory in hardware (network interface card) transmit queue, and the identification information number of buffer memory is returned 0, and the timer that resets;
Step S205 judges whether timer is overtime, if overtime, then changes step S204, otherwise circular wait.Timer is provided with the time can be definite according to the task amount and the network condition of current transmitting-receiving message.
On the basis of embodiment 1, increased timer in the step 2, avoid not sending for a long time request, condition 1 can't satisfy for a long time, causes being buffered in the situation that the message of the identification information correspondence in the formation can't send.
Above execution mode only is used to illustrate the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make various variations and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.
Claims (5)
1. the batch type packet sending and receiving method based on multicore architecture is characterized in that, may further comprise the steps:
S1: the upper-layer protocol stack calls network interface card and drives the transmission function;
S2: described network interface card drive send function with the identification information buffer memory of message to be sent to sending the packet buffer formation, the identification information number of described transmission packet buffer formation buffer memory increases progressively, and described identification information comprises: the pointer of the address of message to be sent and message descriptor;
S3: described network interface card driving transmission function detects the identification information number in the formation of described transmission packet buffer, if the identification information number of buffer memory then changes step S4, otherwise do not send more than or equal to predetermined value;
S4: send the message to be sent of all identification information correspondences of buffer memory in the formation of described transmission packet buffer, and the identification information number of buffer memory is returned 0, change step S2.
2. the batch type packet sending and receiving method based on multicore architecture as claimed in claim 1 is characterized in that, when receiving the identification information of first message, also comprises the step that starts timer among the described step S2;
Among the described step S3 if the identification information number that sends buffer memory in the packet buffer formation less than described predetermined value, and timer expiry then changes step S4, otherwise circular wait;
After described step S4 sent the message of identification information correspondence of buffer memory in the packet buffer formation, timer resetted.
3. the batch type packet sending and receiving method based on multicore architecture as claimed in claim 1 or 2 is characterized in that, during execution in step S2, does not send the packet buffer formation if do not exist, and then set up earlier and send the packet buffer formation, and the identification information number of buffer memory is set to 0.
4. as each described batch type packet sending and receiving method in the claim 1~3 based on multicore architecture, it is characterized in that, described transmission packet buffer queue size is total size of the identification information of 1~n message to be sent, and described predetermined value is smaller or equal to sending the packet buffer queue size.
5. the batch type packet sending and receiving method based on multicore architecture as claimed in claim 4 is characterized in that, described n is to be arbitrarily the value of 2 power in 1 to 256.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011101151946A CN102185770A (en) | 2011-05-05 | 2011-05-05 | Multi-core-architecture-based batch message transmitting and receiving method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011101151946A CN102185770A (en) | 2011-05-05 | 2011-05-05 | Multi-core-architecture-based batch message transmitting and receiving method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102185770A true CN102185770A (en) | 2011-09-14 |
Family
ID=44571841
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011101151946A Pending CN102185770A (en) | 2011-05-05 | 2011-05-05 | Multi-core-architecture-based batch message transmitting and receiving method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102185770A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104064018A (en) * | 2014-06-26 | 2014-09-24 | 广东互维科技有限公司 | Transmission method for environmental-quantity data |
CN104685852A (en) * | 2012-09-19 | 2015-06-03 | 甲骨文国际公司 | System and method for small batching processing of usage requests |
CN104753813A (en) * | 2013-12-27 | 2015-07-01 | 国家计算机网络与信息安全管理中心 | DMA (Direct Memory Access) message transfer method |
WO2015109708A1 (en) * | 2014-01-24 | 2015-07-30 | 中兴通讯股份有限公司 | Data packet processing method and device, and server |
CN106130891A (en) * | 2016-07-07 | 2016-11-16 | 汉柏科技有限公司 | A kind of multi-core network device sends the method and device of message |
WO2016202120A1 (en) * | 2015-06-17 | 2016-12-22 | 深圳市中兴微电子技术有限公司 | Queue storage space management method and device, and computer storage medium |
CN111277514A (en) * | 2020-01-21 | 2020-06-12 | 新华三技术有限公司合肥分公司 | Message queue distribution method, message forwarding method and related device |
CN112702173A (en) * | 2020-12-23 | 2021-04-23 | 上海芯钛信息科技有限公司 | Method for realizing high-speed cryptographic operation of vehicle-mounted communication gateway based on batch operation mechanism |
CN113535425A (en) * | 2021-06-16 | 2021-10-22 | 南京南瑞继保电气有限公司 | Data sending method and device, electronic equipment and storage medium |
CN113676421A (en) * | 2021-10-25 | 2021-11-19 | 之江实验室 | Multi-port network message receiving and transmitting method based on PCIe |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101013383A (en) * | 2007-02-13 | 2007-08-08 | 杭州华为三康技术有限公司 | System and method for implementing packet combined treatment by multi-core CPU |
CN101030943A (en) * | 2007-04-03 | 2007-09-05 | 华为技术有限公司 | Method for transmitting message and route |
CN101719063A (en) * | 2009-10-30 | 2010-06-02 | 曙光信息产业(北京)有限公司 | Software interface realizing method and device with zero-copy function |
CN101719872A (en) * | 2009-12-11 | 2010-06-02 | 曙光信息产业(北京)有限公司 | Zero-copy mode based method and device for sending and receiving multi-queue messages |
CN101841476A (en) * | 2010-04-22 | 2010-09-22 | 北京星网锐捷网络技术有限公司 | Message processing method, device and network equipment |
CN102006243A (en) * | 2010-12-28 | 2011-04-06 | 汉柏科技有限公司 | Method for sending congestion messages |
CN102025789A (en) * | 2009-09-17 | 2011-04-20 | 中兴通讯股份有限公司 | Address mapping maintenance method and address mapping system |
-
2011
- 2011-05-05 CN CN2011101151946A patent/CN102185770A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101013383A (en) * | 2007-02-13 | 2007-08-08 | 杭州华为三康技术有限公司 | System and method for implementing packet combined treatment by multi-core CPU |
CN101030943A (en) * | 2007-04-03 | 2007-09-05 | 华为技术有限公司 | Method for transmitting message and route |
CN102025789A (en) * | 2009-09-17 | 2011-04-20 | 中兴通讯股份有限公司 | Address mapping maintenance method and address mapping system |
CN101719063A (en) * | 2009-10-30 | 2010-06-02 | 曙光信息产业(北京)有限公司 | Software interface realizing method and device with zero-copy function |
CN101719872A (en) * | 2009-12-11 | 2010-06-02 | 曙光信息产业(北京)有限公司 | Zero-copy mode based method and device for sending and receiving multi-queue messages |
CN101841476A (en) * | 2010-04-22 | 2010-09-22 | 北京星网锐捷网络技术有限公司 | Message processing method, device and network equipment |
CN102006243A (en) * | 2010-12-28 | 2011-04-06 | 汉柏科技有限公司 | Method for sending congestion messages |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104685852A (en) * | 2012-09-19 | 2015-06-03 | 甲骨文国际公司 | System and method for small batching processing of usage requests |
CN104685852B (en) * | 2012-09-19 | 2018-07-10 | 甲骨文国际公司 | For using the system and method for the small batch processing of request |
CN104753813B (en) * | 2013-12-27 | 2018-03-16 | 国家计算机网络与信息安全管理中心 | The method that DMA transmits message |
CN104753813A (en) * | 2013-12-27 | 2015-07-01 | 国家计算机网络与信息安全管理中心 | DMA (Direct Memory Access) message transfer method |
WO2015109708A1 (en) * | 2014-01-24 | 2015-07-30 | 中兴通讯股份有限公司 | Data packet processing method and device, and server |
CN104064018A (en) * | 2014-06-26 | 2014-09-24 | 广东互维科技有限公司 | Transmission method for environmental-quantity data |
WO2016202120A1 (en) * | 2015-06-17 | 2016-12-22 | 深圳市中兴微电子技术有限公司 | Queue storage space management method and device, and computer storage medium |
CN106130891A (en) * | 2016-07-07 | 2016-11-16 | 汉柏科技有限公司 | A kind of multi-core network device sends the method and device of message |
CN111277514A (en) * | 2020-01-21 | 2020-06-12 | 新华三技术有限公司合肥分公司 | Message queue distribution method, message forwarding method and related device |
CN112702173A (en) * | 2020-12-23 | 2021-04-23 | 上海芯钛信息科技有限公司 | Method for realizing high-speed cryptographic operation of vehicle-mounted communication gateway based on batch operation mechanism |
CN112702173B (en) * | 2020-12-23 | 2023-11-10 | 上海芯钛信息科技有限公司 | Method for realizing high-speed password operation of vehicle-mounted communication gateway based on batch operation mechanism |
CN113535425A (en) * | 2021-06-16 | 2021-10-22 | 南京南瑞继保电气有限公司 | Data sending method and device, electronic equipment and storage medium |
CN113676421A (en) * | 2021-10-25 | 2021-11-19 | 之江实验室 | Multi-port network message receiving and transmitting method based on PCIe |
CN113676421B (en) * | 2021-10-25 | 2022-01-28 | 之江实验室 | Multi-port network message receiving and transmitting method based on PCIe |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102185770A (en) | Multi-core-architecture-based batch message transmitting and receiving method | |
US9374425B2 (en) | Behavior based client selection for disparate treatment | |
EP2552081A2 (en) | Interrupt management | |
CN102891809B (en) | Multi-core network device message presses interface order-preserving method and system | |
CN109408243B (en) | RDMA-based data processing method, device and medium | |
CN101335694B (en) | Interrupt handling method and system | |
CN104408110B (en) | The method, apparatus and system of request of data | |
CN108429703B (en) | DHCP client-side online method and device | |
CN1908925A (en) | Method for improving PCI communication credibility and efficiency | |
CN101841476A (en) | Message processing method, device and network equipment | |
CN102200770B (en) | Information interactive system and method based on PCI (Peripheral Component Interconnect) and upper computer | |
WO2012079352A1 (en) | Method and system for managing multiple network element devices | |
CN106547566A (en) | Communications service process pool management method and system | |
CN104683460B (en) | A kind of communication means of Internet of Things, device and server | |
CN104486187B (en) | A kind of CAN communication device and method of dynamic synchronization | |
CN101442439A (en) | Method for reporting interruption and PCI bus system | |
CN108984321A (en) | A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication | |
WO2011153860A1 (en) | Method, apparatus and core network entity for processing network congestion | |
CN110022218B (en) | Multicast communication method, terminal device and storage medium | |
CN101631353B (en) | Method and device for managing status packet data unit | |
CN102117261B (en) | Communication method between inner processors of chip | |
CN103617023A (en) | Method and device for recycling system garbage resources | |
CN101494569B (en) | Method and apparatus for processing message | |
US8869171B2 (en) | Low-latency communications | |
CN110865891B (en) | Asynchronous message arrangement method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20110914 |