Data transmission method, device and system
The method addresses CFC reliability issues by correcting counters using reference messages and credit values in preambles, enhancing transmission efficiency and resource management in data transmission systems.
Patent Information
- Application Number
- CN202310643717.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
Smart Images

Figure CN119071250A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device and system. Background Art
[0002] For any two communicating devices, the device used to send messages (or traffic) is called the first node, and the device used to receive messages (or traffic) is called the second node. In the process of communication between the first node and the second node, the control of the traffic transmitted from the first node to the second node can be achieved through the traditional priority-based flow control (PFC) technology, so as to avoid the phenomenon of packet loss caused by traffic overflow in the second node during the process of transmitting traffic from the first node to the second node.
[0003] Since the traditional PFC technology is a passive flow control technology and occupies a large amount of receiving buffer resources of the second node, active credit-based flow control (CFC) technology can be used to control the flow transmitted from the first node to the second node to reduce the occupation of the receiving buffer resources of the second node.
[0004] However, when using CFC technology to control the transmission of traffic from the first node to the second node, if the message sent by the first node to the second node is lost, or the credit information returned by the second node to the first node is lost, it will lead to the inability to effectively control the traffic transmitted from the first node to the second node, resulting in a decrease in traffic transmission performance during the process of transmitting traffic from the first node to the second node, and even traffic congestion at the first node. In other words, the reliability of CFC technology is poor. Summary of the invention
[0005] 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.
[0006] To achieve the above objectives, this application provides the following technical solutions:
[0007] 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 a second node through one or more sending queues, and the first counter is used to perform credit flow control (credit-based flow control, CFC) on the message of the first sending queue in the aforementioned one or more sending queues. The method includes: the first node sends a reference message for indicating the correction of the first counter to the second node. The first node receives a business message or a credit response message returned by the second node, and the leading code in the business message or the credit response message carries a credit value, and the credit value is used to correct the first counter.
[0008] Through the method provided by the present application, the counter can be automatically corrected in 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. In addition, in the process of correcting the counter used for credit flow control, the credit value is carried in the message preamble, so that the scheme of the present application is easy to implement. In addition, when the credit value is carried by the preamble of the service message, the network resources of the first node and the second node can be saved. When the credit value is carried by the preamble of the dedicated credit response message, the credit value can be timely 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, which can improve the efficiency of correcting the first counter.
[0009] In a 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 used 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.
[0010] 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 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.
[0011] 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.
[0012] In another possible design, the above method also includes: the first node periodically schedules the to-be-sent messages 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.
[0013] 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 when the first node performs flow control based on the corrected first counter, the reliability is greatly improved.
[0014] In another possible design, the value of the first counter is used to characterize the length of the message scheduled out of the first sending queue. The message scheduled out of the first sending queue includes a communication link located at the first node to transmit the message to the second node and a message cached in the receiving cache of the second node.
[0015] In another possible design, before the first node sends the reference message to the second node, the method further includes: the first node determines 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 the buffer received by the second node. 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.
[0016] 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.
[0017] Through this possible design, during the process of flow control through the first counter, the first node 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.
[0018] 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 receiving cache, the bit width of the second node receiving cache, the receiving queue supporting CFC in the second node, or the offset. Here, the offset is used to determine the message length required for calculating the message credit value.
[0019] Through this possible design, the first node obtains the CFC capability information of the second node by pre-negotiating with the second node, so that the first node can perform credit flow control on the message 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.
[0020] 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 a message 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, and the leading code in the service message or the credit response message carries a credit value, which is used to correct the first counter for credit flow control CFC of the message of the first sending queue. The reference message is used to indicate the correction of the first counter.
[0021] In a 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 used 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.
[0022] In another possible design, the preamble in the above-mentioned 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 of the reference message carries information for credit flow control. The reference request field is used to carry a reference tag identifying the above-mentioned reference message.
[0023] In another possible design, before the second node receives the first message from the first sending queue, the method further includes: the second node receives a CFC capability request message sent by the first node. The second node responds to the CFC capability request message and sends a CFC capability response message to the first 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 receiving buffer, the bit width of the second node receiving buffer, the receiving queue supporting CFC in the second node, or the offset. Here, the offset is used to determine the message length required for calculating the message credit value.
[0024] 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 will not be repeated here.
[0025] In a third aspect, the present application provides a data transmission device.
[0026] In a possible design, the data transmission device is used to execute any one of the methods provided in the first aspect above. The present application may 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 may be divided according to each function, or two or more functions may be integrated into one processing module. Exemplarily, the present application may 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.
[0027] 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 may 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 may be divided according to each function, or two or more functions may be integrated into one processing module. Exemplarily, the present application may 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, which will not be repeated here.
[0028] In another possible design, the data transmission device includes: one or more processors and a communication interface, the one or more processors receive or send data through the communication interface, and the one or more processors are configured to call program instructions stored in a memory so that the data transmission device executes any method provided by the first aspect and any possible design thereof, or executes any method provided by the second aspect and any possible design thereof.
[0029] In a fourth aspect, the present application provides a first node, which sends a message to a 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 on the message of the first sending queue in the one or more sending queues. The first node is used to execute any method provided in any possible implementation of the first aspect to realize the correction of the first counter.
[0030] In a fifth aspect, the present application provides a second node, the second node comprising a first receiving queue, the first receiving queue being used to receive a message from a first sending queue of the first node. The second node is used to execute any method provided in any possible implementation of the second aspect to implement correction of a first counter, the first counter being used to perform credit flow control on the message of the first sending queue.
[0031] In a sixth aspect, the present application provides a data transmission system, comprising a first node and a second node. The first node is used to execute any method provided in any possible implementation of the first aspect, and the second node is used to execute any method provided in any possible implementation of the second aspect, so as to correct a first counter used for credit flow control in the first node.
[0032] In a seventh aspect, the present application provides a computer-readable storage medium, which includes program instructions. When the program instructions are executed on a computer or a processor, the computer or the processor executes any method provided by any possible implementation in the first aspect or the second aspect.
[0033] In an eighth aspect, the present application provides a computer program product, which, when executed on a data transmission device, enables any method provided by any possible implementation in the first aspect or the second aspect to be executed.
[0034] It can be understood that any of the above-mentioned devices, systems, computer storage media or computer program products 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.
[0035] In this application, the names of the above-mentioned 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 equivalent technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a flow control process using CFC technology;
[0037] Figure 2 A schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of the hardware structure of a chip provided in an embodiment of the present application;
[0039] Figure 4a A flowchart of a data transmission method provided in an embodiment of the present application;
[0040] Figure 4b A flowchart of another data transmission method provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of a credit response message provided in an embodiment of the present application;
[0042] Figure 6 Another flow chart of the data transmission method provided in the embodiment of the present application;
[0043] Figure 7 A schematic diagram of the structure of a message preamble provided in an embodiment of the present application
[0044] Figure 8 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0045] Fig. 9 A schematic diagram of the structure of another data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0047] In the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0048] In the present 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.
[0049] When flow control is performed through CFC technology in the process of sending a message from the first node to the second node (flow control is flow control, and flow control through CFC technology is referred to as credit flow control), the first node maintains a credit counter for each sending queue, and determines whether traffic congestion occurs at the second node by the value of the credit counter, and then stops sending messages when it is determined that traffic congestion occurs at the second node.
[0050] refer to Figure 1 , Figure 1 FIG. 1 shows a schematic diagram of a flow control process using CFC technology. Figure 1 As shown, taking the output queue (OQ) 1 of the first node as an example, the credit counter maintained by the first node for OQ 1 is counter 1, and the input queue (IQ) 1 of the second node is used to receive messages from the first node OQ 1.
[0051] At the first node, for any message to be sent, taking the message being the message of OQ 1 as an example, when the first node schedules the message out of the queue from OQ 1, the first node first calculates a credit value 1 for representing the length of the message according to the length of the message, and adds the value of counter 1 to the credit value 1. Then, the first node sends the message to the second node through the sending interface.
[0052] At the second node, for any message to be received, taking the message that needs to be received through IQ 1 as an example, when the second node receives the message through the receiving interface, the second node writes the message into IQ 1 of the receiving buffer. When the second node dispatches the message out of the queue from IQ 1, the second node calculates a credit value 2 used to characterize the length of the message based on the length of the message, and returns the credit value 2 to the first node through the sending interface of the second node. In response, after the first node receives the credit value 2 sent by the second node, the credit value 2 is deducted from the value of counter 1. In other words, counter 1 deducts the credit value used to characterize the length of the message flowing out of the receiving buffer of the second node.
[0053] In this way, by accumulating the credit value used to characterize the length of the message dequeued from the OQ and deducting the credit value used to characterize the length of the message flowing out of the receiving buffer of the second node to the value of the credit counter maintained by the first node, it is possible 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 through the credit counter.
[0054] Therefore, when the value of the credit counter exceeds the flow control threshold, it means that there are too many communication links for transmitting messages from the first node to the second node and too many messages cached in the receiving buffer of the second node, which may cause traffic congestion at the second node. In this case, the first node can stop scheduling and sending messages in the sending queue corresponding to the credit counter, thereby realizing credit flow control through the credit counter in the process of sending messages from the first node to the second node.
[0055] However, when credit flow control is performed in the process of the first node sending a message to the second node by the above method, if the message sent by the first node to the second node is lost, the second node will not generate and send a credit value for representing the length of the message to the second node. Or the second node generates a credit value for representing the length of the message flowing out of the receiving buffer of the second node, but information loss occurs when sending the credit value to the first node.
[0056] In this case, the credit counter maintained by the first node cannot be deducted normally, resulting in the inability to effectively perform credit flow control on the message sent by the first node to the second node through the credit counter. That is, when the credit flow control is performed through the credit counter during the process of the first node sending the message to the second node, the reliability is poor.
[0057] 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, in 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 according to the credit value carried in the preamble code of the service message or credit response message received from the second node.
[0058] By automatically correcting the first counter in the process of credit flow control based on the counter, it is possible to avoid the phenomenon of traffic performance degradation or even blocking 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 referred to the above description and will not be repeated.
[0059] 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.
[0060] 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 this is not limited.
[0061] 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, which is not limited to this. For the sake of simplicity, the embodiments of the present application are described below using the example of the first node and the second node communicating directly.
[0062] refer to Figure 2 , Figure 2 A schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application is shown.
[0063] like Figure 2 As shown, the data transmission system 20 includes a first node 21 and a second node 22 .
[0064] 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 through the first counter. In addition, in the process of the first node 21 performing credit flow control based on the first counter, the first counter can be automatically corrected (such as periodic automatic correction), so that when the first node 21 performs credit flow control based on the corrected first counter, the reliability is greatly improved.
[0065] 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.
[0066] 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 are not limited thereto.
[0067] 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.
[0068] For example, the first node and the second node are both chips used for communication. Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of the hardware structure of a chip provided in an embodiment of the present application. Figure 3 As shown, 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.
[0069] The control circuit 31 is the control part of the chip 30, and is used to control the various devices, modules and circuits in the chip 30. For example, the control circuit 31 can be used to control the dispatching of messages from different sending queues from the sending buffer of the chip 30 to the communication interface 32 to send the messages. For another example, the control circuit 31 can be used to control the dispatching of messages from different receiving queues of the receiving buffer of the chip 30 to the message processing module (such as a processor) of the device where the chip is located.
[0070] Optionally, the control circuit 31 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or a micro-processing unit (MPU), etc., but is not limited thereto.
[0071] The communication interface 32 is used for connecting the chip 30 with other chips via a communication network, wherein the communication network may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc., but is not limited thereto.
[0072] 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 sending interfaces (or sending ports) for sending messages, and one or more receiving interfaces (or receiving ports) for receiving messages, but is not limited thereto.
[0073] In order to control the traffic sent by any sending interface in the communication interface 32, the chip 30 can configure multiple sending queues with different priorities (i.e., the OQ mentioned above) for the sending interface. In this way, the control circuit 31 can control the sending interface to send messages in different sending queues in time-division multiplexing according to the priority of each sending queue. Here, the sending queues with different priorities can be used to send service messages with different sending priority requirements.
[0074] The priority of the sending queue is used to indicate the priority of dispatching the messages in the sending queue to the sending interface. It should be understood that after the message is dispatched to the sending interface, it can be sent out through the communication network by the sending interface. Therefore, the priority of the sending queue can also be understood as the priority of sending the messages in the sending queue through the sending interface.
[0075] For example, the messages in the sending queue with the highest priority are preferentially scheduled out of the queue to the sending interface in sequence, and after all the messages in the sending queue with the highest priority are scheduled out of the queue, the messages in the sending queue with the second highest priority are scheduled out of the queue to the sending interface in sequence, etc. For another example, the scheduling frequency of scheduling the messages in the sending queue with the highest priority out of the queue to the sending interface is the highest, and the scheduling frequency of scheduling the messages in the sending queue with the lowest priority to the sending interface is the lowest. And so on, without limitation thereto.
[0076] It should be understood that when there is Figure 3 The first node of the hardware structure shown configures multiple sending queues for a certain sending interface. For the receiving interface of the chip 30 connected to the sending interface through the communication network and serving as the second node, the receiving interface is configured with a receiving queue that corresponds to the sending queue configured by the sending interface of the first node. In addition, the sending queue and the receiving queue that have a corresponding relationship have the same priority.
[0077] 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).
[0078] 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.
[0079] 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 corresponds to a dedicated sending buffer, which is not limited.
[0080] Optionally, multiple receiving queues configured in a certain receiving interface in the chip 30 may share the above receiving buffer, or each receiving queue corresponds to a dedicated receiving buffer, which is not limited.
[0081] In addition, the control circuit 31 can access the sending buffer and the receiving buffer. Moreover, the control circuit 31 can dispatch the messages of different sending queues in the sending buffer to the sending interface according to the priority of the sending queue. The control circuit 31 can also determine the corresponding receiving queue according to the message received by the receiving interface, and write the received message to the receiving queue located in the receiving buffer. Then, the control circuit 31 can dispatch the messages of different receiving queues to the message processing module of the device where the chip 30 is located based on the priority of different receiving queues. Among them, dispatching the message from the receiving queue can also be understood as the message flowing out of the receiving buffer.
[0082] Among them, the embodiments of the present 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.
[0083] 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.
[0084] The flow control module 34 includes a first counter for credit flow control configured for each sending queue that needs credit flow control based on the sending queue of the chip 30, and a second counter configured for correcting each first counter, so that the second counter can be used to correct the first counter.
[0085] Among them, a first counter is configured corresponding to a sending queue that needs to perform credit flow control. A first counter can be configured corresponding to a second counter. Alternatively, multiple first counters configured for multiple sending queues under the same sending interface can be configured corresponding to a second counter. When multiple first counters configured for multiple sending queues under the same sending interface are configured corresponding to a second counter, the correction of the multiple first counters can be achieved by time-division multiplexing the second counter.
[0086] In other words, when multiple sending queues under any sending interface of the chip 30 need to perform credit flow control, the chip 30 can maintain a first counter for credit flow control for each of the multiple sending queues. That is, the chip 30 maintains multiple first counters for the multiple sending queues under the sending interface. In this scenario, the embodiment of the present application does not specifically limit the number of second counters configured by the chip 30 for correcting the multiple first counters.
[0087] 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.
[0088] For example, the chip 30 maintains four first counters for flow control for the four transmission queues under the transmission interface 1, and maintains one second counter for correcting the four first counters. Then the second node can correct the first first counter through the second counter in time period 1, correct the second first counter through the second counter in time period 2, correct the third first counter through the second counter in time period 3, and correct the fourth first counter through the second counter in time period 4.
[0089] Optionally, the chip 30 may also configure a second counter for calibrating each first counter, that is, the number of the first counters is the same as the number of the second counters, and they correspond one to one.
[0090] 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, used to indicate to start or stop sending messages through the first sending queue). The specific functions can refer to the description of the credit counter above, which will not be repeated here. When the first counter needs to be calibrated, the chip 30 is also configured with a second counter, and the second counter 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, which will not be repeated here.
[0091] In addition, when there is Figure 3When the first node of the hardware structure shown 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 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 for the first receiving queue, and includes a fourth counter configured for the third counter, and 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 a third counter. One third counter can be configured with a fourth counter, or multiple third counters configured for multiple receiving queues under the same receiving port can be configured with a fourth counter, which is not limited to 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.
[0092] 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 realizing the counter function, and this is not limited. 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.
[0093] It should be pointed out that Figure 3 The chip structure shown in the figure does not constitute a limitation on the chip 30, except Figure 3 In addition to the components shown, the chip 30 may include Figure 3 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.
[0094] The data transmission method provided in the embodiments of the present application is described below in conjunction with the accompanying drawings.
[0095] Specifically, when the first node sends a message to the second node through one or more sending queues, for the sake of simple description, in the following embodiments of the present application, the first node is described as an example in which a first counter is configured for performing credit flow control on a first sending queue among the one or more sending queues, and a second counter is configured for correcting the first counter.
[0096] In addition, it is assumed that the receiving queue for receiving the message in the first sending queue of the first node is the first receiving queue of the second node, and the second node is configured with the above-mentioned third counter for the first receiving queue, and the above-mentioned fourth counter is correspondingly configured for the third counter. Among them, the first receiving queue of the second node can also be called a receiving queue having a corresponding relationship with the first sending queue of the first node.
[0097] In this case, refer to Figure 4a , Figure 4a A schematic diagram of a data transmission method provided in an embodiment of the present application is shown. Optionally, the method is applied to Figure 2 The data transmission system shown in FIG. Figure 3 The first node and the second node of the hardware structure shown perform corresponding steps.
[0098] like Figure 4a As shown, the data transmission method provided in the embodiment of the present application includes the following steps:
[0099] 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.
[0100] The detailed description of the reference message and the first counter, as well as the detailed description of the first node determining the reference message, can refer to the relevant description in S201 below, and will not be repeated here. The detailed description of the first node sending the reference message to the second node can refer to the description in S203 below, and will not be repeated here.
[0101] S102: The second node receives a first message from a first sending queue.
[0102] The second node receives the first message from the first sending queue, which can be referred to the description of S204 below and will not be repeated here.
[0103] 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, where 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.
[0104] The credit value carried in the preamble code in the service message or the credit response message is used to represent the length of the message flowing out from the receiving buffer of the second node.
[0105] 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 a 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.
[0106] S104: The first node receives a service message or a credit response message returned by the second node.
[0107] Furthermore, the first node corrects the first counter based on the credit value carried in the preamble code of the service message or credit response message received from the second node.
[0108] 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.
[0109] By using 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.
[0110] In other embodiments, reference Figure 4b , Figure 4b A schematic diagram of another data transmission method provided in an embodiment of the present application is shown. Optionally, the method is applied to Figure 2 The data transmission system shown in FIG. Figure 3 The first node and the second node of the hardware structure shown perform corresponding steps.
[0111] like Figure 4b As shown, the data transmission method provided in the embodiment of the present application includes the following steps:
[0112] S201: When a to-be-sent message that is scheduled out of 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.
[0113] 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.
[0114] The first counter is specifically used to record the length of the message scheduled out of the first sending queue. Among them, 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. Or 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.
[0115] Specifically, the first node may determine the to-be-sent message that is scheduled out of the first sending queue as a reference message.
[0116] 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.
[0117] 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.
[0118] Optionally, the first node may periodically determine the to-be-sent messages that are scheduled out of the first sending queue as reference messages. The embodiment of the present application does not specifically limit the period duration.
[0119] Optionally, the first node may determine the to-be-sent message dispatched from the first sending queue as a reference message in response to the 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 thereto.
[0120] 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 the to-be-sent message that is dispatched out of the first sending queue as a reference message, the embodiment of the present application can periodically and automatically correct the first counter through the periodically determined reference message, thereby improving the reliability of credit flow control through the first counter in the process of the first node sending the message through the first sending queue.
[0121] Further, the first node updates the value of the first counter according to the determined reference message.
[0122] Specifically, the first node may first determine 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 the buffer received by the second node.
[0123] Specifically, the first node can obtain a first credit value representing the length of the reference message by rounding (such as 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) means rounding up the quotient of CFC_Plength / 160.
[0124] Among them, the bit width of the second node receiving buffer used to calculate the first credit value can be regarded as a credit unit when calculating the credit value. Optionally, when calculating the credit value, the credit unit can be the actual receiving buffer bit width of the second node, or an integer multiple of the actual receiving buffer bit width of the second node, or of course, any preset value pre-negotiated by the first node and the second node, which is not limited in the embodiment of the present application.
[0125] 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 it is certainly not limited to this.
[0126] The length of the reference message used to calculate the first credit value refers to the message length when the reference message is cached in the receiving buffer of the second node.
[0127] 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, when calculating the credit value representing the length of a certain message, in order to ensure that the credit value calculated by the first node and the second node is the same (in the 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 cached in the receiving buffer of the second node. That is to say, the credit value used to represent 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.
[0128] Optionally, when determining the length of the reference message, the first node can obtain the total length of the IP data packet of the reference message by reading the total length field carried by the Internet Protocol (IP) header in the reference message for recording the total length of the IP data packet. Then, the first node adds a certain offset to the total length of the IP data packet, so as to obtain the length of the reference message when it is cached in the receiving buffer of the second node. The offset includes the length of the outer header of the IP data packet of the reference message.
[0129] For example, assuming that the IP data packet is a layer 3 message of the reference message, the reference message also includes a layer 2 message header (such as a MAC header) and a layer 1 message header (such as a virtual local area network (VLAN) header) located outside the layer 3 IP header. Optionally, when the second node receives the buffer cache message, it is necessary to add the above-mentioned static extension header to the message, and the offset also includes the length of the static extension header configured by the second node receiving buffer.
[0130] Exemplarily, assuming that 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 that 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 length is generally 40B.
[0131] Optionally, the parameters such as the bit width and offset of the second node receiving buffer used in calculating the first credit value may be obtained by the first node from the second node when the first node negotiates CFC capability with the second node, and this is not limited.
[0132] The process of negotiating the CFC capability between the first node and the second node may include:
[0133] Step 1: Before sending a message to the second node, the first node sends a CFC capability request message to the second node.
[0134] The CFC request message is used to determine whether the second node supports the CFC capability, and if the second node supports the CFC capability, request to obtain the CFC capability information of the second node. The CFC capability information is used to perform credit flow control on the message sent to the second node, and the CFC capability information may include the size of the second node receiving buffer, the bit width of the second node receiving buffer, the receiving queue in the second node that supports CFC, or one or more of the above offsets.
[0135] The size of the second node receiving buffer is used by the first node to set a flow control threshold of a first counter for credit flow control, so that the first node can perform flow control on messages to be sent in the first sending queue according to whether the value of the first counter exceeds the flow control threshold.
[0136] The offset is used to determine the message length required for calculating the message credit value. The bit width of the second node receiving buffer and the message length calculated based on the offset are used to calculate the message credit value.
[0137] 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 CFC capability.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] Specifically, the second node can read the size and bit width of its own receiving buffer from its own configuration information, and determine the queue number of its own receiving 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, and optionally, the second node can determine the above-mentioned static extension header length based on the configuration of its own receiving buffer. Then, the second node calculates the above-mentioned offset based on the determined outer header length of the IP header and the static extension header length. Furthermore, the second node carries the CFC capability information including the size and bit width of its own receiving buffer, the queue number of its own receiving queue that supports CFC, and the offset in a CFC capability response message and sends it to the first node.
[0142] In response, the first node receives the CFC capability response message of the second node, thereby obtaining the bit width of the second node receiving buffer and the offset used to determine the message length required for calculating the credit value.
[0143] In this way, the first node can calculate the length of the reference message when it is cached in the second node receiving buffer according to 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.
[0144] 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.
[0145] 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 that 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.
[0146] Wherein, based on the frequency being the same 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. A beat is an update operation currently performed by the first counter.
[0147] Optionally, when updating the value of the first counter in 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 characterize the length of one or more messages from the first sending queue of the first node flowing out from the receiving buffer of the second node. The number of second credit values can be one or more. For example, one message from the first sending queue of the first node flowing out from the receiving buffer of the second node can correspond to one second credit value.
[0148] 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.
[0149] Therefore, when the first node also includes the second credit value, when updating the value of the first counter:
[0150] In a possible implementation, the first node first adds the first credit value to the current value of the first counter, and then subtracts the second credit value from the value of the first counter after the first credit value is accumulated, thereby completing the update of the value of the first counter. 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 that 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 = 5 + 3 - 4 = 4.
[0151] In another possible implementation, the first node first deducts the second credit value from the current value of the first counter, and 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 value of the first counter. It can be seen that the value of the updated first counter is the difference between the current value and the second credit value, plus the first credit value. As an example, assuming that 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 = 5-4+3=4.
[0152] In addition, it should be noted that when credit flow control is performed based on the first counter in the process of the first node 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.
[0153] It can be seen that the update operation on the first counter includes the accumulation operation on the value of the first counter after the message of the first sending queue is scheduled out of the queue, and the deduction operation on the value of the first counter after the message of the first sending queue flows out from 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 that is currently scheduled out of the first sending queue and transmits the message from 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.
[0154] S202: The first node controls the second counter to obtain the updated value of the first counter.
[0155] 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.
[0156] 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 refer to the relevant description of S209 below, which will not be repeated here.
[0157] 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. Then, the second counter may obtain the updated value of the first counter and set its own value to the obtained value.
[0158] 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.
[0159] S203: The first node sends a reference message to the second node.
[0160] Specifically, the first node first adds a reference mark to the reference message scheduled out of the first sending queue. The reference mark is used to identify that the current message is 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.
[0161] 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.
[0162] Specifically, the value of the third counter is used to characterize the length of the message cached in the receiving buffer of the second node and from the first sending queue, and the value of the third counter is specifically a credit value used to characterize the length of the message cached in the receiving buffer of the second node and from the first sending queue. It can be seen that the value of the third counter can reflect the usage of the receiving buffer in the second node for caching messages from the first sending queue in real time.
[0163] The fourth counter is used to indicate whether the reference message received by the second node flows out from the receiving buffer of the second node. In this way, 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 from the receiving buffer of the second node. When the value of the fourth counter is greater than 0, it indicates that the reference message is still cached in (or called staying in) the receiving buffer of the second node. Among them, the value of the third counter obtained by the fourth counter can refer to the description of S206, and the update process of the fourth counter can refer to the relevant description of S207-S208, which will not be repeated.
[0164] Optionally, the first node may add a reference marker to a preamble code of the reference message. For a detailed description of carrying a reference marker by a preamble code of a message, please refer to the description of "a message preamble code provided in an embodiment of the present application" below, which will not be repeated here.
[0165] Then, the first node dispatches the reference message with the reference tag added to the sending interface of the first node (eg Figure 3 The transmitting interface in the communication interface shown in the figure) is used to enable the transmitting interface to send the reference message with the reference tag added to the second node through the communication network. Here, the embodiment of the present application does not specifically limit the form and / or format of the communication network.
[0166] S204: The second node receives a first message from the first sending queue of the first node.
[0167] 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 described above.
[0168] Specifically, the second node can receive the Figure 3 The receiving interface of the communication interface shown in the figure receives the first message from the first sending queue of the first node. The receiving interface establishes a communication connection with the sending interface of the first node that sends the first message.
[0169] S205: The second node updates the value of the third counter according to the first message.
[0170] The detailed description of the third counter can be found in the above description and will not be repeated here.
[0171] Specifically, after receiving the first message, the second node first determines the third credit value according to the length of the first message and the bit width of its own receiving buffer. The third credit value is used to characterize the length of the first message, or it can be understood that the third credit value is used to characterize the cache depth occupied by the first message when it is cached in the receiving buffer of the second node.
[0172] 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 are given.
[0173] Then, the second node adds the third credit value to the current value of the third counter to complete the update of the third counter value. It can be seen that the updated value of the third counter is the sum of the current value and the third credit value. For example, assuming that 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.
[0174] Optionally, when updating the value of the third counter in 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 second node receiving buffer, 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 second node receiving buffer can correspond to a fourth credit value.
[0175] Here, for a detailed description of the second node determining 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.
[0176] Therefore, when the second node also includes the fourth credit value, when updating the value of the third counter:
[0177] In a 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 the third credit value is accumulated, thereby completing the update of the value of the third counter. 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 that 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.
[0178] 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 value of the third counter in the current shot. It can be seen that the value of the updated 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 that the current value of the third counter is 10, the third credit value is 5, and the fourth credit value is 2, then the value of the updated third counter = 10-2+5 = 13.
[0179] It can be seen that the update operation on the third counter includes an accumulation operation on the value of the third counter before the message from the first sending queue is written into the receiving buffer of the second node, and a deduction operation on the value of the third counter after the message from the first sending queue flows out of the receiving buffer of the second node. In this way, the credit value recorded by the third counter can be taken in real time to characterize the length of the message currently cached in the receiving buffer of the second node and from the first sending queue. In other words, the credit value recorded by the third counter can reflect the cache usage of the second node for caching the receiving buffer from the first sending queue in real time.
[0180] 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.
[0181] Specifically, the second node first determines whether the received first message carries a reference tag. When the second node determines that the first message carries a reference tag, it indicates that the first message is a reference message carrying a reference tag. In this case, the second node controls the fourth counter to obtain the value of the updated third counter in response to the reference tag carried by the first message. In this way, the value of the fourth counter is the same as the value of the updated third counter.
[0182] The detailed description of the reference mark, the third counter and the fourth counter can refer to the above description, which will not be repeated. The process of the second node controlling the fourth counter to obtain the updated value of the third counter can refer to the process description of the first node controlling the second counter to obtain the updated value of the first counter in S202, which will not be repeated.
[0183] Further, the second node writes the first message into a receiving buffer for a first receiving queue for receiving messages from the first sending queue.
[0184] In one example, the first message carries a queue identifier of a first sending queue, and the second node pre-stores a correspondence between the sending queue and the receiving queue, so that the second node can determine the first receiving queue for receiving the first message by querying the correspondence based on the queue identifier of the first sending queue. Then, the second node writes the first message into the first receiving queue.
[0185] S207: The second node updates the value of the fourth counter.
[0186] The second node updates the value of the fourth counter including: after the fourth counter obtains the value of the third counter, the second node deducts the value of the fourth counter according to each message flowing out of its own receiving buffer (or understood as being dispatched out of the first receiving queue) and from the first sending queue. And, after the value of the fourth counter is deducted to 0, the deduction operation is stopped.
[0187] 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, in the process of credit flow control based on the first counter, the second node also deducts the value of the third counter according to 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. Among them, the target time period is the time period from the fourth counter obtaining the value of the third counter to the value of the fourth counter being deducted from 0.
[0188] The following describes the process of the second node deducting the values of the fourth counter and the third counter by taking any message, such as the second message, flowing out of the receiving buffer of the second node and coming from the first sending queue within the target period as an example. The process may include the following steps:
[0189] Step 1: The second node determines the credit value of the second message according to the length of the second message.
[0190] The credit value of the second message is used to characterize the length of the second message, or it can be understood that the credit value of the second message is used to characterize the buffer depth occupied by the second message when it is buffered in the receiving buffer of the second node.
[0191] 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.
[0192] Step 2: The second node deducts the credit value of the second message from the value of the fourth counter.
[0193] 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.
[0194] Step 3: The second node deducts the credit value of the second message from the value of the third counter.
[0195] 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.
[0196] 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 simultaneously.
[0197] It can be seen that the update operation performed on the fourth counter only includes a deduction operation on the value of the fourth counter according to the message from the first sending queue that flows out from the receiving buffer of the second node within the target period. In this way, by determining whether the current value of the fourth counter after deducting the credit value is 0, it is possible to determine whether the current reference message has flowed out from the receiving buffer of the second node.
[0198] Furthermore, after the second node determines the credit value of the message according to the length of the message flowing out of its own receiving buffer and from the first sending queue, it returns the credit value of the message to the first node, that is, returns the credit value used to update the fourth counter (or the third counter) to the first node. For example, after the second node determines the credit value of the second message according to step 1, it also returns the credit value of the second message to the first node. Among them, the credit value returned by the second node to the first node is used by the first node to update the value of the first counter and the value of the second counter. For detailed description, please refer to the relevant description of S209 below, which will not be repeated.
[0199] Specifically, the second node can send an interface (eg Figure 3 The sending interface in the communication interface shown in the figure) returns a message / message including a credit value to the first node, which is not limited to this.
[0200] 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 receiving queue of the second node receiving buffer. Therefore, within the above-mentioned target period, the second node executes the above-mentioned process of steps 1 to 3 for each message scheduled out of the first receiving queue (or understood as each message flowing out of the second node receiving buffer), and returns the credit value determined each time step 1 is executed to the first node, so that the first node updates the values of the first counter and the second counter according to the credit value returned by the second node.
[0201] 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, and the service message or the credit response message is used to carry the credit value that the second node needs to return to the first node. The credit response message is a message generated when the second node needs to return a credit value to the first node and is dedicated to carrying the credit value.
[0202] It is understandable that when the second node needs to return the credit value to the first node, if there is no service message to be sent to the first node in the second node, a credit response message for carrying the credit value can be generated. Of course, the second node can also instantly generate a credit response message for carrying the credit value when it needs to return the credit value to the first node, without having to determine whether there is a service message to be sent to the first node.
[0203] In an embodiment of the present application, a CFC message for carrying credit flow control related information is defined, and the above-mentioned credit response message is one of the CFC messages. Specifically, the embodiment of the present application indicates whether the current message is a CFC message by multiplexing the destination MAC (destination MAC, DMAC) field, the type / length (Type / Length) field and the operation code (Opcode) field in the message MAC frame structure.
[0204] 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.
[0205] For example, when the value of the type field in the 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 the 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 the CFC message is 3, it indicates that the current CFC message is a credit response message for carrying a credit value. For a detailed description of the CFC capability request message and the CFC capability response message, please refer to the relevant description of S201 above, which will not be repeated here.
[0206] Exemplary, reference Figure 5 , Figure 5 A schematic diagram of the structure of a credit response message provided in an embodiment of the present application is exemplarily shown. Figure 5 The rows of the table shown represent bytes, and the columns represent bits.
[0207] like Figure 5As shown, byte 0 to byte 5 in the credit response message MAC frame is the DMAC field, byte 6 to byte 11 is the source MAC (SMAC) field, byte 12 to byte 13 is the Type / Length field, byte 14 to byte 15 is the Opcode field, byte 16 is the type (MsgType) field, byte 17 to byte 19 is a reserved field, byte 20 to byte 59 is a pad field, and byte 60 to byte 63 is a frame check sequence (FCS) field.
[0208] Among them, the detailed interpretation of the DMAC field, SMAC field, Type / Length field, Opcode field, MsgType field and FCS field is 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 specially defined and can be filled with 0.
[0209] like Figure 5 As shown, the embodiment of the present application can Figure 5 The value of the DMAC field in is set to 0x01-80-C2-00-00-01, the value of the Type / Length field is set to 0x9999 / User Define, and the value of the Opcode field is set to 0x0909, so that the current message can be identified as a CFC message. In addition, the embodiment of the present application can Figure 5 The value of the MsgType field in is set to 3, indicating that the current CFC message is a credit response message.
[0210] Further, optionally, for the above-mentioned service message or credit response message for carrying the credit value, the service message and the credit response message may carry the credit value through the message preamble. For the detailed description of carrying the credit value through the message preamble, please refer to the description of the "message preamble provided in the embodiment of the present application" below, which will not be repeated here.
[0211] S208. When the value of the fourth counter is updated to 0, the second node returns to the first node a reference end mark and a credit value deducted when the value of the fourth counter is updated to 0.
[0212] The second node can send an interface (eg Figure 3 The sending interface in the communication interface shown in the figure) returns to the first node a message / message including a reference end mark and a credit value deducted when the value of the fourth counter is updated to 0, without limitation.
[0213] Specifically, the reference end mark 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.
[0214] More specifically, the credit value deducted when the value of the fourth counter is updated to 0 is used to update the value of the first counter and the value of the second counter of the first node. The reference end mark is used to indicate that the reference message received by the second node from the first node has flowed out of the receiving buffer of the second node, so that the reference end mark can be used to indicate that the first node corrects the updated value of the first counter based on the updated value of the second counter. The detailed process can be referred to the description of S209 below, which will not be repeated here.
[0215] It should be understood that when the value of the fourth counter is deducted to 0, it means that the reference message received by the second node has flowed out of the receiving buffer (or it can be understood that the second node schedules the reference message out of the first receiving queue of its own buffer). In this case, the second node returns a reference end marker to the first node.
[0216] 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).
[0217] In this case, the second node returns the complete credit value deducted by 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.
[0218] However, since the message written into the first receiving queue of the second node first may be scheduled out of the first receiving queue later, in other words, the message that flows into the receiving buffer of the second node first may flow out of the receiving buffer of the second node later. In this case, the message written into the receiving buffer of the second node after the reference message may flow out of the receiving buffer of the second node before the reference message.
[0219] 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).
[0220] 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 corrects the deducted first counter based on the value of the deducted second counter in response to the reference end mark.
[0221] Or it can be understood that, in this case, for the credit value determined by the second node according to the message currently flowing out of its own buffer and from the first sending 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. Among them, the second value is used to deduct the value of the fourth counter when the beat is taken. Since the current value of the fourth counter is equal to the second value, the value of the fourth counter is 0 after deducting the second value. Then, the second node returns the second value 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 returned by the second node, and corrects the deducted first counter based on the value of the deducted second counter in response to the reference end mark. And, when the second node returns the credit value to the first node next time, it also returns the first value, so that the first node deducts the value of the first counter according to the credit value returned by the second node including the first value. For the third counter, the second node can deduct the third counter with the aforementioned determined credit value (i.e., the first value + the second value) when the beat is taken. Alternatively, the second node may deduct the third counter by the second value in the current beat, and deduct the third counter by the first value in the next beat. Alternatively, the second node may deduct the third counter by the first value in the current beat, and deduct the third counter by the second value in the next beat. There is no limitation on this.
[0222] 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 receiving buffer and from the first sending 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 beat is performed. 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, the first value 2 is returned at the same time.
[0223] Optionally, when the value of the fourth counter is updated to 0, the second node needs to return a reference end mark to the first node 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, and the service message or the credit response message is used to carry the reference end mark and the credit value that the second node needs to return to the first node. The relevant description of the credit response message can be referred to above and will not be repeated here.
[0224] It is understandable that when the second node needs to return the reference end mark and the credit value to the first node, and there is no service message to be sent to the first node in the second node, a credit response message carrying the reference end mark and the credit value can be generated. Of course, the second node can also instantly generate a credit response message carrying the credit value and the reference end mark when it needs to return the credit value to the first node, without having to determine whether there is a service message to be sent to the first node.
[0225] Further, optionally, for the above-mentioned service message or credit response message for carrying the reference end mark and the credit value, the service message and the credit response message may carry the reference end mark and the credit value through the message preamble. For a detailed description of carrying the reference end mark and the credit value through the message preamble, please refer to the description of the "message preamble provided in the embodiment of the present application" below, which will not be repeated here.
[0226] 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.
[0227] 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 the service message or credit response message received by the second node. The one or more credit values received by the first node include a credit value used to characterize the length of a reference message sent by the first node to the second node.
[0228] 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 according to the updated value of the second counter.
[0229] More specifically, after the first node receives one or more credit values returned by the second node, the value of the first counter and the value of the second counter are deducted by the one or more credit values. Then, the first node corrects the value of the first counter after deducting the one or more credit values based on the remaining value obtained after the second counter is deducted. It should be understood that the update operation on the second counter only includes the deduction operation on the value of the second counter based on the credit value used to characterize the length of the message from the first sending queue flowing out of the second node receiving buffer.
[0230] 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 according to the received credit value. For example, assuming that the current value of the first counter is 15, 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, and 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.
[0231] Furthermore, if the value of the second counter is less than or equal to 0 after deduction, the second counter did not receive the reference end mark when performing this deduction operation. In this case, it means that the message / message including the reference end mark returned by the second node to the first node is lost. And / or, the reference message including the reference mark sent by the first node to the second node is lost, resulting in the second node being unable to respond to the reference mark to execute S206 and subsequent steps described above, and then in the process of correcting the first counter this time, the second node will not return the reference end mark to the first node. Therefore, the first node determines that the correction of the value after deduction of the first counter has failed.
[0232] It should be understood that when the value of the second counter is less than 0 after deduction, it can also be explained that the first node did not receive the reference end mark 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.
[0233] 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.
[0234] Optionally, the first node may wait to re-execute the above S201-S209 in the next cycle, so as to re-calibrate the first counter.
[0235] 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 reference message determined periodically, when the number of consecutive correction failures exceeds a threshold, the first node outputs an alarm message. The specific value of the threshold is not limited in the embodiment of the present application.
[0236] It can be understood that when the number of consecutive correction failures of the first counter exceeds the threshold, it indicates that packets transmitted between the first node and the second node are frequently lost, that is, the packet loss rate is serious. Therefore, the first node outputs an alarm message to the user, which can remind the user to promptly inspect the communication link between the first node and the second node, thereby ensuring the communication quality.
[0237] In other cases, when the first node receives a message / message returned by the second node including a credit value and a reference end mark (such as the credit value and the reference end mark 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 mark, corrects the value of the first counter after deducting the credit value according to the remaining value of the second counter after deducting the credit value. For clear description, the embodiment of the present application refers to the value of the first counter after deducting the credit value as the third value. Among them, the detailed description of the reference end mark refers to the above description and will not be repeated.
[0238] Furthermore, when the first node receives a message / packet including a credit value and a reference end mark, the first node deducts the credit value from the second counter and, in response to the reference end mark, stops updating the second counter.
[0239] Specifically, when the remaining value is equal to 0, the first node determines, in response to the reference end mark, that the process of performing the first counter on the message sent by the first sending queue is normal, and therefore there is no need to calibrate the first counter.
[0240] It should be understood that when the first node receives the reference end mark, it indicates that the value of the fourth counter of the second node is 0, which further 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 at this moment, 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.
[0241] When the above-mentioned remaining value is greater than 0, the first node, in response to the reference end mark, deducts the above-mentioned 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 above-mentioned remaining value is greater than 0, and the first node determines that it has received the reference end mark returned by the second node, the value of the first counter (i.e., the third value) is deducted from the above-mentioned remaining 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 corrected first counter is 12-7=5.
[0242] It should be understood that when the first node receives the reference end mark, it indicates that the value of the fourth counter of the second node is 0, which further 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 greater than 0, indicating that the value of the second counter of the first node is not 0, that is, it indicates that the second counter indicates that the reference message is still cached in (or called staying in) the receiving buffer of the second node at this moment. Therefore, it is explained that in this case, after the first node sends the reference message to the second node, and before the first node receives the reference end mark 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 remaining value from the value of the first counter (i.e., the third value), which can realize compensation correction of the value of the first counter, so that the first counter accurately records the communication link currently scheduled out of the first sending queue and located in the first node to transmit the message to the second node and the message length cached in the receiving 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. Furthermore, 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.
[0243] 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 performing credit flow control on the message sent by the first node through the counter.
[0244] To deepen the understanding of the method described in the embodiment of the present application, the following Figure 6 The above method is described by way of example.
[0245] refer to Figure 6 , Figure 6 Another flow chart of the data transmission method provided by the embodiment of the present application is shown. Figure 6 As shown, 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 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.
[0246] In this scenario, the first node can execute the above S201 to schedule a message of a certain video service class out of the first sending queue, such as message 1, as a fixed reference message, and update the first counter according to message 1. Then, the first node executes the above S202 to control the second counter to obtain the updated value of the first counter. Then, the first node executes the above S203 to send message 1 to the second node.
[0247] In response, the second node executes the above S204 to receive the message 1. Then, the second node executes the above S205 and S206 to update the value of the third counter according to the message 1, and controls the fourth counter to obtain the updated value of the third counter. The second node continues to execute the above S207 to S208 to update the fourth counter and the third counter, and returns the credit value used to update the fourth counter to the first node each time, and returns the reference end mark to the first node when the fourth counter is updated to 0.
[0248] In response, the first node executes S209 to receive a message / message including only the credit value returned by the second node, or a message / message including the credit value and the reference end mark returned by the second node. In this way, the first node can update the value of the first counter and the value of the second counter according to the received credit value, and correct the updated value of the first counter according to the updated value of the second counter.
[0249] Below, the message preamble provided in the embodiment of the present application is explained.
[0250] 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 grouping field and a check field.
[0251] Among them, the type field of the preamble is used to carry a type tag to indicate the type of the preamble. The type tag includes a common preamble tag and a CFC type tag. The CFC type tag is used to indicate that the preamble of the current message carries information for credit flow control. Here, the information used for credit flow control includes but is not limited to at least one of the reference tag, credit value, or reference end tag mentioned above.
[0252] As an example, a normal preamble mark can be represented by a hexadecimal value of 0x5 (0101 in binary), and a CFC type mark can be represented by a hexadecimal value of 0xA (1010 in binary). Thus, when the type field of the current preamble takes a value of 0x5, it indicates that the preamble of the current message is a normal preamble. When the type field of the current preamble takes a value of 0xA, it indicates that the preamble of the current message carries information for credit flow control, such as at least one of the reference mark, credit value, or reference end mark described above.
[0253] Reference request field: used to carry the reference tag described above. As an example, the value of the reference tag can be 7, which is represented by 111 in binary. Therefore, when the reference request field includes 3 bits and these 3 bits are set to 111, it means that the reference request field of the message preamble carries a reference tag. When the 3 bits of the reference request field are set to any value other than 111, it means 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.
[0254] Credit value field: used to carry the credit value returned by the second node to the first node above. In an embodiment 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 the credit value field of the preamble can carry is limited. In some examples, the credit value field of a message preamble can carry at most a credit value for deducting four first counters at a time. Among them, these four first counters are used to perform credit flow control on the messages of the four sending queues respectively.
[0255] 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 for deducting a first counter, that is, one credit value subfield corresponds to one first counter. Since one first counter is used to perform credit flow control on the message of a sending queue, that is, one first counter corresponds to one sending queue. Therefore, it can also be understood that one credit value subfield corresponds to one sending queue.
[0256] It should also be understood that when the credit value field and / or credit value subfield of the message preamble code 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 code does not carry a credit value.
[0257] Reference end field: used to carry the reference end marker described above. As an example, when the reference end field includes 1 bit, and when this 1 bit is set to 1, it indicates that the reference end field of the message preamble carries the reference end marker. When 1 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.
[0258] 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.
[0259] 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 from 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 for characterizing 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.
[0260] 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 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 time.
[0261] As an example, it is assumed that the credit value field can carry at most the credit value for deducting 4 first counters each time, and the first node currently includes 8 sending queues that need to perform credit flow control, so the 8 first counters corresponding to the 8 sending queues need to be deducted according to the credit value returned by the opposite node. Therefore, the 8 sending queues can be divided into queue group 1 and queue group 2. Among them, queue group 1 can include 4 sending queues, namely, sending queue 1, sending queue 2, sending queue 3 and sending queue 4, and queue group 2 can include 4 sending queues, namely, sending queue 5, sending queue 6, sending queue 7 and sending queue 8. In this way, when the value carried by the queue group field is used to identify queue group 1, the credit value field of the current message preamble correspondingly carries 4 credit values for deducting the first counters of each sending queue in queue group 1. Similarly, when the value carried by the queue group field is used to identify queue group 2, the credit value field of the current message preamble correspondingly carries 4 credit values for deducting the first counters of each sending queue in queue group 2.
[0262] 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 For example, when the queue group field includes 2 bits, the queue group field can identify 2 queue groups. 2 There are four queue groups, that is, four queue groups, and these four queue groups are specifically identified by four combination states of 01, 10, 00, and 11 of 2 bits.
[0263] Check field: used to check the preamble. The check field can be, for example, an 8-bit CRC check code.
[0264] 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).
[0265] 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.
[0266] In addition, the second node carries the credit value returned by the second node to the first node through the preamble of the service message or credit response message described above, which means that the type field of the preamble is set to the value corresponding to the CFC type tag (such as 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 (such as the credit value of the second message described above) to the first node through the credit subfield in the preamble of the service message or credit response message.
[0267] 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.
[0268] In addition, the second node carries the reference end mark 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 mark (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 mark (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 refer to the above description and will not be repeated.
[0269] 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.
[0270] Optionally, for a service message or a 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 may be 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.
[0271] As an example, see Figure 7 , Figure 7 A schematic diagram of the structure of a message preamble provided in an embodiment of the present application is shown.
[0272] like Figure 7 As shown, the 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. Figure 7 The / S / field and the preamble field shown constitute a traditional preamble. The preamble is generally used to isolate each Ethernet frame. The preamble may also be called a locator. Figure 7 The preamble field shown consists of 6 bytes. Figure 7 The SFD field shown includes 1 byte and is used to indicate the start of a frame. Figure 7 The frame payload field shown is generally greater than or equal to 60 bytes, specifically for a MAC frame. Figure 7 The FCS field shown includes 4 bytes and is used to check the Ethernet frame.
[0273] like Figure 7 As shown, for the first 8 bytes of Ethernet frame 70, byte 7 is the / S / field, byte 0 is the SFD field, and byte 1 to byte 6 are the preamble field.
[0274] Among them, Figure 7 The MSG_TYPE field from bit 4 to bit 7 in byte 6 shown above can be used as the type field of the preamble code mentioned above to carry the common preamble code mark or CFC type mark mentioned above. Figure 7 The S_REQ field from bit 1 to bit 3 in byte 6 shown above can be used as the reference request field mentioned above to carry the reference tag mentioned above. Figure 7 The Cos_Group field in bit 0 of byte 6 shown above can be used as the queue group field mentioned above to carry the queue group identifier mentioned above.
[0275] like Figure 7 As shown, for Figure 7Any byte from byte 2 to byte 5 shown, bit 0 to bit 6 in the byte can be used as a credit value subfield as mentioned above, to carry one or more credit values returned by the second node to the first node as mentioned above, and bit 7 in the byte can be used as a reference end subfield as mentioned above, to carry a reference end mark returned by the second node to the first node. Moreover, the credit value subfield and the reference end subfield in the byte correspond to the same sending queue, so that the byte can carry a credit value for deducting a first counter corresponding to a certain sending queue, and carry a reference end mark for indicating that a reference message from the sending queue flows out of the receiving buffer. Therefore, Figure 7 The reference end subfield and credit value subfield in byte 2 to byte 5 of the shown preamble code correspond to four sending queues, and can carry credit values for deducting four first counters corresponding to the four sending queues one by one, and carry a reference end marker for indicating that the reference messages from the four sending queues flow out of the receiving buffer.
[0276] For the sake of simplicity, for a certain sending queue, in the following example, the "credit value used to deduct the first counter corresponding to the sending queue" is referred to as the "credit value corresponding to the sending queue". Also, the "reference end marker used to indicate that the reference message from the sending queue flows out of the receiving buffer" is referred to as the "reference end marker corresponding to the sending queue".
[0277] In one example, a port of the first node includes four sending queues that need to be credit flow controlled, namely, sending queue 0, sending queue 1, sending queue 2, and sending queue 3. In this case, Figure 7 As shown, Figure 7 The credit value subfield and the reference end subfield in byte 2 shown may correspond to the send queue 0, and may carry the credit value corresponding to the send queue 0, and carry the reference end marker corresponding to the send queue 0. Specifically, the embodiment of the present application may be Figure 7 As shown, bits 0 to 6 of byte 2 carry the credit value corresponding to send queue 0 (e.g. Figure 7 credit 0) as shown, and through Figure 7 As shown, bit 7 of byte 2 carries the reference end marker corresponding to send queue 0 (eg Figure 7 T_ACK0 shown).
[0278] Similarly, the embodiments of the present application can be Figure 7 As shown, bit 0 to bit 6 of byte 3 carry the credit value corresponding to send queue 1 (such as Figure 7 credit 1) as shown, and through Figure 7 As shown, bit 7 of byte 3 carries the reference end marker corresponding to send queue 1 (eg Figure 7 T_ACK1 shown). In the embodiment of the present application, Figure 7 As shown, bits 0 to 6 of byte 4 carry the credit value corresponding to send queue 2 (e.g. Figure 7 credit 2) as shown, and through Figure 7 As shown, bit 7 of byte 4 carries the reference end marker corresponding to the send queue 2 (eg Figure 7 T_ACK2 shown). In the embodiment of the present application, Figure 7 As shown, bit 0 to bit 6 of byte 5 carry the credit value corresponding to send queue 3 (such as Figure 7 credit3) as shown, and through Figure 7 As shown, bit 7 of byte 5 carries the reference end marker corresponding to send queue 3 (eg Figure 7 T_ACK3 shown).
[0279] In another example, when a port in the first node includes 8 sending queues that need to be credit flow controlled, the 8 sending queues can be divided into queue group 1 and queue group 2. In addition, queue group 1 includes sending queue 0, sending queue 1, sending queue 2 and sending queue 3, and queue group 2 includes sending queue 4, sending queue 5, sending queue 6 and sending queue 7.
[0280] In this case, when Figure 7 The value of the Cos_Group field shown is the identifier of queue group 1. Figure 7 As shown, byte 2 to byte 5 can carry the credit value corresponding to each sending queue in queue group 1, and carry the reference end mark corresponding to each sending queue in queue group 1. Specifically, Figure 7 As shown, Figure 7 The credit value subfield and reference end subfield in byte 2 shown may correspond to the send queue 0, and may carry the credit value corresponding to the send queue 0 (such as credit 0), and carry the reference end marker corresponding to the send queue 0 (such as T_ACK0). Similarly, Figure 7 The credit value subfield and reference end subfield in byte 3 shown may correspond to send queue 1, and may carry a credit value corresponding to send queue 1 (such as credit 1), and a reference end marker corresponding to send queue 1 (such as T_ACK1). Figure 7The credit value subfield and reference end subfield in byte 4 shown may correspond to send queue 2, and may carry a credit value corresponding to send queue 2 (such as credit 2), and a reference end marker corresponding to send queue 2 (such as T_ACK2). Figure 7 The credit value subfield and reference end subfield in byte 5 shown may correspond to send queue 3, and may carry a credit value corresponding to send queue 3 (such as credit 3), and a reference end marker corresponding to send queue 3 (such as T_ACK3).
[0281] Similarly, when Figure 7 The value of the Cos_Group field shown is the identifier of queue group 2. Figure 7 As shown, byte 2 to byte 5 can respectively carry the credit value corresponding to each sending queue in queue group 2, and carry the reference end mark corresponding to each sending queue in queue group 2. Specifically, Figure 7 As shown, Figure 7 The credit value subfield and the reference end subfield in byte 2 shown may correspond to the send queue 4, and may carry the credit value corresponding to the send queue 4 (such as credit 4), and carry the reference end marker corresponding to the send queue 4 (such as T_ACK4). Similarly, Figure 7 The credit value subfield and reference end subfield in byte3 shown may correspond to send queue 5, and may carry a credit value corresponding to send queue 5 (such as credit 5), and a reference end marker corresponding to send queue 5 (such as T_ACK5). Figure 7 The credit value subfield and reference end subfield in byte 4 shown may correspond to send queue 6, and may carry a credit value corresponding to send queue 6 (such as credit 6), and a reference end marker corresponding to send queue 6 (such as T_ACK6). Figure 7 The credit value subfield and reference end subfield in byte 5 shown may correspond to send queue 7, and may carry a credit value corresponding to send queue 7 (such as credit 7), and a reference end marker corresponding to send queue 7 (such as T_ACK7).
[0282] like Figure 7 As shown, Figure 7 Byte 1 in the preamble shown can be used to carry an 8-bit CRC check code.
[0283] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.
[0284] In order to achieve the above functions, Figure 8 As shown, Figure 8 The structure diagram of a data transmission device 80 provided in an embodiment of the present application is shown. The data transmission device 80 is the first node mentioned above, 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, to execute Figure 4a , Figure 4b or Figure 6 The data transmission device 80 may include a sending unit 81 and a receiving unit 82.
[0285] The sending unit 81 is used to send a reference message for indicating correction of the first counter to the second node. The receiving unit 82 is used to receive a service message or a credit response message returned by the second node, wherein the leading code in the service message or the credit response message carries a credit value, and the credit value is used to correct the first counter.
[0286] As an example, combining Figure 4a , the sending unit 81 can be used to execute S101, and the receiving unit 82 can be used to execute S104. Figure 4b , the sending unit 81 can be used to execute S203, and the receiving unit 82 can be used to execute S209.
[0287] 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 used 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.
[0288] 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.
[0289] 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, in response to a correction instruction, determine the to-be-sent messages scheduled out of the first sending queue as reference messages.
[0290] Optionally, the value of the first counter is used to characterize 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.
[0291] Optionally, the processing unit 83 is specifically used to: before sending a 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.
[0292] As an example, combining Figure 4b , the processing unit 83 can be used to execute S201.
[0293] 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.
[0294] Optionally, the sending unit 81 is further used 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 used 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 receiving cache, the bit width of the second node receiving cache, the receiving queue supporting CFC in the second node, or the offset. Here, the offset is used to determine the message length required when calculating the message credit value.
[0295] For the specific description of the above optional manner, please refer to the above method embodiment, which will not be repeated here. In addition, the explanation of any of the above data transmission devices 80 and the description of the beneficial effects can refer to the above corresponding method embodiment, which will not be repeated here.
[0296] As an example, combining Figure 3 The sending unit 81 and the receiving unit 82 in the data transmission device 80 can be Figure 3 The processing unit 83 can be implemented by the communication interface 32 shown. Figure 3 The control circuit 31 and the flow control module 34 are implemented together. The output unit 84 can be realized by Figure 3 The output interface of the device where the chip 30 is located is implemented. Here, the output interface includes but is not limited to a display screen, a speaker, an indicator light, etc.
[0297] like Fig. 9 As shown, Fig. 9The structure diagram of a data transmission device 90 provided in an embodiment of the present application is shown. The data transmission device 90 is applied to the second node including the first receiving queue, and the first receiving queue is used to receive the message from the first sending queue of the first node. The data transmission device 90 is used to execute the above-mentioned data transmission method, for example, to execute Figure 4a , Figure 4b or Figure 6 The data transmission device 90 may include a receiving unit 91 and a sending unit 92.
[0298] The receiving unit 91 is configured to receive a first message from a first sending queue. The sending unit 92 is 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. The reference message is used to indicate the correction of the first counter.
[0299] As an example, combining Figure 4a , the receiving unit 91 can be used to execute S102, and the sending unit 92 can be used to execute S103. Figure 4b , the receiving unit 91 can be used to execute S204, and the sending unit 92 can be used to execute S207 and S208.
[0300] Optionally, 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 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 mark, and the CFC type mark 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 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.
[0301] 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.
[0302] Optionally, the receiving unit 91 is further used 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 93 is further used 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, and the CFC capability information includes one or more of the size of the second node receiving cache, the bit width of the second node receiving cache, the receiving queue supporting CFC in the second node, or the offset. Here, the offset is used to determine the message length required for calculating the message credit value.
[0303] 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 of any of the above data transmission devices 90 and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0304] As an example, combining Figure 3 The receiving unit 91 and the sending unit 93 in the data transmission device 90 can be Figure 3 The communication interface 32 is shown implemented.
[0305] Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example 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 executed 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.
[0306] It should be noted that Figure 8 and Fig. 9 The division of modules in the example is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or software function modules.
[0307] The embodiment of the present application also provides a first node. The first node sends a message to the second node through one or more sending queues, and the first node is configured with the first counter described 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. The first node executes the method provided in the embodiment of the present application (such as Figure 4a , Figure 4b or Figure 6The part of the method executed by the first node) is used to achieve correction of the first counter used for credit flow control.
[0308] The embodiment of the present application also provides a second node. The second node includes a first receiving queue for receiving messages from a first sending queue of the first node, and the second node is configured with the third counter and the fourth counter, and the value of the third counter is used to represent the length of the message from the first sending queue cached in the receiving cache of the second node. The second node executes the method provided by the embodiment of the present application (such as Figure 4a , Figure 4b or Figure 6 The part of the method executed by the second node) is used to correct the first counter, where the first counter is used to perform credit flow control on the messages in the first sending queue.
[0309] An embodiment of the present application also provides a data transmission system, which includes a first node and a second node, and 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.
[0310] The present application also provides 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, which, when executed by one or more processors, can provide the above Figure 4a , Figure 4b or Figure 6 Thus, for example, reference to Figure 4a One or more features of S101 to S104 may be undertaken by one or more instructions in the computer program product.
[0311] In some examples, such as for executing Figure 4a , Figure 4b or Figure 6 The data transmission determination apparatus of the described method 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.
[0312] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When executing instructions on a computer and executing a computer, a process or function according to an embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0313] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope 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; 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, 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; the reference message is used to indicate 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.
