Tlp message scheduling method and device, data processor network card and storage medium
By adopting a multi-level scheduling method in the data processor network card, the tlp packets that are scheduling network traffic and storage traffic are balanced, and the problem of low scheduling efficiency in the existing technology is solved, achieving more efficient data processing and stability.
Patent Information
- Application Number
- CN202411721765.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, Tlp packet scheduling efficiency is low and cannot effectively handle mixed scenarios of network traffic and storage traffic.
Using the multi-level scheduling method, firstly, the net_pkt_tlp message and blk_pkt_tlp message are balanced by the target algorithm in the first-level scheduling module, and then the various tlp messages are rotated by the rotation scheduling algorithm in the second-level scheduling module to ensure the balanced scheduling of network traffic and storage traffic.
The scheduling efficiency of Tlp packets is improved, ensuring the balanced processing of network traffic and storage traffic in the data plane of the DPU network card in the data center, and improving the stability of the data processor network card and the efficiency of DMA read requests.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a TLP message scheduling method, device, data processor network card, computer-readable storage medium and computer program product. Background Art
[0002] On the data plane of the DPU (Data Processing Unit) network card in the data center, there are often scenarios where network traffic and storage traffic are mixed. In virtualized application scenarios, the implementation of the VirtIO (virtual input & output) protocol requires four DMA operations to complete the transmission of a network message or storage message, during which multiple tlp messages (Transaction Layer Packet) may be generated.
[0003] At present, the more common practice is to directly use the RR algorithm (Round-Robin Scheduling Algorithm) to schedule multiple TLP messages.
[0004] However, the current method of scheduling multiple TLP messages using the RR algorithm has the problem of low message scheduling efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a TLP message scheduling method, device, data processor network card, computer-readable storage medium and computer program product that can improve the TLP message scheduling efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides a TLP message scheduling method, which is applied to a data processor network card, comprising:
[0007] Get multiple tlp messages; multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0008] Input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, perform balanced scheduling through the target algorithm in the first-level scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0009] The scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module preset in the data processor network card, and are round-robin scheduled by the round-robin scheduling algorithm preset in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0010] In one embodiment, balanced scheduling is performed by a target algorithm in a first-level scheduling module to obtain scheduled net_pkt_tlp messages and blk_pkt_tlp messages, including:
[0011] According to the message length of the net_pkt_tlp message and the message length of the blk_pkt_tlp message, the network traffic of the net_pkt_tlp message and the blk_pkt_tlp message is balanced and scheduled through the target algorithm in the first-level scheduling module, and the storage traffic of the net_pkt_tlp message and the blk_pkt_tlp message is balanced and scheduled to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message.
[0012] In one embodiment, the first-level scheduling module includes a mode register and a state machine, and different modes of the mode register correspond to different candidate algorithms; the candidate algorithms include a round-robin scheduling algorithm, a weighted round-robin scheduling algorithm, and a deficit weighted polling algorithm;
[0013] Balanced scheduling is performed through the target algorithm in the first-level scheduling module, including:
[0014] The current mode of the mode register is determined according to the current application scenario information, the candidate algorithm corresponding to the current mode is determined as the target algorithm, and the state machine performs balanced scheduling according to the target algorithm.
[0015] In one embodiment, the net_pkt_tlp message and the blk_pkt_tlp message are input into a first-level scheduling module pre-set in the data processor network card, including:
[0016] According to the preset filtering conditions, the net_pkt_tlp message and the blk_pkt_tlp message are filtered to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message;
[0017] The filtered net_pkt_tlp message and blk_pkt_tlp message are input into a first-level scheduling module pre-set in the data processor network card.
[0018] In an exemplary embodiment, according to a preset filtering condition, the net_pkt_tlp message and the blk_pkt_tlp message are filtered to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message, including:
[0019] Remove the pkt_tlp messages whose requested memory addresses are illegal, the pkt_tlp messages that lack sop and eop, and the pkt_tlp messages whose actual message lengths are inconsistent with the set message lengths contained in the net_pkt_tlp messages and the blk_pkt_tlp messages, and obtain the filtered net_pkt_tlp messages and blk_pkt_tlp messages.
[0020] In one embodiment, the scheduling order of each TLP message is obtained by performing round-robin scheduling through the round-robin scheduling algorithm preset in the secondary scheduling module, including:
[0021] Through the round-robin scheduling algorithm pre-set in the secondary scheduling module, the current TLP message queue is traversed and scheduled to obtain the scheduling feedback information of the TLP message. The original scheduling order of the TLP message is adjusted according to the scheduling feedback information until a scheduling balance is achieved between various TLP messages, and the scheduling order of various TLP messages is obtained.
[0022] In a second aspect, the present application also provides a TLP message scheduling device, which is applied to a data processor network card, including:
[0023] A message acquisition module is used to acquire multiple tlp messages; the multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0024] The first-level scheduling module is used to input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, and perform balanced scheduling through the target algorithm in the first-level scheduling module to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0025] The secondary scheduling module is used to input the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message into the secondary scheduling module pre-set in the data processor network card, and perform round-robin scheduling through the round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0026] In a third aspect, the present application further provides a data processor network card, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0027] Get multiple tlp messages; multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0028] Input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, perform balanced scheduling through the target algorithm in the first-level scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0029] The scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module preset in the data processor network card, and are round-robin scheduled by the round-robin scheduling algorithm preset in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0031] Get multiple tlp messages; multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0032] Input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, perform balanced scheduling through the target algorithm in the first-level scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0033] The scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module preset in the data processor network card, and are round-robin scheduled by the round-robin scheduling algorithm preset in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0034] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0035] Get multiple tlp messages; multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0036] Input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, perform balanced scheduling through the target algorithm in the first-level scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0037] The scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module preset in the data processor network card, and are round-robin scheduled by the round-robin scheduling algorithm preset in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0038] The above-mentioned tlp message scheduling method, device, data processor network card, computer-readable storage medium and computer program product respectively obtain index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message, input the net_pkt_tlp message and blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, and use the target algorithm in the first-level scheduling target to schedule the first-level scheduling target. Balanced scheduling is performed to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message, and then the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module pre-set in the data processor network card, and the round-robin scheduling algorithm pre-set in the secondary scheduling module is used for round-robin scheduling to obtain the scheduling order of various tlp messages. By setting up multi-level message scheduling, the first-level scheduling ensures the balanced scheduling of storage traffic and network traffic, the second-level scheduling ensures the balanced scheduling of various tlp messages, and the single-layer processes a single scheduling task, thereby improving the scheduling efficiency of tlp messages. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] FIG1 is an application environment diagram of a TLP message scheduling method in one embodiment;
[0041] FIG2 is a schematic diagram of a flow chart of a TLP scheduling method in one embodiment;
[0042] FIG3 is a diagram of an overall scheduling architecture in one embodiment;
[0043] FIG4 is a block diagram of a scheduling module in another embodiment;
[0044] FIG5 is a schematic diagram of a process of filtering TLP messages in one embodiment;
[0045] Figure 6 It is a structural block diagram of a TLP message scheduling device in one embodiment;
[0046] FIG. 7 is a diagram showing the internal structure of a data processor network card in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The tlp message scheduling method provided in the embodiment of the present application can be applied in the application environment as shown in Figure 1. Among them, the external device / controller 102 communicates with the data processor network card 104 through the I / O bus, and the data processor network card is provided with a primary scheduling module and a secondary scheduling module, wherein the primary scheduling module is integrated with a mode register containing a plurality of candidate algorithms, and a state machine for executing the algorithm, and the secondary scheduling module is also integrated with a state machine for executing the algorithm. The data processor network card is also integrated with a FIFO queue for storing tlp messages, and the tlp messages in the FIFO queue are balanced in scheduling storage traffic and network traffic according to the scheduling order.
[0049] The data processor network card 104 obtains the index_tlp message, the ring_tlp message, the net_desc_tlp message, the blk_desc_tlp message, the net_pkt_tlp message, and the blk_pkt_tlp message, and then inputs the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card 104, and performs balanced scheduling through the target algorithm in the first-level scheduling module to obtain the scheduled net_ pkt_tlp message and blk_pkt_tlp message, and finally the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module pre-set in the data processor network card 104, and the round-robin scheduling algorithm pre-set in the secondary scheduling module is used for round-robin scheduling to obtain the scheduling order of the various tlp messages.
[0050] The external device / controller 102 may be a terminal, not limited to various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The external device / controller 102 may also be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0051] In an exemplary embodiment, as shown in FIG2 , a TLP message scheduling method is provided, which is described by taking the method applied to the data processor network card 104 in FIG1 as an example, and includes the following steps S201 to S203. Among them:
[0052] Step S201, obtaining multiple tlp messages; the multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message.
[0053] Among them, the tlp (Transaction Layer Packet) message can be understood as a data transmission format in the PCIExpress (PCIe) protocol, which is used to transmit data between devices, the index_tlp message can be understood as the TLP for obtaining index information, the ring_tlp message can be understood as the TLP for obtaining ring information, the net_desc_tlp message can be understood as the TLP for obtaining network message descriptors, the blk_desc_tlp message can be understood as the TLP for obtaining storage message descriptors, the net_pkt_tlp message can be understood as the TLP for obtaining network messages, and the blk_pkt_tlp message can be understood as the TLP for obtaining storage messages. All of the above messages belong to the non-posted type TLP generated by the DMA (Direct Memory Access) part.
[0054] For example, the data processor network card 104 communicates with the external device / controller 102, and obtains the index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message, and blk_pkt_tlp message, which are non-posted TLPs generated during the communication process. By obtaining a large number of tlp messages, a data foundation is laid for the subsequent scheduling of the same tlp message.
[0055] Step S202, input the net_pkt_tlp message and the blk_pkt_tlp message into a primary scheduling module pre-set in the data processor network card, perform balanced scheduling through the target algorithm in the primary scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message.
[0056] Optionally, the data processor network card 104 inputs the net_pkt_tlp message and the blk_pkt_tlp message into a pre-set first-level scheduling module, and performs balanced scheduling of the net_pkt_tlp message and the blk_pkt_tlp message and the network traffic and the storage traffic through the target algorithm in the first-level scheduling module to obtain the scheduled net_pkt_tlp message and the blk_pkt_tlp message, wherein the target algorithm is determined on-site according to the current application scenario of the network card. By selecting the most suitable target algorithm online according to different application scenarios, the balance of network traffic and storage traffic in various application scenarios is ensured.
[0057] Step S203, the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into the secondary scheduling module preset in the data processor network card, and round-robin scheduling is performed through the round-robin scheduling algorithm preset in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0058] Among them, the Round-Robin Scheduling Algorithm (RR algorithm) can be understood as a fair allocation of resources, so that each task can get a certain time slice in the cycle, and each task is allocated a fixed length of time slice (time period). When the time slice of a task is used up, the scheduler suspends the task and allocates CPU resources to the next task.
[0059] Optionally, the data processor network card 104 inputs the net_pkt_tlp message and the blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message after the processing into a pre-set secondary scheduling module, and performs round-robin scheduling on the above tlp messages through the pre-set round-robin scheduling algorithm in the secondary scheduling module, and adjusts the order of the tlp queue according to the result of the round-robin scheduling to obtain the scheduling order of various tlp messages. By performing round-robin scheduling on various tlp messages of non-posted type and adjusting the optimal processing order, the balanced scheduling of non-posted bus transactions is ensured, the stability of the data processor network card is improved, and the efficiency of DMA read requests is improved.
[0060] In the above tlp message scheduling method, index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message are obtained respectively, and the net_pkt_tlp message and blk_pkt_tlp message are input into the first-level scheduling module pre-set in the data processor network card, and balanced scheduling is performed through the target algorithm in the first-level scheduling target to obtain the scheduled n et_pkt_tlp message and blk_pkt_tlp message, and then the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message are input into the secondary scheduling module pre-set in the data processor network card, and the round-robin scheduling algorithm pre-set in the secondary scheduling module is used for round-robin scheduling to obtain the scheduling order of various tlp messages. By setting up multi-level message scheduling, the first-level scheduling ensures the balanced scheduling of storage traffic and network traffic, the second-level scheduling ensures the balanced scheduling of various tlp messages, and the single-layer processes a single scheduling task, thereby improving the scheduling efficiency of tlp messages.
[0061] In one embodiment, balanced scheduling is performed by a target algorithm in a first-level scheduling module to obtain scheduled net_pkt_tlp messages and blk_pkt_tlp messages, including: according to the message length of the net_pkt_tlp message and the message length of the blk_pkt_tlp message, the network traffic of the net_pkt_tlp message and the blk_pkt_tlp message are balanced scheduled by the target algorithm in the first-level scheduling module, and the storage traffic of the net_pkt_tlp message and the blk_pkt_tlp message are balanced scheduled to obtain the scheduled net_pkt_tlp message and the blk_pkt_tlp message.
[0062] For example, the data processor network card 104 calculates the corresponding message lengths of the net_pkt_tlp message and the message lengths of the blk_pkt_tlp message using the target algorithm in the first-level scheduling module, and the network traffic and storage traffic that should be allocated to each, and obtains the scheduled net_pkt_tlp message and blk_pkt_tlp message. By using the target algorithm and the message length, the network traffic and storage traffic allocated to the net_pkt_tlp message, the network traffic and storage traffic of the first-level blk_pkt_tlp message are calculated respectively, and the balance of the balanced scheduling of the network traffic and storage traffic is achieved, and the internal stability of the data processor network card is ensured.
[0063] In one embodiment, the first-level scheduling module includes a mode register and a state machine, and different modes of the mode register correspond to different candidate algorithms; the candidate algorithms include a round-robin scheduling algorithm, a weighted round-robin scheduling algorithm, and a deficit weighted polling algorithm;
[0064] Balanced scheduling is performed through the target algorithm in the first-level scheduling module, including: determining the current mode of the mode register according to the current application scenario information, determining the candidate algorithm corresponding to the current mode as the target algorithm, and executing balanced scheduling according to the target algorithm by the state machine.
[0065] Among them, the mode register can be understood as a component that stores candidate algorithms. One mode corresponds to one candidate algorithm. The state machine can be understood as a mathematical model for executing the target algorithm, which is used to calculate the resources that should be allocated to each TLP message under the target algorithm. The weighted round-robin scheduling algorithm (Weighted Round Robin, WRR algorithm) can be understood as allocating different resources and scheduling times to tasks of different priorities. The deficit weighted round-robin algorithm (Deficit Weighted Round Robin, DWRR algorithm) can be understood as each traffic flow or task is assigned a weight. The weight determines the priority and time allocation of the task in scheduling, and maintains a "deficit" value to adjust the scheduling order and scheduling duration of the task.
[0066] Optionally, the data processor network card 104 determines the current mode of the mode register according to the current application scenario information, determines the candidate algorithm corresponding to the current mode as the target algorithm, and the state machine reads the currently determined target algorithm from the mode register, and performs balanced scheduling according to the target algorithm. The target algorithm used in the first-level scheduling module is selected online through the current application scenario information, which ensures the adaptability of the target algorithm to the current application scenario, thereby ensuring balanced scheduling of network traffic and storage traffic in various scenarios.
[0067] In an exemplary embodiment, the net_pkt_tlp message and the blk_pkt_tlp message are input into a first-level scheduling module preset in a data processor network card, including: filtering the net_pkt_tlp message and the blk_pkt_tlp message according to a preset filtering condition to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message; and inputting the filtered net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module preset in the data processor network card.
[0068] For example, the data processor network card filters and cleans the net_pkt_tlp message and the blk_pkt_tlp message according to the preset filtering conditions, removes the abnormal TLP message, obtains the filtered net_pkt_tlp message and the blk_pkt_tlp message, and finally inputs the filtered net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card. By pre-filtering the net_pkt_tlp message and the blk_pkt_tlp message, the validity and availability of the TLP message are guaranteed, thereby improving the balance of the balanced scheduling.
[0069] In one embodiment, according to a preset filtering condition, the net_pkt_tlp message and the blk_pkt_tlp message are filtered to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message, including: removing the pkt_tlp message whose requested memory address is illegal, the pkt_tlp message missing sop and eop, and the pkt_tlp message whose actual message length is inconsistent with the set message length contained in the net_pkt_tlp message and the blk_pkt_tlp message, to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message.
[0070] Among them, sop (start of packet) can be understood as the start flag of the tlp message. Similarly, eop (end of packet) can be understood as the end flag of the tlp message.
[0071] Optionally, the data processor network card 104 removes pkt_tlp messages whose requested memory addresses are illegal, pkt_tlp messages with missing start flags and end flags, and pkt_tlp messages whose actual message lengths are inconsistent with set message lengths, contained in the net_pkt_tlp messages and blk_pkt_tlp messages, to obtain filtered net_pkt_tlp messages and blk_pkt_tlp messages.
[0072] By removing the above abnormal TLP messages, the following technical effects are achieved:
[0073] 1. By removing pkt_tlp messages with illegal requested memory addresses, the network card ensures that only legal and valid messages are processed. This significantly reduces the number of error handling and retransmissions, and improves the effectiveness of data transmission.
[0074] 2. In network communications, the start and end flags are crucial to ensure the integrity of the message. Removing messages that are missing these flags can prevent data parsing errors and ensure that the receiver can correctly understand the structure and content of the data packet.
[0075] 3. Filtering messages whose actual message length is inconsistent with the set message length helps the system avoid processing incomplete or erroneously transmitted data, enhancing the robustness of the system. This can reduce system crashes or abnormal behaviors caused by format errors and improve overall stability.
[0076] 4. By filtering out the above illegal or malformed messages, bandwidth occupancy can be reduced, bandwidth utilization can be improved, and processing burden can be reduced.
[0077] In one of the embodiments, a round-robin scheduling algorithm pre-set in the secondary scheduling module is used to perform round-robin scheduling to obtain a scheduling order for each TLP message, including: using the round-robin scheduling algorithm pre-set in the secondary scheduling module, traversing and scheduling the current TLP message queue to obtain scheduling feedback information of the TLP message, adjusting the original scheduling order of the TLP message according to the scheduling feedback information until a scheduling balance is reached between various TLP messages, and obtaining the scheduling order of various TLP messages.
[0078] The scheduling feedback information refers to the response feedback generated when the TLP message is scheduled in the current scheduling order.
[0079] For example, the data processor network card 104 uses the round-robin scheduling algorithm pre-set in the secondary scheduling module to traverse and schedule the tlp messages in the tlp message queue in the FIFO in order, obtain the scheduling response feedback information of each tlp message, adjust the original scheduling order of the tlp message according to the scheduling response feedback information, and traverse the adjusted tlp message queue, repeatedly adjust the scheduling order of various tlp messages, until the various tlp messages reach a scheduling balance, and obtain the scheduling order of various tlp messages. The data processor network card 104 uses the round-robin scheduling algorithm in the secondary scheduling module to dynamically traverse and adjust the tlp messages in the FIFO, which significantly improves the balance and fairness of the scheduling.
[0080] In an exemplary embodiment, a specific implementation of a TLP message scheduling method is provided, wherein:
[0081] TLP: Transaction Layer Packet
[0082] DMA: Direct Memory Access
[0083] DPU: Data Processing Unit
[0084] : Round-Robin Scheduling Algorithm
[0085] WRR algorithm: Weighted Round Robin
[0086] DWRR algorithm: Algorithm (Deficit Weighted Round Robin)
[0087] FPGA: Field Programmable Gate Array
[0088] VirtIO: virtual input & output
[0089] sop: start of packet
[0090] eop: end of packet
[0091] The device implementation scheme is shown in Figure 3. There are 6 types of non-posted TLPs that need to be generated by the DMA part, namely, TLP for obtaining index information (index_tlp), TLP for obtaining ring information (ring_tlp), TLP for obtaining network message descriptors (net_desc_tlp), TLP for obtaining storage message descriptors (blk_desc_tlp), TLP for obtaining network messages (net_pkt_tlp), and TLP for obtaining storage messages (blk_pkt_tlp). Among them, the TLP for obtaining network messages (net_pkt_tlp) and the TLP for obtaining storage messages (blk_pkt_tlp) are output after a first-level scheduling. The scheduling algorithms used in this level of scheduling are RR algorithm, WRR algorithm, and DWRR algorithm, and the three algorithms can be selected online through the mode register. The output of the first-level scheduling is output after a first-level RR scheduling with the other four TLPs.
[0092] In the implementation of the specific solution, a simple and easy-to-adjust implementation method was selected in combination with the characteristics of FPGA. As shown in Figure 4. In the read_pkt_req_mux module (first-level scheduling module), the TLP (net_pkt_tlp) of the network message and the TLP (blk_pkt_tlp) of the storage message are pre-cached in the FIFO, and the state machine is used to complete the selection and function of the RR algorithm, WRR algorithm, and DWRR algorithm. In the mux_non_posted module, the TLP (index_tlp) of the index information, the TLP (ring_tlp) of the ring information, the TLP (net_desc_tlp) of the network message descriptor, the TLP (blk_desc_tlp) of the storage message descriptor, and the TLP of the message are obtained. After entering the module, they are first cached in the FIFO respectively, and the state machine is used to complete the scheduling of the RR algorithm and output.
[0093] The specific process of the first-level scheduling is shown in Figure 5. First, basic error checks are performed on the TLP (net_pkt_tlp) for obtaining network messages and the TLP (blk_pkt_tlp) for obtaining storage messages. Filter out abnormalities such as abnormal DMA addresses, abnormal sop and eop flags of data (sop missing, eop missing), and abnormal length of read request messages. The filtered normal non-posted TLPs are cached in the FIFOs respectively. The two types of non-posted TLPs are evenly scheduled according to the currently configured scheduling algorithm.
[0094] After completing the previous level scheduling, the non-posted TLP of the application message is polled and scheduled with other non-posted TLPs.
[0095] Compared with the prior art, this application has the following advantages:
[0096] (1) Multi-level scheduling of various non-posted TLP types in DMA. It can ensure balanced scheduling of storage traffic, network traffic and other non-posted bus transactions.
[0097] (2) It can select the TLP scheduling algorithm online according to different application scenarios, thereby ensuring the balance of network traffic and storage traffic of the DPU network card in various application scenarios.
[0098] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0099] Based on the same inventive concept, the embodiment of the present application also provides a TLP message scheduling device for implementing the TLP message scheduling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more TLP message scheduling device embodiments provided below can refer to the limitations of the TLP message scheduling method above, and will not be repeated here.
[0100] In an exemplary embodiment, Figure 6 As shown, a TLP message scheduling device is provided, including: a message acquisition module 601, a primary scheduling module 602 and a secondary scheduling module 603, wherein:
[0101] The message acquisition module 601 is used to acquire multiple tlp messages; the multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message;
[0102] The first-level scheduling module 602 is used to input the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, and perform balanced scheduling through the target algorithm in the first-level scheduling module to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message;
[0103] The secondary scheduling module 603 is used to input the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message into the secondary scheduling module pre-set in the data processor network card, and perform round-robin scheduling through the round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain the scheduling order of various tlp messages.
[0104] In one embodiment, the first-level scheduling module 602 is further used to perform balanced scheduling of network traffic of the net_pkt_tlp message and the blk_pkt_tlp message according to the message length of the net_pkt_tlp message and the message length of the blk_pkt_tlp message through the target algorithm in the first-level scheduling module, and to perform balanced scheduling of storage traffic of the net_pkt_tlp message and the blk_pkt_tlp message to obtain the scheduled net_pkt_tlp message and the blk_pkt_tlp message.
[0105] In one embodiment, the first-level scheduling module includes a mode register and a state machine, and different modes of the mode register correspond to different candidate algorithms; the candidate algorithms include a round-robin scheduling algorithm, a weighted circular scheduling algorithm, and a difference weighted polling algorithm. The first-level scheduling module 602 also includes a target algorithm determination submodule, which is used to determine the current mode of the mode register according to the current application scenario information, determine the candidate algorithm corresponding to the current mode as the target algorithm, and the state machine performs balanced scheduling according to the target algorithm.
[0106] In an exemplary embodiment, the first-level scheduling module 602 further includes a message filtering submodule and a message input module, wherein:
[0107] The message filtering submodule is used to filter the net_pkt_tlp message and the blk_pkt_tlp message according to the preset filtering condition to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message.
[0108] The message input submodule is used to input the filtered net_pkt_tlp message and blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card.
[0109] In one embodiment, the message filtering submodule is also used to remove the pkt_tlp messages whose requested memory addresses are illegal, the pkt_tlp messages missing sop and eop, and the pkt_tlp messages whose actual message lengths are inconsistent with the set message lengths contained in the net_pkt_tlp messages and blk_pkt_tlp messages, so as to obtain the filtered net_pkt_tlp messages and blk_pkt_tlp messages.
[0110] In one of the embodiments, the secondary scheduling module 603 is also used to traverse and schedule the current TLP message queue through the round-robin scheduling algorithm pre-set in the secondary scheduling module, obtain the scheduling feedback information of the TLP message, and adjust the original scheduling order of the TLP message according to the scheduling feedback information until a scheduling balance is reached between various TLP messages, thereby obtaining the scheduling order of various TLP messages.
[0111] Each module in the above-mentioned TLP message dispatching device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the data processor network card in the form of hardware, or can be stored in the memory in the data processor network card in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0112] In an exemplary embodiment, a data processor network card is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The data processor network card includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the data processor network card is used to provide computing and control capabilities. The memory of the data processor network card includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the data processor network card is used to store index_tlp messages, ring_tlp messages, net_desc_tlp messages, blk_desc_tlp messages, net_pkt_tlp messages, blk_pkt_tlp messages and algorithm data. The input / output interface of the data processor network card is used to exchange information between the processor and external devices. The communication interface of the data processor network card is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a TLP message scheduling method is implemented.
[0113] Those skilled in the art will appreciate that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the data processor network card to which the solution of the present application is applied. A specific data processor network card may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] In an exemplary embodiment, a data processor network card is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the TLP message scheduling method in the above embodiment when executing the computer program.
[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the TLP message scheduling method in the above embodiment is implemented.
[0116] In one embodiment, a computer program product is provided, including a computer program, which implements the TLP message scheduling method in the above embodiment when executed by a processor.
[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0118] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0119] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0120] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A TLP message scheduling method, characterized in that: Applied to a data processor network card, the method comprises: Acquire multiple tlp messages; the multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message; Input the net_pkt_tlp message and the blk_pkt_tlp message into a primary scheduling module pre-set in the data processor network card, perform balanced scheduling through a target algorithm in the primary scheduling module, and obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message; The scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message are input into a secondary scheduling module pre-set in the data processor network card, and round-robin scheduling is performed through a round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain a scheduling order of various tlp messages.
2. The method according to claim 1, characterized in that The balanced scheduling is performed by the target algorithm in the first-level scheduling module to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message, including: According to the message length of the net_pkt_tlp message and the message length of the blk_pkt_tlp message, the network traffic of the net_pkt_tlp message and the blk_pkt_tlp message are balanced and scheduled through the target algorithm in the first-level scheduling module, and the storage traffic of the net_pkt_tlp message and the blk_pkt_tlp message are balanced and scheduled to obtain the scheduled net_pkt_tlp message and blk_pkt_tlp message.
3. The method according to any one of claims 1 to 2, characterized in that: The first-level scheduling module includes a mode register and a state machine, and different modes of the mode register correspond to different candidate algorithms; the candidate algorithms include a round-robin scheduling algorithm, a weighted cyclic scheduling algorithm, and a difference weighted polling algorithm; The balanced scheduling is performed by the target algorithm in the first-level scheduling module, including: The current mode of the mode register is determined according to the current application scenario information, the candidate algorithm corresponding to the current mode is determined as the target algorithm, and the state machine performs balanced scheduling according to the target algorithm.
4. The method according to claim 1, characterized in that The step of inputting the net_pkt_tlp message and the blk_pkt_tlp message into a first-level scheduling module pre-set in the data processor network card includes: According to the preset filtering condition, the net_pkt_tlp message and the blk_pkt_tlp message are filtered to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message; The filtered net_pkt_tlp message and blk_pkt_tlp message are input into a primary scheduling module pre-set in the data processor network card.
5. The method according to claim 4, characterized in that The filtering of the net_pkt_tlp message and the blk_pkt_tlp message according to the preset filtering condition to obtain the filtered net_pkt_tlp message and the blk_pkt_tlp message includes: Remove the pkt_tlp message whose requested memory address is illegal, the pkt_tlp message missing sop and eop, and the pkt_tlp message whose actual message length is inconsistent with the set message length contained in the net_pkt_tlp message and the blk_pkt_tlp message to obtain filtered net_pkt_tlp message and blk_pkt_tlp message.
6. The method according to claim 1, characterized in that The round-robin scheduling algorithm pre-set in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of each of the TLP messages, including: Through the round-robin scheduling algorithm pre-set in the secondary scheduling module, the current TLP message queue is traversed and scheduled to obtain the scheduling feedback information of the TLP message, and the original scheduling order of the TLP message is adjusted according to the scheduling feedback information until a scheduling balance is achieved between the various TLP messages, and the scheduling order of the various TLP messages is obtained.
7. A TLP message scheduling device, characterized in that: Applied to a data processor network card, the device comprises: A message acquisition module, used to acquire multiple tlp messages; the multiple tlp messages include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message and blk_pkt_tlp message; A first-level scheduling module, used for inputting the net_pkt_tlp message and the blk_pkt_tlp message into the first-level scheduling module pre-set in the data processor network card, performing balanced scheduling through the target algorithm in the first-level scheduling module, and obtaining the scheduled net_pkt_tlp message and blk_pkt_tlp message; The secondary scheduling module is used to input the scheduled net_pkt_tlp message and blk_pkt_tlp message, index_tlp message, ring_tlp message, net_desc_tlp message, and blk_desc_tlp message into the secondary scheduling module pre-set in the data processor network card, and perform round-robin scheduling through the round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain the scheduling order of various tlp messages.
8. A data processor network card, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Integrated message flow searching and updating method
CN105337991A
QoS processing and control method and network interface controller
CN110581776A
Adaptive address translation caches
CN113454610A
TSN message scheduling method, switch, equipment and storage medium
CN115086245A
Data transmission method and device, equipment and storage medium
CN115514682A