Data retransmission apparatus and data retransmission method
Patent Information
- Application Number
- CN202510504868.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2026-10-23
AI Technical Summary
然而,现有数据重传方法的性能普遍不高
[0017]如上所述,于本申请实施例中,重传控制器可以根据传输通路中的错误的数据包的数量,确定对应于写操作的重传请求的重传模式以及生成对应的重传PSN信息。基于上述确定的重传模式和生成的重传PSN信息进行数据重传,能够避免采用固定重传模式进行数据重传而导致的性能下降。
Smart Images

Figure CN122969735A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology and relates to a retransmission device, particularly a data retransmission device and a data retransmission method. Background Technology
[0002] RDMA (Remote Direct Memory Access) technology allows devices to directly access the memory of remote devices over a network without intervention from the operating system kernel. RDMA offers advantages such as low latency, high throughput, and low CPU (Central Processing Unit) usage, and is widely used in HPC (High Performance Computing), distributed storage, cloud computing, and big data processing. However, in RDMA technology, due to network instability, transmission errors, or packet loss, data packets often fail to reach the receiving end correctly. In such cases, retransmission of lost or erroneous data packets is necessary. However, existing data retransmission methods generally have low performance. Summary of the Invention
[0003] This application provides a data retransmission device and a data retransmission method for retransmitting data packets.
[0004] In a first aspect, embodiments of this application provide a data retransmission device. The data retransmission device includes a shared buffer, at least one retransmission controller, and at least one WQE processing unit. The at least one retransmission controller corresponds one-to-one with the at least one WQE processing unit, wherein: the shared buffer stores WQEs for multiple QPs; the retransmission controller determines the retransmission mode corresponding to a retransmission request for a write operation and generates corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path, and sends the retransmission PSN information and the WQE corresponding to the retransmission request obtained from the shared buffer to the corresponding WQE processing unit; the WQE processing unit assembles the WQE corresponding to the retransmission request into one or more data packets, and sends the data packets matching the retransmission PSN information from the one or more data packets to the receiving end of the QP corresponding to the retransmission request.
[0005] In some implementations, determining the retransmission mode corresponding to a write operation retransmission request and generating corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path includes: when the number of erroneous data packets does not reach an error threshold, determining the retransmission mode corresponding to the write operation retransmission request as selective retransmission, and generating the retransmission PSN information based on the PSN corresponding to each erroneous data packet; when the number of erroneous data packets reaches the error threshold, determining the retransmission mode corresponding to the write operation retransmission request as Go_Back_N retransmission, determining the retransmission starting point by comparing the PSN of each data packet associated with the WQE corresponding to the retransmission request with the PSN of the first data packet in the erroneous data packets that needs to be retransmitted, and generating the retransmission PSN information based on the determined retransmission starting point.
[0006] In some implementations, comparing the PSN of each data packet associated with the WQE corresponding to the retransmission request with the PSN of the first data packet that needs to be retransmitted among the erroneous data packets to determine the retransmission starting point, and generating the retransmission PSN information based on the determined retransmission starting point includes: sequentially comparing the PSN of each data packet associated with the WQE corresponding to the retransmission request with the PSN of the first data packet that needs to be retransmitted in ascending order, until a data packet with the same PSN as the first data packet that needs to be retransmitted is found, and using the found data packet as the retransmission starting point, and generating the retransmission PSN information based on the found data packet and the PSNs of all subsequent data packets.
[0007] In some implementations, when the retransmission controller receives the retransmission request, it compares the PSN corresponding to the retransmission request with the PSN corresponding to the latest received ACK to determine whether the retransmission request needs to be executed.
[0008] In some implementations, if the PSN corresponding to the retransmission request is less than the PSN corresponding to the latest received ACK, then the retransmission request is not executed.
[0009] In some embodiments, the data retransmission device further includes a completion queue control unit. The retransmission controller is also configured to receive an ACK and a CQ request from the completion queue control unit. In response to the ACK and the CQ request, the retransmission controller removes the WQE corresponding to the ACK from the shared buffer and generates a CQE, and sends the CQE to the completion queue control unit.
[0010] In some implementations, the completion queue control unit is used to receive the CQE, rearrange the received CQE according to the PSN corresponding to the received CQE, and output the CQE in the rearranged order.
[0011] In some implementations, the retransmission controller is further configured to, upon receiving the retransmission request, determine whether the number of retransmissions of the QP corresponding to the retransmission request has exceeded the maximum number of retransmissions; if the number of retransmissions exceeds the maximum number of retransmissions, then report an error interruption.
[0012] In some implementations, the retransmission controller includes a monitor for monitoring the data transmission volume corresponding to the retransmission request of the QP being processed by the WQE processing unit and the time occupied by the WQE processing unit; when the monitor detects that the data transmission volume corresponding to the retransmission request of the QP being processed or the time occupied by the WQE processing unit reaches the switching condition, the retransmission controller switches the WQE processing unit to process the retransmission requests of other pending QPs.
[0013] In some implementations, the data retransmission device manages the WQE of multiple QPs in a linked list manner in the shared buffer.
[0014] In some implementations, for any given QP, when processing a retransmission request for that QP, the data retransmission device will not process the feedback information returned by the receiver of that QP regarding the previously sent data packets, until the corresponding retransmission request is completed.
[0015] In some implementations, for any QP, when the data retransmission device is processing a retransmission request for that QP, if it receives a new retransmission request from the receiver of that QP, it stops processing the current retransmission request and processes the new retransmission request.
[0016] Secondly, embodiments of this application provide a data retransmission method. The data retransmission method is applied to a data retransmission device, which includes a shared buffer, at least one retransmission controller, and at least one WQE processing unit. The at least one retransmission controller corresponds one-to-one with the at least one WQE processing unit. The shared buffer stores the WQEs of multiple QPs. The data retransmission method includes: determining, based on the number of erroneous data packets in the transmission path, a retransmission mode corresponding to a write operation's retransmission request and generating corresponding retransmission PSN information using the retransmission controller; sending the retransmission PSN information and the WQEs corresponding to the retransmission request obtained from the shared buffer to the corresponding WQE processing unit; assembling the WQEs corresponding to the retransmission request into one or more data packets using the WQE processing unit; and sending the data packets matching the retransmission PSN information from the one or more data packets to the receiving end of the QP corresponding to the retransmission request.
[0017] As described above, in this embodiment of the application, the retransmission controller can determine the retransmission mode corresponding to the retransmission request for the write operation and generate the corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path. Data retransmission based on the determined retransmission mode and the generated retransmission PSN information can avoid the performance degradation caused by using a fixed retransmission mode.
[0018] In this embodiment of the application, the retransmission mode corresponding to the retransmission request for the write operation can be determined as selective retransmission or Go_Back_N retransmission based on the number of erroneous data packets in the transmission path. Selective retransmission and Go_Back_N retransmission can be independent of each other and will not affect performance.
[0019] In this embodiment of the application, when processing out-of-order data generated by selective retransmission, only the final CQE (Completion Queue Entry) can be rearranged, thereby improving data transmission efficiency. Attached Figure Description
[0020] Figure 1 The diagram shown is a structural schematic of the data retransmission device provided in an embodiment of this application.
[0021] Figure 2 The flowchart shown is a data retransmission method provided in an embodiment of this application.
[0022] Figure 3 The flowchart shown is a process by which the retransmission execution unit in this embodiment of the application processes the retransmission request of QP in a time-division multiplexing manner.
[0023] Figure 4 The diagram shows a state machine for finding the PSN and initiating a retransmission in an embodiment of this application. Detailed Implementation
[0024] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0025] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the illustrations only show the components related to this application and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0026] This application provides a data retransmission device and a data retransmission method. The data retransmission device of this application may include a shared buffer, a retransmission controller, and a WQE (Work Queue Element) processing unit. The retransmission controller, upon receiving a retransmission request corresponding to a write operation, determines the retransmission mode (e.g., selective retransmission or Go-Back-N retransmission) and generates the corresponding PSN (Packet Sequence Number) information based on the number of erroneous data packets in the transmission path. It then retrieves the WQE corresponding to the retransmission request (i.e., the WQE requiring retransmission) from the shared buffer and sends the WQE and the retransmission PSN information to the corresponding WQE processing unit. The WQE processing unit assembles the WQE into one or more data packets and sends the data packets matching the retransmission PSN information from the one or more data packets to the receiver of the QP (Queue Pair) corresponding to the retransmission request.
[0027] The technical solutions provided by the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0028] Figure 1 The diagram shown is a structural schematic of the data retransmission device in an embodiment of this application. Figure 1 As shown, the data retransmission device is connected to an external memory, such as HBM (High Bandwidth Memory), but this application is not limited to this. The data retransmission device includes a configuration unit, a WQE fetch unit, a shared buffer, a retransmission controller, a WQE processor, a completion queue control unit, and an ACK psn unit.
[0029] The configuration unit receives configuration parameters and configures the registers of the data retransmission device according to these parameters. These configuration parameters may include, for example, the number of concurrently operating QPs and information about each QP. The QP information may include the QP's ID, the storage location and length of the corresponding WQE in external memory, the number of retransmissions supported by the QP, and the maximum retransmission time. In some implementations, after configuration, the configuration unit may send a configuration update notification to other modules (such as the WQE handling unit).
[0030] The WQE transport unit generates a transport request corresponding to each QP based on the configuration parameters, and sends the transport request of each QP sequentially to the DMA (Direct Memory Access) module so that the WQE can be transported from external memory to the shared cache through the DMA module.
[0031] It is understood that each WQE transfer unit can only process one transfer request for a QP at a time. Only after that transfer request is completed can it process another QP transfer request. Therefore, when the number of QPs is large, to improve WQE transfer efficiency, multiple independent WQE transfer units can be set up in the data retransmission device to process multiple QP transfer requests in parallel. These multiple WQE transfer units can be connected to the DMA module through a first arbitrator. Figure 1 This illustration uses two WQE transport units as an example. These two WQE transport units are connected through a first arbitrator (such as...). Figure 1 The arbitrator 2r1 in the first module is connected to the DMA module. When two WQE transfer units send transfer requests simultaneously, the first arbitrator arbitrates to determine the transfer request of the WQE transfer unit that outputs to the DMA module. In some implementations, the WQE transfer unit may send status update information to the configuration unit after completing each transfer request. The configuration unit may update registers or trigger subsequent operations of other modules based on the status update information.
[0032] The shared cache is a WQE temporary storage area shared by multiple QPs. For example, the shared cache can be implemented using SRAM (Static Random Access Memory), but this application is not limited to this.
[0033] In some implementations, when the WQE transport unit moves the WQE data from each QP to the shared cache via the DMA module, the shared cache can notify the WQE transport unit of its available storage space in real time to prevent the WQE transport unit from transporting too much data and causing storage overflow in the shared cache. In some implementations, the shared cache can send storage space usage information to the WQE transport unit through the cache status unit (Sram_sts). The cache status unit can dynamically monitor the available storage space of the shared cache and provide this information to the WQE transport unit, enabling it to effectively plan transport tasks based on the current available storage space and avoid data loss due to storage overflow.
[0034] The WQE processing unit is used to parse and assemble WQE packets. Specifically, the WQE processing unit has two operating states: normal operation and retransmission. In normal operation, for any QP, the WQE processing unit can retrieve the WQE of that QP from the shared buffer, parse the retrieved WQE, and then assemble the retrieved WQE into one or more data packets based on the parsing result, and send the assembled data packets to the receiving end of that QP. Parsing the WQE yields information such as the operation type (e.g., read / write), destination address, data length, and PSN. When assembling WQEs into data packets, each data packet has a PSN, and the PSNs of these data packets are sequentially incremented starting from the parsed initial PSN. For example, if the initial PSN of a WQE is 100, and the WQE is assembled into a single data packet, then the PSN of that data packet is 100. If the WQE is assembled into three data packets, and these three data packets are in the order of data packet 1, data packet 2, and data packet 3, then data packet 1 has a PSN of 100, data packet 2 has a PSN of 101, and data packet 3 has a PSN of 102.
[0035] The WQE processing unit enters the retransmission state upon receiving a retransmission command (Retry_in_process) from the retransmission controller. In the retransmission state, the WQE processing unit receives the retransmission PSN (Retry_psn) information and the WQE information to be retransmitted (Retry_WQE_info) from the retransmission controller. It assembles the WQEs to be retransmitted into one or more data packets and sends the data packets matching the retransmission PSN information to the receiving end of the corresponding QP. As mentioned above, each data packet has a PSN. The WQE processing unit can filter out data packets matching the retransmission PSN information from the one or more data packets and send these matching data packets to the receiving end of the corresponding QP.
[0036] Similarly, each WQE processing unit can only process one QP's WQE transmit (or retransmission) request at a time. When the number of QPs is large, to improve processing efficiency, multiple retransmission controllers and multiple WQE processing units can be configured in the data retransmission device. These multiple retransmission controllers and multiple WQE processing units can correspond one-to-one, and each WQE processing unit can be connected to its corresponding retransmission controller. In this way, the data retransmission device can simultaneously receive and process multiple QPs' WQE transmit or retransmission requests. These multiple retransmission controllers can be connected to a shared buffer via a second arbitrator. Figure 1 Taking a case with 32 retransmission controllers as an example, these 32 retransmission controllers can be transmitted via a second arbitrator (such as...). Figure 1 The arbitrator 32r1 in the middle is connected to the shared cache.
[0037] The retransmission controller receives ACKs (Acknowledgements, also referred to as confirmation messages in this application) and / or retransmission requests for the WQE corresponding to each QP. Upon receiving an ACK and a CQ (Completion Queue) request from the Completion Queue Control Unit, the retransmission controller may remove (POP) the WQE corresponding to the ACK from the shared buffer, generate a Completion Queue Entry (CQE), and return the CQE to the Completion Queue Control Unit.
[0038] Upon receiving a retransmission request, the retransmission controller can determine the corresponding retransmission mode based on the operation type of the WQE corresponding to the retransmission request. In this application, the data retransmission device can include multiple retransmission modes, such as selective retransmission and Go_Back_N retransmission. For read operations, Go_Back_N retransmission can be used. For write operations, the mode can be selected based on the number of erroneous data packets. For example, selective retransmission can be used when the number of erroneous data packets is small, and Go_Back_N retransmission can be used when the number of erroneous data packets is large. In some embodiments, for write operations, the retransmission controller can determine whether to switch from selective retransmission to Go_Back_N retransmission based on whether the number of erroneous data packets reaches an error threshold. For example, a NACK (Negative Acknowledgement) buffer can be set at the receiver of each QP. When the receiver of the corresponding QP detects multiple erroneous data packets, these multiple erroneous data packets can be temporarily stored in the NACK buffer. When the number of erroneous data packets stored in the NACK buffer reaches the error threshold (such as the depth value of the NACK buffer), the receiver of the corresponding QP can actively notify the data retransmission device. Alternatively, the receiver of the corresponding QP can add the status of the NACK buffer to the acknowledgment packet (hereinafter also referred to as the feedback packet), thereby triggering the retransmission controller to select the Go_Back_N retransmission scheme when it receives a retransmission request again.
[0039] After determining the retransmission mode, the retransmission controller generates retransmission PSN information based on the determined retransmission mode and erroneous data packets. It then retrieves the required WQE from the shared buffer based on the WQE information corresponding to the retransmission request and sends the required WQE and retransmission PSN information to the corresponding WQE processing unit. Erroneous data packets refer to packet loss, packet verification failure, packet timeout, etc. How to generate retransmission PSN information will be described later.
[0040] The response unit receives feedback packets from the receivers of each QP, parses the feedback packets, generates ACK and / or retransmission requests based on the parsing results, and sends them to the retransmission controller. Specifically, each feedback packet typically contains feedback information for all data packets of the corresponding WQE. The response unit parses the packets to obtain the response type of each data packet. Response types can include RX response and RX non-response. RX response indicates that the corresponding data packet has been successfully acknowledged, while RX non-response indicates that the corresponding data packet was not received, there was an acknowledgment error, or a timeout occurred. Data packets corresponding to such RX non-response are erroneous data packets. Furthermore, the response unit can locate the corresponding WQE based on the QP ID carried in the feedback packet and obtain the PSN of each data packet associated with that WQE. Then, the response unit can generate an ACK or retransmission request based on the response type of each data packet, and the ACK or retransmission request carries the PSN of the corresponding data packet. It can be understood that when the response type is RX response, it corresponds to ACK; when the response type is RX non-response, it corresponds to a retransmission request.
[0041] The completion queue control unit is used to obtain ACK from the response unit, generate CQ request based on ACK, and send CQ request to the retransmission controller. The completion queue control unit is also used to receive CQE corresponding to the CQ request returned by the retransmission controller, rearrange the received CQE according to the PSN corresponding to the received CQE, and output the CQE in the rearranged order.
[0042] Figure 2 The flowchart shown is a data retransmission method provided in an embodiment of this application. This data retransmission method can be applied to... Figure 1 The data retransmission device shown (hereinafter also referred to as the sender). For example... Figure 2 As shown, the data retransmission method includes:
[0043] S21, the retransmission controller determines the retransmission mode corresponding to the retransmission request for the write operation and generates the corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path, and sends the retransmission PSN information and the WQE corresponding to the retransmission request obtained from the shared buffer to the corresponding WQE processing unit.
[0044] S22, the WQE corresponding to the retransmission request is assembled into one or more data packets by the WQE processing unit, and the data packets that match the retransmission PSN information in the one or more data packets are sent to the receiving end of the QP corresponding to the retransmission request.
[0045] In some implementations, determining the retransmission mode corresponding to the retransmission request for a write operation and generating the corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path includes: when the number of erroneous data packets does not reach an error threshold, determining the retransmission mode corresponding to the retransmission request for the write operation as selective retransmission, and generating retransmission PSN information based on the PSN corresponding to each erroneous data packet; when the number of erroneous data packets reaches the error threshold, determining the retransmission mode corresponding to the retransmission request for the write operation as Go_Back_N retransmission, and determining the retransmission starting point by comparing the PSN of each data packet associated with the WQE (WQE corresponding to the retransmission request) that needs to be retransmitted with the PSN of the first data packet that needs to be retransmitted among the erroneous data packets, and generating retransmission PSN information based on the determined retransmission starting point.
[0046] In some implementations, comparing the PSN of each data packet associated with the WQE requiring retransmission with the PSN of the first data packet requiring retransmission to determine the retransmission starting point, and generating retransmission PSN information based on the determined retransmission starting point, includes: sequentially comparing the PSN of each data packet associated with the WQE requiring retransmission with the PSN of the first data packet requiring retransmission in ascending order, until a data packet with the same PSN as the first data packet requiring retransmission is found. This found data packet is used as the retransmission starting point, and retransmission PSN information is generated based on the PSN of this data packet and all subsequent data packets. Therefore, this application embodiment provides a retransmission skipping mechanism for Go_Back_N retransmissions, enabling the rapid skipping of data packets with PSNs smaller than the PSN of the first data packet requiring retransmission during retransmission, which helps reduce retransmission latency.
[0047] In some implementations, the data retransmission method provided in this application may further include: upon receiving a retransmission request, comparing the PSN corresponding to the retransmission request with the PSN corresponding to the latest received ACK through a retransmission controller to determine whether the retransmission request needs to be executed, i.e., whether retransmission is required. If the PSN corresponding to the retransmission request is less than the PSN corresponding to the latest received ACK, it is determined that the retransmission request will not be executed; if the PSN corresponding to the retransmission request is greater than the PSN corresponding to the latest received ACK, it is determined that the retransmission request will be executed.
[0048] When the PSN corresponding to the retransmission request is less than the PSN corresponding to the latest received ACK, the system can enter an error handling state (e.g., trigger exception handling); when the PSN corresponding to the retransmission request is greater than the PSN corresponding to the latest received ACK, the system can enter a waiting RNR (Responder Not Ready) state.
[0049] In the RNR waiting state, the retransmission controller needs to wait for the receiver of the corresponding QP to be ready before instructing the WQE processing unit to enter the retransmission state. In some implementations, an RNR register can be configured for each QP to record the preparation time of the receiver of the corresponding QP. The retransmission controller can determine whether the receiver of the corresponding QP is ready based on the value of the RNR register. This can avoid the receiver data overload problem caused by the receiver of the corresponding QP not being ready to receive data.
[0050] In some implementations, the data retransmission method provided in this application may further include: receiving ACK and CQ requests through a retransmission controller, removing the WQE corresponding to the ACK from the shared buffer and generating a CQE, and sending the CQE to the completion queue control unit.
[0051] In some implementations, when the retransmission mode is selective retransmission and the CQE is sent to the completion queue control unit, the data retransmission method provided in this application embodiment may further include: the completion queue control unit rearranging the received CQE according to the PSN corresponding to the received CQE, and outputting the CQE in the rearranged order.
[0052] Specifically, under selective retransmission, since the response to retransmitted data packets may be later than that of non-retransmitted data packets, the sending end needs to sort the CQEs according to the PSN. If the PSN corresponding to a received CQE is greater than the PSN of the first WQE in the shared buffer, the CQE is temporarily stored in the buffer of the completion queue control unit until the PSN corresponding to the received CQE matches the PSN of the first WQE in the shared buffer, and the matched CQEs are output in sequence. The output CQEs can be written to external memory through a DMA module. In other words, the embodiments of this application support out-of-order reception of out-of-order data packets generated by selective retransmission, which is beneficial to improving the efficiency of data transmission.
[0053] In some implementations, the data retransmission method provided in this application may further include using independent PSNs for read and write operations. When the retransmission mode of the retransmission request for a write operation is determined to be selective retransmission, since read and write operations use independent PSNs, the Go_Back_N retransmission of the read operation will not block the selective retransmission of the write operation.
[0054] In some implementations, the packet header may indicate the retransmission count for the corresponding QP. The data retransmission method provided in this application may further include: upon receiving a retransmission request, determining, through a retransmission controller, whether the retransmission count for the QP corresponding to the retransmission request has exceeded the maximum number of retransmissions supported by the data retransmission device (also known as the maximum retransmission count); if the retransmission count has exceeded the maximum number of retransmissions supported by the data retransmission device, then reporting an error interruption. This approach avoids the problem of excessive retransmissions caused by invalid data packets triggering retransmissions multiple times.
[0055] In some implementations, the transmitting end may include multiple retransmission controllers, each corresponding to a WQE processing unit. This allows the transmitting end to process multiple QP retransmission requests in parallel.
[0056] For example, when the number of QPs is greater than the number of retransmission controllers, time-division multiplexing can be used to utilize the retransmission controllers to handle the retransmission requests of QPs.
[0057] In some implementations, the retransmission controller may include a monitor. See also Figure 3 The data retransmission method provided in this application embodiment may further include:
[0058] S31, the monitor in the retransmission controller monitors the amount of data transmitted and the time occupied by the WQE processing unit for the retransmission request of the QP being processed.
[0059] S32, when it is detected that the data transmission volume corresponding to the retransmission request of the QP being processed or the time occupied by the WQE processing unit reaches the switching condition, the WQE processing unit is switched to process the retransmission requests of other pending QPs through the retransmission controller.
[0060] In some implementations, a shared cache is used to store the WQE (Wide Quality Envelope) of multiple concurrently operating QPs. The data retransmission device manages the data of multiple QPs in the shared cache using a linked list, thereby dynamically allocating cache space to adapt to the storage needs of different QPs. Specifically, since the retransmission process requires monitoring and querying the data transmission status in the current link, it introduces significant hardware overhead for systems processing multiple QPs in parallel. To address this issue, this application embodiment manages the data of multiple QPs using a linked list, with multiple QPs sharing the same cache. For example, each QP can be a FIFO (First In First Out) data structure, and different QPs are completely independent. This means that the data of different QPs can be stored in physically discontinuous areas and can be accessed out of order; operations on the data of any QP (such as retransmission, reading, or writing) will not affect the management of other QPs.
[0061] In some implementations, the data retransmission method provided in this application may further include: for any QP, when the data retransmission device processes the retransmission request of the QP, it no longer processes the feedback information on the previously sent data packets returned by the receiver of the QP, until the corresponding retransmission request is completed.
[0062] In some implementations, when the retransmission mode corresponding to the write operation retransmission request is Go_Back_N retransmission, the data retransmission method provided in this application embodiment may further include: for any QP, when the data retransmission device is processing the retransmission request of the QP, if a new retransmission request is received from the receiver of the QP, the currently processed retransmission request is stopped and the new retransmission request is processed to reduce invalid retransmissions.
[0063] Figure 4 This diagram illustrates the state machine for finding the PSN and initiating a retransmission in an embodiment of this application. The states in this state machine are described below:
[0064] When in the Idle state, if an ACK is received along with a CQ request, the system jumps to the state of reading the WQE header information; if a retransmission request is detected, the system jumps to the PSN check state.
[0065] When in the state of reading WQE header information, read the WQE header information, record the current packet length, and switch to the state of removing WQE.
[0066] When in the WQE removal state, the corresponding WQE in the shared buffer is read according to the recorded packet length. After reading is complete, the process switches to the CQ sending state.
[0067] When in the CQ sending state, the CQ information is written to the corresponding location via the DMA interface.
[0068] While in PSN check state, compare the PSN that needs to be retransmitted with the PSN corresponding to the latest received ACK. If the PSN that needs to be retransmitted is less than the PSN corresponding to the latest received ACK, or if the current QP retransmission count is greater than the maximum retransmission count, then enter error handling state; if the PSN that needs to be retransmitted is greater than the PSN corresponding to the latest received ACK, then enter wait for RNR state.
[0069] When in the waiting RNR state, after the receiver is ready and the WQE processing unit is ready, it enters the reading WQE state.
[0070] When in the read WQE state, read the WQE from the shared buffer and enter the send WQE state.
[0071] When in the WQE sending state, the read WQE is sent to the WQE processing unit, and the state of checking the last WQE is entered.
[0072] When in the state of checking the last WQE, after each WQE is sent, it is necessary to determine whether the retransmitted WQE is the last one. If it is, the retransmission ends; otherwise, continue reading WQE and retransmitting.
[0073] When in an error handling state, report exceptions via interrupt.
[0074] The protection scope of the data retransmission method provided in this application is not limited to the execution order of the steps listed in this application. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this application is included within the protection scope of this application.
[0075] As described above, in this embodiment, the retransmission controller can determine the retransmission mode corresponding to the write operation's retransmission request and generate corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path. Data retransmission based on the determined retransmission mode and generated retransmission PSN information avoids the performance degradation caused by using a fixed retransmission mode. In this embodiment, the retransmission mode corresponding to the write operation's retransmission request can be determined as selective retransmission or Go_Back_N retransmission based on the number of erroneous data packets in the transmission path. Selective retransmission and Go_Back_N retransmission can be independent of each other and will not affect performance. Furthermore, in this embodiment, when processing out-of-order data generated by selective retransmission, rearrangement can be performed only on the final CQE, thereby improving data transmission efficiency.
[0076] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A data retransmission device, characterized in that, The data retransmission device includes a shared buffer, at least one retransmission controller, and at least one WQE processing unit, wherein the at least one retransmission controller corresponds one-to-one with the at least one WQE processing unit, wherein: The shared cache is used to store the WQE of multiple QPs; The retransmission controller is used to determine the retransmission mode corresponding to the retransmission request for the write operation and generate the corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path, and send the retransmission PSN information and the WQE corresponding to the retransmission request obtained from the shared cache to the corresponding WQE processing unit. The WQE processing unit is used to assemble the WQE corresponding to the retransmission request into one or more data packets, and send the data packets that match the retransmission PSN information in the one or more data packets to the receiving end of the QP corresponding to the retransmission request.
2. The data retransmission device according to claim 1, characterized in that, Based on the number of erroneous data packets in the transmission path, determining the retransmission mode corresponding to the retransmission request for the write operation and generating the corresponding retransmission PSN information includes: When the number of erroneous data packets does not reach the error threshold, the retransmission mode corresponding to the retransmission request for the write operation is determined to be selective retransmission, and the retransmission PSN information is generated according to the PSN corresponding to each erroneous data packet. When the number of erroneous data packets reaches the error threshold, the retransmission mode corresponding to the retransmission request for the write operation is determined to be Go_Back_N retransmission. The retransmission starting point is determined by comparing the PSN of each data packet associated with the WQE corresponding to the retransmission request with the PSN of the first data packet that needs to be retransmitted in the erroneous data packets. The retransmission PSN information is generated based on the determined retransmission starting point.
3. The data retransmission device according to claim 2, characterized in that, The retransmission starting point is determined by comparing the PSN of each data packet associated with the WQE corresponding to the retransmission request with the PSN of the first data packet that needs to be retransmitted among the erroneous data packets, and the retransmission PSN information is generated based on the determined retransmission starting point, including: According to the PSN of each data packet associated with the WQE corresponding to the retransmission request in ascending order, the PSN of each data packet is compared with the PSN of the first data packet that needs to be retransmitted, until a data packet with the same PSN as the first data packet that needs to be retransmitted is found, and the found data packet is used as the starting point of the retransmission. The retransmission PSN information is generated based on the PSN of the found data packet and all subsequent data packets.
4. The data retransmission device according to claim 1, characterized in that, When the retransmission controller receives the retransmission request, it compares the PSN corresponding to the retransmission request with the PSN corresponding to the latest received ACK to determine whether the retransmission request needs to be executed.
5. The data retransmission device according to claim 4, characterized in that, If the PSN corresponding to the retransmission request is less than the PSN corresponding to the latest received ACK, then the retransmission request will not be executed.
6. The data retransmission device according to claim 1, characterized in that, The data retransmission device further includes a completion queue control unit. The retransmission controller is also configured to receive an ACK and a CQ request from the completion queue control unit. In response to the ACK and the CQ request, the retransmission controller removes the WQE corresponding to the ACK from the shared buffer and generates a CQE, and sends the CQE to the completion queue control unit.
7. The data retransmission device according to claim 6, characterized in that, The completion queue control unit is used to receive the CQE, rearrange the received CQE according to the PSN corresponding to the received CQE, and output the CQE in the rearranged order.
8. The data retransmission device according to claim 1, characterized in that, The retransmission controller is further configured to, upon receiving the retransmission request, determine whether the number of retransmissions of the QP corresponding to the retransmission request has exceeded the maximum number of retransmissions; if the number of retransmissions exceeds the maximum number of retransmissions, then report an error interruption.
9. The data retransmission device according to claim 1, characterized in that, The retransmission controller includes a monitor, which is used to monitor the amount of data transmitted corresponding to the retransmission request of the QP being processed by the WQE processing unit and the time occupied by the WQE processing unit. When the monitor detects that the data transmission volume corresponding to the retransmission request of the QP being processed or the time occupied by the WQE processing unit reaches the switching condition, the retransmission controller switches the WQE processing unit to process the retransmission requests of other pending QPs.
10. The data retransmission device according to claim 1, characterized in that, The data retransmission device manages the WQE of multiple QPs in the shared buffer using a linked list.
11. The data retransmission device according to claim 1, characterized in that, For any given QP, when processing a retransmission request for that QP, the data retransmission device will no longer process the feedback information returned by the receiver of that QP regarding the previously sent data packets, until the corresponding retransmission request is completed.
12. The data retransmission device according to claim 1, characterized in that, For any QP, when the data retransmission device is processing a retransmission request for that QP, if it receives a new retransmission request from the receiver of that QP, it stops processing the current retransmission request and processes the new retransmission request.
13. A data retransmission method, characterized in that, The data retransmission method is applied to a data retransmission device, which includes a shared buffer, at least one retransmission controller, and at least one WQE processing unit. The at least one retransmission controller corresponds one-to-one with the at least one WQE processing unit. The shared buffer stores the WQE of multiple QPs. The retransmission controller determines the retransmission mode corresponding to the retransmission request for the write operation and generates the corresponding retransmission PSN information based on the number of erroneous data packets in the transmission path. The retransmission PSN information and the WQE corresponding to the retransmission request obtained from the shared buffer are then sent to the corresponding WQE processing unit. The WQE processing unit assembles the WQE corresponding to the retransmission request into one or more data packets, and sends the data packets that match the retransmission PSN information in the one or more data packets to the receiving end of the QP corresponding to the retransmission request.