Processing unit and flow control unit, and related methods

By adopting a flow control mechanism of bidirectional traffic values ​​between AI chips, the problem of dead communication caused by loss during data transmission is solved, the synchronous correction of traffic values ​​is realized, and the reliability and efficiency of data transmission are improved.

CN114221905BActive Publication Date: 2024-10-29T-HEAD (SHANGHAI) SEMICON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010912936.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-03
Publication Date
2024-10-29
Estimated Expiration
2040-09-03

AI Technical Summary

Technical Problem

Existing technology has the risk of dead communication in data transmission between AI chips. This is mainly due to the fact that the sending end cannot update the traffic value due to data loss, and thus cannot continue to send data.

Method used

Using a flow control mechanism based on bidirectional flow values, the sending end not only receives the flow value allowed by the receiving end, but also sends the consumed flow value to the receiving end, so that the receiving end can correct the flow value difference and ensure the flow value synchronization.

Benefits of technology

It effectively avoids the occurrence of dead communication, ensures the reliability and efficiency of data transmission, and improves the efficiency of data transmission between processing units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114221905B_ABST
    Figure CN114221905B_ABST
Patent Text Reader

Abstract

The present disclosure provides a processing unit and a flow control unit, and related methods. The flow control unit is located at the sending end, and includes: a first flow extreme value memory, used to store a first flow extreme value; a first flow consumption memory, used to store the flow value consumed by the sending end; a comparator, used to determine that the size of the data to be sent does not exceed the difference between the first flow extreme value and the consumed flow value, allowing the data to be sent to the receiving end; a second flow generator, which sends the consumed flow value as a second flow value to the flow control unit located at the receiving end, so that the flow control unit adjusts the flow value sent to the first flow extreme value memory next time according to the difference between the second flow value and the amount of data received by the receiving end from the sending end. The embodiment of the present disclosure avoids the situation where the sending end has no updated flow value available to send data due to data loss in the middle, thereby avoiding the occurrence of dead communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to processing unit interconnection, and more particularly, to a processing unit and a flow control unit, and related methods. Background Art

[0002] Artificial intelligence (AI) chips (such as NPU, neural network acceleration unit) are dedicated to hardware acceleration and machine learning processing of neural networks. When deploying AI chips, it is often necessary to interconnect AI chips to form a larger processing network to cope with AI tasks that require more computing resources.

[0003] If the amount of data sent by the sending AI chip to the receiving AI chip exceeds the receiving buffer capacity of the receiving AI chip during AI chip communication, data overflow will occur. Therefore, flow control must be performed. A flow control technology in the prior art adopts a mechanism based on the allowed flow value notified in advance. After the data in the receiving buffer of the receiving AI chip is moved into the memory, this part of the data no longer exists in the receiving buffer. According to the size of this part of the data (the amount of data transferred from the receiving buffer to the receiving end memory), the flow value indicating how many packets of data are allowed to be sent to the sending AI chip can be sent to the sending AI chip. As the amount of data is continuously transferred from the receiving buffer to the memory during the use of the receiving AI chip, the flow value sent to the sending AI chip is continuously updated. Every time the sending AI chip sends data, it is equivalent to consuming the corresponding flow value. Before sending data to the receiving AI chip, each time the sending AI chip checks whether the size of the data to be sent is not greater than the difference between the flow extreme value and the consumed flow value. If so, the data can be sent.

[0004] Although the above mechanism based on the allowed traffic value notified in advance reduces data overflow, there is a risk of dead communication. If the data sent by the sending AI chip to the receiving AI chip is lost during transmission, since the receiving AI chip does not receive this data, it will not be buffered in the receiving buffer, nor will it be moved from the receiving buffer to the memory, thereby triggering the update of the traffic value to the sending AI chip. In this way, the total traffic value released to the sending AI chip is less than expected. If more and more data is lost on the way, the sending AI chip cannot receive the updated traffic value and can no longer send data, resulting in dead communication. Summary of the invention

[0005] In view of this, the present disclosure aims to avoid the situation where the sending end has no updated flow value to send data due to data loss in the middle, thereby avoiding the occurrence of dead communication.

[0006] To achieve this objective, according to one aspect of the present disclosure, the present disclosure provides a flow control unit, located at a sending end, comprising:

[0007] A first flow extreme value memory, used to store a first flow extreme value, the first flow extreme value being updated according to a first flow value sent by a flow control unit at a receiving end, the first flow value indicating an amount of data that the receiving end is allowed to further receive;

[0008] A first traffic consumption memory, used to store a traffic value consumed by the sending end, wherein the consumed traffic value represents an amount of data that the sending end has sent to the receiving end;

[0009] A comparator, configured to determine that the size of the data to be sent does not exceed the difference between the first flow extreme value and the consumed flow value, and allow the data to be sent to the receiving end;

[0010] The second traffic generator sends the consumed traffic value as the second traffic value to the flow control unit at the receiving end, so that the flow control unit at the receiving end adjusts the first traffic value to be sent to the first traffic extreme value memory next time according to the difference between the second traffic value and the amount of data that the receiving end has received from the sending end.

[0011] Optionally, the sending end includes a sending end processing unit, and the flow control unit is located in the sending end processing unit; the receiving end includes a receiving end processing unit, and the flow control unit of the receiving end is located in the receiving end processing unit.

[0012] Optionally, the flow control unit further includes:

[0013] A first flow value parser, configured to parse a flow value from a current first flow value notification packet received by a flow control unit at a receiving end;

[0014] A previous first flow value buffer, which caches the flow value parsed from the previous first flow value notification packet received from the flow control unit at the receiving end;

[0015] a subtractor, configured to subtract the flow value cached in the previous first flow value buffer from the flow value parsed from the current first flow value notification packet to obtain a flow value difference;

[0016] The first adder is used to accumulate the flow value difference to the first flow extreme value stored in the first flow extreme value memory.

[0017] Optionally, after the subtractor obtains the flow value difference, the flow value parser updates the previous first flow value buffer with the flow value parsed from the current first flow value notification packet.

[0018] Optionally, the flow control unit further includes: a second adder, configured to add the size of the sent data to the consumed flow value stored in the first flow value consumption memory after sending the data to the receiving end.

[0019] Optionally, the second traffic value generator puts the second traffic value in a second traffic value notification packet and sends it to the receiving end.

[0020] Optionally, the first flow value parser performs a transmission error check on the current first flow value notification packet received from the receiving end, and discards the current first flow value notification packet if a check error is found.

[0021] Optionally, the current first flow value notification packet includes a first flow value initial notification packet and a first flow value update notification packet, and the sending end chip flow control unit also includes a first flow value initial confirmation packet generator, which is used to generate a first flow value initial confirmation packet to be sent to the receiving end after storing the flow value notified by the first flow value initial notification packet in the first flow value extreme value memory.

[0022] Optionally, the data sent by the sending end to the receiving end, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet are transmitted in a flow value message packet format, and the flow value message packet format includes a destination chip address, a source chip address, a packet type, a notified flow value, a padding bit, and a transmission error check bit.

[0023] Optionally, the first traffic extreme values ​​stored in the first traffic extreme value memory include multiple first traffic extreme values ​​corresponding to the virtual channels of multiple receiving ends respectively; the first traffic consumption memory stores the traffic values ​​that the sending end has consumed for the virtual channels of the multiple receiving ends respectively; the comparator determines the virtual channel of the receiving end to which the data is to be sent, and if the size of the data to be sent does not exceed the difference between the traffic extreme value corresponding to the virtual channel of the receiving end and the consumed traffic value corresponding to the virtual channel of the receiving end, the data is allowed to be sent to the virtual channel of the receiving end; the second traffic value generator uses the traffic values ​​that have been consumed for the virtual channels of the multiple receiving ends as the second traffic values ​​corresponding to the virtual channels of the multiple receiving ends respectively, and sends them to the multiple receiving ends respectively; the notified second traffic value includes the second traffic values ​​corresponding to the virtual channels of the multiple receiving ends.

[0024] Optionally, the unit of the flow value or the second flow value is set equal to 64 bytes, the initial flow value in the first flow value initial notification group is set to 1440 flow value units, the maximum value stored in the first flow extreme value memory and the first flow value consumption memory is 4096 flow value units, and the storage is reset after exceeding the maximum value.

[0025] Optionally, a period for sending the flow value or the second flow value is N times a period for the sending end to send data to the receiving end, where N is a positive integer greater than or equal to 2.

[0026] Optionally, N=8 or N=16.

[0027] According to one aspect of the present disclosure, a processing unit is provided, which is located at a transmitting end and includes: a memory; a direct memory access module for controlling direct access to the memory; a plurality of ports; and a switching module for controlling the connection between the direct memory access module and the plurality of ports, wherein at least one of the plurality of ports includes a transmitting end chip flow control unit according to claims 1-13, a MAC layer for performing a media access control MAC, and a serializer and deserializer for serializing data to be transmitted or deserializing received data.

[0028] According to one aspect of the present disclosure, a flow control unit is provided, located at a receiving end, comprising:

[0029] A receiving data buffer, used for buffering data received from the sending end;

[0030] A second flow value memory, used to store a second flow value received from the sending end;

[0031] A received data size memory, used to store the size of data received from the sending end;

[0032] a difference calculation unit, configured to calculate a difference between a second flow value stored in the second flow value memory and a received data size stored in the received data size memory;

[0033] The first flow value allocation unit is used to update the flow value sent to the sending end according to the difference between the second flow value and the size of the received data and the amount of data sent from the receiving data buffer to the receiving end memory.

[0034] Optionally, the receiving end includes a receiving end processing unit, and the flow control unit is located in the receiving end processing unit; the sending end includes a sending end processing unit, and the flow control unit of the sending end is located in the sending end processing unit.

[0035] Optionally, the initial value stored in the received data size memory is set to 0, and the flow control unit also includes: a third adder, used to add the received data size to the value stored in the received data size memory in response to receiving data from the transmitting end.

[0036] Optionally, after the difference calculation unit calculates the difference, the third adder adds the difference to the value stored in the received data size memory.

[0037] Optionally, the flow control unit also includes: a fifth adder, used to add the difference between the second flow value and the size of the received data, and the amount of data sent from the receiving data buffer to the receiving end memory to the flow value allocated by the first flow value allocation unit.

[0038] Optionally, the flow control unit further includes: a first flow value notification packet generator, configured to put the updated flow value in a first flow value notification packet, and send the packet to the sending end.

[0039] Optionally, the flow control unit further includes: a second flow value parser, configured to parse out a second flow value from a second flow value notification packet received by the sending end, and store the second flow value in the second flow value memory.

[0040] Optionally, the current first flow value notification packet includes a first flow value initial notification packet and a first flow value update notification packet; after the receiving-end chip flow control unit sends the first flow value initial notification packet to the sending-end chip flow control unit, the receiving-end chip flow control unit also receives the first flow value initial confirmation packet sent by the sending-end chip flow control unit.

[0041] Optionally, the data sent by the sending end to the receiving end, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet are transmitted in a flow value message packet format, and the flow value message packet format includes a destination chip address, a source chip address, a packet type, a notified flow value, a padding bit, and a transmission error check bit.

[0042] Optionally, the second flow values ​​stored in the second flow value memory include multiple second flow values ​​corresponding to the virtual channels of multiple transmitters; the received data size memory stores the data sizes received from the virtual channels of the multiple transmitters; the difference calculation unit calculates the differences between the multiple second flow values ​​corresponding to the virtual channels of the multiple transmitters stored in the second flow value memory and the received data sizes corresponding to the virtual channels of the multiple transmitters stored in the received data size memory; the first flow value allocation unit updates the multiple first flow values ​​sent to the virtual channels of the multiple transmitters according to the differences obtained for the virtual channels of the multiple transmitters and the amount of data sent to the receiving end memory for the virtual channels of the multiple transmitters in the receiving data buffer, and the notified first flow values ​​include the first flow values ​​corresponding to the virtual channels of the multiple transmitters.

[0043] Optionally, the size of the receiving data buffer is set to 720k bits, the unit of the flow value is set equal to 64 bytes, the initial flow value in the first flow value initial notification packet is set to 1440 flow value units, the maximum value of the second flow value stored in the second flow value memory and the received data size stored in the received data size memory is 4096 flow value units, and the storage is reset after exceeding the maximum value.

[0044] Optionally, a period for sending the flow value or the second flow value is N times a period for the sending end to send data to the receiving end, where N is a positive integer greater than or equal to 2.

[0045] Optionally, N=8 or N=16.

[0046] According to one aspect of the present disclosure, a processing unit is provided, located at a receiving end, comprising: a memory; a direct memory access module for controlling direct access to the memory; a plurality of ports; a switching module for controlling the connection between the direct memory access module and the plurality of ports, wherein at least one of the plurality of ports comprises a receiving end chip flow control unit according to claims 15-27, a MAC layer for performing a media access control MAC, and a serializer and deserializer for serializing data to be sent or deserializing received data.

[0047] According to one aspect of the present disclosure, a sending end flow control method is provided, comprising:

[0048] Update the first traffic extreme value according to the traffic value sent by the receiving end, wherein the sent traffic value is the amount of data that the receiving end is currently allowed to increase in reception;

[0049] If the size of the data to be sent does not exceed the difference between the first traffic limit and the consumed traffic value, the data is allowed to be sent to the receiving end, wherein the consumed first traffic value is equal to the amount of data that the sending end has sent to the receiving end;

[0050] The consumed traffic value is used as a second traffic value to be sent to the receiving end, so that the receiving end adjusts the traffic value sent to the sending end according to the difference between the second traffic value and the amount of data received by the receiving end from the sending end.

[0051] Optionally, updating the first flow extreme value according to the flow value sent by the receiving end includes:

[0052] Parsing the flow value from the current first flow value notification packet received by the receiving end;

[0053] The flow value parsed from the current first flow value notification packet is subtracted from the flow value parsed from the previous first flow value notification packet received from the receiving end to obtain a flow value difference;

[0054] The flow value difference is accumulated to the flow value stored in the first flow extreme value memory.

[0055] Optionally, after allowing the data to be sent to the receiving end, the method further includes: adding the size of the sent data to the consumed traffic value.

[0056] Optionally, taking the consumed traffic value as the second traffic value to send to the receiving end includes: placing the consumed traffic value as the second traffic value in a second traffic value notification packet to send to the receiving end.

[0057] Optionally, before parsing the flow value from the current first flow value notification packet received from the receiving end, the method also includes: performing a transmission error check on the current first flow value notification packet received from the receiving end, and if a check error is found, discarding the current first flow value notification packet.

[0058] According to one aspect of the present disclosure, a receiving end chip flow control method is provided, comprising:

[0059] storing the data received from the transmitting end in a receiving data buffer;

[0060] receiving a second flow value from a transmitting end;

[0061] Get the size of data received from the sending chip;

[0062] Calculating a difference between the second flow value and the received data size;

[0063] The flow value sent to the sending end is updated according to the difference and the amount of data transferred from the receiving data buffer to the receiving end memory.

[0064] Optionally, obtaining the size of data received from the sending end includes:

[0065] Set the received data size memory, the initial value stored in the received data size memory is 0;

[0066] In response to receiving data from the transmitting end, adding the received data size to the value stored in the received data size memory;

[0067] The received data size is read from the received data size memory.

[0068] Optionally, after calculating the difference between the second flow value and the received data size, the method further comprises: adding the difference to the value stored in the received data size memory.

[0069] Optionally, updating the flow value sent to the sending end according to the difference and the amount of data transferred from the receiving data buffer to the receiving end memory includes:

[0070] adding the difference between the second flow value and the size of the received data and the amount of data transferred from the receiving data buffer to the receiving end memory to the flow value allocated for sending to the sending end;

[0071] The flow value is sent to the sending end chip.

[0072] Optionally, sending the flow value to the sending end includes: putting the flow value in a first flow value notification packet and sending the packet to the sending end.

[0073] Optionally, the receiving the second flow value from the sending end includes: parsing the second flow value from a second flow value notification packet received by the sending end.

[0074] Different from the flow control mechanism based on unidirectional flow value in the prior art, the embodiment of the present disclosure proposes a flow control mechanism based on bidirectional flow value. That is to say, not only does the receiving end send the allowed flow value to the sending end chip according to the transfer of data from its own receiving data buffer to the memory to inform the sending end how much data can be sent, but the sending end also sends the consumed flow value (that is, how much data the sending end has sent to the receiving end) to the receiving end as the second flow value, so that the receiving end can compare the second flow value with the amount of data received by the receiving end from the sending end to see if the two are consistent. If they are inconsistent, it means that the data transmission is lost during the process. In this way, the flow value sent to the sending end can be adjusted according to the difference between the two, so as to ensure the synchronization of the flow values ​​of the sending and receiving ends. Through the above method, even if the data transmission is lost, the allowed flow value can be automatically corrected and will not fall into dead communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The above and other objects, features and advantages of the present disclosure will become more apparent through the description of the embodiments of the present disclosure with reference to the following drawings, in which:

[0076] Figure 1 It is an overall architecture diagram of the interconnection of processing units used in the embodiments of the present disclosure;

[0077] Figure 2 It is a diagram of the internal structure of two interconnected processing units;

[0078] Figure 3 It is an internal structure diagram of a sending end flow control unit and a receiving end flow control unit in the prior art.

[0079] Figure 4 It is an internal structure diagram of a sending-end flow control unit and a receiving-end flow control unit according to an embodiment of the present disclosure.

[0080] Figure 5 It is a flowchart of a flow control method at a sending end according to an embodiment of the present disclosure.

[0081] Figure 6 It is a flowchart of a flow control method at a receiving end according to an embodiment of the present disclosure.

[0082] Figure 7 The diagram is a general format diagram of a flow value message packet according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0083] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, well-known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.

[0084] Explanation of terms

[0085] The following terms are used in this article.

[0086] Processing unit: a unit that processes information by running programs, including traditional processing units (central processing units, etc.) for performing general operations, and acceleration units that accelerate the processing of transactions that are processed more slowly by some traditional processing units. For example, acceleration units designed to improve the data processing speed in the field of neural networks in response to the low efficiency of traditional processing units in processing calculations in the field of neural networks include central processing units (CPUs), graphics processing units (GPUs), general-purpose graphics processing units (GPGPUs), field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), and dedicated intelligent acceleration hardware (for example, neural network processors NPUs).

[0087] Traffic value: The amount of data that the receiving end is allowed to receive, that is, the cumulative value of the amount of data that the receiving end has allowed the sending end to send in history. It is not the incremental data that is newly freed up in the receiving data buffer each time, but the cumulative value of all these incremental data in history. The data received by the receiving end is cached in the receiving data buffer and then formally stored in the memory. Once the receiving data buffer has data moved into the memory, a part of the storage capacity of the receiving data buffer is freed up to receive new data. The receiving end will continuously accumulate the newly added amount of data allowed to be sent by the sending end, which becomes the first traffic value.

[0088] First flow extreme value: the amount of data that the receiving end is allowed to receive as known by the sending end. That is to say, the above flow value is the amount of data that the receiving end is allowed to receive as known by itself, while the first flow extreme value is the amount of data that the receiving end is allowed to receive as known by the sending end. The two are actually the same amount observed from different angles. Each time the receiving end sends a flow value to the sending end, the sending end extracts the flow value increment, that is, the difference between the flow value and the last received flow value, and then accumulates the difference to the first flow extreme value, so that the first flow extreme value reflects the sum of all these differences, and finally the amount of data that the receiving end is allowed to receive as seen from the sending end. It reflects the sum of the storage capacity that has been freed up by the receiving end in history. It may be larger than the storage capacity of the receiving data buffer of the receiving end, because the same storage space of the receiving data buffer will be freed up repeatedly, and this part of the storage space will be repeatedly reflected in the flow value and the first flow extreme value. However, since the consumed traffic value (i.e., the total amount of data that the sending end has sent to the receiving end) is also repeatedly accumulated, that is, as long as the sending end sends data to the receiving end, the traffic value is consumed, regardless of whether the consumed part is the first appearing part of the same storage space in the traffic value, or the part that appears repeatedly thereafter, the consumed traffic value can be compared with the first traffic extreme value to determine the difference, and based on the difference, it is determined whether the next data can be sent from the sending end to the receiving end.

[0089] Consumed traffic value: The amount of data that the sender has sent to the receiver. As long as the sender sends data to the receiver, the above traffic value is consumed, and the newly sent data amount is added to the consumed traffic value.

[0090] Second traffic value: the traffic value consumed by the sender, that is, the amount of data that the sender has sent to the receiver. The second traffic value reflects a cumulative amount, not an increment. It is the total amount of data that the sender has sent to the receiver in history. The receiver records the total amount of data it has received from the sender in history. Subtracting the two can get the amount of data lost in transmission. After compensating for this amount of data, the credit synchronization between the sender and the receiver can be achieved.

[0091] First flow value notification packet: a packet used by the receiving end to notify the sending end of the flow value allowed to be sent. It includes a first flow value initial notification packet and a first flow value update notification packet. The first flow value initial notification packet refers to a packet in which the receiving end notifies the sending end of the flow value when the sending end has not yet transmitted data to the receiving end. The first flow value update notification packet refers to a packet in which the receiving end notifies the sending end of the updated flow value when the sending end has already transmitted data to the receiving end.

[0092] Second flow value notification packet: a packet used by the sending end to notify the receiving end of the second flow value.

[0093] Transmission error checking: A check performed on the received data packets to verify whether any errors occurred during the transmission process, including a cyclic redundancy check (CRC).

[0094] First flow value initial confirmation packet: a packet in which the sending end receives the first flow value initial notification packet sent by the receiving end and confirms to the receiving end that it has received the first flow value initial notification packet.

[0095] Traffic value message packet format: a general format used to transmit data sent from the sender to the receiver, the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet.

[0096] Traffic value unit: the recording unit of the traffic value. Each unit of traffic value corresponds to a fixed amount of data.

[0097] Reset storage: When the accumulated value of the storage data exceeds the specified maximum value, it becomes 0, and the accumulated storage continues on this basis.

[0098] Dead communication: Under the condition that the traffic value is used as the credential for sending more data, if the sender cannot continue to receive the traffic value sent by the receiver, it cannot continue to send data to the receiver, which is called dead communication.

[0099] Direct Memory Access (DMA): Direct memory access is a high-speed data transmission method. Data can be transferred directly between memory or input and output devices through a channel without being processed by the CPU. When a device interface attempts to send data (usually large amounts of data) directly to another device through the bus, it will first send a DMA request signal to the CPU. The peripheral device submits a bus request to the CPU to take over the bus control right through a special interface circuit of DMA - the DMA controller (DMAC). After receiving the signal, the CPU will respond to the DMA signal according to the priority of the DMA signal and the order of the DMA request after the current bus cycle ends. When the CPU responds to a DMA request for a device interface, it will give up the bus control right. Therefore, under the management of the DMA controller, the peripheral device and the memory directly exchange data without CPU intervention. After the data transfer is completed, the device interface will send a DMA end signal to the CPU to return the bus control right.

[0100] Media Access Control (MAC): A mechanism for allocating channel rights when contention arises for the use of a shared channel in a local area network. It defines how data frames are transmitted on the medium. Access to the connection medium is "first come, first served" on links that share the same bandwidth. Physical addressing is defined here, as is the logical topology (the path that signals take through the physical topology). Line control, error notification (not corrected), frame delivery order, and optional flow control are also implemented at this layer.

[0101] Serialization: Converting parallel data into serial data for transmission between processing units.

[0102] Deserialization: Since the data transmitted between processing units is serial data, the processing unit needs to deserialize the serial data into parallel data for processing and storage after receiving it. The process of deserializing serial data into parallel data is called deserialization.

[0103] Background and general network structure of the embodiments of the present disclosure

[0104] A processing unit is a unit that processes information by running a program. It includes traditional processing units (central processing units, etc.) for performing general operations, and acceleration units that accelerate the processing of transactions that are slower in some traditional processing units. For example, in view of the low efficiency of traditional processing units in processing calculations in the field of neural networks, acceleration units designed to improve the data processing speed in the field of neural networks include central processing units (CPUs), graphics processing units (GPUs), general-purpose graphics processing units (GPGPUs), field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), and dedicated intelligent acceleration hardware (e.g., neural network processors NPUs). In the field of artificial intelligence, processing units are often embodied as artificial intelligence (AI) chips.

[0105] In the field of AI, processing units can be interconnected to form a large processing network to handle AI tasks that require more computing power, such as Figure 1 As shown. Figure 1 , the interconnection of multiple processing units 110 is shown. Each processing unit 110 has four ports 120, namely P0-P3, for interconnecting with different other processing units 110 in four directions. Corresponding to the four ports 120 are four memories 110, which are used to store data required for communication with different other processing units 110. For example, data received from four different other processing units 110 can be stored in four memories 110 respectively. Although four ports 120 and four memories 110 are shown in the figure, in fact, those skilled in the art will understand that there can also be other numbers of ports 120 and memories 110.

[0106] Figure 1In the example, processing unit A can transfer data from internal memory M0 to adjacent processing unit B through port P0, and store it in memory M2 of processing unit B through port P2 of processing unit B. Processing unit B can move data from memory M3 of processing unit B through port P3 to adjacent processing unit E, and store it in memory M1 of processing unit E through port P1 of processing unit E, and so on.

[0107] An existing method for building interconnected processing units is to use a PCIe interface and introduce a PCIe switch to build an interconnected network. However, using a PCIe switch results in low throughput and long waiting time, which cannot meet the requirements of AI applications.

[0108] In order to improve the performance of throughput and latency, the existing technology adopts Figure 2 The structure is used to realize the interconnection of processing units. Figure 2 As shown, the processing unit 100 includes four ports 120, a switching module 140, a direct memory access (DMA) module 130, and a memory 110. Although four ports 120 are shown in the figure, those skilled in the art will appreciate that other numbers of ports 120 may also be provided. Each port 120 includes a serializer and deserializer 121, a media access control (MAC) layer 122, a transmitting end flow control unit 123, and a receiving end flow control unit 124.

[0109] The serial and deserializer 121 is used to convert the data to be sent into serial data for high-speed transmission between processing units, and convert the serial data between processing units into parallel data for processing and storage. Converting parallel data into serial data for transmission between processing units is called serialization. The process of deserializing serial data into parallel data is called deserialization.

[0110] The MAC layer 122 mainly solves the problem of how to allocate channel usage rights when there is competition for the use of shared channels in the local area network. It defines how data frames are transmitted on the medium. In links sharing the same bandwidth, access to the connection medium is "first come, first served". Physical addressing is defined here, and logical topology (the path of the signal through the physical topology) is also defined here.

[0111] The sending end flow control unit 123 is a unit that controls when the data is sent out by the processing unit. The receiving end flow control unit 124 is a unit that controls the reception of data when the processing unit receives data. The control of the flow value is completed in these two parts. It is also the main unit for avoiding dead communication by controlling the second flow value in the embodiment of the present disclosure.

[0112] The switching module 140 is a module for implementing data exchange between each port 120 and the memory 110 . Figure 2In the figure, the switching module 140 and the four ports 120 each have a pair of input and output ports (the ports here are ports inside the switching module 140, not the four ports 120 mentioned above, which are connected to the four ports 120 mentioned above), and the direct memory access module 130 has a pair of input and output ports.

[0113] The direct memory access (DMA) module 130 is a module for DMA communication between the external processing unit 100 and the memory 110 inside the processing unit 100. DMA is a high-speed data transmission method. Data can be directly transferred between the memory or input and output devices from a channel without being processed by the CPU. When a device interface attempts to send data (generally a large amount of data) directly to another device through the bus, it will first send a DMA request signal to the CPU. The peripheral device submits a bus request to take over the bus control right to the CPU through a special interface circuit of DMA - DMA controller (DMAC). After receiving the signal, the CPU will respond to the DMA signal according to the priority of the DMA signal and the order of DMA request after the current bus cycle ends. When the CPU responds to a DMA request for a device interface, it will give up the bus control right. Therefore, under the management of the DMA controller, the peripheral device and the memory directly exchange data without CPU intervention. Since the communication link between processing units is not 100% reliable, data must be retransmitted in some cases. Therefore, even if the transmitting end has sent the data, the DMA module 130 of the transmitting end will still lock the data in the memory 110 until an ACK signal is received from the receiving end. If an ACK signal is received, indicating that the data has been successfully received by the receiving end, the DMA module 130 can release the address space and reallocate it. If a non-acknowledgement (NAK) signal is received, the DMA module 130 will retransmit the data, thereby omitting a dedicated retransmission buffer.

[0114] The memory 110 is a part of the processing unit 100 that stores data. The data received by each port 120 of the processing unit 100 is finally stored in the memory 110. The data sent by each port 120 of the processing unit 100 also comes from the memory 110.

[0115] Figure 2 In the structure, each port 120 supports 800Gbps data communication. Figure 2 Each processing unit supports sending and receiving a total of 3200Gbps of data to and from four other processing units through four ports.

[0116] The processing unit 100 for sending data is called the sending end processing unit 1001, and the processing unit 100 for receiving data is called the receiving end processing unit 1002. Since the data received by the receiving end processing unit 1002 must be cached in the receiving data buffer first and then transferred to the memory 110, if the amount of data sent by the sending end processing unit 1001 to the receiving end processing unit 1002 exceeds the receiving buffer capacity of the receiving end processing unit 1002 during the communication between the processing units, data overflow will occur. Therefore, the prior art adopts Figure 3 Flow control is performed in this way. Figure 3 In the figure, only the sending end flow control unit 123 of the sending end processing unit 1001 and the receiving end flow control unit 124 of the receiving end processing unit 1002 are shown, but in fact, the sending end processing unit 1001 also has a receiving end flow control unit 124, and the receiving end processing unit 1002 also has a sending end flow control unit 123, but this article mainly focuses on sending data from the sending end processing unit 1001 to the receiving end processing unit 1002, so the receiving end flow control unit 124 of the sending end processing unit 1001 and the sending end flow control unit 123 of the receiving end processing unit 1002 do not play a role. In addition, since the embodiment of the present disclosure is mainly completed by the sending end flow control unit 123 and the receiving end flow control unit 124, therefore, Figure 3 Omitted Figure 2 The serializer and deserializer 121, the MAC layer 122, the switching module 140, the DMA module 130, and the memory 110 are included.

[0117] In order to prevent overflow, the sending end processing unit 1001 needs to send data according to the amount of data that the receiving end processing unit 1002 can receive. Therefore, it adopts a mechanism to pre-notify the traffic allowed to be sent. After the data in the receiving data buffer 12401 of the receiving end is moved into the memory 110, this part of the data no longer exists in the receiving data buffer 12401. According to the size of this part of the data (the size of the data newly transferred from the receiving data buffer 12401 to the receiving end memory), the flow value indicating how many packets of data are allowed to be sent to the sending end processing unit 1001 can be sent. As the receiving end receives the data buffer 12401 continuously transfers data to the receiving end memory during use, the flow value sent to the sending end is continuously updated. Every time the sending end processing unit 1001 sends data, it is equivalent to consuming the corresponding flow value. Each time before the sending end processing unit 1001 sends data to the receiving end processing unit 1002, it checks whether the size of the data to be sent is not greater than the difference between the flow extreme value and the consumed flow value. If so, it means that the receiving end's receiving data buffer 12401 will not overflow, and the data can be sent.

[0118] like Figure 3As shown, when the receiving end processing unit 1002 does not receive data from the sending end processing unit 1001, the receiving data buffer 12401 does not store any data, and the size of the data allowed to be sent by the sending end processing unit 1001 to itself is the size of the entire receiving data buffer 12401. At this time, the first flow value allocation unit 12402 allocates an initial first flow value, and its size is the size of the receiving data buffer 12401. The first flow value notification packet generator 12403 puts the initial first flow value in the first flow value initial notification packet, and sends it to the sending end flow control unit 123 through the transmitter 12405.

[0119] The receiver 12311 of the transmitting end processing unit 1001 receives the first flow value initial notification packet. The first flow value parser 12305 parses the flow value from the first flow value initial notification packet received by the receiving end flow control unit 124 and reflects it in the first flow extreme value storage 12302.

[0120] The first flow extreme value memory 12302 stores the first flow extreme value. The first flow extreme value is the accumulated value of the flow value received by the transmitting end from the receiving end. It reflects how many flow values ​​the transmitting end processing unit 1001 has received from the receiving end chip 1002 since the start of counting, that is, the sum of the storage capacity that has been freed up by the receiving end in history. The initial flow value received by the transmitting end from the receiving end is the entire storage capacity of the receiving data buffer 12401. The transmitting end sends data to the receiving end according to the initial flow value to fill up the receiving data buffer 12401. Afterwards, a part of the data in the receiving data buffer 12401 is transferred to the memory 110, and a part of the storage space will be freed up. The amount of storage space freed up due to data transfer is the amount of updated flow value received by the transmitting end from the receiving end. Whenever the receiving data buffer 12401 transfers data to the receiving end memory, the receiving end processing unit 1002 adds the amount of transferred data to the flow value and sends it to the transmitting end processing unit 1001, and finally adds it to the first flow extreme value recorded by the transmitting end processing unit 1001. Therefore, the first flow extreme value is generally larger than the storage capacity of the receiving data buffer 12401 at the receiving end, because the same storage space of the receiving data buffer 12401 will be repeatedly freed up, and this part of the storage space will be repeatedly accumulated to the flow value and the first flow extreme value.

[0121] After the initial flow value is stored in the first flow extreme value memory 12302, the first flow value initial confirmation packet generator 12319 of the sending end sends the first flow value initial confirmation packet to the receiving end through the transmitter 12310 of the sending end.

[0122] The first flow value consumption memory 12303 stores the consumed flow value, that is, the sum of the data volume that the transmitting end has sent to the receiving end. When the transmitting end sends data to the receiving end, the flow value of the corresponding size will be increased in the first flow value consumption memory 12303. The flow extreme value stored in the first flow extreme value memory 12302 is the amount of data that the receiving end allows the transmitting end to send, and the consumed flow value stored in the first flow value consumption memory 12303 is the amount of data that has been sent according to the first flow extreme value. The difference between the two is the amount of data that the transmitting end is allowed to send additionally. The comparator 12304 compares whether the amount of data currently to be sent to the receiving end in the sending data buffer 12301 does not exceed the difference. If it does not exceed, the next data can be sent from the transmitting end to the receiving end. If it exceeds, it cannot be sent. However, since the first flow extreme value stored in the first flow extreme value memory 12302 will increase later, it will definitely wait until a moment when it does not exceed to allow the next data to be sent from the transmitting end to the receiving end.

[0123] After the data packet to be sent is sent to the receiving end through the transmitter 12310 of the sending end flow control unit 123, the size of the sent data is added to the consumed flow value stored in the first flow value consumption memory 12303 through the second adder 12309.

[0124] After the receiving end stream control unit 124 receives the data packet sent by the sending end through its receiver 12406, it stores it in the receiving data buffer 12401 until the receiving data buffer 12401 is full. After the receiving data buffer 12401 is full, the received data stored in the receiving data buffer 12401 will be transferred to the memory 110 of the receiving end. In this way, the receiving data buffer 12401 has free storage capacity again. At this time, data from the sending end can be received again. Therefore, the amount of data newly transferred to the receiving end memory in the receiving data buffer 12401 is accumulated to the flow value allocated by the first flow value allocation unit 12402 through the fifth adder 12404. Previously, the flow value allocated by the first flow value allocation unit 12402 was the entire storage capacity of the receiving data buffer 12401. At this time, the flow value allocated by the first flow value allocation unit 12402 becomes the total storage capacity of the receiving data buffer 12401 plus the amount of data newly transferred from the receiving data buffer 12401 to the receiving end memory, that is, the amount of data that the sending end is allowed to send to the receiving end in history. Next, the first flow value notification packet generator 12403 is used to put the updated flow value in the first flow value update notification packet and send it to the sending end flow control unit 123 through the sender 12405 of the sending end.

[0125] The first flow value parser 12305 of the transmitting end receives the first flow value update notification packet through the receiver 12311 of the transmitting end, and parses the updated flow value therefrom. The updated flow value is actually the total amount of data that the receiving end allows the transmitting end to send to it in history. The previous first flow value buffer 12306 caches the flow value parsed from the previous first flow value notification packet received by the receiving end stream control unit 123, that is, the total amount of data that the receiving end allows the transmitting end to send to it before receiving the current flow value update notification packet. The subtractor 12307 subtracts the two, and obtains the amount of data that the current first flow value update notification packet newly allows the transmitting end to send to the receiving end, that is, the flow value difference. The first adder 12308 adds the flow value difference to the flow extreme value stored in the first flow extreme value memory 12302, and obtains the updated first flow extreme value. The updated first flow extreme value reflects the total amount of data that the receiving end allows the transmitting end to send to it in history.

[0126] The reason why the sending end first receives the updated flow value, then obtains the first flow value difference based on it, and then accumulates the difference to the first flow extreme value, instead of directly letting the receiving end transmit the flow value difference, that is, the amount of data newly transferred to the receiving end memory by the receiving data buffer 12401, is to avoid the impact caused by transmission loss. If the receiving end directly sends the flow value difference to the sending end, once the difference is lost in transmission, the first flow extreme value stored in the first flow extreme value memory 12302 will never reflect the lost difference. If the updated flow value is sent, even if the value is lost during the transmission process, since the flow value allocated by the first flow value allocation unit 12402 is always accumulated on the basis of the first flow value allocated last time, the difference is not actually lost in the entire updated flow value. In this way, after the first flow value parser 12305 receives the next first flow value update notification packet, it parses the updated flow value, and when it subtracts the value cached in the previous first flow value buffer 12306, the difference becomes the sum of the differences of the first flow values ​​transmitted by the receiving end to the sending end for the two most recent times. Therefore, even if the transmission is lost, the lost flow value difference will be correctly accumulated to the first flow extreme value memory 12302 in the subsequent process, avoiding the impact caused by the transmission loss.

[0127] In addition, the first flow value parser 12305 can perform a transmission error check on the first flow value notification packet received from the receiving end. The transmission error check is a check for the received data packet to verify whether an error occurs during the transmission process, including a cyclic redundancy check (CRC) and the like. If the check is wrong, the first flow value notification packet is discarded. This can improve the reliability of the received flow value. Discarding the first flow value notification packet will not cause the risk of losing the flow value to be received. The reason is the same as above. Even if the current flow value is discarded, the next flow value sent by the receiving end chip 1002 is accumulated on the basis of the current flow value. In this way, after the first flow value parser 12305 receives the next first flow value update notification packet, it parses the updated flow value, and when it is subtracted from the value cached in the previous first flow value buffer 12306, the difference becomes the sum of the difference between the current and next first flow values ​​transmitted by the receiving end to the sending end. Therefore, even if the transmission is lost, the lost flow value difference will be correctly accumulated to the first flow extreme value memory 12302 in the subsequent process, avoiding the impact caused by the transmission loss.

[0128] After the subtractor 12307 obtains the first flow value difference, the first flow value parser 12305 can use the flow value parsed from the current first flow value notification packet to update the previous first flow value buffer 12306, because when the flow value difference is calculated next time, the current flow value actually becomes the previous flow value in the next calculation. This is done to ensure that the next flow value difference calculation has a correct premise.

[0129] When the transmitting end wants to send data to the receiving end, the comparator 12304 takes out the data to be sent from the sending data buffer 12301, and compares the data size with the difference between the flow extreme value stored in the first flow extreme value memory 12302 and the consumed flow value stored in the first flow value consumption memory 12303. If the data size to be sent does not exceed the difference, it means that sending the data will not cause the receiving data buffer 12401 of the receiving end to overflow, and the data can be sent. After the transmitter 12310 of the transmitting end sends the data, the second adder 12309 adds the size of the data to be sent to the consumed flow value stored in the first flow value consumption memory 12303, so that the consumed flow value always reflects the amount of data sent by the transmitting end to the receiving end.

[0130] After the sending end sends the data to the receiving end, the receiving end stream control unit 124 repeats the same process as above, thereby achieving continuous data transmission.

[0131] The advantages of the above flow value-based flow control over previous technologies include:

[0132] (1) Even if the first flow value notification packet is lost on the way, it will never cause overflow. This is because, for the reasons mentioned above, after the first flow value parser 12305 receives the next non-lost flow value, when it subtracts the value cached by the previous first flow value buffer 12306, the difference becomes the sum of the difference between the flow values ​​transmitted by the receiving end to the sending end this time and the next time. Therefore, even if the transmission is lost, the lost flow value difference will be correctly accumulated to the first flow extreme value memory 12302 in the subsequent process, avoiding the impact caused by the transmission loss.

[0133] (2) The mechanism can accurately know the size of the space transferred from the receiving data buffer 12401 to the receiving end memory, and fully utilize the space of the receiving data buffer 12401 instead of reserving some buffer space for data packets, which causes waste.

[0134] (3) Due to the reasonable evaluation of the data size sent from the sender to the receiver, the transmission efficiency is improved and the time to switch from the state of waiting for data to the state of sending new data is shortened.

[0135] (4) The size of the receive data buffer 12401 can be flexibly controlled.

[0136] However, since the link is not 100% reliable, the flow control based on the flow value has the risk of communication interruption, that is, dead communication. In the above process, if the data sent from the sending end to the receiving end is lost during the transmission and does not reach the receiving end, the sending end considers that it has been sent, so the consumed flow value is accumulated in the first flow value consumption memory 12303, but the receiving end does not receive the data, and cannot allocate a new flow value according to the release of the corresponding data space of the receiving data buffer 12401. The sending end cannot receive the new flow value, thereby updating the first flow extreme value in the first flow extreme value memory 12302. In this way, the first flow extreme value in the first flow extreme value memory 12302 cannot be increased, but the consumed flow value in the first flow value consumption memory 12303 continues to increase, resulting in a smaller and smaller difference between the two, so that the data to be sent from the sending data buffer 12301 cannot be sent, resulting in a dead communication between the sending end processing unit 100 and the receiving end processing unit 1002.

[0137] The flow control mechanism based on the bidirectional flow value of the embodiment of the present disclosure

[0138] The flow control mechanism based on the bidirectional flow value means that not only the receiving end sends to the sending end the flow value indicating how much data the receiving end allows the sending end to send to itself, but also the sending end sends to the receiving end the second flow value indicating how much data the sending end has cumulatively sent to the receiving end. When the receiving end receives the second flow value, it will compare it with the total data size that has been received from the sending end counted internally. If there is a deviation, the deviation will be compensated to the flow value to be sent to the sending end next time, so that the first flow extreme value stored in the first flow extreme value memory 12302 has a chance to be corrected when dead communication occurs, thereby avoiding dead communication.

[0139] According to an embodiment of the present disclosure, the flow control mechanism based on the bidirectional flow value is as follows: Figure 4 shown. Figure 4 and Figure 3 The difference in the flow control unit 123 at the sending end is that Figure 4 The sending end flow control unit 123 adds a second flow value generator 12312. The second flow value generator 12312 uses the consumed flow value stored in the first flow value consumption memory 12303 (actually how much data the sending end has sent to the receiving end) as the second flow value to send to the receiving end flow control unit 124. Specifically, the second flow value generator 12312 puts the second flow value in the second flow value notification packet and sends it to the receiving end flow control unit 124 through the sending end receiver 12311. Figure 4 The other parts of the sending end stream control unit 123 are Figure 3 Similarly, the functions and signal flow relationships of these parts are described in reference Figure 3 It has been described in detail in the introduction, so I will not repeat it here.

[0140] Figure 4 The receiving end stream control unit 124 and Figure 3 The difference is that it adds a second flow value parser 12411, a second flow value memory 12407, a received data size memory 12408, a difference calculation unit 12409, a third adder 12410, and the content accumulated by the fifth adder 12404 is the same as Figure 3 Different from Figure 3 The rest of the functions and signal flow relationships are in reference Figure 3 It has been described in detail in the introduction, so I will not repeat it here.

[0141] The second flow value parser 12411 parses the second flow value notification packet received by the receiver 12406 at the receiving end from the second flow value notification packet received by the flow control unit 123 at the sending end to obtain the second flow value, and stores it in the second flow value memory 12407. The second flow value memory 12407 is dedicated to storing the second flow value.

[0142] The received data size memory 12408 stores the data size that the receiving end has received from the transmitting end. The second flow value represents the amount of data that the transmitting end has sent to the receiving end. The difference between the second flow value and the received data size stored in the received data size memory 12408 is actually the amount of data lost on the way. The difference calculation unit 12409 is used to calculate the difference. When the difference is 0, it means that there is no loss on the way, and the fifth adder 12404 is like Figure 3 As in the example, the amount of data newly transferred from the receiving data buffer 12401 to the receiving end memory is added to the flow value already allocated by the first flow value allocation unit 12402, without considering the difference. Figure 3 The fifth adder 12404 only accumulates the amount of data newly transferred to the receiving end memory by the receiving data buffer 12401. Figure 4 In the embodiment, the fifth adder 12404 adds the difference between the second flow value and the size of the received data and the amount of data newly transferred from the receiving data buffer 12401 to the receiving end memory to the flow value allocated by the first flow value allocation unit 12402. The difference is added to the first flow value to compensate for the inaccurate amount of storage space newly freed up by the receiving data buffer 12401 due to transmission loss, resulting in inaccurate flow value returned to the sending end, which causes dead communication.

[0143] When determining the received data size in the received data size memory 12408, the initial value stored in the received data size memory 12408 is set to 0. The third adder 12410, in response to receiving data from the transmitting end, adds the received data size to the value stored in the received data size memory 12408. Since the initial value stored in the received data size memory 12408 is 0, the receiving end adds the data size to the value stored in the received data size memory 12408 every time it receives data, so that the data size that the receiving end has received from the transmitting end can be directly read from the received data size memory 12408. In addition, after the difference calculation unit 12409 calculates the difference, the third adder 12410 adds the difference to the value stored in the received data size memory 12408.

[0144] The above-mentioned first flow value initial notification packet and first flow value update notification packet are collectively referred to as the first flow value notification packet. The first flow value notification packet is a packet used to notify the first flow value, whether it is the first time to notify the first flow value to the sender, or the first flow value updated before.

[0145] In the embodiment of the present disclosure, the data, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet sent by the transmitting end to the receiving end can be transmitted in the flow value message packet format. The flow value message packet format is a general format for transmitting the data, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet sent by the transmitting end chip to the receiving end chip. Setting a general format to transmit multiple packets unique to the embodiment of the present disclosure is conducive to reducing the processing load and improving the processing efficiency.

[0146] The flow value message packet format is as follows Figure 7 As shown, it includes a destination chip address (DA) 701, a source chip address (SA) 702, a packet type 703, a notified flow value or a second flow value (C0-C3) 704-707, a fill bit 708, and a transmission error check bit 709.

[0147] DA 701 is the address of the receiving end processing unit 1002 in the processing unit data communication, and SA 702 is the address of the sending end processing unit 1001 in the processing unit data communication. To establish processing unit communication, the addresses of the sending end processing unit 1001 and the receiving end processing unit 1002 must first be known, so these two fields must be included. In the example where the total packet length is 64 bytes, 8 bytes can be allocated to each of these two fields.

[0148] The communication type 703 indicates whether the message packet is a data packet, a first flow value initial notification packet, a first flow value update notification packet, a first flow value initial confirmation packet, or a second flow value notification packet. In the example where the total packet length is 64 bytes, 2 bytes can be allocated to this field.

[0149] The notified flow value or second flow value (C0-C3) 704-707 field carries the notified flow value or the second flow value. For the first flow value initial notification packet, this field carries the initial flow value; for the first flow value update notification packet, this field carries the updated flow value; for the first flow value initial confirmation packet, this field carries the confirmed received flow value; for the second flow value notification packet, this field carries the second flow value; for the data packet, this field is empty. The reason why the notified flow value or the second flow value (C0-C3) 704-707 is set to multiple fields C0-C3 instead of one field C0 is described in detail below. In the example where the total packet length is 64 bytes, each of the multiple fields C0-C3 can be set to 2 bytes.

[0150] The padding bit 708 is a bit filled in order to make the length of the entire flow value message packet reach a specified length, such as 64 bytes. For the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, or the second flow value notification packet, the padding bit can be placed with a fixed code string. For the data packet, the padding bit 708 can be used to carry the data to be transmitted. In the example where the total packet length is 64 bytes, 36 bytes can be allocated to this field.

[0151] The transmission error check bit 709 is a bit set to check whether an error occurs during the transmission of the entire flow value message packet, such as a cyclic redundancy check (CRC) bit. If this bit indicates that a transmission error occurs, the packet can be discarded or retransmitted. In the example where the total packet length is 64 bytes, 2 bytes can be allocated to this field.

[0152] Since the processing unit network may be composed of hundreds or thousands of processing units, in order to avoid network transmission congestion, the above-mentioned message packet can carry the content to be transmitted by multiple virtual channels to reduce network load. It can be considered that a sending end processing unit 1001 and multiple receiving end processing units 1002 each have multiple virtual channels, and the content to be transmitted by multiple virtual channels can be carried in one message packet at the same time. A receiving end processing unit 1002 and multiple sending end processing units 1001 also have multiple virtual channels respectively, and the content to be transmitted by multiple virtual channels can be carried in one message packet at the same time.

[0153] For example, for a message packet to be sent by a transmitting end processing unit 1001, it is allowed to simultaneously transmit the second flow value or data sent to the virtual channels of multiple (for example, 4) receiving end processing units, which, for example, respectively occupy the above-mentioned C0-C3 fields, and a virtual channel is formed between the transmitting end processing unit 1001 and any receiving end processing unit 1002. For a notification packet to be sent by a receiving end processing unit 1002, it is allowed to simultaneously transmit the flow value (initial or updated first flow value) sent to the virtual channels of multiple (for example, 4) transmitting end processing units, which, for example, respectively occupy the above-mentioned C0-C3 fields, and a virtual channel is formed between the receiving end processing unit 1002 and any transmitting end processing unit 1001. In this way, the network load can be greatly reduced.

[0154] In the case where a transmitting end processing unit 1001 and multiple receiving end processing units 1002 form multiple virtual channels, the first traffic extreme value stored in the first traffic extreme value memory 12302 includes multiple first traffic extreme values ​​corresponding to the virtual channels of multiple receiving end processing units 1002, reflecting the amount of data that the transmitting end processing unit 1001 can allow to be sent to each receiving end processing unit 1002; the first traffic value consumption memory 12303 stores the traffic values ​​that the transmitting end processing unit has consumed for the virtual channels of the multiple receiving end processing units, reflecting the amount of data that has been sent to each receiving end processing unit 1002; the comparator 12304 stores the traffic values ​​that the transmitting end processing unit has consumed for the virtual channels of the multiple receiving end processing units, reflecting the amount of data that has been sent to each receiving end processing unit 1002; The second flow value generator 12312 determines the virtual channel of the receiving end processing unit 1002 to which the data is to be sent, and allows the data to be sent to the virtual channel of the receiving end processing unit 1002 if the size of the data to be sent does not exceed the difference between the first flow extreme value corresponding to the virtual channel of the receiving end processing unit 1002 and the consumed flow value corresponding to the virtual channel of the receiving end processing unit 1002; the second flow value generator 12312 uses the consumed flow values ​​of the virtual channels of the multiple receiving end processing units 1002 as the second flow values ​​corresponding to the virtual channels of the multiple receiving end processing units 10021002, respectively, to send them to the receiving end flow control unit 124 of the multiple receiving end processing units 1002. In this way, the C0-C3 fields of the second flow value notification packet generated by the second flow value generator 12312 respectively include the second flow values ​​corresponding to the virtual channels of multiple receiving end processing units (for example, 4), so as to simultaneously notify the second flow values ​​to multiple receiving end processing units 1002 and reduce network congestion.

[0155] In the case where a receiving end processing unit 1002 and multiple sending end processing units 1001 form multiple virtual channels, the second flow value stored in the second flow value memory 12407 includes multiple second flow values ​​corresponding to the virtual channels of the multiple sending end processing units, respectively reflecting the amount of data sent by the multiple sending end processing units 1001 to the receiving end processing unit 1002; the received data size memory 12408 respectively stores the size of data received by the receiving end processing unit 1002 from the virtual channels of the multiple sending end processing units 1001; the difference calculation unit 12409 respectively calculates the multiple second flow values ​​corresponding to the virtual channels of the multiple sending end processing units 1001 stored in the second flow value memory 12407 The difference between the second flow value and the data size respectively received from the virtual channels of the multiple transmitting end processing units 1001 stored in the received data size memory 12408, the difference calculated for the virtual channel of each transmitting end processing unit 1001 is actually the amount of data lost during the transmission of data from the transmitting end processing unit 1001 to the receiving end processing unit 1002; the first flow value allocation unit 12402 updates the multiple flow values ​​sent to the virtual channels of the multiple transmitting end processing units 1001 according to the difference obtained for the virtual channels of the multiple transmitting end processing units 1001 and the amount of data transferred from the receiving data buffer 12401 to the receiving end memory for the virtual channels of the multiple transmitting end processing units 1001. In this way, the C0-C3 fields of the first flow value initial notification packet or the first flow value update notification packet generated by the first flow value notification packet generator 12403 respectively include the flow values ​​corresponding to the virtual channels of multiple transmitting end processing units (for example, 4), so as to simultaneously notify the respective flow values ​​of multiple transmitting end chips 1001 and reduce network congestion.

[0156] If the flow value or the second flow value in the C0-C3 field is directly in bytes or bits, it will greatly occupy the storage space in the message packet and reduce the transmission efficiency. Therefore, the unit of the flow value or the second flow value can be set equal to 64 bytes. The number of units of the flow value represents the number of 64-byte storage capacity. In addition, the size of the receiving data buffer 12401 can be set to 720k bits to cover the time taken for the data to go back and forth between the two processing units. As mentioned above, the initial flow value corresponds to the storage space of the entire receiving data buffer 12401 (the receiving data buffer 12401 does not store data at the beginning, and the amount of storage space of the receiving data buffer 12401 determines the amount of data allowed to be sent by the sending end processing unit 1001 to the receiving end processing unit 1002), so the initial flow value can be 720k / (8×64)=1440 flow value units.

[0157] In addition, it can be seen from the above process that the first flow extreme value memory 12302, the first flow value consumption memory 12303, the second flow value memory 12407, and the received data size memory 12408 all store accumulated values, which are constantly accumulated with the use process and never decrease. In this way, there is a problem that the stored values ​​are getting larger and larger, wasting storage space. In order to avoid wasting storage space, the maximum value stored in these four memories is specified, and when it exceeds the maximum value, it starts to accumulate again from 0. For example, when the maximum value is set to 5000 flow value units, when the value stored in the memory reaches 5000, it automatically changes back to 0 and accumulates again on the basis of 0, that is, resets the storage. Since the embodiment of the present disclosure mainly uses the difference between the value stored in the first flow extreme value memory 12302 and the value stored in the first flow value consumption memory 12303, and the difference between the value stored in the second flow value memory 12407 and the value stored in the first flow value consumption memory 12303, the compared pair of values ​​often return to zero at a relatively close time point, and their difference remains unchanged, that is, it does not affect the calculation of their difference, and saves storage space at the same time. Even if at a certain time point, one of the compared pair of values ​​returns to zero and the other does not return to zero, if the obtained difference is a negative number, the correct difference can be obtained by adding the maximum value (such as 5000) to the negative number.

[0158] An empirical formula for the maximum value is 2×2^(ceil(log2(a))), where a represents the initial flow value, ceil(x) is the ceiling function, which is used to find the smallest integer greater than or equal to x, and 2^(x) represents 2 to the power of x. When a=1440, substituting into the formula, 4096 is obtained, that is, at this time, the maximum value stored in the first flow extreme value memory 12302, the first flow value consumption memory 12303, the second flow value memory 12407, and the received data size memory 12408 is 4096 flow value units.

[0159] The sending of the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet is not necessarily consistent with the period of sending data. Since the main cost of the embodiment of the present disclosure lies in the additional bandwidth required to transmit the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet. A typical data packet size is 1K bytes, and the typical sizes of the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet are 64 bytes respectively. Assume that the period of sending the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet is N times the period of sending data packets. If N=1, it means that the period of sending the first traffic value initial notification packet, the first traffic value update notification packet, the first traffic value initial confirmation packet, and the second traffic value notification packet is equal to the period of sending data packets. If N=1, the bandwidth cost of transmitting traffic value related information is 64 / 1024=6.25%. If N=a, the bandwidth cost of transmitting information related to the flow value is 64 / 1024a=(6.25 / a)%. For example, when N=8, the bandwidth cost is 0.78%. When N=16, the bandwidth cost is 0.39%. At this time, the size of the receiving data buffer 12401 only needs to be increased by 8KB (when N=8) or 16KB (when N=16). Practice shows that making N a positive integer greater than or equal to 2, especially N=8 or N=16, can enable the embodiment of the present disclosure to achieve better results.

[0160] According to one embodiment of the present disclosure, Figure 5 As shown, a sending end flow control method is provided, comprising:

[0161] Step 510: Update the first flow extreme value according to the flow value sent by the receiving end, wherein the sent flow value is the amount of data that the receiving end is currently allowed to increase in reception;

[0162] Step 520: If the size of the data to be sent does not exceed the difference between the first flow extreme value and the consumed flow value, the data is allowed to be sent to the receiving end, wherein the consumed first flow value is equal to the amount of data sent by the sending end to the receiving end;

[0163] Step 530: Use the consumed traffic value as a second traffic value to send to the receiving end, so that the receiving end adjusts the traffic value sent to the sending end according to the difference between the second traffic value and the amount of data received by the receiving end from the sending end.

[0164] Optionally, step 510 includes:

[0165] Parsing the flow value from the current first flow value notification packet received by the receiving end;

[0166] The flow value parsed from the current first flow value notification packet is subtracted from the flow value parsed from the previous first flow value notification packet received from the receiving end to obtain a flow value difference;

[0167] The flow value difference is accumulated to the flow value stored in the first flow extreme value memory.

[0168] Optionally, after step 520, the method further includes: adding the size of the sent data to the consumed traffic value.

[0169] Optionally, step 530 includes: placing the consumed traffic value as the second traffic value in a second traffic value notification packet to send to the receiving end.

[0170] Optionally, before parsing the flow value from the current first flow value notification packet received from the receiving end, the method also includes: performing a transmission error check on the current first flow value notification packet received from the receiving end, and if a check error is found, discarding the current first flow value notification packet.

[0171] like Figure 6 As shown, according to an embodiment of the present disclosure, a receiving end flow control method is provided, including:

[0172] Step 610, storing the data received from the transmitting end in a receiving data buffer;

[0173] Step 620: receiving a second flow value from the transmitting end;

[0174] Step 630, obtaining the size of data received from the transmitting end chip;

[0175] Step 640: Calculate the difference between the second flow value and the received data size;

[0176] Step 650: Update the flow value sent to the sending end according to the difference and the amount of data transferred from the receiving data buffer to the receiving end memory.

[0177] Optionally, step 630 includes:

[0178] Set the received data size memory, the initial value stored in the received data size memory is 0;

[0179] In response to receiving data from the transmitting end, adding the received data size to the value stored in the received data size memory;

[0180] The received data size is read from the received data size memory.

[0181] Optionally, after step 640, the method further includes: adding the difference to the value stored in the received data size memory.

[0182] Optionally, step 650 includes:

[0183] adding the difference between the second flow value and the size of the received data and the amount of data transferred from the receiving data buffer to the receiving end memory to the flow value allocated for sending to the sending end;

[0184] The flow value is sent to the sending end chip.

[0185] Optionally, sending the flow value to the sending end includes: putting the flow value in a first flow value notification packet and sending the packet to the sending end.

[0186] Optionally, step 620 includes: parsing the second flow value from a second flow value notification packet received by the sending end.

[0187] The implementation details of the above-mentioned sending end flow control method and receiving end flow control method have been described in the above-mentioned device embodiment part, and will not be repeated here for the sake of saving space.

[0188] The commercial value of the disclosed embodiments

[0189] By using the flow control mechanism based on bidirectional flow values ​​of the embodiment of the present disclosure, it is possible to ensure that when some data packets are lost due to errors in transmission, the flow values ​​of the sending and receiving ends are synchronized and can be automatically corrected. Therefore, flow control based on flow values ​​can be used together with end-to-end DMA and internal switching modules to provide high-throughput interconnection on unreliable links. Flow control based on flow values ​​can reduce transmission delays and improve switching efficiency. Experiments have shown that the embodiment of the present disclosure increases network throughput by 20% and transmission efficiency between processing units by more than 30%, and has broad market prospects.

[0190] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0191] It should be understood that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0192] It should be understood that an element described in singular form herein or shown in the drawings as only one does not limit the number of the element to one. In addition, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be split into multiple modules or elements.

[0193] It should also be understood that the terms and expressions used herein are for description only, and one or more embodiments of this specification should not be limited to these terms and expressions. The use of these terms and expressions does not mean to exclude any equivalent features of the illustrations and descriptions (or parts thereof), and it should be recognized that various modifications that may exist should also be included in the scope of the claims. Other modifications, changes and substitutions may also exist. Accordingly, the claims should be deemed to cover all such equivalents.

Claims

1. A flow control unit, located at a sending end, comprising: A first flow extreme value memory, used to store a first flow extreme value, the first flow extreme value being updated according to a first flow value sent by a flow control unit at a receiving end, the first flow value indicating an amount of data that the receiving end is allowed to further receive; A first traffic consumption memory, used to store a traffic value consumed by the sending end, wherein the consumed traffic value represents an amount of data that the sending end has sent to the receiving end; A comparator, configured to determine that the size of the data to be sent does not exceed the difference between the first flow extreme value and the consumed flow value, and allow the data to be sent to be sent to the receiving end; The second traffic generator sends the consumed traffic value as a second traffic value to the traffic control unit at the receiving end, so that the traffic control unit at the receiving end adjusts the traffic value sent to the first traffic extreme value memory next time according to the difference between the second traffic value and the amount of data received by the receiving end from the sending end; A first flow value parser, configured to parse a flow value from a current first flow value notification packet received by a flow control unit at a receiving end; A previous first flow value buffer, which caches the flow value parsed from the previous first flow value notification packet received from the flow control unit at the receiving end; a subtractor, configured to subtract the flow value cached in the previous first flow value buffer from the flow value parsed from the current first flow value notification packet to obtain a flow value difference; The first adder is used to accumulate the flow value difference to the first flow extreme value stored in the first flow extreme value memory.

2. The flow control unit according to claim 1, wherein: The sending end includes a sending end processing unit, and the flow control unit is located in the sending end processing unit; the receiving end includes a receiving end processing unit, and the flow control unit of the receiving end is located in the receiving end processing unit.

3. The flow control unit according to claim 1, wherein: After the subtractor obtains the flow value difference, the flow value parser updates the previous first flow value buffer with the flow value parsed from the current first flow value notification packet.

4. The flow control unit according to claim 1, further comprising: The second adder is used to add the size of the sent data to the consumed traffic value stored in the first traffic value consumption memory after sending the data to the receiving end.

5. The flow control unit according to claim 1, wherein: The second traffic value generator puts the second traffic value in a second traffic value notification packet and sends it to the receiving end.

6. The flow control unit according to claim 1, wherein: The first flow value parser performs a transmission error check on the current first flow value notification packet received from the receiving end, and discards the current first flow value notification packet if a check error occurs.

7. The flow control unit according to claim 1, wherein: The current first flow value notification packet includes a first flow value initial notification packet and a first flow value update notification packet. The sending end chip flow control unit also includes a first flow value initial confirmation packet generator, which is used to generate a first flow value initial confirmation packet to be sent to the receiving end after the flow value notified by the first flow value initial notification packet is stored in the first flow value extreme value memory.

8. The flow control unit according to claim 5 or 7, wherein: The data sent by the sending end to the receiving end, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet are transmitted in a flow value message packet format, and the flow value message packet format includes a destination chip address, a source chip address, a packet type, a notified flow value, a padding bit, and a transmission error check bit.

9. The flow control unit according to claim 8, wherein: The first traffic extreme value stored in the first traffic extreme value memory includes a plurality of first traffic extreme values ​​respectively corresponding to the virtual channels of the plurality of receiving ends; The first traffic consumption memory stores the traffic values ​​respectively consumed by the sending end for the virtual channels of the plurality of receiving ends; The comparator determines the virtual channel of the receiving end to which the data is to be sent, and allows the data to be sent to the virtual channel of the receiving end if the size of the data to be sent does not exceed the difference between the flow extreme value corresponding to the virtual channel of the receiving end and the consumed flow value corresponding to the virtual channel of the receiving end; The second flow value generator uses the flow values ​​respectively consumed by the virtual channels of the multiple receiving ends as second flow values ​​respectively corresponding to the virtual channels of the multiple receiving ends, and sends them to the multiple receiving ends respectively; The notified second flow value includes second flow values ​​corresponding to virtual channels of multiple receiving ends.

10. The flow control unit according to claim 8, wherein: The unit of the flow value or the second flow value is set equal to 64 bytes, the initial flow value in the first flow value initial notification group is set to 1440 flow value units, the maximum value stored in the first flow extreme value memory and the first flow value consumption memory is 4096 flow value units, and the storage is reset after exceeding the maximum value.

11. The flow control unit according to claim 1, wherein: The period for sending the flow value or the second flow value is N times the period for the sending end to send data to the receiving end, where N is a positive integer greater than or equal to 2.

12. The flow control unit according to claim 11, wherein: N=8 or N=16.

13. A processing unit, located at a transmitting end, comprising: Memory; A direct memory access module, used for controlling direct access to the memory; Multiple ports; A switching module controls the connection between the direct memory access module and the multiple ports, wherein at least one of the multiple ports includes a transmitting end chip flow control unit according to any one of claims 1 to 12, a MAC layer for performing a medium access control MAC, and a serializer and deserializer for serializing data to be sent or deserializing received data.

14. A flow control unit, located at a receiving end, comprising: A receiving data buffer, used for buffering data received from the sending end; A second flow value memory, used to store a second flow value received from the sending end, wherein the second flow value is a flow value consumed by the sending end; A received data size memory, used to store the size of data received from the sending end; a difference calculation unit, configured to calculate a difference between a second flow value stored in the second flow value memory and a received data size stored in the received data size memory; The first flow value allocation unit is used to update the flow value sent to the sending end according to the difference between the second flow value and the size of the received data and the amount of data sent from the receiving data buffer to the receiving end memory.

15. The flow control unit according to claim 14, wherein: The receiving end includes a receiving end processing unit, and the flow control unit is located in the receiving end processing unit; the sending end includes a sending end processing unit, and the flow control unit of the sending end is located in the sending end processing unit.

16. The flow control unit according to claim 14, wherein: The initial value stored in the received data size memory is set to 0, and the flow control unit also includes: a third adder, which is used to add the received data size to the value stored in the received data size memory in response to receiving data from the transmitting end.

17. The flow control unit according to claim 16, wherein: The third adder accumulates the difference to the value stored in the received data size memory after the difference calculation unit calculates the difference.

18. The flow control unit according to claim 14, further comprising: A fifth adder is used to add the difference between the second flow value and the size of the received data and the amount of data sent from the receiving data buffer to the receiving end memory to the flow value allocated by the first flow value allocation unit.

19. The flow control unit according to claim 14, further comprising: The first flow value notification packet generator is used to put the updated flow value in the first flow value notification packet and send it to the sending end.

20. The flow control unit according to claim 14, further comprising: The second flow value parser is used to parse the second flow value notification packet received by the sending end to obtain the second flow value, and store it in the second flow value memory.

21. The flow control unit according to claim 19, wherein: The current first flow value notification packet includes a first flow value initial notification packet and a first flow value update notification packet; after the receiving end chip flow control unit sends the first flow value initial notification packet to the sending end chip flow control unit, the receiving end chip flow control unit also receives the first flow value initial confirmation packet sent by the sending end chip flow control unit.

22. The flow control unit according to claim 20 or 21, wherein: The data sent by the sending end to the receiving end, the first flow value initial notification packet, the first flow value update notification packet, the first flow value initial confirmation packet, and the second flow value notification packet are transmitted in a flow value message packet format, and the flow value message packet format includes a destination chip address, a source chip address, a packet type, a notified flow value, a padding bit, and a transmission error check bit.

23. The flow control unit according to claim 22, wherein: The second flow value stored in the second flow value memory includes a plurality of second flow values ​​corresponding to the virtual channels of the plurality of transmitting ends respectively; the received data size memory respectively stores the data sizes received from the virtual channels of the plurality of transmitting ends; The difference calculation unit calculates the difference between the plurality of second flow values ​​corresponding to the virtual channels of the plurality of transmitting ends stored in the second flow value memory and the received data sizes corresponding to the virtual channels of the plurality of transmitting ends stored in the received data size memory; The first flow value allocation unit updates the multiple first flow values ​​sent to the virtual channels of the multiple sending ends according to the differences obtained for the virtual channels of the multiple sending ends and the amount of data sent to the receiving end memory for the virtual channels of the multiple sending ends in the receiving data buffer, and the notified first flow values ​​include the first flow values ​​corresponding to the virtual channels of the multiple sending ends.

24. The flow control unit according to claim 22, wherein: The size of the receiving data buffer is set to 720k bits, the unit of the flow value is set to 64 bytes, the initial flow value in the first flow value initial notification packet is set to 1440 flow value units, the maximum value of the second flow value stored in the second flow value memory and the received data size stored in the received data size memory is 4096 flow value units, and the storage is reset after exceeding the maximum value.

25. The flow control unit according to claim 14, wherein: The period for sending the flow value or the second flow value is N times the period for the sending end to send data to the receiving end, where N is a positive integer greater than or equal to 2.

26. The flow control unit according to claim 25, wherein: N=8 or N=16.

27. A processing unit, located at a receiving end, comprising: Memory; A direct memory access module, used for controlling direct access to the memory; Multiple ports; A switching module controls the connection between the direct memory access module and the multiple ports, wherein at least one of the multiple ports includes a receiving end chip flow control unit according to any one of claims 15 to 26, a MAC layer for performing a medium access control MAC, and a serializer and deserializer that serializes data to be sent or deserializes received data.

28. A sending end flow control method, comprising: Update the first traffic extreme value according to the traffic value sent by the receiving end, wherein the sent traffic value is the amount of data that the receiving end is currently allowed to increase in reception; If the size of the data to be sent does not exceed the difference between the first traffic limit and the consumed traffic value, the data is allowed to be sent to the receiving end, wherein the consumed first traffic value is equal to the amount of data that the sending end has sent to the receiving end; Using the consumed flow value as a second flow value to send to the receiving end, so that the receiving end adjusts the flow value sent to the sending end according to the difference between the second flow value and the amount of data received by the receiving end from the sending end; Wherein, updating the first flow extreme value according to the flow value sent by the receiving end includes: Parsing the flow value from the current first flow value notification packet received by the receiving end; The flow value parsed from the current first flow value notification packet is subtracted from the flow value parsed from the previous first flow value notification packet received from the receiving end to obtain a flow value difference; The flow value difference is accumulated to the flow value stored in the first flow extreme value memory.

29. The method according to claim 28, after allowing the data to be sent to the receiving end, the method further comprises: The size of the sent data is added to the consumed traffic value.

30. The method of claim 28, wherein: The taking the consumed traffic value as the second traffic value to send to the receiving end includes: putting the consumed traffic value as the second traffic value in a second traffic value notification packet to send to the receiving end.

31. The method of claim 28, wherein: Before parsing the flow value from the current first flow value notification packet received from the receiving end, the method further includes: performing a transmission error check on the current first flow value notification packet received from the receiving end, and discarding the current first flow value notification packet if a check error is found.

32. A receiving end flow control method, comprising: storing the data received from the transmitting end in a receiving data buffer; receiving a second flow value from the sending end, where the second flow value is a flow value consumed by the sending end; Get the size of data received from the sending chip; Calculating a difference between the second flow value and the received data size; The flow value sent to the sending end is updated according to the difference and the amount of data transferred from the receiving data buffer to the receiving end memory.

33. The method of claim 32, wherein: The step of obtaining the size of data received from the transmitting end includes: Set the received data size memory, the initial value stored in the received data size memory is 0; In response to receiving data from the transmitting end, adding the received data size to the value stored in the received data size memory; The received data size is read from the received data size memory.

34. The method of claim 33, wherein: After calculating the difference between the second flow value and the received data size, the method further comprises: The difference is added to the value stored in the received data size memory.

35. The method of claim 32, wherein: The updating of the flow value sent to the sending end according to the difference and the amount of data transferred from the receiving data buffer to the receiving end memory comprises: adding the difference between the second flow value and the size of the received data and the amount of data transferred from the receiving data buffer to the receiving end memory to the flow value allocated for sending to the sending end; The flow value is sent to the sending end chip.

36. The method of claim 35, wherein: The sending of the flow value to the sending end includes: placing the flow value in a first flow value notification packet and sending the packet to the sending end.

37. The method of claim 32, wherein: The receiving the second flow value from the sending end includes: parsing the second flow value from a second flow value notification packet received by the sending end.

Citation Information

Patent Citations

  • Method and system for controlling flow

    CN101707789A

  • Data transmission method, device and system

    CN104639298A