CN105164980A - Method and system for distributing network data in many-core processor - Google Patents

Method and system for distributing network data in many-core processor Download PDF

Info

Publication number
CN105164980A
CN105164980A CN201480000856.7A CN201480000856A CN105164980A CN 105164980 A CN105164980 A CN 105164980A CN 201480000856 A CN201480000856 A CN 201480000856A CN 105164980 A CN105164980 A CN 105164980A
Authority
CN
China
Prior art keywords
host system
flow table
state
flow
core
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
Application number
CN201480000856.7A
Other languages
Chinese (zh)
Other versions
CN105164980B (en
Inventor
唐继元
王伟
蔡毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN105164980A publication Critical patent/CN105164980A/en
Application granted granted Critical
Publication of CN105164980B publication Critical patent/CN105164980B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention applies to the technical field of communications, and provides a method and apparatus for distributing network data in a many-core processor. The method comprises a host system maintains a traffic table of a network card, the traffic table of the network card being stored in an independent memory block of the network card; the memory area of the traffic table in the host system maps to the independent memory block through a direct memory access DMA controller in the host system; after the DMA controller detects that the traffic table in the memory of the host system has been changed, the changed traffic table in the memory of the host system is mapped to the independent memory of the network card in order to finish the maintenance of the traffic table of the network card; and the host system is forbidden to send traffic table maintenance commands to the network card. The technical solution provided by the present invention has the advantages of less interaction costs and improving network throughput.

Description

Method and system for distributing network data under many cores Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method and a system for distributing network data under many cores.
Background
The rapid development of network communication technology promotes the continuous increase of network bandwidth and flow, and the experience rule shows that: 1Mbps network data requires 1MHz CPU processing capacity, when gigabit and more than ten million networks appear, the network data protocol processing occupies a large amount of CPU computing time, and the processing capacity of the network protocol stack gradually becomes the bottleneck of the overall performance of the system. With the advent of 10Gbps network adapters, a single-core CPU cannot completely meet the requirements of network cards, so that the CPU develops towards multi-core and many-core.
For the many-core direction, it is natural to consider the parallelism of the CPU, however, using many-core to improve throughput through a single, shared queue requires a software locking mechanism that can lead to inefficiencies. In order to improve the efficiency, RSS (received side scaling, Chinese: receiving end extension) is introduced to be commonly called as a multi-queue network card technology, and each queue can be bound to different cores in many cores through interruption by the support of multi-queue network card driving so as to meet the requirement of the network card. However, RSS has the following disadvantages: data cannot be guaranteed to be distributed to the core where the application program is located; the software partitioning technology cannot be matched; it cannot cooperate with OS (operating system, Chinese) scheduling and load balancing. In order to make up for the defects of the RSS, a guide Flow table (Flow directorTable) is introduced into the multi-queue network card, the guide Flow table is specially used for recording the corresponding relation between the network Flow and the CPU where the application is located, and the multi-queue network card firstly performs guide Flow table matching and then performs RSS distribution. The guide flow table is located in a network card memory and is a hash (Chinese: hash) table, each table entry corresponds to a filter, the RXPacket can be transmitted to a corresponding hardware queue through the matched filter, and the hash table can contain 8 k-32 k of table entries. The addition, deletion and update operations of the table entries in the flow table are all responsible for the network card, a host system (an application program or an OS) sends a request to the network card through a register interface of the multi-queue network card, and the network card returns an operation result to the host system after completing the relevant operations.
In the technical scheme for realizing the prior art, the following technical problems are found in the prior art:
the interaction overhead between the host system and the network card is large; for example, a driver of the network card cannot delete a single entry in the flow table, because the driver cannot sense whether the connection of the single entry is in an active state; the driver needs to periodically flush the whole flow table, and the test result shows that it takes 80000 cycles (about 40 us) for the driver to schedule the kernel to run flush operation, and additionally, it takes 70000 cycles (about 35 us) for the whole flow table of flush. If the driver of the network card does not adopt the policy of periodically flushing the whole flow table, it also needs to spend a lot of time to periodically confirm whether each entry in the flow table is in the activated state, so as to delete the filter corresponding to the entry which is in the inactivated state for a long time from the flow table.
Technical problem
The embodiment of the invention provides a method for distributing network data under many cores, which aims to solve the problem of high interaction overhead between a host system and a network card in the prior art.
Technical solution
In a first aspect, a method for distributing data of a many-core network includes:
the host system maintains a flow table of the network card, and the flow table of the network card is stored in an independent memory block in the network card;
the memory area of the flow table in the host system and the independent memory block form mapping through a Direct Memory Access (DMA) controller in the host system;
after the DMA controller detects that the flow table of the memory of the host system is changed, the changed flow table of the memory of the host system is mapped into the independent memory of the network card so as to complete the maintenance of the flow table of the network card; and the host system prohibits sending the flow table maintenance command to the network card.
In a first possible implementation manner of the first aspect, the table entry TableEntry of the flow table includes: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the maintaining, by the host system, a shared flow table includes:
when an application program of a stream in a network is migrated, the host system modifies a table entry of the migration corresponding stream in a stream table of a memory of the host system; storing the core identification of the new core newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state;
the host system judges whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after the host system delays for a Time t, the host system distributes the received data packet of the migrated stream to the new core for processing, and the host system stores the t in the Relay Time;
the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the method for calculating t is:
t = (old core current load — new core current load)/number of packets processed per protocol stack unit time.
In a second aspect, a method for transmitting data of a many-core network, the method includes:
the network card receives the network data, and the flow distribution is carried out on the network data according to the flow table stored in the network card independent memory block;
the independent memory block forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
In a third aspect, a host system, the host system comprising:
the maintenance unit is used for maintaining a flow table of the network card, and the flow table of the network card is stored in an independent memory block in the network card;
the memory area of the flow table in the host system and the independent memory block form mapping through a Direct Memory Access (DMA) controller in the host system;
the DMA controller is used for mapping the changed flow table of the memory of the host system into the independent memory of the network card to complete the maintenance of the flow table of the network card after detecting that the flow table of the memory of the host system is changed;
and the forbidding unit is used for forbidding sending the flow table maintenance command to the network card.
In a first possible implementation manner of the third aspect, the table entry TableEntry of the flow table includes: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
In a second possible implementation of the third aspect, the maintenance unit comprises:
the migration modification module is used for modifying the table entries of the migration corresponding flows in the flow table of the memory of the host system when the application program of the flows in the network is migrated; storing the core identification of the new core newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state;
the judging delay module is used for judging whether the load of the current queue of the old core is smaller than the load of the current queue of the newcore; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after delaying for a Time t, distributing the received data packet of the migrated stream to the new core for processing, and storing the t in the Relay Time;
the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
In a third possible implementation manner of the third aspect, t is:
t = (old core current load — new core current load)/number of packets processed per protocol stack unit time.
In a fourth aspect, a network card, the network card comprising:
a receiving unit for receiving network data;
the flow forwarding unit is used for carrying out flow distribution on the network data according to the flow table stored in the network card independent memory block;
the independent memory block forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
In a fifth aspect, a host system, the host system comprising: the device comprises a processor, a memory, a communication port, a bus and a Direct Memory Access (DMA) controller, wherein the processor, the memory, the communication port and the DMA controller are all connected through the bus;
the communication port is used for receiving network data;
the memory is used for storing a flow table; a memory area where the flow table stored in the memory is located and a network card independent memory block form mapping through the DMA controller;
the processor is used for maintaining a flow table of a network card, and the flow table of the network card is stored in an independent memory block in the network card;
the DMA controller is used for mapping the changed flow table stored by the memory into the independent memory of the network card to complete maintenance of the flow table of the network card after detecting that the flow table stored by the memory is changed;
and the processor is used for forbidding sending of the flow table maintenance command to the network card.
In a first possible implementation manner of the fifth aspect, the table entry TableEntry of the flow table includes: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
With reference to the first possible implementation manner of the fifth aspect, in a second possible implementation manner, when an application program of a flow in a network migrates, the processor modifies a table entry of the corresponding flow in a flow table of the memory; storing the core identifier of the newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state; judging whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after delaying for a Time t, distributing the received data packet of the migrated stream to the new core for processing, and storing the t in the Relay Time;
the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
With reference to the second possible implementation manner of the fifth aspect, in a third possible implementation manner, t = (old core current load — newcore current load)/number of data packets processed within a protocol stack unit time.
In a sixth aspect, a network card, the network card comprising: the system comprises a logic processing module, a memory, a communication port and a bus, wherein the logic processing module, the memory, the communication port and the memory are all connected through the bus;
the communication port is used for receiving network data;
the memory is used for storing a flow table;
the logic processing module is used for carrying out flow distribution on the network data according to a flow table stored in a network card memory;
the memory forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
Advantageous effects
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the technical scheme of the invention improves the parallel processing capability of the network and increases the throughput of the network. The host system maintains the network card flow table completely, so that the time overhead of maintenance is reduced, the flexibility and efficiency of maintenance of the network card flow table are improved, and a foundation is provided for full utilization of functions of the network card flow table; the host system can update the filter corresponding to the connection in time according to the protocol connection state, improve the hit rate of the filter, facilitate the network application program to realize that the stream data is directed to the core where the network program is located by utilizing the filter, facilitate reducing the competition on shared resources, minimize the software synchronization overhead, increase the cache hit rate, and provide a transparent mechanism for the upper network application program stream direction; when the application program is migrated, the timeout time is calculated by using the real-time loads of the receiving queues of the two cores, so that the delay distribution time of the data packet is reduced, and the network throughput is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow diagram of a method for distributing data of a many-core network according to an embodiment of the present invention;
FIG. 2 is a diagram of a TCP packet provided in accordance with an embodiment of the present invention;
FIG. 3 is a block diagram of a host system according to an embodiment of the present invention;
fig. 4 is a block diagram of a network card according to an embodiment of the present invention;
FIG. 5 is a hardware block diagram of a host system provided in accordance with an embodiment of the present invention;
fig. 6 is a hardware structure diagram of a network card according to an embodiment of the present invention;
fig. 7 is a schematic diagram of TCP packet out-of-order according to an embodiment of the present invention.
Modes for carrying out the invention
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
A DMA (Direct memory access) controller is a unique device for transferring data within a system and can be considered as a controller that can connect internal and external memory devices to each peripheral device having DMA capabilities via a set of dedicated buses. The DMA controller can be arranged independently or integrated in a host system or a network card.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The specific embodiment of the present invention provides a method for distributing many-core network data, which is shown in fig. 1 and includes the following steps:
101. the host system maintains a flow table of the network card; the flow table of the network card is stored in an independent memory block in the network card;
the memory area of the flow table in the host system and the independent memory block form mapping through a Direct Memory Access (DMA) controller in the host system;
102. after a DMA controller in a host system detects that a flow table of a memory of the host system is changed, mapping the changed flow table of the memory of the host system into an independent memory of the network card to finish maintenance of the flow table of the network card; and the host system prohibits sending the flow table maintenance command to the network card.
The technical scheme provided by the specific implementation mode of the invention shares the flow table in the independent memory block of the network card to the host system, so that the flow table in the network card is completely maintained by the host system, the time overhead of flow table maintenance is reduced, the flexibility and the efficiency of network card flow table maintenance are improved, and a foundation is provided for the full utilization of the functions of the network card flow table. The flow table is not stored in the network card data memory area, but is separately stored in one memory block, and the memory block can be an independent memory mapped in the memory area of the host system, so that the flow table in the independent memory block can be separately shared to the host system, and the host system can directly maintain the flow table (including operations such as searching, adding, deleting, refreshing and the like of a filter) without the interference of the network card, so that the interaction overhead between the host system and the network card is low. The host system can directly operate the flow table, and the flow table can be updated according to the state of the connection in the protocol stack. Therefore, the technical scheme provided by the invention has the advantage of low interactive overhead between the host system and the network card.
Optionally, Table entries (english: Table Entry) in the flow Table; table Entry may include the following fields:
flow table identification Field (English: Flow ID Field); for identifying a stream;
filter Action (English: Filter Action); an identification of a core for operating the stream;
conflict flags (English: Collision Flag); for identifying whether a collision of streams occurs;
flow status (English: FlowState); recording the current state of the stream, specifically setting the following three states (of course, more states may be set in actual situations);
a CLOSED state (CLOSED), which indicates that the flow has been CLOSED, i.e., is about to be deleted from the flow table;
NORMAL state (NORMAL): this state indicates that the flow is in a normal state, which may also be referred to as a transmission state;
transition state (transition): this state indicates that the application of the flow has migrated, i.e. the application of the flow has migrated from the old core (oldcore) to the new core (new core).
The old core may be a core that executes the application program before the migration occurs, and the new core may be a core that executes the application program after the migration occurs
Delay Time (English: delay Time); the time t used for recording the delay required when the FlowState is TRANSITIONAL;
a packet pointer to be processed (English: Pending Packets Ptr); the method is used for recording the sequence of received data Packets (called Receive Packets, RXPackets for short) in a data packet pointer to be processed when the FlowState is transport, wherein the sequence of RX Packets in the Pending Packets Ptr is the same as the sequence number of the RXPackets.
The Next Filter pointer (English: Next Filter PTR); for recording the next filter identification.
The Flow State (english: Flow State), the delay time (english: delay time) and the Pending packet pointer (english: Pending Packets Ptr) are fields newly added to the Flow entry according to the embodiment of the present invention.
In the process migration in the network, as shown in fig. 2, the original application data is divided into 4 TCP (Transmission control protocol) packets, and the sequence number in the TCP header is incremented in the 4 TCP packets. As shown in fig. 7, the middlebox 1 and the middlebox 2 arrive before the first chip, the middlebox 2 arrives before the middlebox 1, and there is packet disorder between the first chip, the middlebox 1, and the middlebox 2. In order to solve the problem of packet disorder, the embodiment of the present invention adopts a technical solution in which a host system maintains a shared flow table to solve the above technical problem, and the technical solution for specifically maintaining the shared flow table may include:
when a network application program is migrated, the migration in the network may be caused by various reasons, for example, the OS (operating system) load balancing may cause the application program to be migrated in a flexible manner. Generally, when a network application program is migrated, a current core (which may also be referred to as a core before migration) is referred to as oldcore; the core to which the application (i.e., to be migrated) is distributed immediately (may also be referred to as the migrated core) is referred to as the newcore; according to the scheme provided by the specific implementation mode of the invention, when the network application program is migrated, the host system modifies the Table Entry of the migration corresponding flow in the flow Table; and storing the core identification of the new core in the TableEntry, and modifying the state of the corresponding flow to be migrated into a migration state. The specific implementation mode can be as follows: modifying the filter operation (FilterAction) in Table Entry into the core identification of a new core; modifying Flow State in Table Entry into TRANSITIONAL;
the host system judges whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, the host system delays for a time t, and then the migrated RX Packets are distributed to the new core for processing; and saves t in Relay Time.
By adopting the condition, the situation that before the new core processes the RX Packets, the old core processes the RX Packets to be processed, so that the processing sequence of the RX Packets is consistent with the sequence number of the RXpackets, and the problem of packet disorder can not occur.
The calculation method of t may specifically be: t = (old core current load — new core current load)/number of data packets processed in protocol stack unit time (specifically, may be second, millisecond, microsecond, etc.).
Optionally, the host system may further implement the following two functions in maintaining the shared flow table, where the two functions are specifically: filter addition and Filter deletion; the implementation of both functions will be described in detail below.
Adding a Filter;
when the network connection is established, after the three-way handshake is successful, the network connection state becomes a normal state, and at this time, the host system may create a filter for the connection according to a certain policy and add the filter to the flow table. The strategy of adding the filter in the flow table has two strategies, wherein the first strategy is to directly add the filter of a new connection in the flow table when the new connection occurs; the other is to count the number of RXPackets received by a new connection when the new connection appears, and add a filter of the new connection in the flow table when the number reaches a set number threshold. The first filter adding scheme is suitable for long-time linking, and for short-time linking, unnecessary maintenance overhead of the flow table is brought by adopting the first scheme; for short links, another filter addition scheme is suitable.
Deleting the Filter;
when the connection state of the Filter changes (from the normal state to the closed state), the host system may delete the Filter from the flow table according to a deletion policy. The deletion policy may specifically be: when the connection state of the Filter is changed from the normal state to the closed state, the closed state may specifically be: TIME _ WAIT, CLOSE _ WAIT, or CLOSED, the host system deleting the Filter from the flow table; or the host system periodically detects the connection state of the Filter, when the connection corresponding to the Filter is abnormally interrupted, the connection state of the Filter is modified into a closed state, and the Filter is deleted from the flow table; such a deletion strategy is applicable in the case of link aborts.
The technical scheme of the host system for maintaining the flow table improves the parallel processing capacity of the network and increases the throughput of the network. The host system maintains the flow table in the network card completely, so that the time overhead of maintenance is reduced, the flexibility and efficiency of maintaining the flow table of the network card are improved, and a foundation is provided for the full utilization of the functions of the flow table of the network card; the host system can update the filter corresponding to the connection in time according to the protocol connection state, improve the hit rate of the filter, facilitate the network application program to realize that the stream data is directed to the core where the network program is located by utilizing the filter, facilitate reducing the competition on shared resources, minimize the software synchronization overhead, increase the cache hit rate, and provide a transparent mechanism for the upper network application program stream direction; when the application program is migrated, the timeout time is calculated by using the real-time loads of the receiving queues of the two cores, so that the delay distribution time of the data packet is reduced, and the network throughput is further improved.
The specific implementation of the present invention further provides a method for sending network data under many cores, where the method includes:
the network card receives the network data, and the flow distribution is carried out on the network data according to the flow table stored in the independent memory of the network card;
the independent memory block is mapped with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
The method shares the flow table data with the host system and maintains the flow table, so that the interactive expense can be reduced.
The embodiment of the present invention further provides a host system, and the host system 300, as shown in fig. 3, includes:
a maintenance unit 301, configured to maintain a flow table of a network card, where the flow table of the network card is stored in an independent memory block in the network card;
the memory area of the flow table in the host system 300 and the independent memory block form a mapping by accessing the DMA controller through the direct memory in the host system;
the DMA controller 302 is configured to map the changed flow table of the memory of the host system into the independent memory of the network card to complete maintenance of the flow table of the network card after detecting that the flow table of the memory of the host system is changed;
a prohibiting unit 303, configured to prohibit sending of the flow table maintenance command to the network card.
Optionally, the Table Entry of the flow Table includes: three fields; the three fields are respectively: flow state FlowState, delay Time and Pending packet pointer Pending Packets Ptr;
wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
Optionally, the maintenance unit 301 may include:
a migration modification module 3011, configured to modify a table entry of a migration corresponding stream in a stream table of a memory of the host system when an application program of the stream in the network is migrated; storing the core identification of the new core newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state;
a determining delay module 3012, configured to determine whether a current queue load of the old core is smaller than a current queue load of the newcore; when the load of the current queue of the old core is smaller than that of the current queue of the newcore, after the host system delays for a Time t, the received data packet of the migrated stream is distributed to the new core for processing, and the t is stored in the Relay Time;
the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
Optionally, t = (old core current load — new core current load)/number of packets processed within a unit time of the protocol stack.
The specific embodiment of the present invention provides a network card, and the network card 400 is as shown in fig. 4, and includes:
a receiving unit 401, configured to receive network data;
a flow forwarding unit 402, configured to perform flow distribution on the network data according to a flow table stored in the network card independent memory block;
the independent memory block forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
The embodiment of the present invention provides a host system, which includes, as shown in fig. 5: the system comprises a processor 501, a memory 502, a communication port 503, a bus 504 and a DMA controller 505, wherein the processor 501, the memory 502, the communication port 503 and the DMA controller 505 are all connected through the bus 504; DMA controller 505 may also be integrated within processor 501;
a communication port 503 for receiving network data;
a memory 502 for storing a flow table; a memory area of the flow table stored in the memory 502 and the network card independent memory block form a mapping through the DMA controller 505;
a processor 501, configured to maintain a flow table of a network card, where the flow table of the network card is stored in an independent memory block in the network card;
the DMA controller 505 is configured to map the changed flow table stored in the memory 502 into an independent memory of the network card to complete maintenance of the flow table of the network card after detecting that the flow table stored in the memory 502 is changed;
and the processor 501 is configured to prohibit sending of the flow table maintenance command to the network card.
Optionally, the Table Entry of the flow Table includes: three fields; the three fields are respectively: flow state FlowState, delay Time and Pending packet pointer Pending Packets Ptr;
wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
Optionally, when the application program of the stream in the network is migrated, the processor 501 modifies the table entry of the migration corresponding stream in the stream table of the memory 502; storing the core identifier of the newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state; judging whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after delaying for a Time t, distributing the received data packet of the migrated stream to the new core for processing, and storing the t in the Relay Time;
the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
Optionally, t = (old core current load — new core current load)/number of data packets processed in a unit time of the protocol stack.
The specific embodiment of the present invention provides a network card, which includes, as shown in fig. 6: the system comprises a logic processing module 601, a storage 602, a memory 605, a communication port 603 and a bus 604, wherein the logic processing module 601, the storage 602, the communication port 603 and the memory 605 are all connected through the bus 604;
a communication port 603 for receiving network data;
a memory 605 for storing a flow table;
the logic processing module 601 is configured to perform stream distribution on the network data according to a stream table stored in a network card memory;
the memory 605 forms a mapping with a memory area of a flow table of the host system maintained by the host system through a DMA controller within the host system.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (15)

  1. A method for distributing data of a many-core network, the method comprising:
    the host system maintains a flow table of the network card, and the flow table of the network card is stored in an independent memory block in the network card;
    the memory area of the flow table in the host system and the independent memory block form mapping through a Direct Memory Access (DMA) controller in the host system;
    after the DMA controller detects that the flow table of the memory of the host system is changed, the changed flow table of the memory of the host system is mapped into the independent memory of the network card so as to complete the maintenance of the flow table of the network card; and the host system prohibits sending the flow table maintenance command to the network card.
  2. The method of claim 1, wherein a table entry TableEntry of the flow table comprises: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
    wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
    a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
    and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
  3. The method of claim 2, wherein the host system maintaining a shared flow table comprises:
    when an application program of a stream in a network is migrated, the host system modifies a table entry of the migration corresponding stream in a stream table of a memory of the host system; storing the core identification of the new core newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state;
    the host system judges whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after the host system delays for a Time t, the host system distributes the received data packet of the migrated stream to the new core for processing, and the host system stores the t in the Relay Time;
    the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
  4. The method of claim 3, wherein t is calculated by:
    t = (old core current load — new core current load)/number of packets processed per protocol stack unit time.
  5. A method for sending network data under many cores is characterized by comprising the following steps:
    the network card receives the network data, and the flow distribution is carried out on the network data according to the flow table stored in the network card independent memory block;
    the independent memory block forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
  6. A host system, comprising:
    the maintenance unit is used for maintaining a flow table of the network card, and the flow table of the network card is stored in an independent memory block in the network card;
    the memory area of the flow table in the host system and the independent memory block form mapping through a Direct Memory Access (DMA) controller in the host system;
    the DMA controller is used for mapping the changed flow table of the memory of the host system into the independent memory of the network card to complete the maintenance of the flow table of the network card after detecting that the flow table of the memory of the host system is changed;
    and the forbidding unit is used for forbidding sending the flow table maintenance command to the network card.
  7. The host system of claim 6, wherein a table entry TableEntry of the flow table comprises: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
    wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
    a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
    and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
  8. The host system of claim 6, wherein the maintenance unit comprises:
    the migration modification module is used for modifying the table entries of the migration corresponding flows in the flow table of the memory of the host system when the application program of the flows in the network is migrated; storing the core identification of the new core newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state;
    the judging delay module is used for judging whether the load of the current queue of the old core is smaller than the load of the current queue of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after delaying for a Time t, distributing the received data packet of the migrated stream to the new core for processing, and storing the t in the Relay Time;
    the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
  9. The host system of claim 6, wherein t is:
    t = (old core current load — new core current load)/number of packets processed per protocol stack unit time.
  10. A network card, comprising:
    a receiving unit for receiving network data;
    the flow forwarding unit is used for carrying out flow distribution on the network data according to the flow table stored in the network card independent memory block;
    the independent memory block forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
  11. A host system, comprising: the device comprises a processor, a memory, a communication port, a bus and a Direct Memory Access (DMA) controller, wherein the processor, the memory, the communication port and the DMA controller are all connected through the bus;
    the communication port is used for receiving network data;
    the memory is used for storing a flow table; a memory area where the flow table stored in the memory is located and a network card independent memory block form mapping through the DMA controller;
    the processor is used for maintaining a flow table of a network card, and the flow table of the network card is stored in an independent memory block in the network card;
    the DMA controller is used for mapping the changed flow table stored by the memory into the independent memory of the network card to complete maintenance of the flow table of the network card after detecting that the flow table stored by the memory is changed;
    and the processor is used for forbidding sending of the flow table maintenance command to the network card.
  12. The host system of claim 11, wherein a table entry TableEntry of the flow table comprises: three fields; the three fields are respectively: flow State, delay Time and Pending packet pointer Pending packetstpr;
    wherein, the field Flow State indicates the current State of the Flow, and the State includes: a transmission state, a transition state, and a shutdown state;
    a field delay Time, which indicates the Time that needs to be delayed when the Flow State is in a migration State;
    and a field Pending Packets Ptr indicates the sequence of the received packet pointers in the Pending packet when the FlowState is in the migration state.
  13. The host system of claim 12,
    when the application program of the flow in the network is migrated, the processor modifies the table entry of the migration corresponding flow in the flow table of the memory; storing the core identifier of the newcore in the table entry, and modifying the state of the flow corresponding to the migration into a migration state; judging whether the current queue load of the old core is smaller than the current queue load of the new core; when the load of the current queue of the old core is smaller than that of the current queue of the new core, after delaying for a Time t, distributing the received data packet of the migrated stream to the new core for processing, and storing the t in the Relay Time;
    the old core is a core for executing the application program before the migration occurs, and the new core is a core for executing the application program after the migration occurs.
  14. The host system of claim 13,
    t = (old core current load — new core current load)/number of packets processed per protocol stack unit time.
  15. A network card, comprising: the system comprises a logic processing module, a memory, a communication port and a bus, wherein the logic processing module, the memory, the communication port and the memory are all connected through the bus;
    the communication port is used for receiving network data;
    the memory is used for storing a flow table;
    the logic processing module is used for carrying out flow distribution on the network data according to a flow table stored in a network card memory;
    the memory forms a mapping with a memory area of a flow table of the host system through a Direct Memory Access (DMA) controller in the host system, and the flow table is maintained by the host system.
CN201480000856.7A 2014-04-04 2014-04-04 The distribution method and system of many-core lower network data Active CN105164980B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/074868 WO2015149374A1 (en) 2014-04-04 2014-04-04 Method and system for distributing network data in many-core processor

Publications (2)

Publication Number Publication Date
CN105164980A true CN105164980A (en) 2015-12-16
CN105164980B CN105164980B (en) 2019-01-08

Family

ID=54239334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201480000856.7A Active CN105164980B (en) 2014-04-04 2014-04-04 The distribution method and system of many-core lower network data

Country Status (2)

Country Link
CN (1) CN105164980B (en)
WO (1) WO2015149374A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933283A (en) * 2017-12-19 2019-06-25 西部数据技术公司 Direct host accesses storage device memory space
CN111880942A (en) * 2020-08-03 2020-11-03 北京天融信网络安全技术有限公司 Network threat processing method and device
US11720283B2 (en) 2017-12-19 2023-08-08 Western Digital Technologies, Inc. Coherent access to persistent memory region range
CN116723162A (en) * 2023-08-10 2023-09-08 浪潮电子信息产业股份有限公司 Network first packet processing method, system, device, medium and heterogeneous equipment

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112780953B (en) * 2021-02-08 2022-07-12 浙江工业大学 Independent metering area pipe network leakage detection method based on mode detection
CN115174409A (en) * 2022-06-30 2022-10-11 无锡芯光互连技术研究院有限公司 Network connection method and system based on CXL protocol
CN115914102B (en) * 2023-02-08 2023-05-23 阿里巴巴(中国)有限公司 Data forwarding method, flow table processing method, equipment and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101135980A (en) * 2006-08-29 2008-03-05 飞塔信息科技(北京)有限公司 Device and method for realizing zero copy based on Linux operating system
CN102780642A (en) * 2012-08-23 2012-11-14 深圳乌托邦系统集成有限公司 Multichannel network message transmission method
US20130054857A1 (en) * 2011-08-25 2013-02-28 Neil R.T Horman Reducing latency at a network interface card
CN102984085A (en) * 2012-11-21 2013-03-20 网神信息技术(北京)股份有限公司 Mapping method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101135980A (en) * 2006-08-29 2008-03-05 飞塔信息科技(北京)有限公司 Device and method for realizing zero copy based on Linux operating system
US20130054857A1 (en) * 2011-08-25 2013-02-28 Neil R.T Horman Reducing latency at a network interface card
CN102780642A (en) * 2012-08-23 2012-11-14 深圳乌托邦系统集成有限公司 Multichannel network message transmission method
CN102984085A (en) * 2012-11-21 2013-03-20 网神信息技术(北京)股份有限公司 Mapping method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ALEKSEY PESTEREV等: "《Improving Network Connection Locality on Multicore System》", 《 PROCEEDINGS OF THE 7TH ACM EUROPEAN CONFERENCE ON COMPUTER SYSTEMS》 *
汪泓帆: "一种基于 X86 架构的多核绑定技术", 《计算机安全》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933283A (en) * 2017-12-19 2019-06-25 西部数据技术公司 Direct host accesses storage device memory space
CN109933283B (en) * 2017-12-19 2022-06-28 西部数据技术公司 Direct host access storage device storage space
US11681634B2 (en) 2017-12-19 2023-06-20 Western Digital Technologies, Inc. Direct host access to storage device memory space
US11720283B2 (en) 2017-12-19 2023-08-08 Western Digital Technologies, Inc. Coherent access to persistent memory region range
CN111880942A (en) * 2020-08-03 2020-11-03 北京天融信网络安全技术有限公司 Network threat processing method and device
CN116723162A (en) * 2023-08-10 2023-09-08 浪潮电子信息产业股份有限公司 Network first packet processing method, system, device, medium and heterogeneous equipment
CN116723162B (en) * 2023-08-10 2023-11-03 浪潮电子信息产业股份有限公司 Network first packet processing method, system, device, medium and heterogeneous equipment

Also Published As

Publication number Publication date
CN105164980B (en) 2019-01-08
WO2015149374A1 (en) 2015-10-08

Similar Documents

Publication Publication Date Title
CN105164980A (en) Method and system for distributing network data in many-core processor
EP3754511A1 (en) Multi-protocol support for transactions
US9652425B2 (en) Method, apparatus and system for a source-synchronous circuit-switched network on a chip (NOC)
US20090213732A1 (en) Preserving packet order when migrating network flows between cores
US10884786B2 (en) Switch device, switching method, and computer program product
CN112769905B (en) NUMA (non uniform memory access) architecture based high-performance network card performance optimization method under Feiteng platform
US20090006521A1 (en) Adaptive receive side scaling
CN110636139B (en) Optimization method and system for cloud load balancing
CN104281493A (en) Method for improving performance of multiprocess programs of application delivery communication platforms
WO2014166404A1 (en) Network data packet processing method and device
US20190042151A1 (en) Hybrid framework of nvme-based storage system in cloud computing environment
CN107870879A (en) A kind of data-moving method, accelerator board, main frame and data-moving system
CN106603409B (en) Data processing system, method and equipment
CN112559436B (en) Context access method and system of RDMA communication equipment
US9632958B2 (en) System for migrating stash transactions
CN114490499A (en) System, apparatus and method for streaming input/output data
CN110138809A (en) A kind of TCP message splicing system and method towards ethernet controller receives link
CN109117386A (en) A kind of system and method for network remote read-write secondary storage
WO2018125490A1 (en) Transferring packets between virtual machines via a direct memory access device
CN115934625B (en) Doorbell knocking method, equipment and medium for remote direct memory access
CN114363269B (en) Message transmission method, system, equipment and medium
CN103440213A (en) Network card driving method applied to system with multiple CPUs (Central Processing Unit) and network cards
CA2891927C (en) Method and apparatus for traffic management scheduling
US10673983B2 (en) Processing a unit of work
CN106790162B (en) Virtual network optimization method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210428

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Device Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.