Data transmission method, apparatus and system

By using the preamble of business messages or credit response messages to carry credit values ​​in the automatic counter correction mechanism, the problem of poor reliability of traditional credit flow control technology is solved, and more stable flow control and resource utilization are achieved.

WO2024244466A1PCT designated stage expired Publication Date: 2024-12-05HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/070216
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-31
Filing Date
2024-01-02
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

Traditional credit flow control technology has poor reliability during message transmission, resulting in unstable flow control and potential problems such as traffic congestion and performance degradation.

Method used

By automatically correcting the counter, the credit value is carried in the preamble of the business message or credit response message to correct the counter, ensuring the reliability of flow control.

Benefits of technology

It improves the reliability of flow control, avoids the degradation of flow performance and congestion caused by packet or credit value loss, and enhances the utilization efficiency of network resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024070216_05122024_PF_FP_ABST
    Figure CN2024070216_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications. Disclosed are a data transmission method, apparatus and system. In the method, a counter is automatically recovered in the process of performing credit-based flow control (CFC) on the basis of the counter, thereby avoiding the phenomenon of flow performance reduction or even flow blockage caused by the loss of a message or a credit value, and improving the reliability of CFC. The method is applied to a first node configured with a first counter, wherein the first node sends a message to a second node by means of one or more sending queues, and the first counter is used for performing CFC on a message of a first sending queue among the one or more sending queues. The method comprises: a first node sending to a second node a reference message used for instructing the correction of a first counter; and the first node receiving a service message or a credit response message returned by the second node, wherein a preamble of the service message or the credit response message carries a credit value, and the credit value is used for correcting the first counter.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method, device and system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on May 31, 2023, with application number 202310643717.7 and application name “A Data Transmission Method, Device and System”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a data transmission method, device and system. Background Art

[0003] For any two communicating devices, the device sending messages (or traffic) is called the first node, and the device receiving messages (or traffic) is called the second node. During communication between the first and second nodes, traditional priority-based flow control (PFC) techniques can be used to control the traffic transmitted from the first node to the second node, thereby preventing traffic overflow at the second node and resulting in packet loss.

[0004] Because traditional PFC technology is a passive flow control technique and occupies a large amount of the second node's receive buffer resources, active credit-based flow control (CFC) technology can be used to control the amount of traffic transmitted from the first node to the second node, thereby reducing the use of the second node's receive buffer resources.

[0005] However, when using CFC to control traffic transmission from a first node to a second node, if a message sent by the first node to the second node is lost, or if the credit information returned by the second node to the first node is lost, effective control of the traffic transmitted from the first node to the second node becomes impossible. This can lead to decreased traffic transmission performance during the transmission from the first node to the second node, or even traffic congestion at the first node. In other words, CFC technology has poor reliability.

[0006] Summary of the Invention

[0007] The present application provides a data transmission method, device and system. The method automatically restores the counter during the process of credit flow control based on the counter, thereby avoiding the decline in flow performance or even blockage caused by the loss of messages or credit values, and improving the reliability of credit flow control.

[0008] To achieve the above objectives, this application provides the following technical solutions:

[0009] In a first aspect, the present application provides a data transmission method, which is applied to a first node configured with a first counter. The first node sends a message to the second node through one or more sending queues, and the first counter is used to perform credit-based flow control (CFC) on the message of the first sending queue in the one or more sending queues. The method includes: the first node sends a reference message to the second node for indicating the correction of the first counter. The first node receives a business message or a credit response message returned by the second node, and the preamble in the business message or the credit response message carries a credit value, which is used to correct the first counter.

[0010] The method provided by the present application enables automatic correction of the counter during the process of credit flow control of the message sent by the first node through the counter, thereby greatly improving the reliability of credit flow control of the message sent by the first node through the counter. Moreover, in the process of correcting the counter used for credit flow control, the credit value is carried in the message preamble, making the present application solution easy to implement. In addition, when the credit value is carried in the preamble of the service message, network resources of the first node and the second node can be saved. When the credit value is carried in the preamble of a dedicated credit response message, the credit value can be promptly transmitted to the first node through the credit response message without waiting for the service message to arrive and then transmitting the credit value to the first node through the service message, thereby improving the efficiency of correcting the first counter.

[0011] In one possible design, the above-mentioned credit value is used to characterize the length of the message from the first sending queue and flowing out of the receiving cache of the second node. The preamble in the above-mentioned business message and credit response message includes a type field, a reference end field and a credit value field. Among them, the type field carries a credit flow control CFC type mark, and the CFC type mark is used to indicate that the preamble in the above-mentioned business message and credit response message carries information for credit flow control. The reference end field is used to carry a reference end mark, and the reference end mark is used to indicate that the reference message has flowed out of the receiving cache of the second node. The credit value field is used to carry the credit value returned by the second node to the first node.

[0012] In another possible design, the preamble in the reference message includes a type field and a reference request field. The type field carries a CFC type tag, which indicates that the preamble in the reference message carries information for credit flow control. The reference request field carries a reference tag that identifies the reference message.

[0013] Through the above two possible designs, the reference mark used to identify the reference message, the credit value used to correct the counter, and the reference end mark used to indicate that the reference message has flowed out of the receiving cache of the second node in the present application scheme can all be carried by the message preamble code, making the present application scheme easy to implement.

[0014] In another possible design, the above method also includes: the first node periodically determines the to-be-sent messages scheduled out of the first sending queue as reference messages; or, the first node determines the to-be-sent messages scheduled out of the first sending queue as reference messages in response to a correction instruction.

[0015] Through this possible design, when the first node performs flow control on the messages sent by the first sending queue based on the first counter, the first counter can be periodically and automatically corrected, so that the reliability of the first node when performing flow control based on the corrected first counter is greatly improved.

[0016] In another possible design, the value of the first counter is used to represent the length of the message scheduled to be dequeued from the first transmit queue. The message scheduled to be dequeued from the first transmit queue includes the communication link located at the first node to transmit the message to the second node and the message cached in the receive cache of the second node.

[0017] In another possible design, before the first node sends the reference message to the second node, the method further includes: the first node determining a first credit value representing the length of the reference message based on the length of the reference message and the bit width of the second node's receive buffer. The first node adds the first credit value to the current value of the first counter to complete the update of the first counter value.

[0018] In another possible design, the method further includes: when the number of consecutive correction failures of the first counter exceeds a threshold, the first node outputs an alarm message.

[0019] Through this possible design, when the first node performs flow control through the first counter, it promptly outputs an alarm message to the user when the automatic correction of the first counter fails. This can promptly remind the user to inspect the communication link between the first node and the second node, thereby ensuring the communication quality.

[0020] In another possible design, before the first node sends a message to the second node, the method further includes: the first node sends a CFC capability request message to the second node. The first node receives a CFC capability response message returned by the second node. The CFC capability response message carries the CFC capability information of the second node, and the CFC capability information is used to perform credit flow control on the message sent to the second node. The CFC capability information includes one or more of the size of the second node's receive buffer, the bit width of the second node's receive buffer, the receive queues in the second node that support CFC, or an offset. Here, the offset is used to determine the message length required to calculate the message credit value.

[0021] Through this possible design, the first node obtains the CFC capability information of the second node through pre-negotiation with the second node, so that the first node can perform credit flow control on the messages sent to the second node based on the obtained CFC capability information of the second node, and calibrate the counter used for credit flow control.

[0022] In a second aspect, the present application provides a data transmission method, which is applied to a second node including a first receiving queue. The first receiving queue is used to receive messages from a first sending queue of the first node. The method includes: the second node receives a first message from the first sending queue. In response to the first message being a reference message, the second node sends a service message or a credit response message to the first node. The preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct a first counter for performing credit flow control (CFC) on messages in the first sending queue. The reference message is used to indicate the correction of the first counter.

[0023] In one possible design, the above-mentioned credit value is used to characterize the length of the message from the first sending queue and flowing out of the receiving cache of the second node. The preamble in the above-mentioned business message and credit response message includes a type field, a reference end field and a credit value field. Among them, the type field carries a credit flow control CFC type mark, and the CFC type mark is used to indicate that the preamble in the above-mentioned business message and credit response message carries information for credit flow control. The reference end field is used to carry a reference end mark, and the reference end mark is used to indicate that the reference message has flowed out of the receiving cache of the second node. The credit value field is used to carry the credit value returned by the second node to the first node.

[0024] In another possible design, the preamble in the reference message includes a type field and a reference request field. The type field carries a CFC type tag, which indicates that the preamble of the reference message carries information for credit flow control. The reference request field carries a reference tag that identifies the reference message.

[0025] In another possible design, before the second node receives the first message from the first transmit queue, the method further includes: the second node receiving a CFC capability request message sent by the first node. In response to the CFC capability request message, the second node sends a CFC capability response message to the first node. The CFC capability response message carries the second node's CFC capability information, which is used to perform credit flow control on messages sent to the second node. The CFC capability information includes one or more of the size of the second node's receive buffer, the bit width of the second node's receive buffer, the receive queues in the second node that support CFC, or an offset. The offset is used to determine the message length required to calculate the message credit value.

[0026] It can be understood that the beneficial effects of the technical solution provided by the second aspect and any possible design thereof can be referred to the description of the beneficial effects of the technical solution provided by the first aspect and any possible design thereof, and no further details will be given.

[0027] In a third aspect, the present application provides a data transmission device.

[0028] In one possible design, the data transmission device is used to execute any one of the methods provided in the first aspect above. The present application can divide the data transmission device into functional modules according to any one of the methods provided in the first aspect above. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. Exemplarily, the present application can divide the data transmission device into a sending unit and a receiving unit, etc. according to the function. The description of the possible technical solutions and beneficial effects executed by each of the divided functional modules can refer to the technical solutions provided by the first aspect or its corresponding possible design, and will not be repeated here.

[0029] In another possible design, the data transmission device is used to execute any of the methods provided in the second aspect above. The present application can divide the data transmission device into functional modules according to any of the methods provided in the second aspect above. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. Exemplarily, the present application can divide the data transmission device into a receiving unit and a sending unit, etc. according to the function. The description of the possible technical solutions and beneficial effects executed by each of the divided functional modules can refer to the technical solutions provided by the second aspect or its corresponding possible design, and will not be repeated here.

[0030] In another possible design, the data transmission device includes: one or more processors and a communication interface, the one or more processors receiving or sending data through the communication interface, the one or more processors being configured to call program instructions stored in a memory so that the data transmission device executes any method provided in the first aspect and any possible design thereof, or executes any method provided in the second aspect and any possible design thereof.

[0031] In a fourth aspect, the present application provides a first node that sends a message to a second node via one or more send queues. The first node is configured with a first counter, the first counter being configured to perform credit flow control on messages in a first send queue among the one or more send queues. The first node is configured to execute any method provided in any possible implementation of the first aspect to calibrate the first counter.

[0032] In a fifth aspect, the present application provides a second node, comprising a first receive queue, the first receive queue being configured to receive messages from a first transmit queue of the first node. The second node is configured to execute any of the methods provided in any possible implementation of the second aspect to calibrate a first counter, the first counter being configured to perform credit flow control on messages in the first transmit queue.

[0033] In a sixth aspect, the present application provides a data transmission system, comprising a first node and a second node. The first node is configured to execute any method provided in any possible implementation of the first aspect, and the second node is configured to execute any method provided in any possible implementation of the second aspect, to calibrate a first counter used for credit flow control in the first node.

[0034] In the seventh aspect, the present application provides a computer-readable storage medium, which includes program instructions. When the program instructions are run on a computer or processor, the computer or processor executes any method provided by any possible implementation in the first aspect or the second aspect.

[0035] In an eighth aspect, the present application provides a computer program product, which, when run on a data transmission device, enables any method provided by any possible implementation in the first aspect or the second aspect to be executed.

[0036] It can be understood that any of the devices, systems, computer storage media or computer program products provided above can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0037] In this application, the names of the data transmission device and data transmission system do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] FIG1 is a schematic diagram of a flow chart of flow control using CFC technology;

[0039] FIG2 is a schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application;

[0040] FIG3 is a schematic diagram of the hardware structure of a chip provided in an embodiment of the present application;

[0041] FIG4a is a flow chart of a data transmission method provided in an embodiment of the present application;

[0042] FIG4 b is a schematic flow chart of another data transmission method provided in an embodiment of the present application;

[0043] FIG5 is a schematic diagram of the structure of a credit response message provided in an embodiment of the present application;

[0044] FIG6 is another flow chart of a data transmission method provided in an embodiment of the present application;

[0045] FIG7 is a schematic diagram of the structure of a message preamble provided in an embodiment of the present application

[0046] FIG8 is a schematic structural diagram of a data transmission device provided in an embodiment of the present application;

[0047] FIG9 is a schematic structural diagram of another data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0049] In the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0050] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages.

[0051] When CFC technology is used to perform flow control (flow control is flow control, and flow control using CFC technology is referred to as credit flow control) when a first node sends a message to a second node, the first node maintains a credit counter for each sending queue, and determines whether traffic congestion occurs at the second node based on the value of the credit counter, and then stops sending messages when it is determined that traffic congestion occurs at the second node.

[0052] Referring to Figure 1 , a schematic diagram illustrating a flow control process using CFC technology is shown. As shown in Figure 1 , taking output queue (OQ) 1 of a first node as an example, the credit counter maintained by the first node for OQ 1 is counter 1, and input queue (IQ) 1 of a second node is used to receive packets from OQ 1 of the first node.

[0053] At the first node, for any message to be sent, for example, a message in OQ 1, when the first node dequeues the message from OQ 1, the first node first calculates a credit value 1 representing the message length based on the message length, and adds the value of counter 1 to the credit value 1. The first node then sends the message to the second node through the sending interface.

[0054] At the second node, for any message to be received, assuming that the message needs to be received through IQ 1, when the second node receives the message through its receive interface, it writes the message to IQ 1 of its receive buffer. When the second node dequeues the message from IQ 1, it calculates a credit value 2 representing the message length based on the message length and returns the credit value 2 to the first node through its send interface. In response, after receiving the credit value 2 sent by the second node, the first node deducts the credit value 2 from the value of counter 1. In other words, counter 1 deducts the credit value representing the length of the message flowing out of the second node's receive buffer.

[0055] In this way, by accumulating the credit value used to represent the length of the message dequeued from the OQ and deducting the credit value used to represent the length of the message flowing out of the receiving buffer of the second node from the value of the credit counter maintained by the first node, it is possible to use the credit counter to record the communication link that transmits the message dequeued from the OQ and located at the first node to the second node and the length of the message cached in the receiving buffer of the second node.

[0056] Therefore, when the credit counter value exceeds the flow control threshold, it indicates that the communication link between the first node and the second node, as well as the number of packets buffered in the second node's receive buffer, is high, potentially causing traffic congestion at the second node. In this case, the first node can stop scheduling packets in the send queue corresponding to the credit counter, thereby implementing credit flow control using the credit counter during the process of sending packets from the first node to the second node.

[0057] However, when credit flow control is performed using the above method while a first node is sending a message to a second node, if the message sent by the first node to the second node is lost, the second node may not generate and send a credit value representing the length of the message to the second node. Alternatively, the second node may generate a credit value representing the length of the message flowing out of the second node's receive buffer, but the credit value may be lost when it is sent to the first node.

[0058] In this case, the credit counter maintained by the first node cannot be decremented normally, resulting in an inability to effectively use the credit counter to control the credit flow of messages sent from the first node to the second node. In other words, when using the credit counter to control credit flow during the process of sending messages from the first node to the second node, reliability is poor.

[0059] Based on this, an embodiment of the present application provides a data transmission method, which is applied to a first node that sends a message to a second node through one or more sending queues. For a first sending queue in the first node, during the process of performing credit flow control on the message of the first sending queue through a first counter, the method sends a reference message for indicating correction of the first counter to the second node through the first node, and corrects the first counter based on the credit value carried in the preamble of the service message or credit response message received from the second node.

[0060] By automatically correcting the first counter during the counter-based credit flow control process, it is possible to avoid traffic performance degradation or even traffic congestion caused by the loss of messages sent by the first node or the loss of credit values ​​received by the first node, thereby improving the reliability of credit flow control based on the first counter. The description of credit flow control based on the counter can be found above and will not be repeated here.

[0061] An embodiment of the present application also provides a data transmission system, which includes a first node and a second node. The method provided in the embodiment of the present application is applied to the system, and is specifically used to calibrate the first counter during the process of performing credit flow control through the first counter when the first node sends a message to the second node in the system, thereby greatly improving the reliability of credit flow control through the first counter during the process of sending a message from the first node to the second node.

[0062] The first node and the second node may communicate with each other via a communication link of any form (eg, wired or wireless) and / or format, and are not limited thereto.

[0063] Optionally, the first node and the second node may communicate directly. Alternatively, the first node and the second node may communicate via one or more switching devices / nodes, without limitation. For simplicity, the following description of the embodiments of the present application uses direct communication between the first node and the second node as an example.

[0064] Refer to FIG2 , which shows a schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application.

[0065] As shown in FIG. 2 , the data transmission system 20 includes a first node 21 and a second node 22 .

[0066] The first node 21 can send a message to the second node 22 via Ethernet. The first node 21 can perform credit flow control on the message sent to the second node 22 using the first counter. Furthermore, during the process of the first node 21 performing credit flow control based on the first counter, the first counter can be automatically calibrated (e.g., periodically) so that the reliability of the credit flow control performed by the first node 21 based on the calibrated first counter is greatly improved.

[0067] An embodiment of the present application also provides a data transmission device, which is applied to the first node and the second node in the above-mentioned data transmission system, and is used to execute the corresponding steps performed by the first node and the second node in the method described below in the embodiment of the present application.

[0068] Optionally, the first node and the second node may be two chips capable of communicating, or two groups of chip components capable of communicating, or two network nodes capable of communicating, etc., which is not limited.

[0069] As an example, the chip capable of communication may be a network interface card (NIC), etc., and the network node may be a router, a switch, a server, a gateway, etc., without limitation.

[0070] Taking the example of chips where both the first node and the second node are used for communication, FIG3 shows a schematic diagram of the hardware structure of a chip provided in an embodiment of the present application. As shown in FIG3, the chip 30 includes a control circuit 31, a communication interface 32, a memory 33, and a flow control module 34, and the control circuit 31, the communication interface 32, the memory 33, and the flow control module 34 are connected and communicated with each other.

[0071] The control circuit 31 is the control portion of the chip 30 and is used to control the various devices, modules, and circuits within the chip 30. For example, the control circuit 31 can be used to control the dispatching of messages from different transmit queues in the chip 30's transmit buffer to the communication interface 32 to transmit the messages. For another example, the control circuit 31 can be used to control the dispatching of messages from different receive queues in the chip 30's receive buffer to the message processing module (e.g., processor) of the device in which the chip resides.

[0072] Optionally, the control circuit 31 may be a general central processing unit (CPU), an application-specific integrated circuit (ASIC), or a micro-processing unit (MPU), etc., but is not limited thereto.

[0073] The communication interface 32 is used to connect the chip 30 to other chips via a communication network, where the communication network can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc., but is not limited thereto.

[0074] As an example, when the communication network is Ethernet, the communication interface 32 may be a media access control (MAC) interface, but is not limited thereto. The communication interface 32 includes one or more transmitting interfaces (or transmitting ports) for transmitting messages, and one or more receiving interfaces (or receiving ports) for receiving messages, but is not limited thereto.

[0075] To control the traffic sent by any of the transmission interfaces in the communication interface 32, the chip 30 can configure multiple transmission queues (i.e., the OQs described above) with different priorities for the transmission interface. In this way, the control circuit 31 can control the transmission interface to send messages in different transmission queues in a time-division multiplexing manner based on the priorities of each transmission queue. Here, transmission queues with different priorities can be used to send service messages with different transmission priority requirements.

[0076] The priority of a send queue indicates the priority with which messages in the send queue are dispatched to the send interface. It should be understood that once a message is dispatched to the send interface, it can be sent out through the communication network. Therefore, the priority of a send queue can also be understood as the priority with which messages in the send queue are sent through the send interface.

[0077] For example, packets in the highest-priority send queue are first scheduled out of the queue to the send interface, and after all packets in the highest-priority send queue are scheduled out of the queue, packets in the next highest-priority send queue are scheduled out of the queue to the send interface, and so on. For another example, the dispatching frequency of dispatching packets in the highest-priority send queue to the send interface is the highest, and the dispatching frequency of dispatching packets in the lowest-priority send queue to the send interface is the lowest. The present invention is not limited to this.

[0078] It should be understood that when a first node having the hardware structure shown in FIG3 configures multiple transmit queues for a transmit interface, the receive interface of chip 30, which is connected to the transmit interface via the communication network and serves as the second node, is configured with a receive queue that corresponds one-to-one with the transmit queue configured for the transmit interface of the first node. Furthermore, the corresponding transmit queues and receive queues have the same priority.

[0079] As an example, a sending queue and a receiving queue having a corresponding relationship may be marked by setting the same queue identifier (such as a queue number).

[0080] The memory 33 includes a sending buffer for temporarily storing messages to be sent by the sending interface of the chip 30, and a receiving buffer for temporarily storing messages received by the receiving interface.

[0081] Optionally, multiple sending queues configured in a certain sending interface in the chip 30 may share the above-mentioned sending buffer, or each sending queue may correspond to a dedicated sending buffer, which is not limited.

[0082] Optionally, multiple receiving queues configured in a certain receiving interface in the chip 30 may share the above-mentioned receiving buffer, or each receiving queue may correspond to a dedicated receiving buffer, which is not limited to this.

[0083] In addition, the control circuit 31 can access the transmit buffer and the receive buffer. Furthermore, the control circuit 31 can dispatch messages from different transmit queues in the transmit buffer to the transmit interface based on the priority of the transmit queue. The control circuit 31 can also determine the corresponding receive queue based on the message received by the receive interface, and write the received message to the receive queue located in the receive buffer. Subsequently, the control circuit 31 can dispatch messages from different receive queues to the message processing module of the device where the chip 30 is located based on the priority of different receive queues. Among them, dispatching a message from a receive queue can also be understood as the message flowing out of the receive buffer.

[0084] Among them, the embodiments of this application do not describe in detail the process of how the message is scheduled to the corresponding sending queue and how the received message is written to the corresponding receiving queue.

[0085] The flow control module 34 is used to perform flow control (eg, instruct to start or stop sending messages) when the chip 30 sends messages to other chips.

[0086] The flow control module 34 includes a first counter for credit flow control configured for each sending queue that requires credit flow control based on the sending queue of the chip 30, and a second counter configured to correct each first counter, so that the second counter can be used to correct the first counter.

[0087] A first counter is configured for each transmit queue requiring credit flow control. A second counter can be configured for each first counter. Alternatively, a second counter can be configured for each of the multiple first counters configured for multiple transmit queues under the same transmit interface. When a second counter is configured for each of the multiple first counters configured for multiple transmit queues under the same transmit interface, the multiple first counters can be corrected by time-division multiplexing the second counter.

[0088] In other words, when multiple send queues under any send interface of chip 30 all require credit flow control, chip 30 can maintain a first counter for each of the multiple send queues used for credit flow control. That is, chip 30 maintains multiple first counters for the multiple send queues under the send interface. In this scenario, the embodiment of the present application does not specifically limit the number of second counters configured in chip 30 for calibrating the multiple first counters.

[0089] Optionally, the chip 30 may configure a second counter for calibrating the plurality of first counters. In this case, the calibration of the plurality of first counters may be achieved by time-division multiplexing the second counter.

[0090] For example, chip 30 maintains four first counters for flow control for the four transmit queues under transmit interface 1, and maintains one second counter for calibrating the four first counters. The second node can then calibrate the first first counter using the second counter in period 1, calibrate the second first counter using the second counter in period 2, calibrate the third first counter using the second counter in period 3, and calibrate the fourth first counter using the second counter in period 4.

[0091] Optionally, the chip 30 may also configure a second counter for calibrating each first counter, that is, the number of first counters is the same as the number of second counters, and they correspond one to one.

[0092] It should be understood that for any sending queue in the chip 30 that needs to be flow controlled, such as the first sending queue, when the chip 30 configures a first counter for the first sending queue, the first counter is used to perform flow control in the process of sending messages through the first sending queue (for example, to indicate to start or stop sending messages through the first sending queue). For specific functions, please refer to the description of the credit counter above and will not be repeated here. When the first counter needs to be calibrated, the chip 30 is also configured with a second counter, which is used to implement the correction of the first counter to improve the reliability of credit flow control based on the first counter in the process of the chip 30 sending messages through the first sending queue. Among them, more detailed instructions for the use of the first counter and the second counter can be referred to the description below and will not be repeated here.

[0093] In addition, when the first node having the hardware structure shown in Figure 3 is configured with the above-mentioned first counter for the first sending queue, and is configured with a second counter for correcting the first counter, for the chip 30 (or called the second node) that receives the message from the first sending queue of the first node through the first receiving queue, the flow control module 34 of the chip 30 also includes a third counter configured corresponding to the first receiving queue, and includes a fourth counter configured corresponding to the third counter. The third counter and the fourth counter are used together to assist in the correction of the first counter configured for the first sending queue in the first node. Among them, one receiving queue is configured with one third counter. One third counter can be configured with one fourth counter, or multiple third counters configured for multiple receiving queues under the same receiving port can be configured with one fourth counter, and there is no limitation on this. For more detailed instructions on the use of the third counter and the fourth counter, please refer to the description in the method below, which will not be repeated here.

[0094] Optionally, any counter in the flow control module 34 (such as the first counter, the second counter, the third counter, or the fourth counter, etc.) can be a hardware circuit capable of implementing a counter function, and this is not limited to this. In addition, the counter in the flow control module 34 is updated based on the system clock frequency of the chip 30. Each update operation of the counter can be called a beat. In other words, the frequency of the counter update operation is the same as the system clock frequency of the chip 30.

[0095] It should be noted that the chip structure shown in FIG3 does not constitute a limitation on the chip 30. In addition to the components shown in FIG3, the chip 30 may include more or fewer components than shown in FIG3, or combine certain components, or arrange the components differently.

[0096] The data transmission method provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0097] Specifically, when the first node sends a message to the second node through one or more sending queues, for the sake of simplicity, in the following embodiments of the present application, the first node is described as follows: it is configured with a first counter for performing credit flow control on the first sending queue in the one or more sending queues, and is configured with a second counter for correcting the first counter.

[0098] Furthermore, assuming that the receive queue for receiving messages in the first transmit queue of the first node is the first receive queue of the second node, and the second node is configured with the aforementioned third counter for the first receive queue, and the aforementioned fourth counter is correspondingly configured for the third counter. The first receive queue of the second node may also be referred to as a receive queue having a corresponding relationship with the first transmit queue of the first node.

[0099] In this case, referring to Figure 4a, Figure 4a shows a flow chart of a data transmission method provided by an embodiment of the present application. Optionally, the method is applied to the data transmission system shown in Figure 2, and the first node and the second node having the hardware structure shown in Figure 3 perform the corresponding steps.

[0100] As shown in FIG4a , the data transmission method provided in the embodiment of the present application includes the following steps:

[0101] S101: A first node sends a reference message to a second node, where the reference message is used to instruct correction of the first counter.

[0102] For detailed descriptions of the reference message and the first counter, as well as the first node determining the reference message, please refer to the relevant description in S201 below, which will not be repeated here. For detailed descriptions of the first node sending the reference message to the second node, please refer to the description in S203 below, which will not be repeated here.

[0103] S102: The second node receives a first message from a first sending queue.

[0104] The second node receives the first message from the first sending queue. Please refer to the description of S204 below and will not repeat it here.

[0105] S103: In response to the first message being a reference message, the second node sends a service message or a credit response message to the first node. The preamble in the service message or the credit response message carries a credit value, and the credit value is used to calibrate the first counter.

[0106] The credit value carried in the preamble of the service message or the credit response message is used to represent the length of the message flowing out of the receiving buffer of the second node.

[0107] Among them, the detailed description of the second node determining the credit value, the detailed description of the business message or credit response message carrying the credit value, and the detailed description of the second node sending the business message or credit response message carrying the credit value to the first node in response to the first message being a reference message can all be referred to the descriptions of S206 to S208 below and will not be repeated here.

[0108] S104: The first node receives the service message or credit response message returned by the second node.

[0109] Furthermore, the first node corrects the first counter based on the credit value carried in the preamble of the service message or credit response message received from the second node.

[0110] Among them, the detailed description of how the first node corrects the first counter based on the credit value carried in the preamble code of the service message or the credit response message can be referred to the description of S209 below and will not be repeated here.

[0111] By the method described in S101 to S104, the counter can be automatically corrected during the process of credit flow control of the message sent by the first node through the counter, thereby greatly improving the reliability of credit flow control of the message sent by the first node through the counter.

[0112] In other embodiments, referring to FIG4b, FIG4b shows a flow chart of another data transmission method provided in an embodiment of the present application. Optionally, the method is applied to the data transmission system shown in FIG2, and the first node and the second node having the hardware structure shown in FIG3 perform the corresponding steps.

[0113] As shown in FIG4b , the data transmission method provided in the embodiment of the present application includes the following steps:

[0114] S201: When a to-be-sent message dispatched from a first sending queue of a first node is a reference message, the first node updates a value of a first counter according to the reference message.

[0115] The reference message is a message for instructing correction of the first counter. The first counter is used to perform credit flow control when the first node sends a message to the second node through the first sending queue, for example, to instruct to start or stop sending a message to the second node through the first sending queue.

[0116] The first counter is specifically used to record the length of the message scheduled out of the first sending queue. The message scheduled out of the first sending queue includes the communication link located at the first node to transmit the message to the second node and the message cached in the receiving buffer of the second node. Alternatively, it can be understood that the value of the first counter is used to characterize the length of the message scheduled out of the first sending queue. The value of the first counter is specifically a credit value used to characterize the length of the message scheduled out of the first sending queue. In other words, the first counter records the current occupancy of the receiving buffer of the second node in real time through the credit value corresponding to the message length.

[0117] Specifically, the first node may determine the to-be-sent message that is scheduled out of the first sending queue as the reference message.

[0118] The message to be sent may be a service message that needs to be sent through the first sending queue of the first node, or a sample message dedicated to calibrating the first counter, which is not limited.

[0119] Optionally, the first node may randomly determine a to-be-sent message that is scheduled out of the first sending queue as a reference message.

[0120] Optionally, the first node may periodically determine the to-be-sent messages that are scheduled out of the first sending queue as reference messages.

[0121] Optionally, the first node may determine the to-be-sent message dispatched from the first sending queue as a reference message in response to a correction instruction. The correction instruction may be a correction instruction issued by a processor of the first node, or a correction instruction received by the first node from a user, which is not limited to this.

[0122] It should be understood that for each reference message determined by the first node, the embodiment of the present application executes S202-S209 described below to achieve correction of the first counter. In this way, when the first node periodically determines a to-be-sent message that is dequeued from the first transmit queue as a reference message, the embodiment of the present application can periodically and automatically correct the first counter using the periodically determined reference message, thereby improving the reliability of credit flow control performed by the first counter during the process of the first node sending messages through the first transmit queue.

[0123] Further, the first node updates the value of the first counter according to the determined reference message.

[0124] Specifically, the first node may first determine a first credit value for representing the length of the reference message according to the length of the reference message and the bit width of the buffer received by the second node.

[0125] Specifically, the first node can obtain a first credit value representing the length of the reference message by rounding (e.g., rounding up) the quotient of the reference message length and the bit width of the second node receiving buffer. As an example, assuming that the length of the reference message is CFC_Plength and the bit width of the second node receiving buffer is 160 bytes (byte, B), the first credit value representing the length of the reference message = Ceiling(CFC_Plength / 160, 1). Wherein, Ceiling(CFC_Plength / 160, 1) represents rounding up the quotient of CFC_Plength / 160.

[0126] The bit width of the second node's receive buffer used to calculate the first credit value can be considered a credit unit when calculating the credit value. Optionally, when calculating the credit value, the credit unit can be the second node's actual receive buffer bit width, or an integer multiple of the second node's actual receive buffer bit width. Of course, it can also be any preset value pre-negotiated between the first node and the second node, and this embodiment of the present application is not limited to this.

[0127] It should be understood that the bit width of a buffer refers to the data width (or data length) of a single access to the buffer. The bit width of a buffer can generally be an integer multiple of 32 bytes (byte, B). This is because the smallest bit width unit when designing a chip buffer can be 32B, but of course it is not limited to this.

[0128] The length of the reference message used to calculate the first credit value refers to the message length when the reference message is buffered in the receiving buffer of the second node.

[0129] It should be understood that, since some buffers may be configured as follows: when writing a message into the buffer, it is necessary to first add a static extension header to the message to facilitate buffer identification and / or operation, and then write the message with the added static extension header into the buffer. In this case, when the receiving buffer of the second node is a buffer of this type, then when calculating the credit value representing the length of a certain message, in order to ensure that the credit values ​​calculated by the first node and the second node are the same (in subsequent steps, the second node needs to calculate the credit value for the message cached in the receiving buffer), when the first node calculates the credit value for representing the length of the message, the message length used is: the actual length of the message + the length of the static extension header added to the message when the second node caches the message, that is, when the first node calculates the credit value for representing the length of the message, the message length used is the length of the message when it is cached in the receiving buffer of the second node. In other words, the credit value for representing the length of the message described in the context of the embodiment of the present application is actually used to represent the cache depth occupied when the message is cached in the receiving buffer.

[0130] Optionally, when determining the length of the reference message, the first node can obtain the total length of the reference message's IP data packet by reading the total length field in the reference message's Internet Protocol (IP) header, which records the total length of the IP data packet. The first node then adds a certain offset to the total length of the IP data packet to obtain the length of the reference message when it is cached in the second node's receive buffer. The offset includes the length of the reference message's IP data packet's outer header.

[0131] For example, assuming that the IP data packet is a Layer 3 packet of the reference packet, the reference packet also includes a Layer 2 packet header (e.g., a MAC header) and a Layer 1 packet header (e.g., a virtual local area network (VLAN) header) located outside the Layer 3 IP header. Optionally, when the second node receives the packet in a buffer, it is necessary to add the aforementioned static extension header to the packet. In this case, the offset also includes the length of the static extension header configured in the second node's receive buffer.

[0132] For example, assuming the reference message is an Internet Protocol version 4 (IPv4) message, the reference message length = the length indicated by the Total Length field in the IP header + the offset. Assuming the reference message is an Internet Protocol version 6 (IPv6) message, the reference message length = the length indicated by the Total Length field in the IP header + the IPv6 header length + the offset. The IPv6 header is typically 40 bytes long.

[0133] Optionally, the parameters such as the bit width and offset of the second node receiving buffer used in the calculation of the first credit value may be obtained by the first node from the second node when the first node and the second node negotiate CFC capabilities, and this is not limited to this.

[0134] The process of negotiating the CFC capability between the first node and the second node may include:

[0135] Step 1: Before sending a message to the second node, the first node sends a CFC capability request message to the second node.

[0136] The CFC request message is used to determine whether the second node supports CFC capabilities and, if so, to request the second node's CFC capability information. The CFC capability information is used to perform credit flow control on messages sent to the second node. The CFC capability information may include one or more of the following: the size of the second node's receive buffer, the bit width of the second node's receive buffer, the receive queues on the second node that support CFC, or the offsets described above.

[0137] The size of the second node receiving buffer is used by the first node to set the flow control threshold of the first counter for credit flow control, so that the first node can perform flow control on the messages to be sent in the first sending queue based on whether the value of the first counter exceeds the flow control threshold.

[0138] The offset is used to determine the message length required for calculating the message credit value. The second node receives the buffer width and the message length calculated based on the offset and uses it to calculate the message credit value.

[0139] The receiving queues supporting CFC in the second node are used by the first node to determine which receiving queues in the second node support the CFC capability.

[0140] In this way, when the second node does not support the CFC capability, after receiving the CFC request message sent by the first node, the second node cannot identify the CFC request message, and thus the second node may discard the CFC request message.

[0141] When the second node supports the CFC capability, after receiving the CFC request message sent by the first node, the second node may execute step 2.

[0142] Step 2: The second node identifies and responds to the CFC request message, and sends a CFC capability response message carrying its own CFC capability information to the first node.

[0143] Specifically, the second node can read the size and bit width of its own receive buffer from its own configuration information and determine the queue number of its own receive queue that supports CFC. The second node can also determine the outer header length of the IP header of the message transmitted between the second node and the first node based on the communication mode adopted when communicating with the first node. Optionally, the second node can determine the aforementioned static extension header length based on its own receive buffer configuration. The second node then calculates the aforementioned offset based on the determined outer header length of the IP header and the static extension header length. Furthermore, the second node carries CFC capability information, including the size and bit width of its own receive buffer, the queue number of its own receive queue that supports CFC, and the offset, in a CFC capability response message and sends it to the first node.

[0144] In response, the first node receives the CFC capability response message from the second node, thereby obtaining the bit width of the second node's receive buffer and an offset for determining the message length required for calculating the credit value.

[0145] In this way, the first node can calculate the length of the reference message when it is cached in the second node receiving buffer based on the offset, and round the quotient of the length and the bit width of the second node receiving buffer to obtain a first credit value representing the length of the reference message.

[0146] Furthermore, the first node adds the first credit value to the current value of the first counter to complete the update of the value of the first counter in the current beat.

[0147] It can be seen that the updated value of the first counter is the sum of the current value and the first credit value. For example, assuming the current value of the first counter is 5 and the first credit value is 3, the updated value of the first counter is 5+3=8.

[0148] Wherein, based on the same frequency as the system clock of the first node, each update operation including accumulation and / or deduction performed by the first counter of the first node is called a beat. The beat is the current update operation performed by the first counter.

[0149] Optionally, when updating the value of the first counter during the current beat, the first node may include a second credit value returned by the second node and not used for the deduction operation. The second credit value is specifically used to represent the length of one or more messages from the first transmit queue of the first node that flowed out of the receive buffer of the second node. The number of second credit values ​​can be one or more. For example, one message from the first transmit queue of the first node that flowed out of the receive buffer of the second node may correspond to one second credit value.

[0150] Here, for the detailed process of the second node returning the second credit value to the first node, reference may be made to the description of the second node returning the credit value to the first node described in S207 or S208, and will not be repeated here.

[0151] Therefore, when the first node also includes the second credit value, when updating the value of the first counter:

[0152] In one possible implementation, the first node first adds the first credit value to the current value of the first counter, then subtracts the second credit value from the value of the first counter after adding the first credit value, thereby completing the update of the first counter value. It can be seen that the updated value of the first counter is the difference between the sum of the current value and the first credit value and the second credit value. As an example, assuming the current value of the first counter is 5, the first credit value is 3, and the second credit value is 4, then the updated value of the first counter is 5 + 3 - 4 = 4.

[0153] In another possible implementation, the first node first deducts the second credit value from the current value of the first counter, then adds the first credit value to the value of the first counter after deducting the second credit value, thereby completing the update of the first counter value. It can be seen that the updated value of the first counter is the difference between the current value and the second credit value, plus the sum of the first credit value. As an example, assuming the current value of the first counter is 5, the first credit value is 3, and the second credit value is 4, then the updated value of the first counter is 5-4+3=4.

[0154] In addition, it should be noted that when the first node performs credit flow control based on the first counter in the process of sending a message through the first sending queue, each time the first node dispatches a message from the first sending queue, the value of the first counter will be updated (including accumulation and / or deduction) according to the message.

[0155] It can be seen that the update operation performed on the first counter includes an accumulation operation on the value of the first counter after the message in the first sending queue is scheduled to be dequeued, and an operation of deducting the value of the first counter after the message in the first sending queue flows out of the receiving buffer of the second node. In this way, the credit value recorded by the first counter can represent in real time the communication link for transmitting messages currently scheduled to be dequeued from the first sending queue and located at the first node to the second node, and the length of the message cached in the receiving buffer of the second node. In other words, the credit value recorded by the first counter can reflect in real time the cache usage of the second node for caching the receiving buffer from the first sending queue.

[0156] S202: The first node controls the second counter to obtain the updated value of the first counter.

[0157] The second counter is specifically used to indicate whether the reference message flows out from the receiving buffer of the second node that receives the reference message.

[0158] Specifically, after the second counter obtains the updated value of the first counter, when the value of the second counter is updated to 0, it indicates that the reference message has flowed out of the receiving buffer of the second node. When the value of the second counter is greater than 0, it indicates that the reference message is still cached in (or remains in) the receiving buffer of the second node. The update process of the second counter can be referred to the relevant description of S209 below and will not be repeated here.

[0159] Optionally, after updating the value of the first counter according to the reference message, the first node may send a sampling instruction to the first counter to instruct the first counter to send the updated value to the second counter. The second counter may then obtain the updated value of the first counter and set its own value to the obtained value.

[0160] Optionally, after updating the value of the first counter according to the reference message, the first node may send a sampling instruction to the second counter to instruct the second counter to read the updated value of the first counter and set its own value to the read value.

[0161] S203: The first node sends a reference message to the second node.

[0162] Specifically, the first node first adds a reference tag to the reference message scheduled out of the first sending queue. The reference tag is used to identify the current message as a reference message and to instruct the second node that receives the reference message to control the fourth counter to obtain the value of the third counter.

[0163] The third counter is a counter configured in the second node for the first receiving queue for receiving messages from the first sending queue, and the fourth counter is a counter configured by the second node for the third node.

[0164] Specifically, the value of the third counter represents the length of packets from the first transmit queue and buffered in the receive buffer of the second node. Specifically, the value of the third counter is a credit value representing the length of packets from the first transmit queue and buffered in the receive buffer of the second node. This indicates that the value of the third counter can reflect, in real time, the usage of the receive buffer on the second node used to buffer packets from the first transmit queue.

[0165] The fourth counter is used to indicate whether the reference message received by the second node has flowed out of the second node's receive buffer. Thus, after the fourth counter obtains the value of the third counter, when the value of the fourth counter is updated to 0, it indicates that the reference message has flowed out of the second node's receive buffer. When the value of the fourth counter is greater than 0, it indicates that the reference message is still cached in (or remains in) the second node's receive buffer. The process of obtaining the value of the third counter by the fourth counter can be described in S206, and the process of updating the fourth counter can be described in S207-S208, which will not be repeated here.

[0166] Optionally, the first node may add a reference marker to the preamble code of the reference message. For detailed description of the reference marker carried by the preamble code of the message, please refer to the description of the "message preamble code provided in the embodiment of the present application" below, which will not be repeated here.

[0167] The first node then dispatches the reference message with the reference tag added to a sending interface of the first node (e.g., a sending interface in the communication interface shown in FIG3 ), so that the sending interface sends the reference message with the reference tag added to the second node via the communication network. The embodiments of the present application do not specifically limit the form and / or format of the communication network.

[0168] S204: The second node receives a first message from the first sending queue of the first node.

[0169] The first message is any message received by the second node from the first sending queue of the first node. For example, the first message may be the reference message mentioned above.

[0170] Specifically, the second node may receive the first message from the first sending queue of the first node through a receiving interface (the receiving interface of the communication interface shown in FIG3 ), wherein the receiving interface has a communication connection with the sending interface of the first node that sends the first message.

[0171] S205: The second node updates the value of the third counter according to the first message.

[0172] The detailed description of the third counter can be found in the above description and will not be repeated here.

[0173] Specifically, after receiving the first message, the second node first determines a third credit value based on the length of the first message and the bit width of its own receive buffer. The third credit value represents the length of the first message, or more specifically, the buffer depth occupied by the first message when cached in the second node's receive buffer.

[0174] Among them, for the detailed description of the second node determining the third credit value based on the length of the first message and the bit width of its own receiving buffer, please refer to the description of the first node determining the first credit value based on the length of the reference message and the bit width of the second node receiving buffer in S201, and no further details will be given.

[0175] The second node then adds the third credit value to the current value of the third counter to complete the update of the third counter value. As can be seen, the updated value of the third counter is the sum of the current value and the third credit value. For example, if the current value of the third counter is 10 and the third credit value is 5, the updated value of the third counter is 10 + 5 = 15.

[0176] Optionally, when updating the value of the third counter at the beat, the second node may also include a fourth credit value calculated based on the length of the message from the first sending queue flowing out of its own receiving buffer and not used for the deduction operation. That is, the fourth credit value is used to characterize the length of one or more messages from the first sending queue flowing out of the receiving buffer of the second node, or it can be understood that the fourth credit value is used to characterize the cache depth occupied by the one or more messages when cached in the receiving buffer. The number of fourth credit values ​​can be one or more. For example, a message from the first sending queue of the first node flowing out of the receiving buffer of the second node can correspond to one fourth credit value.

[0177] Here, for a detailed description of how the second node determines the fourth credit value based on the length of one or more messages from the first sending queue flowing out of its own receiving buffer, please refer to the relevant description of determining the credit value of the second message based on the second message in S207 below, which is not repeated here.

[0178] Therefore, if the second node also includes the fourth credit value, then when updating the value of the third counter:

[0179] In one possible implementation, the second node first adds the third credit value to the current value of the third counter, and then subtracts the fourth credit value from the value of the third counter after adding the third credit value, thereby completing the update of the third counter value. It can be seen that the value of the third counter after the update is the difference between the sum of the current value and the third credit value and the fourth credit value. As an example, assuming the current value of the third counter is 10, the third credit value is 5, and the fourth credit value is 2, then the updated value of the third counter = 10 + 5 - 2 = 13.

[0180] In another possible implementation, the second node first deducts the fourth credit value from the current value of the third counter, and then adds the third credit value to the value of the third counter after deducting the fourth credit value, thereby completing the update of the third counter value. It can be seen that the updated value of the third counter is the difference between the current value and the fourth credit value, plus the sum of the third credit value. As an example, assuming the current value of the third counter is 10, the third credit value is 5, and the fourth credit value is 2, then the updated value of the third counter is 10-2+5=13.

[0181] As can be seen, the update operation on the third counter includes an accumulation operation on the third counter value before the message from the first transmit queue is written to the second node's receive buffer, and a decrement operation on the third counter value after the message from the first transmit queue flows out of the second node's receive buffer. This allows the credit value recorded by the third counter to be used in real time to represent the length of the message currently cached in the second node's receive buffer and originating from the first transmit queue. In other words, the credit value recorded by the third counter can reflect in real time the cache usage of the second node's receive buffer for caching messages from the first transmit queue.

[0182] S206 : In response to the first message being the reference message, the second node controls the fourth counter to obtain the updated value of the third counter.

[0183] Specifically, the second node first determines whether the received first message carries a reference marker. If the second node determines that the first message carries a reference marker, it indicates that the first message is a reference message carrying a reference marker. In this case, the second node controls the fourth counter to obtain the updated value of the third counter in response to the reference marker carried in the first message. In this way, the value of the fourth counter is the same as the updated value of the third counter.

[0184] The detailed description of the reference mark, the third counter, and the fourth counter can be referred to above and will not be repeated here. The process of the second node controlling the fourth counter to obtain the updated value of the third counter can be referred to the process of the first node controlling the second counter to obtain the updated value of the first counter in S202 and will not be repeated here.

[0185] Furthermore, the second node writes the first message into a receiving buffer for a first receiving queue for receiving messages from the first sending queue.

[0186] In one example, a first message carries the queue identifier of a first send queue, and a second node pre-stores a correspondence between send queues and receive queues. Thus, the second node can query the correspondence based on the queue identifier of the first send queue to determine the first receive queue for receiving the first message. Subsequently, the second node writes the first message to the first receive queue.

[0187] S207: The second node updates the value of the fourth counter.

[0188] The second node updates the value of the fourth counter by: after the fourth counter obtains the value of the third counter, the second node decrements the value of the fourth counter based on each packet flowing out of its own receive buffer (or dispatched out of the first receive queue) and from the first transmit queue. The decrement operation stops after the value of the fourth counter reaches 0.

[0189] When credit flow control is performed based on the first counter during the process of the first node sending a message through the first sending queue, and the first counter is automatically corrected using the method provided in the embodiment of the present application, during the process of credit flow control based on the first counter, the second node also deducts the value of the third counter based on each message flowing out of its own receiving buffer and from the first sending queue. It should be understood that the "each message flowing out of its own receiving buffer and from the first sending queue" mentioned here includes each message flowing out of the receiving buffer of the second node and from the first sending queue within the target time period. The target time period is the time period from the fourth counter obtaining the value of the third counter to the time the value of the fourth counter is deducted to 0.

[0190] The following describes the process of the second node deducting the values ​​of the fourth counter and the third counter, taking any message, such as the second message, flowing out of the second node's receive buffer and from the first send queue during the target period as an example. The process may include the following steps:

[0191] Step 1: The second node determines the credit value of the second message according to the length of the second message.

[0192] The credit value of the second message is used to represent the length of the second message, or it can be understood that the credit value of the second message is used to represent the buffer depth occupied by the second message when it is buffered in the receiving buffer of the second node.

[0193] Among them, the process of the second node determining the credit value of the second message based on the length of the second message and the bit width of its own receiving buffer can refer to the process of the first node determining the first credit value based on the length of the reference message and the bit width of the second node receiving buffer in S201 above, and will not be repeated here.

[0194] Step 2: The second node deducts the credit value of the second message from the value of the fourth counter.

[0195] When the second message from the first sending queue flows out from the receiving buffer of the second node in the target time period, the second node deducts the credit value of the second message from the value of the fourth counter, so that according to whether the value of the fourth counter after deduction is 0, the second node can determine whether the reference message has flowed out from the receiving buffer of the second node.

[0196] Step 3: The second node deducts the credit value of the second message from the value of the third counter.

[0197] When the second message from the first sending queue flows out from the second node receiving buffer, the second node deducts the credit value of the second message from the value of the third counter, thereby achieving the purpose of updating the third counter for recording the length of the message cached in the second node receiving buffer and from the first sending queue in real time based on the message flowing out of the second node receiving buffer.

[0198] Among them, the execution order of step 2 and step 3 is not limited in the embodiment of the present application. For example, step 2 can be executed first, and then step 3, or step 3 can be executed first, and then step 2, or step 2 and step 3 can be executed at the same time.

[0199] As can be seen, the update operation on the fourth counter simply involves decrementing the value of the fourth counter based on the number of messages from the first transmit queue that flowed out of the second node's receive buffer during the target period. Thus, whether the current value of the fourth counter, after deducting the credit value, is 0 can be used to determine whether the current reference message has flowed out of the second node's receive buffer.

[0200] Furthermore, after determining the credit value of the message flowing out of its own receive buffer and from the first transmit queue based on its length, the second node returns the credit value of the message to the first node. That is, the second node returns the credit value used to update the fourth counter (or third counter) to the first node. For example, after determining the credit value of the second message according to step 1, the second node also returns the credit value of the second message to the first node. The credit value returned by the second node to the first node is used by the first node to update the values ​​of the first counter and the second counter. For detailed description, please refer to the relevant description of S209 below and will not be repeated here.

[0201] Specifically, the second node may return a message / packet including the credit value to the first node through a sending interface (eg, a sending interface in the communication interface shown in FIG. 3 ), which is not limited thereto.

[0202] It should be noted that when the second node receives the reference message and controls the fourth counter to obtain the updated value of the third counter in response to the reference message, one or more messages may be cached in the first receive queue of the second node's receive buffer. Therefore, during the target time period, the second node executes the above steps 1-3 for each message scheduled out of the first receive queue (or each message flowing out of the second node's receive buffer), and returns the credit value determined each time step 1 is executed to the first node, so that the first node can update the values ​​of the first and second counters based on the credit value returned by the second node.

[0203] Optionally, when the second node needs to return a credit value to the first node, the second node sends a service message or a credit response message to the first node. The service message or the credit response message carries the credit value that the second node needs to return to the first node. The credit response message is a message generated specifically for carrying the credit value when the second node needs to return the credit value to the first node.

[0204] It is understood that when the second node needs to return a credit value to the first node, if the second node does not have any service messages to send to the first node, it can generate a credit response message carrying the credit value. Of course, the second node can also immediately generate a credit response message carrying the credit value when it needs to return a credit value to the first node, without determining whether there are any service messages to send to the first node.

[0205] In this embodiment of the present application, a CFC message is defined for carrying credit flow control-related information. The aforementioned credit response message is a type of CFC message. Specifically, this embodiment of the present application indicates whether the current message is a CFC message by multiplexing the destination MAC (DMAC) field, the Type / Length field, and the Opcode field in the message MAC frame structure.

[0206] The CFC message also includes a type field. In the embodiment of the present application, the CFC message indicates the specific purpose of the current CFC message through different values ​​of the type field.

[0207] For example, when the value of the Type field in a CFC message is 0, it indicates that the current CFC message is a CFC Capability Request message for requesting CFC capability information. When the value of the Type field in a CFC message is 1, it indicates that the current CFC message is a CFC Capability Response message carrying CFC capability information. When the value of the Type field in a CFC message is 3, it indicates that the current CFC message is a Credit Response message carrying a credit value. For detailed descriptions of the CFC Capability Request message and the CFC Capability Response message, please refer to the relevant description of S201 above and will not be repeated here.

[0208] For example, referring to Figure 5, Figure 5 shows a schematic diagram of the structure of a credit response message provided by an embodiment of the present application. The rows of the table shown in Figure 5 represent bytes, and the columns represent bits.

[0209] As shown in Figure 5, bytes 0 to byte 5 in the credit response message MAC frame are the DMAC field, bytes 6 to byte 11 are the source MAC (SMAC) field, bytes 12 to byte 13 are the Type / Length field, bytes 14 to byte 15 are the Opcode field, byte 16 is the type (MsgType) field, bytes 17 to byte 19 are reserved fields, bytes 20 to byte 59 are the pad field, and bytes 60 to byte 63 are the frame check sequence (FCS) field.

[0210] The detailed explanations of the DMAC field, SMAC field, Type / Length field, Opcode field, MsgType field, and FCS field are not repeated here. In addition, in the embodiment of the present application, the reserved field and pad field in the credit response message MAC frame are not specifically defined and can be filled with 0.

[0211] As shown in Figure 5 , the embodiment of the present application can set the value of the DMAC field in Figure 5 to 0x01-80-C2-00-00-01, the value of the Type / Length field to 0x9999 / User Define, and the value of the Opcode field to 0x0909, thereby identifying the current message as a CFC message. Furthermore, the embodiment of the present application can set the value of the MsgType field in Figure 5 to 3, thereby indicating that the current CFC message is a credit response message.

[0212] Furthermore, optionally, for the service message or credit response message used to carry the credit value, the service message and credit response message may carry the credit value via a message preamble. For a detailed description of carrying the credit value via a message preamble, refer to the description of the "Message Preamble Provided in the Embodiments of the Present Application" below and will not be repeated here.

[0213] S208 . When the value of the fourth counter is updated to 0, the second node returns a reference end marker and a credit value deducted when the value of the fourth counter is updated to 0 to the first node.

[0214] In which, the second node can return a message / message including a reference end mark and the credit value deducted when the value of the fourth counter is updated to 0 to the first node through a sending interface (for example, the sending interface in the communication interface shown in Figure 3), without limitation.

[0215] Specifically, the reference end marker and the credit value deducted when the value of the fourth counter is updated to 0 are used to correct the first counter configured for the first sending queue in the first node.

[0216] More specifically, the credit value deducted from the fourth counter when the value is updated to 0 is used to update the values ​​of the first and second counters of the first node. The reference end marker indicates that the reference message received by the second node from the first node has flowed out of the second node's receive buffer. Thus, the reference end marker can be used to instruct the first node to correct the updated value of the first counter based on the updated value of the second counter. For detailed information, refer to the description of S209 below and are not detailed here.

[0217] It should be understood that when the value of the fourth counter is deducted to 0, it indicates that the reference message received by the second node has flowed out of the receive buffer (or it can be understood that the second node has dequeued the reference message from the first receive queue of its own buffer). In this case, the second node returns a reference end marker to the first node.

[0218] In one possible implementation, for the credit value determined by the second node based on the message currently flowing out of its own receiving buffer and from the first sending queue, if the second node deducts the value of the fourth counter based on the credit value, the value of the fourth counter is exactly 0 (refer to S207 for the specific process).

[0219] In this case, the second node returns the complete credit value deducted from the fourth counter (that is, the credit value determined by the second node based on the message currently flowing out of its own receive buffer and from the first send queue) and the reference end mark to the first node, so that the first node deducts the value of the first counter and the value of the second counter according to the credit value returned by the second node, and in response to the reference end mark, corrects the deducted first counter based on the value of the deducted second counter.

[0220] However, because the message written to the first receive queue on the second node first might be scheduled out of the first receive queue later, in other words, the message that first flows into the second node's receive buffer might flow out of it later. Consequently, the message written to the second node's receive buffer after the reference message might flow out of the second node's receive buffer before the reference message.

[0221] Therefore, in another possible implementation, for the credit value determined by the second node based on the message currently flowing out of its own receiving buffer and from the first sending queue, if the second node deducts the value of the fourth counter based on the credit value, the value of the fourth counter is less than 0 (refer to S207 for the specific process).

[0222] In this case, the second node only returns the credit value deducted when the fourth counter is deducted to 0 and the reference end mark to the first node, so that the first node deducts the value of the first counter and the value of the second counter according to the credit value returned by the second node, and in response to the reference end mark, corrects the deducted first counter based on the value of the deducted second counter.

[0223] Alternatively, in this case, the second node determines the credit value based on the message currently flowing out of its own buffer and from the first transmit queue. The second node divides the credit value into a first value and a second value equal to the current value of the fourth counter. The second value is used to deduct the value of the fourth counter on the current beat. Since the current value of the fourth counter is equal to the second value, the value of the fourth counter after deducting the second value is 0. Furthermore, the second node returns the second value and a reference end marker to the first node, so that the first node deducts the values ​​of the first and second counters based on the second value returned by the second node. In response to the reference end marker, the first node corrects the deducted first counter based on the deducted value of the second counter. Furthermore, the next time the second node returns the credit value to the first node, it also returns the first value, so that the first node deducts the value of the first counter based on the credit value returned by the second node, including the first value. With respect to the third counter, the second node can deduct the credit value determined above (i.e., the first value + the second value) from the third counter on the current beat. Alternatively, the second node may decrement the third counter by the second value on the current beat, and decrement the third counter by the first value on the next beat. Alternatively, the second node may decrement the third counter by the first value on the current beat, and decrement the third counter by the second value on the next beat. This is not limited to this.

[0224] As an example, assuming that the current value of the fourth counter is 8, the credit value 10 determined by the second node based on the message currently flowing out of its own receive buffer and from the first transmit queue can be divided into a first value of 2 and a second value of 8. Among them, the second value 8 is used to deduct the value of the third counter and the value of the fourth counter when the second value 8 is deducted. At this time, the value of the fourth counter is 0 after deducting the second value 8. Therefore, the second node returns the second value 8 and the reference end mark to the first node, so that the first node deducts the value of the first counter and the value of the second counter according to the second value 8 returned by the second node, and in response to the reference end mark, corrects the deducted first counter based on the value of the deducted second counter. In addition, when the second node returns the credit value to the first node next time, it also returns the first value 2.

[0225] Optionally, when the value of the fourth counter is updated to 0 and the second node needs to return to the first node the reference end marker and the credit value deducted when the fourth counter is updated to 0, the second node sends a service message or a credit response message to the first node. The service message or credit response message carries the reference end marker and credit value that the second node needs to return to the first node. The description of the credit response message can be found above and is not repeated here.

[0226] It is understood that when the second node needs to return a reference end marker and a credit value to the first node, and the second node has no service messages to send to the first node, it can generate a credit response message that carries the reference end marker and the credit value. Of course, the second node can also instantly generate a credit response message that carries the credit value and the reference end marker when it needs to return a credit value to the first node, without determining whether there are any service messages to send to the first node.

[0227] Furthermore, optionally, for the service message or credit response message used to carry the reference end marker and credit value, the service message and credit response message may carry the reference end marker and credit value via a message preamble. For a detailed description of carrying the reference end marker and credit value via a message preamble, refer to the description of the "Message Preamble Provided in Embodiments of the Present Application" below and will not be repeated here.

[0228] S209: The first node receives one or more credit values ​​returned by the second node, wherein the one or more credit values ​​are used to update the value of the first counter and the value of the second counter of the first node, and the updated value of the second counter is used to correct the updated value of the first counter.

[0229] The one or more credit values ​​returned by the first node and received by the second node are one or more credit values ​​parsed by the first node from a service message or credit response message received by the first node from the second node. The one or more credit values ​​received by the first node include a credit value representing the length of a reference message sent by the first node to the second node.

[0230] Specifically, the first node receives one or more credit values ​​returned by the second node, updates the value of the first counter and the value of the second counter according to the received one or more credit values, and corrects the updated value of the first counter based on the updated value of the second counter.

[0231] More specifically, after receiving one or more credit values ​​returned by the second node, the first node deducts the one or more credit values ​​from the value of the first counter and the value of the second counter. The first node then corrects the value of the first counter based on the remaining value obtained after deducting the one or more credit values ​​from the second counter. It should be understood that the update operation on the second counter only includes the deduction of the second counter value based on the credit value used to represent the length of the message from the first transmit queue that flows out of the second node's receive buffer.

[0232] In some cases, when the first node receives a message / message returned by the second node that only includes a credit value (such as the credit value returned by the second node in S207), the first node deducts the value of the first counter and the value of the second counter based on the received credit value. For example, assuming that the current value of the first counter is 15 and the current value of the second counter is 10, and the message returned by the second node received by the first node only includes a credit value of 3, the first node deducts 3 from the value of the first counter and the value of the second counter respectively. The value of the first counter after deduction is 15-3=12, and the value of the second counter after deduction is 10-3=7.

[0233] Furthermore, if the value of the second counter after deduction is less than or equal to 0, the second counter did not receive the reference end marker when performing this deduction operation. In this case, it indicates that the message / message containing the reference end marker returned by the second node to the first node is lost. And / or, the reference message containing the reference marker sent by the first node to the second node is lost, resulting in the second node being unable to respond to the reference marker and execute S206 and subsequent steps described above. Consequently, during this correction of the first counter, the second node will not return the reference end marker to the first node. Therefore, the first node determines that the correction of the value of the first counter after deduction has failed.

[0234] It should be understood that when the value of the second counter is less than 0 after deduction, it can also indicate that the first node did not receive the reference end marker returned by the second node when the second counter was deducted to 0. Therefore, the first node determines that the correction of the value of the first counter after deduction has failed.

[0235] Optionally, after determining that the calibration of the first counter fails, the first node may immediately trigger the execution of the above S201 - S209 , thereby starting a new round of calibration process for the first counter.

[0236] Optionally, the first node may wait to re-execute the above S201-S209 in the next cycle, thereby re-calibrating the first counter.

[0237] Optionally, during the process of the first node periodically correcting the first counter, when the number of consecutive correction failures exceeds a threshold, the first node outputs an alarm message. That is, during the process of the first node periodically correcting the first counter based on a periodically determined reference message, when the number of consecutive correction failures exceeds a threshold, the first node outputs an alarm message. This embodiment of the present application does not limit the specific value of this threshold.

[0238] It can be understood that when the number of consecutive failures to correct the first counter exceeds a threshold, it indicates that packets transmitted between the first node and the second node are frequently lost, i.e., the packet loss rate is severe. Therefore, the first node outputs an alarm to the user, thereby prompting the user to promptly inspect and repair the communication link between the first node and the second node, thereby ensuring communication quality.

[0239] In other cases, when the first node receives a message / message returned by the second node including a credit value and a reference end marker (such as the credit value and reference end marker returned by the second node in S208), the first node deducts the value of the first counter and the value of the first counter according to the received credit value, and in response to the reference end marker, corrects the value of the first counter after deducting the credit value based on the remaining value of the second counter after deducting the credit value. For clarity of description, the embodiment of the present application refers to the value of the first counter after deducting the credit value as the third value. In particular, the detailed description of the reference end marker refers to the above description and will not be repeated here.

[0240] Furthermore, when the first node receives the message / packet including the credit value and the reference end marker, the first node deducts the credit value from the second counter and stops updating the second counter in response to the reference end marker.

[0241] Specifically, when the remaining value is equal to 0, the first node determines, in response to the reference end marker, that the process of performing the message sent by the first sending queue based on the first counter is normal, and therefore there is no need to calibrate the first counter.

[0242] It should be understood that when the first node receives the reference end marker, it indicates that the value of the fourth counter of the second node is 0, which in turn indicates that the reference message has flowed out of the receiving buffer of the second node. At this time, the above-mentioned remaining value is also 0, indicating that the second counter also indicates that the reference message has flowed out of the receiving buffer of the second node. It can be seen that the value of the fourth counter of the second node and the value of the second counter of the first node are synchronized, indicating that there is no packet loss between the second node and the first node. Therefore, in this case, the first node determines that the process of sending messages to the first sending queue based on the first counter is normal.

[0243] When the remaining value is greater than 0, the first node, in response to the reference end marker, deducts the remaining value from the value of the first counter (i.e., the third value) to complete the value correction of the first counter. In other words, when the remaining value is greater than 0 and the first node determines that it has received the reference end marker returned by the second node, the remaining value is deducted from the value of the first counter (i.e., the third value) to complete the value correction of the first counter. For example, assuming that the value of the first counter is 12 (i.e., the third value is 12) and the remaining value of the second counter is 7, the value of the first counter after correction is 12-7=5.

[0244] It should be understood that when the first node receives the reference end marker, the value of the fourth counter of the second node is 0, indicating that the reference message has flowed out of the second node's receive buffer. At this time, the above-mentioned residual value is greater than 0, indicating that the value of the second counter of the first node is not 0, that is, the second counter indicates that the reference message is still cached (or is said to be resident) in the receive buffer of the second node. Therefore, in this case, after the first node sends the reference message to the second node and before the first node receives the reference end marker returned by the second node, the credit value returned by the second node to the first node is lost, resulting in the value of the second counter of the first node and the value of the fourth counter of the second node being deducted out of sync. Therefore, the first node deducts the above-mentioned residual value from the value of the first counter (i.e., the third value) to achieve compensation correction of the value of the first counter, so that the first counter accurately records the communication link currently scheduled to be dequeued from the first transmit queue and located on the transmission link of the message from the first node to the second node and the length of the message cached in the receive buffer of the second node. This can prevent the following situation: when the credit value returned by the second node to the first node is lost, the first counter of the first node accumulates more credit values ​​while the corresponding credit value deducted is less. Then, when the false value of the first counter exceeds the flow control threshold, the first node will stop sending messages to the second node, that is, the traffic transmission performance between the first node and the second node will be reduced, and even traffic congestion may occur at the first node.

[0245] In summary, the data transmission method provided by the embodiment of the present application can automatically correct the counter during the process of performing credit flow control on the message sent by the first node through the first counter mentioned above, thereby greatly improving the reliability of credit flow control on the message sent by the first node through the counter.

[0246] To deepen the understanding of the method described in the embodiment of the present application, the above method is exemplarily described below with reference to FIG6 .

[0247] Referring to Figure 6, Figure 6 shows another flow chart of the data transmission method provided by an embodiment of the present application. As shown in Figure 6, when a message of the video service class is sent to the second node through the first sending queue of the first node, and the second node receives the message of the video service class through the first receiving queue. Among them, the first sending queue is configured with a first counter for credit flow control of the video service class message, and is configured with a second counter for correcting the first counter. The first receiving queue is configured with a third counter and a fourth counter for assisting in correcting the aforementioned first counter. Among them, the detailed description of the first counter, the second counter, the third counter and the fourth counter can be referred to the above description and will not be repeated here.

[0248] In this scenario, the first node can execute S201 above to schedule a video service class message, such as message 1, from the first transmission queue as a fixed reference message, and update the first counter based on message 1. Next, the first node executes S202 above to control the second counter to obtain the updated value of the first counter. The first node then executes S203 above to send message 1 to the second node.

[0249] In response, the second node executes S204 above to receive Message 1. Furthermore, the second node executes S205 and S206 above to update the value of the third counter based on Message 1 and controls the fourth counter to obtain the updated value of the third counter. The second node continues executing S207-S208 above to update the fourth and third counters, and returns to the first node the credit value used to update the fourth counter each time. When the fourth counter is updated to 0, the second node returns a reference end marker to the first node.

[0250] In response, the first node executes S209 to receive a message / message returned by the second node that includes only the credit value, or a message / message returned by the second node that includes the credit value and a reference end marker. In this way, the first node can update the values ​​of the first counter and the second counter based on the received credit value, and correct the updated value of the first counter based on the updated value of the second counter.

[0251] Below, the message preamble provided in the embodiment of the present application is explained.

[0252] In the embodiment of the present application, the preamble of the message includes a preamble type field, a reference request field, a credit value field, and a reference end field. Optionally, the preamble of the message also includes a queue group field and a check field.

[0253] The preamble type field carries a type flag to indicate the preamble type. Type flags include a normal preamble flag and a CFC type flag. The CFC type flag indicates that the preamble of the current message carries information used for credit flow control. Information used for credit flow control includes, but is not limited to, at least one of the reference flag, credit value, or reference end flag described above.

[0254] As an example, a normal preamble flag can be represented by the hexadecimal value 0x5 (binary 0101), and a CFC type flag can be represented by the hexadecimal value 0xA (binary 1010). Thus, when the preamble type field value is 0x5, it indicates that the preamble of the current message is a normal preamble. When the preamble type field value is 0xA, it indicates that the preamble of the current message carries information for credit flow control, such as at least one of the reference marker, credit value, or reference end marker described above.

[0255] Reference Request Field: Used to carry the reference tag described above. For example, the reference tag can take the value 7, which is represented as 111 in binary. Therefore, when the Reference Request Field includes three bits and these three bits are set to 111, it indicates that the Reference Request Field of the message preamble carries a reference tag. When the three bits of the Reference Request Field are set to any value other than 111, it indicates that the Reference Request Field of the message preamble is invalid, or it is understood that the Reference Request Field of the message preamble does not carry a reference tag.

[0256] Credit Value Field: Used to carry the credit value returned by the second node to the first node as described above. In embodiments of the present application, the Credit Value Field can carry multiple credit values. However, due to the limited length of the preamble, the number of credit values ​​that can be carried by the preamble's Credit Value Field is limited. In some examples, the Credit Value Field of a message preamble can carry a maximum of four credit values ​​used to deduct from four first counters at a time. These four first counters are used to perform credit flow control on messages in four transmit queues, respectively.

[0257] It should be understood that when the credit value field can carry multiple credit values, the credit value field can be divided into multiple credit value subfields, and each credit value subfield is used to carry one or more credit values ​​used to deduct a first counter. That is, one credit value subfield corresponds to one first counter. Because one first counter is used to perform credit flow control on packets in one send queue, that is, one first counter corresponds to one send queue. Therefore, it can also be understood that one credit value subfield corresponds to one send queue.

[0258] It should also be understood that when the credit value field and / or credit value subfield of the message preamble is set to 0, it means that the credit value field and / or credit value subfield are invalid, or it should be understood that the credit value field and / or credit value subfield of the message preamble does not carry a credit value.

[0259] Reference End Field: Used to carry the reference end marker described above. For example, when the Reference End Field includes one bit and this bit is set to 1, it indicates that the Reference End Field of the message preamble carries the reference end marker. When one bit of the Reference End Field is set to 0, it indicates that the Reference End Field is invalid, or it is understood that the Reference End Field does not carry the reference end marker.

[0260] It should be noted that when the credit value field can carry multiple credit values, that is, when the credit value field includes multiple credit value subfields, the reference end field of the message preamble includes multiple reference end subfields, and the number of the multiple reference end subfields is the same as the number of credit value subfields in the current preamble, and corresponds one to one.

[0261] In this case, taking any credit value subfield in the credit value field, such as credit value subfield 1, as an example, assuming that the sending queue corresponding to credit value subfield 1 is sending queue 1, and the reference end subfield corresponding to credit value subfield 1 is reference end subfield 1. Then, after the first node sends the reference message from sending queue 1 to the second node, and before the reference message flows out of the receiving buffer of the second node, if any message from sending queue 1 in the first node, such as message 1, flows out of the receiving buffer of the second node, then in the preamble of the service message or credit response message sent by the second node to the first node, credit value subfield 1 carries a credit value used to represent the length of message 1, and reference end subfield 1 is set to invalid, that is, reference end subfield 1 does not carry a reference end marker. If the reference message from the sending queue 1 in the first node flows out from the receiving buffer of the second node, then in the preamble code of the service message or credit response message sent by the second node to the first node, the credit value subfield 1 carries a credit value used to characterize the length of the message currently flowing out from the receiving buffer of the second node and from the sending queue 1, and the reference end subfield 1 carries a reference end marker.

[0262] Queue group field: used to carry a queue group identifier to identify the queue group to which the sending queue corresponding to the credit value carried in the current message preamble belongs. It should be understood that when multiple sending queues all use the first counter for credit flow control, the first counters corresponding to each of the multiple sending queues need to be deducted according to the credit value returned by the peer node. Since the number of credit values ​​that the credit value field of a message preamble can carry at a single time is limited, the multiple sending queues can be divided into multiple queue groups, and the number of sending queues included in each queue group is less than or equal to the number of credit values ​​that the credit value field in the preamble can carry. In this way, the credit value field of a message preamble can carry at most the credit value used to deduct the first counter of each sending queue in a queue group at a single time.

[0263] As an example, assume that the credit value field can carry a maximum of credit values ​​for deducting four first counters at a time, and that the first node currently includes eight transmit queues requiring credit flow control. Therefore, the eight first counters corresponding to these eight transmit queues must all be deducted based on the credit values ​​returned by the peer node. Therefore, these eight transmit queues can be divided into queue group 1 and queue group 2. Queue group 1 can include four transmit queues: transmit queue 1, transmit queue 2, transmit queue 3, and transmit queue 4, and queue group 2 can include four transmit queues: transmit queue 5, transmit queue 6, transmit queue 7, and transmit queue 8. Thus, when the value carried by the queue group field identifies queue group 1, the credit value field of the current message preamble correspondingly carries the four credit values ​​for deducting the first counters of each transmit queue in queue group 1. Similarly, when the value carried by the queue group field identifies queue group 2, the credit value field of the current message preamble correspondingly carries the four credit values ​​for deducting the first counters of each transmit queue in queue group 2.

[0264] It is understood that the number of queue groups that the queue group field can identify is 2 to the power of n, where n is the number of bits included in the queue group field. For example, when the queue group field includes 1 bit, the queue group field can identify 2 1 Queue groups, that is, 2 queue groups, and these 2 queue groups are specifically identified by the two states of 0 and 1 of 1 bit. For another example, when the queue group field includes 2 bits, the queue group field can identify 2 2 There are queue groups, that is, 4 queue groups, and these 4 queue groups are specifically identified by the four combination states of 01, 10, 00, and 11 of 2 bits.

[0265] Check field: used to check the preamble. The check field can be, for example, an 8-bit CRC check code.

[0266] Based on the message preamble described above, the first node adds a reference tag to the reference message in S203 above, which means setting the type field of the reference message preamble to the value corresponding to the CFC type tag (such as 0xA), and setting the reference request field to the value corresponding to the reference tag (such as 111 mentioned above).

[0267] That is, in the preamble of the reference message sent by the first node to the second node in S203 , the type field carries the CFC type tag, and the reference request field carries the reference tag.

[0268] In addition, the second node carries the credit value returned by the second node to the first node via the preamble of the service message or credit response message described above. This means that the type field of the preamble is set to the value corresponding to the CFC type tag (e.g., 0xA), the queue group field of the preamble is set to the group number of the queue group corresponding to the credit value, and the credit value subfield corresponding to the credit value in the credit value field carries the credit value. In this way, the second node can return the credit value (e.g., the credit value of the second message described above) to the first node via the credit subfield in the preamble of the service message or credit response message.

[0269] Among them, the queue group corresponding to the credit value refers to the queue group to which the sending queue from which the message used to calculate the credit value comes belongs. The credit value subfield corresponding to the credit value refers to the credit value subfield corresponding to the sending queue from which the message used to calculate the credit value comes. Among them, the description of the correspondence between the sending queue and the credit value subfield can refer to the description of "one credit value subfield corresponds to one sending queue" above, and will not be repeated here. As an example, when the second node calculates the credit value 1 based on the message from the sending queue 1 flowing out of the receiving buffer, the queue group corresponding to the credit value 1 is the queue group to which the sending queue 1 belongs, and the credit value subfield corresponding to the credit value 1 is the credit value subfield corresponding to the sending queue 1.

[0270] In addition, the second node carries the reference end marker and the credit value returned by the second node to the first node through the preamble of the service message or credit response message in S208, which means that the type field of the preamble is set to the value corresponding to the CFC type marker (such as 0xA), the queue group field is set to the identifier of the queue group corresponding to the credit value, the credit value subfield corresponding to the credit value in the credit value field carries the credit value, and the reference end subfield corresponding to the credit value subfield in the preamble is set to the value corresponding to the reference end marker (such as 1). Among them, the description of the queue group corresponding to the credit value, the description of the credit value subfield corresponding to the credit value, and the description of the credit value subfield corresponding to the reference end subfield can all be referred to above and will not be repeated here.

[0271] In this way, in the preamble code of the service message or credit response message sent by the second node to the first node in S208, the type field carries the CFC type tag, the reference end field carries the reference end tag, and the credit value field carries the credit value returned by the second node to the first node.

[0272] Optionally, for a service message or credit response message sent by the second node and carrying a reference end mark and a credit value, or only carrying a credit value, the message can also be used as a reference message sent by the second node to the first node for correcting the credit flow control counter, and the reference mark is carried in the reference request field of the message preamble, that is, the value of the reference request field of the message preamble is the value corresponding to the reference mark (such as 7), and there is no limitation on this.

[0273] As an example, refer to Figure 7, which shows a schematic structural diagram of a message preamble provided in an embodiment of the present application.

[0274] As shown in Figure 7 , a MAC-based Ethernet frame 70 includes an / S / field, a preamble field, a start of frame delimiter (SFD) field, a frame payload field, and an FCS field. The / S / field and preamble field shown in Figure 7 constitute a traditional preamble, which is generally used to isolate each Ethernet frame and can also be called a locator. The preamble field shown in Figure 7 includes 6 bytes. The SFD field shown in Figure 7 includes 1 byte and is used to indicate the start of a frame. The frame payload field shown in Figure 7 is generally greater than or equal to 60 bytes, specifically a MAC frame. The FCS field shown in Figure 7 includes 4 bytes and is used to verify the Ethernet frame.

[0275] As shown in FIG7 , for the first 8 bytes of Ethernet frame 70, byte 7 is the / S / field, byte 0 is the SFD field, and bytes 1 to byte 6 are the preamble field.

[0276] The MSG_TYPE field, including bits 4 to 7 of byte 6 shown in FIG7 , can serve as the preamble type field described above, and can be used to carry the common preamble flag or CFC type flag described above. The S_REQ field, including bits 1 to 3 of byte 6 shown in FIG7 , can serve as the reference request field described above, and can be used to carry the reference flag described above. The Cos_Group field, including bit 0 of byte 6 shown in FIG7 , can serve as the queue group field described above, and can be used to carry the queue group identifier described above.

[0277] As shown in Figure 7 , for any byte from byte 2 to byte 5 shown in Figure 7 , bits 0 to 6 of that byte can serve as a credit value subfield as described above, used to carry one or more credit values ​​returned by the second node to the first node, and bit 7 of that byte can serve as a reference end subfield as described above, used to carry a reference end marker returned by the second node to the first node. Furthermore, the credit value subfield and reference end subfield in that byte correspond to the same transmit queue, so that the byte can carry a credit value used to decrement the first counter corresponding to a transmit queue and a reference end marker used to indicate that a reference message from that transmit queue has flowed out of the receive buffer. Therefore, the reference end subfield and credit value subfield in bytes 2 to byte 5 of the preamble shown in Figure 7 correspond to four transmit queues and can carry credit values ​​used to decrement the four first counters corresponding to each of the four transmit queues, as well as a reference end marker used to indicate that a reference message from each of the four transmit queues has flowed out of the receive buffer.

[0278] For simplicity, in the following examples, for a certain send queue, the "credit value used to deduct the first counter corresponding to the send queue" is referred to as the "credit value corresponding to the send queue." Furthermore, the "reference end marker used to indicate that a reference message from the send queue has flowed out of the receive buffer" is referred to as the "reference end marker corresponding to the send queue."

[0279] In one example, when a port of the first node includes four transmit queues that require credit flow control, namely transmit queue 0, transmit queue 1, transmit queue 2, and transmit queue 3. In this case, as shown in FIG7 , the credit value subfield and the reference end subfield in byte 2 shown in FIG7 may correspond to transmit queue 0, and may carry the credit value corresponding to transmit queue 0, and carry the reference end marker corresponding to transmit queue 0. Specifically, the embodiment of the present application may carry the credit value corresponding to transmit queue 0 (such as credit 0 shown in FIG7 ) through bits 0 to bit 6 of byte 2 shown in FIG7 , and carry the reference end marker corresponding to transmit queue 0 (such as T_ACK0 shown in FIG7 ) through bit 7 of byte 2 shown in FIG7 .

[0280] Similarly, an embodiment of the present application may carry the credit value corresponding to send queue 1 (such as credit 1 as shown in Figure 7) through bits 0 to 6 of byte 3 shown in Figure 7, and carry the reference end marker corresponding to send queue 1 (such as T_ACK1 as shown in Figure 7) through bit 7 of byte 3 shown in Figure 7. An embodiment of the present application may carry the credit value corresponding to send queue 2 (such as credit 2 as shown in Figure 7) through bits 0 to 6 of byte 4 shown in Figure 7, and carry the reference end marker corresponding to send queue 2 (such as T_ACK2 as shown in Figure 7) through bit 7 of byte 4 shown in Figure 7. An embodiment of the present application may carry the credit value corresponding to send queue 3 (such as credit 3 as shown in Figure 7) through bits 0 to 6 of byte 5 shown in Figure 7, and carry the reference end marker corresponding to send queue 3 (such as T_ACK3 as shown in Figure 7) through bit 7 of byte 5 shown in Figure 7.

[0281] In another example, when a port in the first node includes eight transmit queues that require credit flow control, the eight transmit queues can be divided into queue group 1 and queue group 2. Queue group 1 includes transmit queue 0, transmit queue 1, transmit queue 2, and transmit queue 3, and queue group 2 includes transmit queue 4, transmit queue 5, transmit queue 6, and transmit queue 7.

[0282] In this case, when the value of the Cos_Group field shown in FIG7 is the identifier of queue group 1, bytes 2 to 5 shown in FIG7 can respectively carry the credit value corresponding to each transmit queue in queue group 1 and the reference end marker corresponding to each transmit queue in queue group 1. Specifically, as shown in FIG7 , the credit value subfield and the reference end subfield in byte 2 of FIG7 can correspond to transmit queue 0 and can carry the credit value corresponding to transmit queue 0 (e.g., credit 0) and the reference end marker corresponding to transmit queue 0 (e.g., T_ACK0). Similarly, the credit value subfield and the reference end subfield in byte 3 of FIG7 can correspond to transmit queue 1 and can carry the credit value corresponding to transmit queue 1 (e.g., credit 1) and the reference end marker corresponding to transmit queue 1 (e.g., T_ACK1). The credit value subfield and the reference end subfield in byte 4 of FIG7 can correspond to transmit queue 2 and can carry the credit value corresponding to transmit queue 2 (e.g., credit 2) and the reference end marker corresponding to transmit queue 2 (e.g., T_ACK2). The credit value subfield and reference end subfield in byte 5 shown in Figure 7 can correspond to the sending queue 3, and can carry the credit value corresponding to the sending queue 3 (such as credit 3), and carry the reference end marker corresponding to the sending queue 3 (such as T_ACK3).

[0283] Similarly, when the value of the Cos_Group field shown in FIG7 is the identifier of queue group 2, bytes 2 to 5 shown in FIG7 can respectively carry the credit value corresponding to each transmit queue in queue group 2 and the reference end marker corresponding to each transmit queue in queue group 2. Specifically, as shown in FIG7 , the credit value subfield and the reference end subfield in byte 2 of FIG7 can correspond to transmit queue 4 and can carry the credit value corresponding to transmit queue 4 (e.g., credit 4) and the reference end marker corresponding to transmit queue 4 (e.g., T_ACK4). Similarly, the credit value subfield and the reference end subfield in byte 3 of FIG7 can correspond to transmit queue 5 and can carry the credit value corresponding to transmit queue 5 (e.g., credit 5) and the reference end marker corresponding to transmit queue 5 (e.g., T_ACK5). The credit value subfield and the reference end subfield in byte 4 of FIG7 can correspond to transmit queue 6 and can carry the credit value corresponding to transmit queue 6 (e.g., credit 6) and the reference end marker corresponding to transmit queue 6 (e.g., T_ACK6). The credit value subfield and reference end subfield in byte 5 shown in Figure 7 can correspond to the sending queue 7, and can carry the credit value corresponding to the sending queue 7 (such as credit 7), and carry the reference end marker corresponding to the sending queue 7 (such as T_ACK7).

[0284] As shown in FIG7 , byte 1 in the preamble shown in FIG7 can be used to carry an 8-bit CRC check code.

[0285] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.

[0286] To achieve the above functions, as shown in FIG8 , FIG8 shows a schematic structural diagram of a data transmission device 80 provided in an embodiment of the present application. The data transmission device 80 is the first node mentioned above, and the first node sends a message to the second node through one or more sending queues. The first node is configured with the first counter mentioned above, and the first counter is used to perform credit flow control on the message of the first sending queue in the one or more sending queues mentioned above. The data transmission device 80 is used to execute the above-mentioned data transmission method, for example, for executing the method shown in FIG4a, FIG4b or FIG6. The data transmission device 80 may include a sending unit 81 and a receiving unit 82.

[0287] The sending unit 81 is configured to send a reference message to the second node for instructing the correction of the first counter. The receiving unit 82 is configured to receive a service message or a credit response message returned by the second node, wherein the preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct the first counter.

[0288] As an example, in conjunction with Figure 4a, the sending unit 81 may be used to execute S101, and the receiving unit 82 may be used to execute S104. In conjunction with Figure 4b, the sending unit 81 may be used to execute S203, and the receiving unit 82 may be used to execute S209.

[0289] Optionally, the credit value is used to characterize the length of the message from the first sending queue and flowing out of the receiving cache of the second node. The preamble in the above-mentioned business message and credit response message includes a type field, a reference end field, and a credit value field. Among them, the type field carries a credit flow control CFC type mark, and the CFC type mark is used to indicate that the preamble in the above-mentioned business message and credit response message carries information for credit flow control. The reference end field is used to carry a reference end mark, and the reference end mark is used to indicate that the reference message has flowed out of the receiving cache of the second node. The credit value field is used to carry the credit value returned by the second node to the first node.

[0290] Optionally, the preamble in the reference message includes a type field and a reference request field. The type field carries a CFC type tag, which indicates that the preamble in the reference message carries information for credit flow control. The reference request field carries a reference tag that identifies the reference message.

[0291] Optionally, the data transmission device 80 also includes: a processing unit 83, which is used to periodically determine the to-be-sent messages scheduled out of the first sending queue as reference messages; or, which is used to determine the to-be-sent messages scheduled out of the first sending queue as reference messages in response to a correction instruction.

[0292] Optionally, the value of the first counter is used to represent the length of the message scheduled out of the first sending queue. The message scheduled out of the first sending queue includes the communication link located at the first node to transmit the message to the second node and the message cached in the receiving cache of the second node.

[0293] Optionally, the processing unit 83 is specifically used to: before sending the reference message to the second node, determine a first credit value used to characterize the length of the reference message based on the length of the reference message and the bit width of the receiving cache of the second node; and add the first credit value to the current value of the first counter to complete the update of the value of the first counter.

[0294] As an example, in conjunction with FIG. 4 b , the processing unit 83 may be configured to execute S201 .

[0295] Optionally, the data transmission device 80 further includes: an output unit 84, configured to output an alarm message when the number of consecutive calibration failures of the first counter exceeds a threshold.

[0296] Optionally, the sending unit 81 is further configured to send a CFC capability request message to the second node before the first node sends a message to the second node. The receiving unit 82 is further configured to receive a CFC capability response message returned by the second node. The CFC capability response message carries the CFC capability information of the second node. The CFC capability information includes one or more of the size of the second node's receive buffer, the bit width of the second node's receive buffer, a receive queue in the second node that supports CFC, or an offset. The offset is used to determine the message length required for calculating the message credit value.

[0297] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation and description of the beneficial effects of any of the above data transmission devices 80 can refer to the above corresponding method embodiments, which will not be repeated here.

[0298] As an example, with reference to FIG3 , the sending unit 81 and receiving unit 82 in the data transmission device 80 can be implemented via the communication interface 32 shown in FIG3 . The processing unit 83 can be implemented jointly by the control circuit 31 and the flow control module 34 shown in FIG3 . The output unit 84 can be implemented via the output interface of the device where the chip 30 shown in FIG3 resides. Here, the output interface includes, but is not limited to, a display screen, a speaker, an indicator light, etc.

[0299] As shown in Figure 9, Figure 9 shows a schematic diagram of the structure of a data transmission device 90 provided in an embodiment of the present application. Data transmission device 90 is applied to the second node including the first receive queue described above, where the first receive queue is used to receive messages from the first transmit queue of the first node. Data transmission device 90 is used to execute the above-mentioned data transmission method, for example, the method shown in Figures 4a, 4b, or 6. Data transmission device 90 may include a receiving unit 91 and a sending unit 92.

[0300] Receiving unit 91 is configured to receive a first message from a first transmit queue. Sending unit 92 is configured to, in response to the first message being a reference message, send a service message or a credit response message to the first node. The preamble in the service message or credit response message carries a credit value, which is used to calibrate a first counter for performing credit flow control (CFC) on messages in the first transmit queue. The reference message is used to instruct the calibration of the first counter.

[0301] As an example, in conjunction with Figure 4a, the receiving unit 91 may be used to execute S102, and the sending unit 92 may be used to execute S103. In conjunction with Figure 4b, the receiving unit 91 may be used to execute S204, and the sending unit 92 may be used to execute S207 and S208.

[0302] Optionally, the credit value is used to characterize the length of the message from the first sending queue and flowing out of the receiving cache of the second node. The preamble in the service message and the credit response message includes a type field, a reference end field, and a credit value field. Among them, the type field carries a credit flow control CFC type tag, and the CFC type tag is used to indicate that the preamble in the service message and the credit response message carries information for credit flow control. The reference end field is used to carry a reference end tag, and the reference end tag is used to indicate that the reference message has flowed out of the receiving cache of the second node. The credit value field is used to carry the credit value returned by the second node to the first node.

[0303] Optionally, the preamble in the reference message includes a type field and a reference request field. The type field carries a CFC type tag, which is used to indicate that the preamble in the reference message carries information for credit flow control. The reference request field is used to carry a reference tag that identifies the reference message.

[0304] Optionally, the receiving unit 91 is further configured to receive a CFC capability request message from the first node before receiving the first message from the first transmit queue. The transmitting unit 93 is further configured to send a CFC capability response message to the first node in response to the CFC capability request message. The CFC capability response message carries the CFC capability information of the second node, including one or more of the size of the second node's receive buffer, the bit width of the second node's receive buffer, the receive queues in the second node that support CFC, or an offset. The offset is used to determine the message length required for calculating the message credit value.

[0305] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation and beneficial effects of any of the above data transmission devices 90 can be referred to the above corresponding method embodiments, which will not be repeated here.

[0306] As an example, in conjunction with FIG. 3 , the receiving unit 91 and the sending unit 93 in the data transmission device 90 may be implemented by the communication interface 32 shown in FIG. 3 .

[0307] It should be readily apparent to those skilled in the art that, in combination with the units and algorithmic steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0308] It should be noted that the module divisions shown in Figures 8 and 9 are schematic and represent only one logical functional division. In actual implementation, other divisions may be employed. For example, two or more functions may be integrated into a single processing module. These integrated modules may be implemented in either hardware or software functional modules.

[0309] The present application also provides a first node. The first node sends messages to a second node via one or more transmit queues, and the first node is configured with the first counter described above, which is used to perform credit flow control on messages in a first transmit queue among the one or more transmit queues. The first node calibrates the first counter used for credit flow control by executing the method provided in the present application (such as the portion executed by the first node in the method described in FIG. 4a , FIG. 4b , or FIG. 6 ).

[0310] The embodiment of the present application also provides a second node. The second node includes a first receive queue for receiving messages from the first transmit queue of the first node. The second node is configured with the third counter and the fourth counter described above. The value of the third counter is used to represent the length of the message from the first transmit queue cached in the receive buffer of the second node. The second node calibrates the first counter by executing the method provided in the embodiment of the present application (such as the portion executed by the second node in the method described in Figures 4a, 4b, or 6). The first counter is used to perform credit flow control on the messages in the first transmit queue.

[0311] An embodiment of the present application further provides a data transmission system, which includes a first node and a second node. The first node and the second node are respectively used to execute corresponding steps in the method described above, which will not be repeated here.

[0312] The embodiments of the present application also provide a computer program product and a computer-readable storage medium for storing the computer program product. The computer program product may include one or more program instructions that, when executed by one or more processors, may provide the functions or partial functions described above with respect to FIG. 4a, FIG. 4b, or FIG. 6. Thus, for example, one or more features of S101 to S104 in FIG. 4a may be performed by one or more instructions in the computer program product.

[0313] In some examples, a data transmission determination device, such as for executing the method described in FIG. 4 a , FIG. 4 b , or FIG. 6 , may be configured to provide various operations, functions, or actions in response to one or more program instructions stored in a computer-readable storage medium.

[0314] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the instructions are executed on a computer and executed by the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available media can be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid state drive (SSD)).

[0315] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A data transmission method, characterized in that: Applied to a first node, the first node sends a message to a second node through one or more sending queues, the first node is configured with a first counter, and the first counter is used to perform credit flow control CFC on a message of a first sending queue in the one or more sending queues; the method includes: The first node sends a reference message to the second node, where the reference message is used to instruct correction of the first counter; The first node receives a service message or a credit response message returned by the second node, where a preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct the first counter.

2. The method according to claim 1, characterized in that The credit value is used to characterize the length of the message from the first sending queue and flowing out of the second node receiving buffer, and the leading code in the service message and the credit response message includes a type field, a reference end field and a credit value field; wherein, The type field carries a credit flow control CFC type tag, and the CFC type tag is used to indicate that the preamble in the service message and the credit response message carries information for credit flow control; The reference end field is used to carry a reference end marker, and the reference end marker is used to indicate that the reference message has flowed out of the receiving buffer of the second node; The credit value field is used to carry the credit value returned by the second node to the first node.

3. The method according to claim 1 or 2, characterized in that: The preamble in the reference message includes a type field and a reference request field, the type field carries a CFC type tag, the CFC type tag is used to indicate that the preamble in the reference message carries information for credit flow control, and the reference request field is used to carry a reference tag that identifies the reference message.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The first node periodically schedules the to-be-sent messages out of the first sending queue and determines them as the reference messages; or, In response to the correction instruction, the first node determines the to-be-sent message that is scheduled out of the first sending queue as the reference message.

5. The method according to any one of claims 1 to 4, characterized in that The value of the first counter is used to represent the length of the message scheduled out of the first sending queue, and the message scheduled out of the first sending queue includes the communication link located at the first node to transmit the message to the second node and the message cached in the receiving cache of the second node.

6. The method according to any one of claims 1 to 5, characterized in that Before the first node sends the reference message to the second node, the method further includes: The first node determines, according to the length of the reference message and the bit width of the receiving buffer of the second node, a first credit value used to characterize the length of the reference message; The first node accumulates the first credit value to the current value of the first counter to complete the update of the value of the first counter.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the number of consecutive correction failures of the first counter exceeds a threshold, the first node outputs an alarm message.

8. The method according to any one of claims 1 to 7, characterized in that Before the first node sends the reference message to the second node, the method further includes: The first node sends a CFC capability request message to the second node; The first node receives a CFC capability response message returned by the second node; The CFC capability response message carries CFC capability information of the second node, and the CFC capability information includes one or more of the size of the receiving cache of the second node, the bit width of the receiving cache of the second node, the receiving queue supporting CFC in the second node, or an offset, and the offset is used to determine the message length required for calculating the message credit value.

9. A data transmission method, characterized in that: Applied to a second node including a first receiving queue, wherein the first receiving queue is used to receive a message from a first sending queue of a first node; the method comprises: The second node receives a first message from the first sending queue; The second node sends a service message or a credit response message to the first node in response to the first message being a reference message, wherein the preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct the first node. A first counter for credit flow control (CFC) of a message in a sending queue; the reference message is used to indicate the correction of the first counter.

10. The method according to claim 9, characterized in that The credit value is used to characterize the length of the message from the first sending queue and flowing out of the second node receiving buffer; the leading code in the service message and the credit response message includes a type field, a reference end field and a credit value field; wherein, The type field carries a credit flow control CFC type tag, and the CFC type tag is used to indicate that the preamble in the service message and the credit response message carries information for credit flow control; The reference end field is used to carry a reference end marker, and the reference end marker is used to indicate that the reference message has flowed out of the receiving buffer of the second node; The credit value field is used to carry the credit value returned by the second node to the first node.

11. The method according to claim 9 or 10, characterized in that: The preamble in the reference message includes a type field and a reference request field; the type field carries a CFC type tag, and the CFC type tag is used to indicate that the preamble in the reference message carries information for credit flow control; The reference request field is used to carry a reference tag identifying the reference message.

12. The method according to any one of claims 9 to 11, characterized in that Before the second node receives the first message from the first sending queue, the method further includes: The second node receives the CFC capability request message sent by the first node; The second node sends a CFC capability response message to the first node in response to the CFC capability request message; The CFC capability response message carries CFC capability information of the second node, and the CFC capability information includes one or more of the size of the receiving cache of the second node, the bit width of the receiving cache of the second node, the receiving queue supporting CFC in the second node, or an offset, and the offset is used to determine the message length required for calculating the message credit value.

13. A data transmission device, characterized in that: Applied to a first node, the first node sends a message to a second node through one or more sending queues, the first node is configured with a first counter, and the first counter is used to perform credit flow control CFC on a message of a first sending queue in the one or more sending queues; the device includes: a sending unit, configured to send a reference message to the second node, wherein the reference message is used to instruct correction of the first counter; A receiving unit is configured to receive a service message or a credit response message returned by the second node, wherein the preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct the first counter.

14. The device according to claim 13, characterized in that The credit value is used to characterize the length of the message from the first sending queue and flowing out of the second node receiving buffer, and the leading code in the service message and the credit response message includes a type field, a reference end field and a credit value field; wherein, The type field carries a credit flow control CFC type tag, and the CFC type tag is used to indicate that the preamble in the service message and the credit response message carries information for credit flow control; The reference end field is used to carry a reference end marker, and the reference end marker is used to indicate that the reference message has flowed out of the receiving buffer of the second node; The credit value field is used to carry the credit value returned by the second node to the first node.

15. The device according to claim 13 or 14, characterized in that The preamble in the reference message includes a type field and a reference request field, the type field carries a CFC type tag, the CFC type tag is used to indicate that the preamble in the reference message carries information for credit flow control, and the reference request field is used to carry a reference tag that identifies the reference message.

16. The device according to any one of claims 13 to 15, characterized in that The device also includes: A processing unit is used to periodically schedule the to-be-sent messages out of the first sending queue as the reference messages; or to respond to a correction instruction and determine the to-be-sent messages out of the first sending queue as the reference messages.

17. The device according to any one of claims 13 to 16, characterized in that The value of the first counter is used to represent the length of the message scheduled out of the first sending queue, and the message scheduled out of the first sending queue includes the communication link located at the first node to transmit the message to the second node and the message cached in the receiving cache of the second node.

18. The device according to any one of claims 13 to 17, characterized in that The processing unit is specifically used for: Before sending the reference message to the second node, determining a first credit value for characterizing the length of the reference message according to the length of the reference message and the bit width of a receiving buffer of the second node; The current value of the first counter is added to the first credit value to complete the update of the value of the first counter.

19. The device according to any one of claims 13 to 18, characterized in that The device also includes: The output unit is used to output an alarm message when the number of consecutive calibration failures of the first counter exceeds a threshold.

20. The device according to any one of claims 13 to 19, characterized in that The sending unit is further configured to send a CFC capability request message to the second node before sending the message to the second node; The receiving unit is further configured to receive a CFC capability response message returned by the second node; The CFC capability response message carries CFC capability information of the second node, and the CFC capability information includes one or more of the size of the receiving cache of the second node, the bit width of the receiving cache of the second node, the receiving queue supporting CFC in the second node, or an offset, and the offset is used to determine the message length required for calculating the message credit value.

21. A data transmission device, characterized in that: Applied to a second node including a first receiving queue, wherein the first receiving queue is used to receive a message from a first sending queue of a first node; the device comprises: A receiving unit, configured to receive a first message from the first sending queue; A sending unit, configured to send a service message or a credit response message to the first node in response to the first message being a reference message, wherein the preamble in the service message or the credit response message carries a credit value, and the credit value is used to correct a first counter for performing credit flow control CFC on messages in the first sending queue, and the reference message is used to indicate correction of the first counter.

22. The device according to claim 21, characterized in that The credit value is used to characterize the length of the message from the first sending queue and flowing out of the second node receiving buffer; the leading code in the service message and the credit response message includes a type field, a reference end field and a credit value field; wherein, The type field carries a credit flow control CFC type tag, and the CFC type tag is used to indicate that the preamble in the service message and the credit response message carries information for credit flow control; The reference end field is used to carry a reference end marker, and the reference end marker is used to indicate that the reference message has flowed out of the receiving buffer of the second node; The credit value field is used to carry the credit value returned by the second node to the first node.

23. The device according to claim 21 or 22, characterized in that The preamble in the reference message includes a type field and a reference request field; the type field carries a CFC type tag, and the CFC type tag is used to indicate that the preamble in the reference message carries information for credit flow control; The reference request field is used to carry a reference tag identifying the reference message.

24. The device according to any one of claims 21 to 23, characterized in that The receiving unit is further configured to receive a CFC capability request message sent by the first node before receiving the first message from the first sending queue; The sending unit is further configured to send a CFC capability response message to the first node in response to the CFC capability request message; The CFC capability response message carries CFC capability information of the second node, and the CFC capability information includes one or more of the size of the receiving cache of the second node, the bit width of the receiving cache of the second node, the receiving queue supporting CFC in the second node, or an offset, and the offset is used to determine the message length required for calculating the message credit value.

25. A first node, characterized in that: The first node sends a message to the second node through one or more sending queues, and the first node is configured with a first counter, and the first counter is used to perform credit flow control CFC on the message of the first sending queue among the one or more sending queues; the first node is used to execute the method as described in any one of claims 1 to 8 to realize the correction of the first counter.

26. A second node, characterized in that: The second node includes a first receiving queue, which is used to receive messages from a first sending queue of the first node; the second node is used to execute the method as described in any one of claims 9 to 12 to realize correction of a first counter, and the first counter is used to perform credit flow control CFC on the messages of the first sending queue.

27. A data transmission system, characterized in that: The method comprises a first node and a second node, wherein the first node is used to execute the method as claimed in any one of claims 1 to 8, and the second node is used to execute the method as claimed in any one of claims 9 to 12, so as to realize correction of a first counter used for credit flow control in the first node.

Citation Information

Patent Citations

  • Credit based flow control system, apparatus and method

    CN101115008A

  • Design method of flow control mechanism on the basis of Credit in network-on-chip

    CN105955920A

  • Credit recovery in a credit based flow control system

    US20050228900A1

  • Consistency checking for credit-based control of data communications

    US20110075555A1

Cited By

  • Dynamic flow control method based on longitudinal expansion networking, electronic equipment and medium

    CN120128536A