A data transmission method, device, equipment, medium and product
By using random access memory on the RDMA network card to process work queue events, the problem of the limited number of queue pairs in the traditional RDMA network card is solved and higher data transmission efficiency and scalability are achieved.
Patent Information
- Application Number
- CN202410895828.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-05
AI Technical Summary
Traditional RDMA network cards have limited internal register resources and a limited number of hardware queue pairs, resulting in reduced data transmission performance when a large number of nodes need to be connected simultaneously.
By using random access memory on the RDMA network card to process work queue events, the update of data sending table entries, data operation table entries, and data receiving table entries is added to realize the sharing of queue numbers, avoid waste of storage resources, and improve data sending efficiency.
While maintaining the transmission efficiency of the RDMA network card, it supports more hardware queue pairs, meets the data interaction needs of more nodes, and greatly improves the connection scalability and data sending efficiency of the RDMA network card.
Smart Images

Figure CN118427151B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote direct data access, and in particular to a data transmission method, device, equipment, medium and product. Background Art
[0002] With the rapid development of technologies such as cloud computing and artificial intelligence big models, the scale of data center networks continues to expand, and the demand for simultaneous data transmission between computing nodes and other multiple computing nodes continues to increase. The mainstream data transmission protocol in data centers is Remote Direct Memory Access (RDMA). Traditional RDMA network cards use internal registers to implement packet serial number (PSN) counters. Due to limited internal register resources, the number of hardware queue pairs (QP) that RDMA network cards can support is limited, and they only support data transmission with hundreds of nodes at the same time.
[0003] When the number of nodes that need to be connected simultaneously exceeds the number of QPs of the RDMA network card, the host memory can be used to cache the unfinished work queue event data. Since the RDMA network card and the host memory need to exchange data through the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI-E), the delay is large, which seriously reduces the RDMA data transmission performance.
[0004] It can be seen that how to increase the number of RDMA network card hardware QPs without affecting the RDMA data transmission performance is a problem that those skilled in the art need to solve. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a data transmission method, apparatus, device, medium and product, which can solve the problem of severe degradation of RDMA data transmission performance.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a data transmission method, including:
[0007] When the queue pair number and the work queue event data are obtained, reading the data sending table entry of the first random access memory according to the queue pair number;
[0008] Get the new address of the current work queue event in the second random access memory from the free pointer storage queue;
[0009] In the case where the data sending table entry is invalid, the data sending table entry, the data operation table entry of the second random memory and the data receiving table entry of the third random memory are updated according to the data length of the work queue event data and the new address, and the work queue event data is written into the data operation table entry; the queue pair number is written into the scheduling information storage queue;
[0010] When the data sending table entry is valid, the data sending table entry and the data receiving table entry of the third random memory are updated according to the data length of the work queue event data and the new address; a new data operation table entry is established on the second random memory according to the new address, and the work queue event data is written into the new data operation table entry.
[0011] On the one hand, according to the data length of the work queue event data and the new address, updating the data sending table entry, the data operation table entry of the second random access memory and the data receiving table entry of the third random access memory includes:
[0012] According to the data length of the work queue event data, the maximum transmission length of the path and the new address, the data sending table entry is updated;
[0013] updating the data operation table entry according to the new address;
[0014] The data receiving table entry is updated according to the last data packet sequence number and the new address contained in the updated data sending table entry.
[0015] On the one hand, according to the data length of the work queue event data, the maximum transmission length of the path and the new address, updating the data sending table entry includes:
[0016] Determining the number of data packets based on the data length of the work queue event data and the maximum transmission length of the path;
[0017] Update the total data packet sequence number and the last data packet sequence number in the data transmission table entry according to the number of data packets;
[0018] The current data packet sequence number in the data transmission table entry is set to zero, the transmission flag bit is adjusted to a valid flag bit, and the operation index in the data transmission table entry is updated to the new address.
[0019] On the one hand, updating the total data packet sequence number and the last data packet sequence number in the data transmission table entry according to the number of data packets includes:
[0020] In the case where the current data packet sequence number starts from zero, the number of data packets is reduced by one and used as the total data packet sequence number and the last data packet sequence number in the data transmission table entry respectively.
[0021] On the one hand, updating the data operation table entry according to the new address includes:
[0022] Access the data operation table entry based on the new address, adjust the operation flag in the data operation table entry to a valid flag, adjust the chain tail flag to a chain tail valid flag, set the start data packet sequence number to zero, and use the queue pair number as the queue pair number of the data operation table entry;
[0023] Writing the work queue event data into the data operation table item includes:
[0024] The work queue event data is written into the work queue event of the data operation table item.
[0025] On the one hand, updating the data receiving table entry according to the last data packet sequence number and the new address contained in the updated data sending table entry includes:
[0026] The data receiving table entry is accessed according to the queue pair number, the receiving flag in the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
[0027] On the one hand, according to the data length of the work queue event data and the new address, updating the data sending table entry and the data receiving table entry of the third random access memory includes:
[0028] Determine whether the current data packet sequence number is equal to the total data packet sequence number;
[0029] When the current data packet sequence number is equal to the total data packet sequence number, the data sending table entry is updated according to the data length of the work queue event data, the maximum transmission length of the path and the new address; the data receiving table entry is updated according to the receiving flag bit of the data receiving table entry, the last data packet sequence number contained in the updated data sending table entry and the new address;
[0030] When the current data packet sequence number is not equal to the total data packet sequence number, the data sending table entry is updated according to the data length of the work queue event data.
[0031] On the one hand, updating the data receiving table entry according to the receiving flag bit of the data receiving table entry, the last data packet sequence number contained in the updated data sending table entry, and the new address includes:
[0032] Determine whether the receiving flag bit of the data receiving table entry is a valid flag bit;
[0033] When the receiving flag of the data receiving table entry is a valid flag, writing the queue pair number into the scheduling information storage queue;
[0034] When the receiving flag of the data receiving table entry is not a valid flag, the receiving flag of the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
[0035] On the one hand, establishing a new data operation table entry on the second random access memory according to the new address includes:
[0036] When the current data packet sequence number is not equal to the total data packet sequence number, determining whether the original data operation table entry of the second random access memory belongs to the tail of the linked list;
[0037] When the original data operation table entry of the second random access memory does not belong to the tail of the linked list, accessing the second random access memory using the new address;
[0038] When the original data operation table entry of the second random access memory belongs to the tail of the linked list or the current data packet sequence number is equal to the total data packet sequence number, the new address is used as the next pointer of the data operation table entry, and the chain tail flag of the data operation table entry is adjusted to the chain tail invalid flag; a new data operation table entry is established on the second random access memory according to the new address, the new address is used as the address of the new data operation table entry, the operation flag of the new data operation table entry is adjusted to the valid flag, the chain tail flag of the new data operation table entry is adjusted to the chain tail valid flag, the total data packet sequence number is increased by one as the starting data packet sequence number of the new data operation table entry, and the queue pair number is used as the queue pair number of the new data operation table entry;
[0039] Writing the work queue event data into a new data operation table entry includes:
[0040] The work queue event data is written into the work queue event of the new data operation table item.
[0041] On the one hand, it also includes:
[0042] When the scheduling information storage queue is not empty, reading a queue pair number from the scheduling information storage queue, and reading the data transmission table item according to the queue pair number;
[0043] In the case where the sending flag bit of the data sending table entry is a valid flag bit, determining whether the current data packet sequence number of the data sending table entry is equal to the total data packet sequence number;
[0044] When the current data packet sequence number of the data transmission table entry is equal to the total data packet sequence number, outputting the queue pair number, the current data packet sequence number and the operation index to the transmission engine module;
[0045] In the case where the current data packet sequence number of the data transmission entry is not equal to the total data packet sequence number, determining a matching data processing mode according to the size relationship between the current data packet sequence number and the last data packet sequence number;
[0046] The queue pair number, the current data packet sequence number and the operation index are output to the sending engine module, and the data sending table entry is updated according to the data processing method.
[0047] On the one hand, according to the size relationship between the current data packet sequence number and the last data packet sequence number, the matching data processing method is determined to include:
[0048] Determine whether the current data packet sequence number is equal to the last data packet sequence number;
[0049] When the current data packet sequence number is equal to the last data packet sequence number, a data processing method of traversing the data packet sequence number is adopted;
[0050] When the current data packet sequence number is not equal to the last data packet sequence number, a data processing method of traversing the data operation table entries is adopted.
[0051] On the one hand, updating the data sending table item according to the data processing method includes:
[0052] Add one to the current data packet sequence number of the data transmission entry;
[0053] The queue pair number is rewritten into the scheduling information storage queue, and the process returns to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table entry according to the queue pair number.
[0054] On the one hand, updating the data sending table item according to the data processing method includes:
[0055] Reading a corresponding first data operation table entry according to the operation index;
[0056] When the chain tail flag bit of the first data operation table entry is the chain tail valid flag bit, the operation is terminated;
[0057] When the chain tail flag of the first data operation table entry is the chain tail invalid flag, reading the corresponding second data operation table entry according to the next pointer;
[0058] Increasing the current data packet sequence number of the data transmission entry by one;
[0059] Using the next pointer as the operation index of the second data operation table entry;
[0060] Update the last data packet sequence number according to the maximum transmission length of the path, the starting data packet sequence number recorded in the second data operation table item, and the data length of the work queue event data;
[0061] The queue pair number is rewritten into the scheduling information storage queue, and the process returns to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table entry according to the queue pair number.
[0062] On the one hand, updating the last data packet sequence number according to the maximum transmission length of the path, the starting data packet sequence number recorded in the second data operation table entry, and the data length of the work queue event data includes:
[0063] Determine the number of second data packets according to the maximum transmission length of the path and the data length of the work queue event data recorded in the second data operation table item;
[0064] Determine the latest last data packet sequence number based on the number of the second data packets and the starting data packet sequence number recorded in the second data operation table entry;
[0065] The last data packet sequence number in the data transmission table entry is updated to the latest last data packet sequence number.
[0066] On the one hand, it also includes:
[0067] When the sending flag of the data sending table entry is not a valid flag, the operation is terminated.
[0068] On the one hand, it also includes:
[0069] When a response data packet including a received data packet sequence number, a queue pair number and a response packet type is obtained, the data receiving table entry is read according to the queue pair number;
[0070] In a case where the receiving flag bit recorded in the data receiving table entry is a valid flag bit, reading the data operation table entry according to the operation index recorded in the data receiving table entry;
[0071] Determine a matching data transmission mode according to the size relationship between the received data packet sequence number and the last data packet sequence number and the response packet type;
[0072] According to the data transmission mode, the queue pair number and the work queue event data recorded in the data operation table item are output to the completion queue, and the update of the data operation table item and the data reception table item is completed.
[0073] On the one hand, according to the size relationship between the received data packet sequence number and the last data packet sequence number and the response packet type, determining the matching data transmission mode includes:
[0074] Determine whether the response packet type is a non-confirmation type;
[0075] In the case where the response packet type is a non-confirmation type, determining whether the received data packet sequence number is less than or equal to the last data packet sequence number;
[0076] When the received data packet sequence number is less than or equal to the last data packet sequence number, a retransmission data transmission mode is adopted;
[0077] In the case where the received data packet sequence number is greater than the last data packet sequence number, a combined confirmation data transmission mode is adopted;
[0078] When the response packet type is a confirmation type, determine whether the received data packet sequence number is less than the last data packet sequence number; when the received data packet sequence number is not less than the last data packet sequence number, adopt a direct transmission data transmission method.
[0079] On the one hand, according to the data transmission mode, outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue, and completing the update of the data operation table item and the data reception table item includes:
[0080] When the data transmission mode is retransmission, reading the data transmission table entry by using the queue pair number;
[0081] The received data packet sequence number is used as the current data packet sequence number of the data transmission table item; the last data packet sequence number recorded in the data reception table item is used as the last data packet sequence number of the data transmission table item, and the operation index recorded in the data reception table item is used as the operation index of the data transmission table item;
[0082] The queue pair number is written into the scheduling information storage queue, and the operation is terminated.
[0083] On the one hand, according to the data transmission mode, outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue, and completing the update of the data operation table item and the data reception table item includes:
[0084] When the data transmission mode is merge confirmation, the queue pair number and the work queue event data are output to the completion queue, and the data operation table entry where the work queue event data is located is released;
[0085] Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag;
[0086] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the operation is terminated;
[0087] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer;
[0088] Adjusting the receiving flag bit of the data receiving table entry to a valid flag bit;
[0089] Based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than or equal to the last data packet sequence number.
[0090] On the one hand, according to the data transmission mode, outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue, and completing the update of the data operation table item and the data reception table item includes:
[0091] When the data transmission mode is direct transmission, the queue pair number and the work queue event data are output to the completion queue, and the data operation table entry where the work queue event data is located is released;
[0092] Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag;
[0093] When the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag, adjusting the receiving flag of the data receiving table entry to an invalid flag;
[0094] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than the last data packet sequence number.
[0095] The embodiment of the present invention further provides a data transmission device, comprising a reading unit, an acquiring unit, a first updating unit, a first writing unit, a second writing unit, a second updating unit, a establishing unit and a third writing unit;
[0096] The reading unit is used to read the data sending table entry of the first random access memory according to the queue pair number when the queue pair number and the work queue event data are obtained;
[0097] The acquisition unit is used to acquire the new address of the current work queue event in the second random access memory from the idle pointer storage queue;
[0098] The first updating unit is used to update the data sending table entry, the data operation table entry of the second random access memory, and the data receiving table entry of the third random access memory according to the data length of the work queue event data and the new address when the data sending table entry is invalid;
[0099] The first writing unit is used to write the work queue event data into the data operation table entry;
[0100] The second writing unit is used to write the queue pair number into the scheduling information storage queue;
[0101] The second updating unit is used to update the data sending table entry and the data receiving table entry of the third random access memory according to the data length of the work queue event data and the new address when the data sending table entry is valid;
[0102] The establishing unit is used to establish a new data operation table entry on the second random access memory according to the new address;
[0103] The third writing unit is used to write the work queue event data into a new data operation table entry.
[0104] The embodiment of the present invention further provides a data transmission device, including:
[0105] Memory for storing computer programs;
[0106] A processor is used to execute the computer program to implement the steps of the above data transmission method.
[0107] An embodiment of the present invention further provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.
[0108] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above data transmission method when executed by a processor.
[0109] It can be seen from the above technical solution that, when the queue pair number and the work queue event data are obtained, the data sending table item of the first random memory is read according to the queue pair number; the new address of the current work queue event in the second random memory is obtained from the free pointer storage queue; when the data sending table item is invalid, according to the data length and new address of the work queue event data, the data sending table item, the data operation table item of the second random memory and the data receiving table item of the third random memory are updated, and the work queue event data is written into the data operation table item. The queue pair number is written into the scheduling information storage queue. When the data sending table item is valid, according to the data length and new address of the work queue event data, the data sending table item and the data receiving table item of the third random memory are updated; a new data operation table item is established on the second random memory according to the new address, and the work queue event data is written into the new data operation table item. The beneficial effect of the present invention is that the processing of work queue events is realized by using the random access memory on the RDMA network card. Compared with the register, the random access memory can store more information, so that under the premise of maintaining the transmission efficiency of the RDMA network card unchanged and using the same on-chip hardware resources, it can support more QP numbers, meet the needs of data interaction with more nodes at the same time, and greatly improve the connection scalability of the RDMA network card. And by setting the data operation table item on the second random access memory, the work queue events of all queue pairs can be shared, avoiding the waste of storage resources and improving the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0111] Figure 1A schematic diagram of the internal structure of an RDMA network card provided by the traditional method;
[0112] Figure 2 A flowchart of a data transmission method provided by an embodiment of the present invention;
[0113] Figure 3 A schematic diagram of the internal structure of an improved request module provided in an embodiment of the present invention;
[0114] Figure 4 A flowchart of a method for updating a table entry when a data transmission table entry is invalid provided by an embodiment of the present invention;
[0115] Figure 5 A flowchart of a method for establishing a new data operation table entry when a data transmission table entry is valid provided by an embodiment of the present invention;
[0116] Figure 6 A flowchart of a method for reading data provided by an embodiment of the present invention;
[0117] Figure 7 A flowchart of a method for processing a response data packet provided by an embodiment of the present invention;
[0118] Figure 8 A schematic diagram of a structure using FPGA as an RDMA network card provided by an embodiment of the present invention;
[0119] Fig. 9 A schematic diagram of the structure of a data transmission device provided by an embodiment of the present invention;
[0120] Fig.10 A structural diagram of a data transmission device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0121] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0122] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0123] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0124] In the traditional way, two nodes use a hardware QP resource of each RDMA network card for RDMA data transmission. Each hardware QP resource includes a packet serial number (PSN) counter, queue context management, and an unfinished work queue event (WQE) cache.
[0125] Figure 1 The schematic diagram of the internal structure of an RDMA network card provided by the traditional method. Based on the functions to be implemented, the RDMA network card includes a work queue event data acquisition (Wqe_fetch) module, a completion queue operation (Complete_write) module, a request (requester) module, a receive data processing (Rx_proc) module, a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI_E) module, and a media access control (Medium Access Control, MAC) module. Among them, the PCI_E module and the MAC module are hardware IP cores for processing related protocols. The Wqe_fetch module is responsible for managing the send queue and obtaining the send WQE from the send queue in the host memory. The WQE contains information such as the RDMA operation type, the work queue event identifier (WQE_ID), the address of the data to be sent in the memory, the data length, and the completion queue number. The Complete_write module is responsible for managing the completion queue and writing the completion information to the host memory. The Rx_proc module receives the response data packet returned by the responder and extracts information such as the QP number, PSN, and MSN. The requester module receives the send queue WQE and queue pair number (QP number) output by the upstream Wqe_fetch module, and directly accesses the send data from the host memory to the local through PCI_E according to WQE. It segments the send data according to the set path maximum transmission length (PMTU), and forms data that conforms to the RDMA protocol format and sends it to the MAC module. The requester module also receives information such as the QP number and PSN output by the Rx_proc module, determines which WQE has been sent or which WQE needs to be resent, and sends the completion information to the Complete_write module for the completed WQE. For the WQE that needs to be retransmitted, confirm the retransmission start PSN, and resegment the send data for retransmission.
[0126] Each QP often has an unfinished WQE cache. If the number of WQEs cached by each QP is small, the sending efficiency will be affected. If each QP caches a lot of WQEs, the RDMA network card needs to support a lot of QPs. When the number of nodes that need to be connected simultaneously exceeds the number of QPs supported by the RDMA network card, some RDMA network cards will use the host memory to implement the QP function. Since the network card and the host memory need to exchange data through PCI-E, the delay is large. In addition, the host memory has a low bandwidth for reading and writing data, which seriously reduces the performance of RDMA data transmission and cannot meet the requirements of high-performance distributed computing such as large artificial intelligence models.
[0127] Therefore, the embodiments of the present invention provide a data transmission method, apparatus, device, medium and product, which implement the processing of work queue events by using the random access memory on the RDMA network card. Since the random access memory can store more information, it can support more QPs while maintaining the transmission efficiency of the RDMA network card unchanged, thereby meeting the demand for data interaction with more nodes at the same time.
[0128] Next, a data transmission method provided by an embodiment of the present invention is introduced in detail. Figure 2 A flowchart of a data transmission method provided by an embodiment of the present invention, the method comprising:
[0129] S201: When the queue pair number and the work queue event data are obtained, a data sending table entry of the first random access memory is read according to the queue pair number.
[0130] In the embodiment of the present invention, the internal structure of the request module in the RDMA network card can be improved so that the RDMA network card can support more QP numbers. The internal structure of the improved request module is as follows: Figure 3 As shown, it includes a sending engine (tx_engine) module, an idle pointer storage queue (pt_fifo), a scheduling information storage queue (schedule_fifo), three random access memories (Random Access Memory, RAM), and each random access memory has its own corresponding read and write logic. The first random access memory of the request module is connected to the work queue event data acquisition module, and the third random access memory is connected to the receiving data processing module. The second random access memory is connected to the completion queue operation module. The sending engine module is respectively connected to the high-speed serial computer expansion bus standard interface and the media access control interface.
[0131] For the convenience of distinction, the three random memories can be respectively called data transmission random memory (tx_ram), data operation random memory (op_ram) and data reception random memory (rx_ram) according to the functions to be implemented by the three random memories. In order to facilitate the execution of the read and write logic of each random memory, a corresponding data table entry can be established for each random memory. For the convenience of distinction, the data table entry corresponding to the data transmission random memory can be called the data transmission table entry, the data table entry corresponding to the data operation random memory can be called the data operation table entry, and the data table entry corresponding to the data reception random memory can be called the data reception table entry.
[0132] The tx_engine module is responsible for calculating the location of the RDMA payload data in the host memory and obtaining the data according to the PSN and WQE of each data packet, and then composing the RDMA data packet output; the pt_fifo module stores the free pointer of op_ram; and the schedule_fifo stores the QP number of the data to be sent. The address of tx_ram is the QP number of the data to be sent, and the address of rx_ram is the QP number of the received data. When RDMA establishes a link, the QP number used to send the data will be allocated, and then the address of the corresponding QP number of tx_ram and rx_ram will be written to 0. The address of op_ram is the free pointer data in pt_fifo.
[0133] Table 1 below is a data structure table of data sending items.
[0134] Table 1
[0135]
[0136] The send flag bit (tx_act) in Table 1 is used to indicate whether the data send table entry is valid. In practical applications, the send flag bit 1 can be used to indicate that the data send table entry is valid, and the send flag bit 0 can be used to indicate that the data send table entry is invalid. For ease of description, total_psn can be used to indicate the total data packet sequence number, last_psn can be used to indicate the last data packet sequence number, op_index can be used to indicate the operation index, and psn can be used to indicate the current data packet sequence number.
[0137] Table 2 below is a data structure table of data operation items.
[0138] Table 2
[0139]
[0140] In Table 2, the operation flag (op_act) is used to indicate whether the data operation table entry is valid. In practical applications, the operation flag position 1 can be used to indicate that the data operation table entry is valid, and the operation flag position 0 can be used to indicate that the data operation table entry is invalid. The chain tail flag (is_tail) is used to indicate whether this table entry is the tail of the linked list. In practical applications, the chain tail flag position 1 can be used to indicate that this table entry is the tail of the chain tail, and the chain tail flag position 0 can be used to indicate that this table entry is not the tail of the chain tail. When the chain tail flag is 0, it means that a new data operation table entry can be further established based on this table entry. For the convenience of description, op_index can be used to indicate the queue pair number corresponding to this table entry, start_psn can be used to indicate the starting data packet sequence number, next_pt can be used to indicate the next pointer, and wqe can be used to indicate the work queue event data.
[0141] Table 3 below is a data structure table of data receiving items.
[0142] Table 3
[0143]
[0144] The receiving flag bit (rx_act) in Table 3 is used to indicate whether the data receiving table entry is valid. In practical applications, the receiving flag bit 1 can be used to indicate that the data receiving table entry is valid, and the receiving flag bit 0 can be used to indicate that the data receiving table entry is invalid. For ease of description, last_psn can be used to indicate the last data packet sequence number, and op_index can be used to indicate the operation index.
[0145] S202: Obtain a new address of the current work queue event in the second random access memory from the free pointer storage queue.
[0146] The idle pointer storage queue stores the idle pointer of the second random access memory. In practical applications, the idle pointer of op_ram can be obtained from pt_fifo as the new address.
[0147] S203: When the data sending table entry is invalid, the data sending table entry, the data operation table entry of the second random memory and the data receiving table entry of the third random memory are updated according to the data length and the new address of the work queue event data, and the work queue event data is written into the data operation table entry; the queue pair number is written into the scheduling information storage queue.
[0148] When the QP number and WQE data are obtained, if the data transmission table entry is invalid at this time, it means that this WQE is the first WQE of the QP. The number of data packets to be used can be calculated based on the data length of the WQE and the PMTU, thereby determining the updated values of last_psn and total_psn in the data transmission table entry. The data packet sequence number starts from 0, and the psn of the data transmission table entry can be set to 0. Set tx_act to 1. Get the free pointer of op_ram from pt_fifo as op_index. Write tx_act, total_psn, last_psn, op_index, and psn to the same address of tx_ram.
[0149] Using the newly obtained op_index as a new address, the WQE data can be written into the data operation table entry, and other information in the data operation table entry can be updated.
[0150] Use the obtained QP number as the receiving address, set rx_act to 1, and write last_psn and op_index to rx_ram. Write the QP number to schedule_fifo, and the operation is complete.
[0151] S204: When the data sending table entry is valid, the data sending table entry and the data receiving table entry of the third random memory are updated according to the data length of the work queue event data and the new address; a new data operation table entry is established on the second random memory according to the new address, and the work queue event data is written into the new data operation table entry.
[0152] If the data transmission table entry is valid, it means that this QP has received the WQE. At this time, it can be further determined whether the psn and total_psn of tx_ram are equal. If psn is equal to total_psn, it means that all the data that the WQE needs to send has been sent. At this time, it is only necessary to send the newly acquired WQE data. For the newly acquired WQE data, a new data operation table entry needs to be established on the second random memory to store the WQE data. According to the data length and new address of the WQE data, the relevant information of the data transmission table entry and the data reception table entry can be updated.
[0153] If psn is not equal to total_psn, it means that some WQEs have not been sent completely. Then, it is necessary to send the unsent WQEs completely and then create a new data operation table entry on the second random access memory for the newly acquired WQE data to store the WQE data.
[0154] It can be seen from the above technical solution that, when the queue pair number and the work queue event data are obtained, the data sending table item of the first random memory is read according to the queue pair number; the new address of the current work queue event in the second random memory is obtained from the free pointer storage queue; when the data sending table item is invalid, according to the data length and new address of the work queue event data, the data sending table item, the data operation table item of the second random memory and the data receiving table item of the third random memory are updated, and the work queue event data is written into the data operation table item. The queue pair number is written into the scheduling information storage queue. When the data sending table item is valid, according to the data length and new address of the work queue event data, the data sending table item and the data receiving table item of the third random memory are updated; a new data operation table item is established on the second random memory according to the new address, and the work queue event data is written into the new data operation table item. The beneficial effect of the present invention is that the processing of work queue events is realized by using the random access memory on the RDMA network card. Compared with the register, the random access memory can store more information, so that under the premise of maintaining the transmission efficiency of the RDMA network card unchanged and using the same on-chip hardware resources, it can support more QP numbers, meet the needs of data interaction with more nodes at the same time, and greatly improve the connection scalability of the RDMA network card. And by setting the data operation table item on the second random access memory, the work queue events of all queue pairs can be shared, avoiding the waste of storage resources and improving the data transmission efficiency.
[0155] Figure 4 A flowchart of a method for updating a table entry when a data transmission table entry is invalid is provided in an embodiment of the present invention, the method comprising:
[0156] S401: updating the data sending table entry according to the data length of the work queue event data, the maximum transmission length of the path and the new address.
[0157] In practical applications, the number of data packets can be determined based on the data length of the work queue event data and the maximum transmission length of the path.
[0158] For example, you can divide the WQE data length by the PMTU to get the quotient and remainder. If the remainder is 0, the quotient is the number of packets required; if the remainder is not 0, the quotient plus 1 is the number of packets required.
[0159] The total data packet sequence number and the last data packet sequence number in the data transmission table entry are updated according to the number of data packets; the current data packet sequence number in the data transmission table entry is set to zero, the transmission flag is adjusted to a valid flag, and the operation index in the data transmission table entry is updated to a new address.
[0160] In the case that the current data packet sequence number starts from zero, the number of data packets minus one can be used as the total data packet sequence number and the last data packet sequence number in the data transmission table entry.
[0161] S402: Update the data operation table entry according to the new address.
[0162] In the embodiment of the present invention, the free pointer of op_ram can be obtained from pt_fifo as the new address.
[0163] Access the data operation table entry based on the new address, adjust the operation flag in the data operation table entry to the valid flag, adjust the chain tail flag to the chain tail valid flag, set the starting data packet sequence number to zero, and use the queue pair number as the queue pair number of the data operation table entry; write the work queue event data into the work queue event of the data operation table entry.
[0164] Taking the valid flag bit of the operation flag bit as 1 and the valid flag bit of the linked list as 1 as an example, op_act can be set to 1, is_tail can be set to 1, start_psn can be set to 0, the QP number can be written into QP_index, and the WQE data can be written into wqe.
[0165] S403: updating the data receiving table entry according to the last data packet sequence number and the new address contained in the updated data sending table entry.
[0166] The data receiving table entry is accessed according to the queue number, the receiving flag in the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
[0167] Taking the valid flag bit of the receiving flag bit as 1 as an example, rx_act can be set to 1, and last_psn and op_index can be written to rx_ram.
[0168] In the embodiment of the present invention, when the data transmission table entry is invalid, the update of each table entry can be achieved based on the data length of the WQE data and the free pointer of op_ram obtained from pt_fifo, and the transmission of the QP number and WQE data can be successfully completed.
[0169] Figure 5 A flowchart of a method for establishing a new data operation table entry when a data transmission table entry is valid is provided in an embodiment of the present invention, the method comprising:
[0170] S501: Determine whether the current data packet sequence number is equal to the total data packet sequence number.
[0171] When the data transmission entry is valid, it can be determined whether the current data packet sequence number is equal to the total data packet sequence number.
[0172] When the current data packet sequence number is not equal to the total data packet sequence number, it indicates that there are WQEs that have not been sent out, and S502 can be executed at this time.
[0173] When the current data packet sequence number is equal to the total data packet sequence number, it indicates that all the data that the WQE needs to send have been sent, and S505 can be executed at this time.
[0174] S502: updating the data sending table entry according to the data length of the work queue event data.
[0175] In the embodiment of the present invention, the number of data packets to be used can be determined according to the data length of the work queue event data and the maximum transmission length of the path. The total data packet sequence number in the data transmission table item plus the number of data packets is used as a new total data packet sequence number, and other data in the data transmission table item remains unchanged to complete the update of the data transmission table item.
[0176] S503: Determine whether the original data operation table entry of the second random access memory belongs to the tail of the linked list.
[0177] In an embodiment of the present invention, an idle index can be obtained from the idle pointer storage queue as a new address, i.e., a new operation index. The operation index originally recorded in the data transmission table item can be used as the original address, and the corresponding data operation table item can be read according to the original address. The data operation table item can be called the original data operation table item.
[0178] If the original data operation table entry does not belong to the tail of the linked list, it means that the WQE stored in the original data operation table entry is not the last WQE of this QP. At this time, the new address can be used to continue reading the corresponding data operation table entry, that is, S504 is executed.
[0179] In the case where the original data operation table entry of the second random access memory belongs to the tail of the linked list, a new data operation table entry may be created, that is, S506 is executed.
[0180] S504: Use the new address to access the second random access memory.
[0181] The new address can be used to read the data operation table entry corresponding to the new address on the second random access memory.
[0182] S505: updating the data sending table entry according to the data length of the work queue event data, the maximum transmission length of the path, and the new address.
[0183] In the embodiment of the present invention, the number of data packets to be used can be determined according to the data length of the work queue event data and the maximum transmission length of the path. The total data packet sequence number in the data transmission table item plus the number of data packets are used as the new total data packet sequence number and the new last data packet sequence number, the current data packet sequence number in the data transmission table item plus one is used as the new current data packet sequence number, and the idle indicator is obtained from the idle pointer storage queue as the new operation index, thereby completing the update of the data transmission table item.
[0184] S506: Use the new address as the next pointer of the data operation table entry, and adjust the chain tail flag of the data operation table entry to the chain tail invalid flag.
[0185] In order to support the creation of new data operation table items, the chain tail flag of the original data operation table items needs to be adjusted to the chain tail invalid flag, so that a new chain list can be further added on this basis.
[0186] S507: Create a new data operation table entry on the second random access memory according to the new address, use the new address as the address of the new data operation table entry, adjust the operation flag of the new data operation table entry to the valid flag, adjust the chain tail flag of the new data operation table entry to the chain tail valid flag, increase the total data packet sequence number by one as the starting data packet sequence number of the new data operation table entry, and use the queue pair number as the queue pair number of the new data operation table entry; write the work queue event data into the work queue event of the new data operation table entry.
[0187] The new address is the address for reading the new data operation table item. Because the new data operation table item is at the end of the linked list, the chain tail flag of the new data operation table item needs to be adjusted to the chain tail valid flag. The operation flag of the new data operation table item is adjusted to the valid flag, the total data packet sequence number is increased by one as the starting data packet sequence number of the new data operation table item, and the queue pair number is used as the queue pair number of the new data operation table item; the work queue event data is written into the work queue event of the new data operation table item, thereby completing the establishment of the new data operation table item.
[0188] S508: Determine whether the receiving flag bit of the data receiving table entry is a valid flag bit.
[0189] In actual applications, the data receiving table entry can be read using the input queue pair number as the address. When the receiving flag bit of the data receiving table entry is a valid flag bit, it indicates that the previous WQE has not been completed, and S509 can be executed at this time; when the receiving flag bit of the data receiving table entry is not a valid flag bit, the information in the data receiving table entry can be updated, that is, S510 can be executed.
[0190] S509: Write the queue pair number into the scheduling information storage queue.
[0191] The operation can be ended by writing the queue pair number into the scheduling information storage queue.
[0192] S510: Adjust the receiving flag of the data receiving table entry to a valid flag, and write the last data packet sequence number and the new address contained in the updated data sending table entry into the corresponding position of the data receiving table entry.
[0193] After completing the update of the information in the data receiving table entry, the queue pair number may be written into the scheduling information storage queue.
[0194] For example, if tx_act of tx_ram is 1, it means that this QP has received WQE. Determine whether psn of tx_ram is equal to total_psn.
[0195] If psn is equal to total_psn, it means that all the data that WQE needs to send has been sent. Use the original total_psn plus the number of packets that the input WQE needs to use to get the new total_psn and the new last_psn. Add 1 to the original psn to get the new psn. Get the free pointer of op_ram from pt_fifo as the new op_index. Write total_psn, last_psn, op_index, and psn to the same address of tx_ram, and tx_act remains unchanged at 1. Use the original op_index read from tx_ram as the address, read op_ram, use the new op_index as next_pt, set is_tail to 0, write to op_ram, and keep other data unchanged. Use the new op_index as the address, set op_act to 1, set is_tail to 1, total_psn plus 1 as start_psn, write the QP number to QP_index, and write the WQE data to wqe of op_ram. Use the input QP number as the address to read rx_ram. If rx_act is 1, it means that the previous WQE has not been completed; if rx_act is 0, use the QP number as the address, set rx_act to 1, and write it to rx_ram together with the new last_psn and new op_index. Finally, write the QP number to schedule_fifo and the operation ends.
[0196] If the psn read from tx_ram is not equal to total_psn, it means that there are WQEs that have not been sent. Use the original total_psn plus the number of data packets required for the input WQE to get the new total_psn, and write it to the same address of tx_ram. Other data remain unchanged. Get the free pointer of op_ram from pt_fifo as the new op_index. Use the original op_index in tx_ram as the address to read op_ram. If is_tail of op_ram is 0, it means that the WQE stored in this table entry is not the last WQE of this QP. Use next_pt as the address and continue to read op_ram. When is_tail of op_ram is 1, the new op_index obtained from pt_fifo is used as next_pt, is_tail is set to 0, and written to op_ram. Other data remain unchanged. Use the new op_index as the address, set op_act to 1, set is_tail to 1, add 1 to the original total_psn as start_psn, write it into op_ram together with QP_index and WQE, and the operation is completed.
[0197] In an embodiment of the present invention, when the data sending table entry is valid, a corresponding processing flow can be adopted according to the size relationship between the current data packet sequence number and the total data packet sequence number to complete the update of the data sending table entry and the data receiving table entry and the creation of the data operation table entry, thereby smoothly realizing the sending of QP number and WQE data.
[0198] Figure 6 A flowchart of a method for reading data provided by an embodiment of the present invention, the method comprising:
[0199] S601: When the scheduling information storage queue is not empty, a queue pair number is read from the scheduling information storage queue, and a data transmission table entry is read according to the queue pair number.
[0200] If the scheduling information storage queue is not empty, it indicates that there is a need to send a data packet. Therefore, if the scheduling information storage queue is not empty, the QP number recorded in the scheduling information storage queue can be used as an address to read the data transmission table entry.
[0201] S602: When the sending flag bit of the data sending entry is a valid flag bit, determine whether the current data packet sequence number of the data sending entry is equal to the total data packet sequence number.
[0202] When the sending flag of the data sending table entry is not a valid flag, that is, the sending flag is an invalid flag, it indicates that an error occurs and the operation is terminated.
[0203] If the sending flag is a valid flag, it is further determined whether the current data packet sequence number is equal to the total data packet sequence number.
[0204] When the current data packet sequence number of the data transmission entry is equal to the total data packet sequence number, it means that the last data packet of all WQEs is to be sent, and S603 can be executed at this time; when the current data packet sequence number of the data transmission entry is not equal to the total data packet sequence number, S604 is executed.
[0205] S603: Output the queue pair number, the current data packet sequence number and the operation index to the sending engine module.
[0206] When the current data packet sequence number of the data transmission entry is equal to the total data packet sequence number, the queue pair number, the current data packet sequence number and the operation index can be directly output to the transmission engine module.
[0207] S604: Determine a matching data processing method according to the size relationship between the current data packet sequence number and the last data packet sequence number.
[0208] When the current data packet sequence number of the data transmission entry is not equal to the total data packet sequence number, it can be further determined whether the current data packet sequence number is equal to the last data packet sequence number.
[0209] When the current data packet sequence number is equal to the last data packet sequence number, a data processing method of traversing the data packet sequence number can be adopted. When the current data packet sequence number is not equal to the last data packet sequence number, a data processing method of traversing the data operation table entry is adopted.
[0210] S605: Output the queue pair number, the current data packet sequence number and the operation index to the sending engine module, and update the data sending table entry according to the data processing method.
[0211] When the current data packet sequence number is not equal to the last data packet sequence number, the queue pair number, the current data packet sequence number and the operation index can be output to the sending engine module, and the current data packet sequence number of the data sending table item can be increased by one; the queue pair number is rewritten into the scheduling information storage queue, and the process returns to S601, that is, when the scheduling information storage queue is not empty, the queue pair number is read from the scheduling information storage queue, and the data sending table item is read according to the queue pair number.
[0212] When the current data packet sequence number is equal to the last data packet sequence number, it means that the last packet of this WQE is to be sent, but there are still WQEs to be processed. At this time, the queue pair number, the current data packet sequence number and the operation index can be output to the sending engine module. The operation index recorded in the data sending table entry is used as the address to read the corresponding first data operation table entry.
[0213] When the chain tail flag of the first data operation table entry is the chain tail valid flag, it means that the table entry stores the last WQE, which contradicts that psn is not equal to total, indicating an error. At this time, the operation can be terminated.
[0214] When the tail flag of the first data operation table item is the invalid tail flag, read the corresponding second data operation table item according to the next pointer; increase the current data packet sequence number of the data sending table item by one; use the next pointer as the operation index of the second data operation table item; update the last data packet sequence number according to the maximum transmission length of the path and the starting data packet sequence number and the data length of the working queue event data recorded in the second data operation table item; rewrite the queue pair number into the scheduling information storage queue, and return to S601, that is, execute the steps of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table item according to the queue pair number.
[0215] In actual applications, the number of second data packets can be determined based on the maximum transmission length of the path and the data length of the work queue event data recorded in the second data operation table item; the latest last data packet sequence number can be determined based on the number of second data packets and the starting data packet sequence number recorded in the second data operation table item; and the last data packet sequence number in the data sending table item is updated to the latest last data packet sequence number.
[0216] For example, when there is a QP number in schedule_fifo, you can read schedule_fifo, use the QP number output by schedule_fifo as the address, and read tx_ram. If tx_act is 0, it means an error has occurred and the operation ends. If tx_act is 1, determine whether psn is equal to total_psn. If psn is equal to total_psn, it means that the last data packet of all WQEs is to be sent, and the QP number, psn and op_index are output to the tx_engine module, and the operation ends.
[0217] If psn is not equal to total_psn, determine whether psn is equal to last_psn. If psn is not equal to last_psn, output the QP number, psn and op_index to the tx_engine module. Add 1 to psn and write it to the same address of tx_ram, and keep other data unchanged. Write the QP number to schedule_fifo and the operation ends. If psn is equal to last_psn, it means that the last packet of this WQE is to be sent, but there are still WQEs to be processed later, and output the QP number, psn and op_index to the tx_engine module. Use op_index as the address and read op_ram. If is_tail is 1, it means that the table entry stores the last WQE, which contradicts the fact that psn is not equal to total, indicating an error and the operation ends. If is_tail is 0, use next_pt as the address and read op_ram. Use the obtained start_psn and the data length and PMTU in WQE to calculate last_psn. Use next_pt as op_index, add 1 to psn in tx_ram, and write it to the address of the same QP number in tx_ram. Other data remain unchanged, write the QP number to schedule_fifo, and the operation ends.
[0218] In the embodiment of the present invention, by detecting whether the scheduling information storage queue is empty, when the scheduling information storage queue stores a QP number, the data packet to be sent can be processed in time.
[0219] Figure 7 A flowchart of a method for processing a response data packet provided by an embodiment of the present invention, the method comprising:
[0220] S701: When a response data packet including a received data packet sequence number, a queue pair number and a response packet type is obtained, a data receiving table entry is read according to the queue pair number.
[0221] When the receiving data processing module receives the response data packet fed back by the remote node, the receiving data processing module can extract the receiving data packet sequence number (rx_psn), QP number and response packet type of the response data packet, and input them to the requester module. Among them, the response packet type can include the confirmation type (ACK) and the non-confirmation type (NAK). The requester module can use the queue pair number as the address to read the data receiving table entry.
[0222] S702: When the receiving flag bit recorded in the data receiving table entry is a valid flag bit, read the data operation table entry according to the operation index recorded in the data receiving table entry.
[0223] If the receive flag recorded in the data receive table entry is an invalid flag, that is, rx_act=0, it means there is an error, and the operation can be terminated directly. If rx_act=1, op_index in rx_ram can be used to read op_ram.
[0224] S703: Determine a matching data transmission mode according to the size relationship between the received data packet sequence number and the last data packet sequence number and the response packet type.
[0225] In practical applications, it can be determined whether the response packet type is a non-confirmation type.
[0226] If the response packet type is a non-confirmation type, it means that the RDMA transmission data packet has not successfully reached the responder and needs to be retransmitted. Further determine whether the received data packet sequence number is less than or equal to the last data packet sequence number. If the received data packet sequence number is less than or equal to the last data packet sequence number, the retransmission data transmission method is adopted. If the received data packet sequence number is greater than the last data packet sequence number, it means that there is a merge confirmation, that is, the WQE before the WQE to which this response data packet belongs has been completed. In this case, the merge confirmation data transmission method is adopted.
[0227] When the response packet type is confirmation type, determine whether the received data packet sequence number is less than the last data packet sequence number; when the received data packet sequence number is not less than the last data packet sequence number, adopt the data transmission mode of direct transmission. When the received data packet sequence number is less than the last data packet sequence number, it means that WQE has not been completed and the operation ends.
[0228] S704: According to the data transmission mode, the queue pair number and the work queue event data recorded in the data operation table item are output to the completion queue, and the update of the data operation table item and the data receiving table item is completed.
[0229] Taking the retransmission data transmission method as an example, when the received data packet sequence number is less than or equal to the last data packet sequence number, the queue pair number is used to read the data sending table item; the received data packet sequence number is used as the current data packet sequence number of the data sending table item; the last data packet sequence number recorded in the data receiving table item is used as the last data packet sequence number of the data sending table item, and the operation index recorded in the data receiving table item is used as the operation index of the data sending table item; the queue pair number is written into the scheduling information storage queue, and the operation is ended.
[0230] Taking the merged confirmed data transmission method as an example, when the received data packet sequence number is greater than the last data packet sequence number, the queue pair number and the work queue event data are output to the completion queue, and the data operation table entry where the work queue event data is located is released. It is determined whether the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag.
[0231] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the operation is terminated. When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; adjust the receiving flag of the data receiving table entry to a valid flag; based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than or equal to the last data packet sequence number.
[0232] Taking the direct transmission data transmission method as an example, when the received data packet sequence number is not less than the last data packet sequence number, the queue pair number and the work queue event data are output to the completion queue, and the data operation table item where the work queue event data is located is released; determine whether the chain tail flag of the data operation table item where the work queue event data is located is the chain tail valid flag.
[0233] In practical applications, the data operation table entry may be released by adjusting the operation flag bit of the data operation table entry to an invalid flag bit and using the operation index as the next pointer.
[0234] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the receiving flag of the data receiving table entry is adjusted to an invalid flag.
[0235] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than the last data packet sequence number.
[0236] For example, when receiving a response data packet fed back by a remote node, the Rx_proc module extracts the rx_psn, QP number, and response packet type of the received packet and inputs them to the requester module. The requester module uses the QP number to read rx_ram and determine whether rx_act is 1. If rx_act is 0, it indicates an error and the operation ends. If rx_act is 1, use the op_index in rx_ram to read op_ram. Determine whether the input response packet type is NAK.
[0237] If the response packet type is NAK, it means that the RDMA transmission data packet has not successfully reached the responder and needs to be retransmitted. Determine whether rx_psn is less than or equal to last_psn. If rx_psn is greater than last_psn, it means that there is a merge confirmation, that is, the WQE before the WQE to which this response packet belongs has been completed. Output the QP number and WQE to the external complete_write module to generate CQE, set op_act to 0 and write it to op_ram, input op_index into pt_fifo, and release this op_ram table entry. Determine whether the original is_tail of op_ram is 1. If is_tail is 1, it means that there is an error and the operation ends; if is_tail is 0, use next_pt to read op_ram. Use the data length and PMTU of the WQE data in op_ram to calculate the number of data packets required, add start_psn to the number of required data packets minus 1, and get last_psn. Write the op_ram read address as op_index and last_psn to the address of the rx_ram with the same QP number, and other rx_ram data remain unchanged.
[0238] Continue to determine whether rx_psn is less than or equal to the new last_psn. If it is greater than the new last_psn, repeat the above steps until rx_psn is less than or equal to last_psn. Use the QP number to read tx_ram, use rx_psn as the psn of tx_ram, and write it into the address of tx_ram with the same QP number together with last_psn and op_index. Other tx_ram data remain unchanged. Enter the QP number into schedule_fifo and the operation is completed.
[0239] If the response packet is not a NAK packet but an ACK packet, then determine whether rx_psn is less than last_psn. If rx_psn is less than last_psn, it means that WQE has not been completed and the operation is over; if rx_psn is equal to or greater than last_psn, then the QP number and WQE are output to the external complete module to generate CQE, op_act is set to 0 and written to op_ram, op_index is input to pt_fifo, and this op_ram entry is released. Then determine whether the original is_tail is 1. If is_tail is 1, rx_act is set to 0 and written to the address of the same QP number in rx_ram, and the operation is over; if is_tail is 0, use next_pt as the address to read op_ram. Use WQE, PMTU and start_psn to calculate last_psn, use the read address of op_ram as op_index, and write it to the address of the same QP number in rx_ram. Then continue to determine whether rx_psn is less than the new last_psn and repeat the above steps.
[0240] After the tx_engine module receives the QP number, PSN and op_index, it uses op_index to read op_ram. Subtract start_psn from PSN to get the number of packets in WQE corresponding to this PSN. Then, according to the starting address (base_addr) of the host memory required to send data in WQE, the starting address of the data corresponding to this PSN is calculated (offset_addr). The calculation method is:
[0241] offset_addr = base_addr + n*PMTU;
[0242] The tx_engine module uses DMA to obtain data from the host memory according to offset_addr, composes RDMA packets and sends them to the external MAC. The PMTU value is generally 1024 bits.
[0243] Figure 8 A structural diagram of an embodiment of the present invention using FPGA as an RDMA network card is provided, with two 100G Ethernet optical ports connected to the Field Programmable Gate Array (FPGA) and two 8GB Synchronous Dynamic Random Access Memory (SDRAM) as memories, which can be connected to the central processing unit of the server through PCI-E.
[0244] This FPGA supports 4096 QPs, the address width of tx_ram and rx_ram is 12 bits, the depth is 4096, the address width of op_ram is 10 bits, the depth is 1024, the data width of schedule_fifo is 12 bits, the depth is 64, the data width of pt_fifo is 10 bits, the depth is 1024. The data width of tx_ram is 83 bits (tx_act is 1 bit, total_psn is 24 bits, last_psn is 24 bits, op_index is 10 bits, psn is 24 bits), the data width of rx_ram is 35 bits (rx_act is 1 bit, last_psn is 24 bits, op_index is 10 bits), and the data width of op_ram is 304 bits (op_act is 1 bit, qp_index is 12 bits, start_psn is 24 bits, is_tail is 1 bit, next_pt is 10 bits, wqe is 256 bits).
[0245] Taking the example that the software uses 2 QPs, each QP sends 2 WQEs, and the PMTU of the network is 1024 bytes, how the present invention performs RDMA operations is explained. Assuming that the software uses QP1 and QP2 to send data, an RDMA link is first established with the remote network node, and addresses 1 and 2 of tx_ram and rx_ram are written to 0. The software writes 4 WQEs into the host memory address space corresponding to the 2 QPs respectively, and rings the doorbell to the RDMA network card (ringing the doorbell means writing the QP number into the internal register of the RDMA network card to enable the RDMA network card to start the RDMA operation). The Wqe_fetch module obtains 4 WQEs from the memory through PCI-E, and sends them to the requester module continuously together with the QP number, as shown in Table 4.
[0246] Table 4
[0247]
[0248] The requester module uses the QP number (1) of the first WQE as the address, reads tx_ram, and obtains tx_act as 0. According to the data length (2048) in the WQE divided by PMTU (1024), the number of required data packets is 2. Calculate last_psn and total_psn as 1, and obtain the free pointer of op_ram from pt_fifo as 0. Write tx_act(1), total_psn(1), last_psn(1), op_index(0), and psn(0) to address 1 of tx_ram, as shown in Table 5. Write op_act(1), QP_index(1), start_psn(0), is_tail(1), next_pt(0), and WQE to address 0 of op_ram. Write rx_act(1), last_psn(1), and op_index(0) to address 1 of rx_ram. Write the QP number (1) to schedule_fifo.
[0249] The requester module uses the QP number (2) of the second WQE as the address, reads tx_ram, and obtains tx_act as 0. According to the data length (4096) in the WQE divided by PMTU (1024), the number of required data packets is 4. Calculate last_psn and total_psn as 3, and obtain the free pointer of op_ram from pt_fifo as 1. Write tx_act(1), total_psn(3), last_psn(3), op_index(1), and psn(0) to address 2 of tx_ram, as shown in Table 5. Write op_act(1), QP_index(2), start_psn(0), is_tail(1), next_pt(0), and WQE to address 1 of op_ram. Write rx_act(1), last_psn(3), and op_index(1) to address 2 of rx_ram. Write the QP number (2) to schedule_fifo.
[0250] The requester module uses the QP number (2) of the third WQE as the address, reads tx_ram, obtains tx_act as 1, total_psn as 3, last_psn as 3, op_index as 1, and psn as 0. Determines that psn is not equal to total_psn. Divides the data length (2048) in the WQE by PMTU (1024) to obtain the required number of packets, which is 2. Adds the required number of packets to total_psn to obtain a new total_psn of 5. Writes the new total_psn to address 2 of tx_ram, and the other data remain unchanged. Obtains the free pointer 2 from pt_fifo. Uses op_index (1) as the address, reads op_ram, obtains is_tail as 1, sets next_pt to the newly obtained free pointer (2), sets is_tail to 0, and writes to address 1 of op_ram, and the other data remain unchanged. Add 1 to total_psn to get start_psn (4), and write op_act(1), QP_index(2), start_psn(4), is_tail(1), next_pt(0), and WQE to address 2 of op_ram.
[0251] The requester module uses the QP number (1) of the 4th WQE as the address, reads tx_ram, and obtains tx_act as 1, total_psn as 1, last_psn as 1, op_index as 0, and psn as 0. It determines that psn is not equal to total_psn. According to the data length (1024) in the WQE divided by PMTU (1024), the required number of data packets is 1. Add the required number of data packets to total_psn to obtain the new total_psn of 2. Write the new total_psn to address 1 of tx_ram, and the other data remain unchanged. Get the free pointer 3 from pt_fifo. Use op_index (0) as the address, read op_ram, get is_tail as 1, set next_pt to the newly obtained free pointer (3), set is_tail to 0, and write to address 0 of op_ram, and the other data remain unchanged. Add 1 to total_psn to get start_psn (2), and write op_act(1), QP_index(1), start_psn(2), is_tail(1), next_pt(0), and WQE to address 3 of op_ram.
[0252] At this point, the four consecutive WQEs have been written into the cache, and the data contents of the three RAMs are shown in the following table:
[0253] Table 5 Data content of data transmission table items
[0254]
[0255] Table 6 Data content of data operation table items
[0256]
[0257] Table 7 Data content of data receiving table items
[0258]
[0259] At this time, schedule_fifo is not empty, and the requester module reads the first QP number (1) from schedule. Use QP number (1) to read tx_ram. Get tx_act is 1, total_psn is 2, last_psn is 1, op_index is 0, and psn is 0. Determine that psn is not equal to total_psn, and output QP number (1), psn (0), and op_index (0) to the tx_engine module. Add 1 to psn to get a new psn (1), write it to address 1 of tx_ram, and keep other data unchanged. Write QP number 1 to schedule_fifo. Continue to read QP numbers from schedule_fifo and repeat the above steps until there is no data in schedule_fifo.
[0260] For example, the responder of QP1 feeds back an ACK packet for each data packet, and the responder of QP2 feeds back an ACK packet for every 6 data packets. The processing flow of the requester for the response data packet is as follows:
[0261] When the Rx_proc module extracts the QP number as 1, rx_psn as 0, and the response data packet is ACK, use the QP number (1) as the address to read rx_ram. Get last_psn as 1 and op_index as 0. Read address 0 of op_ram. Determine that rx_psn is less than last_psn, and the operation ends.
[0262] When the Rx_proc module extracts the QP number as 1, rx_psn as 1, and the response data packet is ACK, use the QP number (1) as the address to read rx_ram. Get rx_act as 1, last_psn as 1, and op_index as 0. Read address 0 of op_ram. Determine that rx_psn is equal to last_psn, and send the QP number (1) and WQE to the external complete_write module. Set op_act to 0, write to op_ram address 0, and write op_index (0) to pt_fifo. Determine that is_tail is 0, and use next_pt (3) to read op_ram. Get start_psn as 2, and calculate the new last_psn as 2 based on the data length (1024) in WQE. Write rx_act (1), last_psn (2), and op_index (3) to address 1 of rx_ram. Determine that rx_psn (1) is less than the new last_psn (2), and the operation ends.
[0263] When the Rx_proc module extracts the QP number as 1, rx_psn as 2, and the response packet is ACK, use the QP number (1) as the address to read rx_ram. Get rx_act as 1, last_psn as 2, and op_index as 3. Read address 3 of op_ram. Determine rx_psn is equal to last_psn, send the QP number (1) and WQE to the external complete_write module. Set op_act to 0, write op_ram address 3, and write op_index (3) to pt_fifo. Determine is_tail as 1, write rx_act (0) to address 1 of rx_ram, and the operation ends.
[0264] When the Rx_proc module extracts QP number 2, rx_psn is 5, and the response data packet is ACK, use QP number (2) as the address to read rx_ram. Get rx_act is 1, last_psn is 3, and op_index is 1. Read address 1 of op_ram. Determine that rx_psn is greater than last_psn, and send QP number (2) and WQE to the external complete_write module. Set op_act to 0, write op_ram address 1, and write op_index (1) to pt_fifo. Determine that is_tail is 0, and use next_pt (2) to read op_ram. Get start_psn is 4, and calculate the new last_psn as 5 based on the data length (2048) in WQE. Write rx_act (1), last_psn (5), and op_index (2) to address 2 of rx_ram. If rx_psn(5) is equal to the new last_psn(5), the QP number(2) and WQE are sent to the external complete_write module. Set op_act to 0, write op_ram address 2, and write op_index(2) to pt_fifo. If is_tail is 1, write rx_act(0) to address 1 of rx_ram, and the operation is complete.
[0265] The present invention can not only increase the number of hardware QPs of RDMA network cards, but also increase the number of hardware QPs of RDMA engines inside other FPGAs or application-specific integrated circuits (ASICs). For example, some FPGA accelerator cards use internal RDMA engines to transmit data from the accelerator card's external memory, thereby increasing the number of hardware QPs.
[0266] Fig. 9 A schematic diagram of the structure of a data transmission device provided by an embodiment of the present invention, comprising a reading unit 91, an acquiring unit 92, a first updating unit 93, a first writing unit 94, a second writing unit 95, a second updating unit 96, an establishing unit 97 and a third writing unit 98;
[0267] A reading unit 91 is used to read the data sending table entry of the first random access memory according to the queue pair number when the queue pair number and the work queue event data are obtained;
[0268] An acquiring unit 92 is used to acquire a new address of the current work queue event in the second random access memory from the idle pointer storage queue;
[0269] A first updating unit 93 is used to update the data sending table item, the data operation table item of the second random access memory and the data receiving table item of the third random access memory according to the data length and the new address of the work queue event data when the data sending table item is invalid;
[0270] A first writing unit 94, used to write the work queue event data into the data operation table entry;
[0271] A second writing unit 95, used to write the queue pair number into the scheduling information storage queue;
[0272] A second updating unit 96 is used to update the data sending table entry and the data receiving table entry of the third random access memory according to the data length and the new address of the work queue event data when the data sending table entry is valid;
[0273] An establishing unit 97, used for establishing a new data operation table entry on the second random access memory according to the new address;
[0274] The third writing unit 98 is used to write the work queue event data into a new data operation table entry.
[0275] In some embodiments, the first updating unit includes a first sending table entry updating subunit, a first operating table entry updating subunit, and a first receiving table entry updating subunit;
[0276] A first sending table entry updating subunit, used to update the data sending table entry according to the data length of the work queue event data, the maximum transmission length of the path and the new address;
[0277] A first operation table item updating subunit, used to update the data operation table item according to the new address;
[0278] The first receiving table entry updating subunit is used to update the data receiving table entry according to the last data packet sequence number and the new address contained in the updated data sending table entry.
[0279] In some embodiments, the first sending table entry update subunit is used to determine the number of data packets based on the data length of the work queue event data and the maximum transmission length of the path; update the total data packet sequence number and the last data packet sequence number in the data sending table entry according to the number of data packets; set the current data packet sequence number in the data sending table entry to zero, adjust the sending flag to a valid flag, and update the operation index in the data sending table entry to a new address.
[0280] In some embodiments, the first transmission entry updating subunit is used to, when the current data packet sequence number starts from zero, reduce the number of data packets by one as the total data packet sequence number and the last data packet sequence number in the data transmission entry.
[0281] In some embodiments, the first operation table entry updating subunit is used to access the data operation table entry based on the new address, adjust the operation flag bit in the data operation table entry to a valid flag bit, adjust the chain tail flag bit to a chain tail valid flag bit, set the start data packet sequence number to zero, and use the queue pair number as the queue pair number of the data operation table entry;
[0282] The first writing unit is used for writing the work queue event data into the work queue event of the data operation table item.
[0283] In some embodiments, the first receiving table entry updating subunit is used to access the data receiving table entry according to the queue pair number, adjust the receiving flag in the data receiving table entry to a valid flag, and write the last data packet sequence number and new address contained in the updated data sending table entry into the corresponding position of the data receiving table entry.
[0284] In some embodiments, the second updating unit includes a sequence number determination subunit, a second sending table entry updating subunit, a second receiving table entry updating subunit, and a third sending table entry updating subunit;
[0285] A sequence number determination subunit, used to determine whether the sequence number of the current data packet is equal to the sequence number of the total data packet;
[0286] The second transmission table entry updating subunit is used to update the data transmission table entry according to the data length of the work queue event data, the maximum transmission length of the path and the new address when the current data packet sequence number is equal to the total data packet sequence number;
[0287] The second receiving table entry updating subunit is used to update the data receiving table entry according to the receiving flag bit of the data receiving table entry, the last data packet sequence number and the new address contained in the updated data sending table entry;
[0288] The third sending table entry updating subunit is used to update the data sending table entry according to the data length of the work queue event data when the current data packet sequence number is not equal to the total data packet sequence number.
[0289] In some embodiments, the second receiving table entry updating sub-unit is used to determine whether the receiving flag of the data receiving table entry is a valid flag; if the receiving flag of the data receiving table entry is a valid flag, the queue pair number is written into the scheduling information storage queue; if the receiving flag of the data receiving table entry is not a valid flag, the receiving flag of the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
[0290] In some embodiments, the establishing unit is used to determine whether the original data operation table entry of the second random access memory belongs to the tail of the linked list when the current data packet sequence number is not equal to the total data packet sequence number;
[0291] When the original data operation table entry of the second random access memory does not belong to the tail of the linked list, the second random access memory is accessed using the new address;
[0292] When the original data operation table entry of the second random access memory belongs to the tail of the linked list or the current data packet sequence number is equal to the total data packet sequence number, the new address is used as the next pointer of the data operation table entry, and the chain tail flag of the data operation table entry is adjusted to the chain tail invalid flag; a new data operation table entry is established on the second random access memory according to the new address, the new address is used as the address of the new data operation table entry, the operation flag of the new data operation table entry is adjusted to the valid flag, the chain tail flag of the new data operation table entry is adjusted to the chain tail valid flag, the total data packet sequence number is increased by one as the starting data packet sequence number of the new data operation table entry, and the queue pair number is used as the queue pair number of the new data operation table entry;
[0293] Writing work queue event data into a new data operation table entry includes:
[0294] Writes the work queue event data to a new data operation table item's work queue event.
[0295] In some embodiments, it further includes a sending table entry reading unit, a first judgment unit, a first output unit, a data processing mode determination unit, and a third updating unit;
[0296] A sending entry reading unit, used to read a queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and read a data sending entry according to the queue pair number;
[0297] A first judgment unit, used for judging whether the current data packet sequence number of the data transmission table entry is equal to the total data packet sequence number when the transmission flag bit of the data transmission table entry is a valid flag bit;
[0298] A first output unit, configured to output the queue pair number, the current data packet sequence number and the operation index to the sending engine module when the current data packet sequence number of the data sending table entry is equal to the total data packet sequence number;
[0299] A data processing mode determining unit, used to determine a matching data processing mode according to a size relationship between the current data packet sequence number and the last data packet sequence number when the current data packet sequence number of the data transmission table entry is not equal to the total data packet sequence number;
[0300] The third updating unit is used to output the queue pair number, the current data packet sequence number and the operation index to the sending engine module, and update the data sending table item according to the data processing method.
[0301] In some embodiments, the data processing method determination unit is used to determine whether the current data packet sequence number is equal to the last data packet sequence number; when the current data packet sequence number is equal to the last data packet sequence number, a data processing method of traversing the data packet sequence number is adopted; when the current data packet sequence number is not equal to the last data packet sequence number, a data processing method of traversing the data operation table items is adopted.
[0302] In some embodiments, the third update unit is used to add one to the current data packet sequence number of the data sending table item; rewrite the queue pair number into the scheduling information storage queue, and return to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table item according to the queue pair number.
[0303] In some embodiments, the third update unit is used to read the corresponding first data operation table item according to the operation index; when the chain tail flag of the first data operation table item is the chain tail valid flag, end the operation; when the chain tail flag of the first data operation table item is the chain tail invalid flag, read the corresponding second data operation table item according to the next pointer; increase the current data packet sequence number of the data sending table item by one; use the next pointer as the operation index of the second data operation table item; update the last data packet sequence number according to the maximum transmission length of the path and the starting data packet sequence number and the data length of the working queue event data recorded in the second data operation table item; rewrite the queue pair number into the scheduling information storage queue, and return to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table item according to the queue pair number.
[0304] In some embodiments, the third update unit is used to determine the number of second data packets based on the maximum transmission length of the path and the data length of the work queue event data recorded in the second data operation table item; determine the latest last data packet sequence number based on the number of second data packets and the starting data packet sequence number recorded in the second data operation table item; and update the last data packet sequence number in the data sending table item to the latest last data packet sequence number.
[0305] In some embodiments, it further includes a termination unit;
[0306] The ending unit is used to end the operation when the sending flag bit of the data sending table item is not a valid flag bit.
[0307] In some embodiments, it further includes a receiving table entry reading unit, an operation table entry reading unit, a data transmission mode determining unit, and a fourth updating unit;
[0308] A receiving table entry reading unit, configured to read a data receiving table entry according to the queue pair number when a response data packet including a received data packet sequence number, a queue pair number and a response packet type is obtained;
[0309] An operation table entry reading unit, configured to read a data operation table entry according to an operation index recorded in the data reception table entry when the reception flag bit recorded in the data reception table entry is a valid flag bit;
[0310] A data transmission mode determination unit, used to determine a matching data transmission mode according to a size relationship between a received data packet sequence number and a last data packet sequence number and a response packet type;
[0311] The fourth updating unit is used to output the queue pair number and the work queue event data recorded in the data operation table item to the completion queue according to the data transmission mode, and complete the update of the data operation table item and the data reception table item.
[0312] In some embodiments, the data transmission mode determination unit is used to determine whether the response packet type is a non-confirmation type; in the case where the response packet type is a non-confirmation type, determine whether the received data packet sequence number is less than or equal to the last data packet sequence number; in the case where the received data packet sequence number is less than or equal to the last data packet sequence number, adopt a retransmission data transmission mode; in the case where the received data packet sequence number is greater than the last data packet sequence number, adopt a combined confirmation data transmission mode; in the case where the response packet type is a confirmation type, determine whether the received data packet sequence number is less than the last data packet sequence number; in the case where the received data packet sequence number is not less than the last data packet sequence number, adopt a direct transmission data transmission mode.
[0313] In some embodiments, the fourth updating unit is used to read the data transmission table entry using the queue pair number when the data transmission mode is retransmission;
[0314] The received data packet sequence number is used as the current data packet sequence number of the data transmission table item; the last data packet sequence number recorded in the data reception table item is used as the last data packet sequence number of the data transmission table item, and the operation index recorded in the data reception table item is used as the operation index of the data transmission table item;
[0315] Write the queue pair number into the scheduling information storage queue and end the operation.
[0316] In some embodiments, the fourth updating unit is used to output the queue pair number and the work queue event data to the completion queue when the data transmission mode is merge confirmation, and release the data operation table entry where the work queue event data is located;
[0317] Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag;
[0318] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the operation is terminated;
[0319] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer;
[0320] Adjust the receiving flag bit of the data receiving table entry to a valid flag bit;
[0321] Based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than or equal to the last data packet sequence number.
[0322] In some embodiments, the fourth updating unit is used to output the queue pair number and the work queue event data to the completion queue when the data transmission mode is direct transmission, and release the data operation table entry where the work queue event data is located;
[0323] Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag;
[0324] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the receiving flag of the data receiving table entry is adjusted to an invalid flag;
[0325] When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than the last data packet sequence number.
[0326] Fig. 9 The description of the features in the corresponding embodiments can be found in Figure 2The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0327] It can be seen from the above technical solution that, when the queue pair number and the work queue event data are obtained, the data sending table item of the first random memory is read according to the queue pair number; the new address of the current work queue event in the second random memory is obtained from the free pointer storage queue; when the data sending table item is invalid, according to the data length and new address of the work queue event data, the data sending table item, the data operation table item of the second random memory and the data receiving table item of the third random memory are updated, and the work queue event data is written into the data operation table item. The queue pair number is written into the scheduling information storage queue. When the data sending table item is valid, according to the data length and new address of the work queue event data, the data sending table item and the data receiving table item of the third random memory are updated; a new data operation table item is established on the second random memory according to the new address, and the work queue event data is written into the new data operation table item. The beneficial effect of the present invention is that the processing of work queue events is realized by using the random access memory on the RDMA network card. Compared with the register, the random access memory can store more information, so that under the premise of maintaining the transmission efficiency of the RDMA network card unchanged and using the same on-chip hardware resources, it can support more QP numbers, meet the needs of data interaction with more nodes at the same time, and greatly improve the connection scalability of the RDMA network card. And by setting the data operation table item on the second random access memory, the work queue events of all queue pairs can be shared, avoiding the waste of storage resources and improving the data transmission efficiency.
[0328] Fig.10 A structural diagram of a data transmission device provided by an embodiment of the present invention, such as Fig.10 As shown, the data transmission device includes: a memory 100 for storing a computer program;
[0329] The processor 101 is used to implement the steps of the data transmission method in the above embodiment when executing a computer program.
[0330] The data transmission device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0331] Among them, the processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 101 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 101 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0332] The memory 100 may include one or more non-volatile storage media, which may be non-transitory. The memory 100 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 100 is at least used to store the following computer program 1001, wherein, after the computer program is loaded and executed by the processor 101, it can implement the relevant steps of the data transmission method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 100 may also include an operating system 1002 and data 1003, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1002 may include Windows, Unix, Linux, etc. Data 1003 may include, but is not limited to, work queue event data, etc.
[0333] In some embodiments, the data transmission device may further include a display screen 102 , an input / output interface 103 , a communication interface 104 , a power supply 105 , and a communication bus 106 .
[0334] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the data transmission device, and may include more or fewer components than shown in the figure.
[0335] It is understandable that if the data transmission method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.
[0336] Based on this, an embodiment of the present invention further provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.
[0337] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above data transmission method when executed by a processor.
[0338] The above is a detailed introduction to a data transmission method, device, equipment, computer-readable storage medium and computer program product provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The equal and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0339] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use unequal methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0340] The above is a detailed introduction to a data transmission method, device, equipment, computer-readable storage medium and computer program product provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A data transmission method, It is characterized in that include: When the queue pair number and the work queue event data are obtained, reading the data sending table entry of the first random access memory according to the queue pair number; Get the new address of the current work queue event in the second random access memory from the free pointer storage queue; In the case where the data sending table entry is invalid, the data sending table entry, the data operation table entry of the second random memory and the data receiving table entry of the third random memory are updated according to the data length of the work queue event data and the new address, and the work queue event data is written into the data operation table entry; the queue pair number is written into the scheduling information storage queue; When the data sending table entry is valid, the data sending table entry and the data receiving table entry of the third random access memory are updated according to the data length of the work queue event data and the new address; a new data operation table entry is established on the second random access memory according to the new address, and the work queue event data is written into the new data operation table entry; According to the data length of the work queue event data and the new address, updating the data sending table entry, the data operation table entry of the second random access memory, and the data receiving table entry of the third random access memory includes: According to the data length of the work queue event data, the maximum transmission length of the path and the new address, the data sending table entry is updated; updating the data operation table entry according to the new address; According to the last data packet sequence number and the new address contained in the updated data transmission table entry, the data reception table entry is updated; According to the data length of the work queue event data and the new address, updating the data sending table entry and the data receiving table entry of the third random access memory includes: Determine whether the current data packet sequence number is equal to the total data packet sequence number; When the current data packet sequence number is equal to the total data packet sequence number, the data sending table entry is updated according to the data length of the work queue event data, the maximum transmission length of the path and the new address; the data receiving table entry is updated according to the receiving flag bit of the data receiving table entry, the last data packet sequence number contained in the updated data sending table entry and the new address; When the current data packet sequence number is not equal to the total data packet sequence number, the data sending table entry is updated according to the data length of the work queue event data.
2. The data transmission method according to claim 1, It is characterized in that According to the data length of the work queue event data, the maximum transmission length of the path, and the new address, updating the data sending table entry includes: Determining the number of data packets based on the data length of the work queue event data and the maximum transmission length of the path; Update the total data packet sequence number and the last data packet sequence number in the data transmission table entry according to the number of data packets; The current data packet sequence number in the data transmission table entry is set to zero, the transmission flag bit is adjusted to a valid flag bit, and the operation index in the data transmission table entry is updated to the new address.
3. The data transmission method according to claim 2, It is characterized in that Updating the total data packet sequence number and the last data packet sequence number in the data transmission table entry according to the number of data packets includes: In the case where the current data packet sequence number starts from zero, the number of data packets is reduced by one and used as the total data packet sequence number and the last data packet sequence number in the data transmission table entry respectively.
4. The data transmission method according to claim 1, It is characterized in that The updating of the data operation table entry according to the new address includes: Access the data operation table entry based on the new address, adjust the operation flag in the data operation table entry to a valid flag, adjust the chain tail flag to a chain tail valid flag, set the start data packet sequence number to zero, and use the queue pair number as the queue pair number of the data operation table entry; Writing the work queue event data into the data operation table item includes: The work queue event data is written into the work queue event of the data operation table item.
5. The data transmission method according to claim 1, It is characterized in that The updating of the data receiving table entry according to the last data packet sequence number and the new address contained in the updated data sending table entry includes: The data receiving table entry is accessed according to the queue pair number, the receiving flag in the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
6. The data transmission method according to claim 1, It is characterized in that According to the reception flag of the data reception table entry, the last data packet sequence number contained in the updated data transmission table entry, and the new address, updating the data reception table entry includes: Determine whether the receiving flag bit of the data receiving table entry is a valid flag bit; When the receiving flag of the data receiving table entry is a valid flag, writing the queue pair number into the scheduling information storage queue; When the receiving flag of the data receiving table entry is not a valid flag, the receiving flag of the data receiving table entry is adjusted to a valid flag, and the last data packet sequence number and the new address contained in the updated data sending table entry are written into the corresponding position of the data receiving table entry.
7. The data transmission method according to claim 1, It is characterized in that Establishing a new data operation table entry on the second random access memory according to the new address includes: When the current data packet sequence number is not equal to the total data packet sequence number, determining whether the original data operation table entry of the second random access memory belongs to the tail of the linked list; When the original data operation table entry of the second random access memory does not belong to the tail of the linked list, accessing the second random access memory using the new address; When the original data operation table entry of the second random access memory belongs to the tail of the linked list or the current data packet sequence number is equal to the total data packet sequence number, the new address is used as the next pointer of the data operation table entry, and the chain tail flag of the data operation table entry is adjusted to the chain tail invalid flag; a new data operation table entry is established on the second random access memory according to the new address, the new address is used as the address of the new data operation table entry, the operation flag of the new data operation table entry is adjusted to the valid flag, the chain tail flag of the new data operation table entry is adjusted to the chain tail valid flag, the total data packet sequence number is increased by one as the starting data packet sequence number of the new data operation table entry, and the queue pair number is used as the queue pair number of the new data operation table entry; Writing the work queue event data into a new data operation table entry includes: The work queue event data is written into the work queue event of the new data operation table item.
8. The data transmission method according to claim 1, It is characterized in that Also includes: When the scheduling information storage queue is not empty, reading a queue pair number from the scheduling information storage queue, and reading the data transmission table item according to the queue pair number; In the case where the sending flag bit of the data sending table entry is a valid flag bit, determining whether the current data packet sequence number of the data sending table entry is equal to the total data packet sequence number; When the current data packet sequence number of the data transmission table entry is equal to the total data packet sequence number, outputting the queue pair number, the current data packet sequence number and the operation index to the transmission engine module; In the case where the current data packet sequence number of the data transmission entry is not equal to the total data packet sequence number, determining a matching data processing mode according to the size relationship between the current data packet sequence number and the last data packet sequence number; The queue pair number, the current data packet sequence number and the operation index are output to the sending engine module, and the data sending table entry is updated according to the data processing method.
9. The data transmission method according to claim 8, It is characterized in that According to the size relationship between the current data packet sequence number and the last data packet sequence number, the matching data processing method includes: Determine whether the current data packet sequence number is equal to the last data packet sequence number; When the current data packet sequence number is equal to the last data packet sequence number, a data processing method of traversing the data packet sequence number is adopted; When the current data packet sequence number is not equal to the last data packet sequence number, a data processing method of traversing the data operation table entries is adopted.
10. The data transmission method according to claim 9, It is characterized in that Implementing the updating of the data sending table item according to the data processing method includes: Add one to the current data packet sequence number of the data transmission entry; The queue pair number is rewritten into the scheduling information storage queue, and the process returns to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table entry according to the queue pair number.
11. The data transmission method according to claim 9, It is characterized in that Implementing the updating of the data sending table item according to the data processing method includes: Reading a corresponding first data operation table entry according to the operation index; When the chain tail flag bit of the first data operation table entry is the chain tail valid flag bit, the operation is terminated; When the chain tail flag of the first data operation table entry is the chain tail invalid flag, reading the corresponding second data operation table entry according to the next pointer; Increasing the current data packet sequence number of the data transmission entry by one; Using the next pointer as the operation index of the second data operation table entry; Update the last data packet sequence number according to the maximum transmission length of the path, the starting data packet sequence number recorded in the second data operation table item, and the data length of the work queue event data; The queue pair number is rewritten into the scheduling information storage queue, and the process returns to the step of reading the queue pair number from the scheduling information storage queue when the scheduling information storage queue is not empty, and reading the data sending table entry according to the queue pair number.
12. The data transmission method according to claim 11, It is characterized in that Updating the last data packet sequence number according to the maximum transmission length of the path, the starting data packet sequence number recorded in the second data operation table entry, and the data length of the work queue event data includes: Determine the number of second data packets according to the maximum transmission length of the path and the data length of the work queue event data recorded in the second data operation table item; Determine the latest last data packet sequence number based on the number of the second data packets and the starting data packet sequence number recorded in the second data operation table entry; The last data packet sequence number in the data transmission table entry is updated to the latest last data packet sequence number.
13. The data transmission method according to claim 1, It is characterized in that Also includes: When a response data packet including a received data packet sequence number, a queue pair number and a response packet type is obtained, the data receiving table entry is read according to the queue pair number; In a case where the receiving flag bit recorded in the data receiving table entry is a valid flag bit, reading the data operation table entry according to the operation index recorded in the data receiving table entry; Determine a matching data transmission mode according to the size relationship between the received data packet sequence number and the last data packet sequence number and the response packet type; According to the data transmission mode, the queue pair number and the work queue event data recorded in the data operation table item are output to the completion queue, and the update of the data operation table item and the data reception table item is completed.
14. The data transmission method according to claim 13, It is characterized in that Determining the matching data transmission mode according to the size relationship between the received data packet sequence number and the last data packet sequence number and the response packet type includes: Determine whether the response packet type is a non-confirmation type; In the case where the response packet type is a non-confirmation type, determining whether the received data packet sequence number is less than or equal to the last data packet sequence number; When the received data packet sequence number is less than or equal to the last data packet sequence number, a retransmission data transmission mode is adopted; In the case where the received data packet sequence number is greater than the last data packet sequence number, a combined confirmation data transmission mode is adopted; When the response packet type is a confirmation type, determine whether the received data packet sequence number is less than the last data packet sequence number; when the received data packet sequence number is not less than the last data packet sequence number, adopt a direct transmission data transmission method.
15. The data transmission method according to claim 14, It is characterized in that Outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue according to the data transmission mode, and completing the update of the data operation table item and the data reception table item includes: When the data transmission mode is retransmission, reading the data transmission table entry by using the queue pair number; The received data packet sequence number is used as the current data packet sequence number of the data transmission table item; the last data packet sequence number recorded in the data reception table item is used as the last data packet sequence number of the data transmission table item, and the operation index recorded in the data reception table item is used as the operation index of the data transmission table item; The queue pair number is written into the scheduling information storage queue, and the operation is terminated.
16. The data transmission method according to claim 14, It is characterized in that Outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue according to the data transmission mode, and completing the update of the data operation table item and the data reception table item includes: When the data transmission mode is merge confirmation, the queue pair number and the work queue event data are output to the completion queue, and the data operation table entry where the work queue event data is located is released; Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag; When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail valid flag, the operation is terminated; When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; Adjusting the receiving flag bit of the data receiving table entry to a valid flag bit; Based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than or equal to the last data packet sequence number.
17. The data transmission method according to claim 14, It is characterized in that Outputting the queue pair number and the work queue event data recorded in the data operation table item to the completion queue according to the data transmission mode, and completing the update of the data operation table item and the data reception table item includes: When the data transmission mode is direct transmission, the queue pair number and the work queue event data are output to the completion queue, and the data operation table entry where the work queue event data is located is released; Determine whether the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag; When the chain tail flag of the data operation table entry where the work queue event data is located is a chain tail valid flag, adjusting the receiving flag of the data receiving table entry to an invalid flag; When the chain tail flag of the data operation table entry where the work queue event data is located is the chain tail invalid flag, read the next data operation table entry corresponding to the next pointer; based on the starting data packet sequence number recorded in the next data operation table entry and the data length of the work queue event data, update the last data packet sequence number of the data sending table entry; use the next pointer as the operation index of the next data operation table entry; and return to the step of determining whether the received data packet sequence number is less than the last data packet sequence number.
18. A data transmission device, It is characterized in that It includes a reading unit, an acquiring unit, a first updating unit, a first writing unit, a second writing unit, a second updating unit, a establishing unit and a third writing unit; The reading unit is used to read the data sending table entry of the first random access memory according to the queue pair number when the queue pair number and the work queue event data are obtained; The acquisition unit is used to acquire the new address of the current work queue event in the second random access memory from the idle pointer storage queue; The first updating unit is used to update the data sending table entry, the data operation table entry of the second random access memory, and the data receiving table entry of the third random access memory according to the data length of the work queue event data and the new address when the data sending table entry is invalid; The first writing unit is used to write the work queue event data into the data operation table entry; The second writing unit is used to write the queue pair number into the scheduling information storage queue; The second updating unit is used to update the data sending table entry and the data receiving table entry of the third random access memory according to the data length of the work queue event data and the new address when the data sending table entry is valid; The establishing unit is used to establish a new data operation table entry on the second random access memory according to the new address; The third writing unit is used to write the work queue event data into a new data operation table entry; The first updating unit includes a first sending table item updating subunit, a first operating table item updating subunit and a first receiving table item updating subunit; A first sending table entry updating subunit, used to update the data sending table entry according to the data length of the work queue event data, the maximum transmission length of the path and the new address; A first operation table item updating subunit, used to update the data operation table item according to the new address; A first receiving table entry updating subunit, used to update the data receiving table entry according to the last data packet sequence number and the new address contained in the updated data sending table entry; The second updating unit includes a sequence number determination subunit, a second sending table item updating subunit, a second receiving table item updating subunit and a third sending table item updating subunit; A sequence number determination subunit, used to determine whether the sequence number of the current data packet is equal to the sequence number of the total data packet; The second transmission table entry updating subunit is used to update the data transmission table entry according to the data length of the work queue event data, the maximum transmission length of the path and the new address when the current data packet sequence number is equal to the total data packet sequence number; The second receiving table entry updating subunit is used to update the data receiving table entry according to the receiving flag bit of the data receiving table entry, the last data packet sequence number and the new address contained in the updated data sending table entry; The third sending table entry updating subunit is used to update the data sending table entry according to the data length of the work queue event data when the current data packet sequence number is not equal to the total data packet sequence number.
19. A data transmission device, It is characterized in that include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the data transmission method according to any one of claims 1 to 17.
20. A non-volatile storage medium, It is characterized in that The non-volatile storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the data transmission method according to any one of claims 1 to 17 are implemented.
21. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the data transmission method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Data transmission system, method and device, communication equipment and storage medium
CN116226027A
RDMA (Remote Direct Memory Access) data sending queue management method and device based on hardware multithreading
CN118069387A
Method, system and storage medium for lockless infinibandtm poll for I / O completion
CN1770110A
Infiniband work and completion queue management via head and tail circular buffers with indirect work queue entries
US20030061417A1
