TLP packet scheduling method and device, data processor network card and storage medium
By employing a multi-level scheduling method to balance and round-robin schedule TLP packets of the data processor network card, the problem of low scheduling efficiency in existing technologies is solved, achieving balanced scheduling of network and storage traffic, and improving the stability of the data processor network card and the efficiency of DMA read requests.
Patent Information
- Application Number
- CN202411721765.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Existing TLP packet scheduling methods suffer from low scheduling efficiency, especially in scenarios where network traffic and storage traffic are mixed in the data plane of the DPU network card in the data center. Traditional RR algorithms cannot effectively schedule various types of TLP packets.
A multi-level scheduling method is adopted. First, the net_pkt_tlp and blk_pkt_tlp packets are balanced and scheduled through the first-level scheduling module, using one of the round-robin scheduling algorithm, weighted round-robin scheduling algorithm, or differential weighted round-robin algorithm. Then, the second-level scheduling module performs round-robin scheduling on all TLP packets to ensure the balance of network and storage traffic.
It improves the scheduling efficiency of TLP packets, ensures balanced scheduling of network and storage traffic in different application scenarios, and enhances the stability of the data processor network card and the efficiency of DMA read requests.
Smart Images

Figure CN119520428B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a TLP message scheduling method, apparatus, data processor network card, computer-readable storage medium, and computer program product. Background Technology
[0002] In the data plane of the network interface card (NIC) of the Data Processing Unit (DPU) in the data center, there are often scenarios where network traffic and storage traffic are mixed. In virtualization application scenarios, implementing the Virtual Input & Output (VIO) protocol requires four DMA operations to complete the transmission of a single network packet or storage packet, during which various TLP packets (Transaction Layer Packets) may be generated.
[0003] Currently, the most common approach is to directly use the RR algorithm (Round-Robin Scheduling Algorithm) to schedule various TLP packets.
[0004] However, current methods that use the RR algorithm to schedule various TLP packets suffer from low packet scheduling efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a TLP packet scheduling method, apparatus, data processor network card, computer-readable storage medium, and computer program product that can improve the efficiency of TLP packet scheduling in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a TLP packet scheduling method applied to a data processor network interface card, including:
[0007] Retrieves various TLP messages; these include: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for retrieving index information, the ring_tlp message is a TLP for retrieving ring buffer information, the net_desc_tlp message is a TLP for retrieving network packet descriptors, the blk_desc_tlp message is a TLP for retrieving storage packet descriptors, the net_pkt_tlp message is a TLP for retrieving network packets, and the blk_pkt_tlp message is a TLP for retrieving storage packets. Each TLP is a non-published type TLP generated by the direct memory access part.
[0008] The net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's network card. The first-level scheduling module performs balanced scheduling using the target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0009] The scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets are input into the pre-configured secondary scheduling module in the data processor's network card. The pre-configured round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of various TLP packets.
[0010] In one embodiment, balanced scheduling is performed using the target algorithm in the first-level scheduling module to obtain scheduled net_pkt_tlp packets and blk_pkt_tlp packets, including:
[0011] Based on the packet lengths of net_pkt_tlp and blk_pkt_tlp packets, the target algorithm in the first-level scheduling module performs balanced scheduling of network traffic and storage traffic of net_pkt_tlp and blk_pkt_tlp packets, resulting in the scheduled net_pkt_tlp and blk_pkt_tlp packets.
[0012] In one embodiment, the first-level scheduling module includes a mode register and a state machine. Different modes of the mode register correspond to different candidate algorithms. The candidate algorithms include round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0013] Balanced scheduling is performed using the target algorithm in the first-level scheduling module, including:
[0014] The current mode of the mode register is determined based on 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 and blk_pkt_tlp packets are input into a pre-configured first-level scheduling module in the data processor's network interface card, including:
[0016] According to the preset filtering conditions, the net_pkt_tlp and blk_pkt_tlp packets are filtered to obtain the filtered net_pkt_tlp and blk_pkt_tlp packets;
[0017] The filtered net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's network card.
[0018] In an exemplary embodiment, net_pkt_tlp packets and blk_pkt_tlp packets are filtered according to preset filtering conditions to obtain filtered net_pkt_tlp packets and blk_pkt_tlp packets, including:
[0019] Remove pkt_tlp messages from net_pkt_tlp messages and blk_pkt_tlp messages that request invalid memory addresses, pkt_tlp messages missing SOP and EOP, or pkt_tlp messages whose actual message length does not match the set message length, to obtain filtered net_pkt_tlp messages and blk_pkt_tlp messages.
[0020] In one embodiment, round-robin scheduling is performed using a pre-set round-robin scheduling algorithm in the secondary scheduling module to obtain the scheduling order of each TLP packet, including:
[0021] The pre-set round-robin scheduling algorithm in the secondary scheduling module traverses the current TLP message queue to obtain the scheduling feedback information of the TLP messages. Based on the scheduling feedback information, the original scheduling order of the TLP messages is adjusted until scheduling balance is achieved among various TLP messages, thus obtaining the scheduling order of various TLP messages.
[0022] Secondly, this application also provides a TLP packet scheduling device, applied to a data processor network interface card, comprising:
[0023] The message acquisition module is used to acquire various TLP messages, including: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for acquiring index information, the ring_tlp message is a TLP for acquiring ring buffer information, the net_desc_tlp message is a TLP for acquiring network packet descriptors, the blk_desc_tlp message is a TLP for acquiring storage packet descriptors, the net_pkt_tlp message is a TLP for acquiring network packets, and the blk_pkt_tlp message is a TLP for acquiring storage packets. Each TLP is a non-publishing type TLP generated by the direct memory access section.
[0024] The first-level scheduling module is used to input net_pkt_tlp and blk_pkt_tlp packets into the pre-configured first-level scheduling module in the data processor's network card. The first-level scheduling module performs balanced scheduling using the target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0025] The secondary scheduling module is used to input the scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets into the pre-configured secondary scheduling module in the data processor's network card. The secondary scheduling module then performs round-robin scheduling using a pre-configured round-robin scheduling algorithm to obtain the scheduling order of various TLP packets.
[0026] Thirdly, this application also provides a data processor network card, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0027] Retrieves various TLP messages; these include: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for retrieving index information, the ring_tlp message is a TLP for retrieving ring buffer information, the net_desc_tlp message is a TLP for retrieving network packet descriptors, the blk_desc_tlp message is a TLP for retrieving storage packet descriptors, the net_pkt_tlp message is a TLP for retrieving network packets, and the blk_pkt_tlp message is a TLP for retrieving storage packets. Each TLP is a non-published type TLP generated by the direct memory access part.
[0028] The net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's network card. The first-level scheduling module performs balanced scheduling using the target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0029] The scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets are input into the pre-configured secondary scheduling module in the data processor's network card. The pre-configured round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of various TLP packets.
[0030] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0031] Retrieves various TLP messages; these include: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for retrieving index information, the ring_tlp message is a TLP for retrieving ring buffer information, the net_desc_tlp message is a TLP for retrieving network packet descriptors, the blk_desc_tlp message is a TLP for retrieving storage packet descriptors, the net_pkt_tlp message is a TLP for retrieving network packets, and the blk_pkt_tlp message is a TLP for retrieving storage packets. Each TLP is a non-published type TLP generated by the direct memory access part.
[0032] The net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's network card. The first-level scheduling module performs balanced scheduling using the target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0033] The scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets are input into the pre-configured secondary scheduling module in the data processor's network card. The pre-configured round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of various TLP packets.
[0034] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0035] Retrieves various TLP messages; these include: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for retrieving index information, the ring_tlp message is a TLP for retrieving ring buffer information, the net_desc_tlp message is a TLP for retrieving network packet descriptors, the blk_desc_tlp message is a TLP for retrieving storage packet descriptors, the net_pkt_tlp message is a TLP for retrieving network packets, and the blk_pkt_tlp message is a TLP for retrieving storage packets. Each TLP is a non-published type TLP generated by the direct memory access part.
[0036] The net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's network card. The first-level scheduling module performs balanced scheduling using the target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0037] The scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets are input into the pre-configured secondary scheduling module in the data processor's network card. The pre-configured round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of various TLP packets.
[0038] The aforementioned TLP packet scheduling method, apparatus, data processor network interface card (NIC), computer-readable storage medium, and computer program product acquire index_tlp packets, ring_tlp packets, net_desc_tlp packets, blk_desc_tlp packets, net_pkt_tlp packets, and blk_pkt_tlp packets, respectively. The net_pkt_tlp packets and blk_pkt_tlp packets are then input into a pre-configured first-level scheduling module in the data processor NIC, and the target algorithm in the first-level scheduling target is applied. Balanced scheduling is performed to obtain scheduled net_pkt_tlp and blk_pkt_tlp packets. These, along with index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets, are then input into a pre-configured secondary scheduling module in the data processor's network interface card. The secondary module uses a pre-configured round-robin scheduling algorithm to determine the scheduling order of various TLP packets. By setting up multi-level packet scheduling, the primary scheduling level ensures balanced scheduling of storage and network traffic, while the secondary scheduling level ensures balanced scheduling of various TLP packets. Each layer handles a single scheduling task, thereby improving the scheduling efficiency of TLP packets. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a diagram illustrating the application environment of the TLP message scheduling method in one embodiment.
[0041] Figure 2 This is a flowchart illustrating the TLP scheduling method in one embodiment;
[0042] Figure 3 Here is a diagram of the overall scheduling architecture in one embodiment;
[0043] Figure 4 Here is a block diagram of the scheduling module in another embodiment;
[0044] Figure 5 This is a flowchart illustrating the process of filtering TLP packets in one embodiment;
[0045] Figure 6 This is a structural block diagram of a TLP message scheduling device in one embodiment;
[0046] Figure 7 This is an internal structure diagram of the data processor network card in one embodiment. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0048] The TLP message scheduling method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the external device / controller 102 communicates with the data processor network card 104 via an I / O bus. The data processor network card is equipped with a primary scheduling module and a secondary scheduling module. The primary scheduling module integrates a mode register containing multiple candidate algorithms and a state machine for executing the algorithm. The secondary scheduling module also integrates a state machine for executing the algorithm. The data processor network card also integrates a FIFO queue for storing TLP packets. The TLP packets in the FIFO queue are scheduled in order to balance storage traffic and network traffic.
[0049] The data processor network interface card 104 acquires index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp packets. Then, it processes the net_pkt_tlp and blk_pkt_tlp packets. Specifically, the index_tlp packet is a TLP for acquiring index information, the ring_tlp packet is a TLP for acquiring ring buffer information, the net_desc_tlp packet is a TLP for acquiring network packet descriptors, the blk_desc_tlp packet is a TLP for acquiring storage packet descriptors, the net_pkt_tlp packet is a TLP for acquiring network packets, and the blk_pkt_tlp packet is a TLP for acquiring storage packets. Each TLP is a non-published type TLP generated by the direct memory access section.
[0050] The collected TLP packets are input into the pre-set primary scheduling module in the data processor network card 104. The primary scheduling module performs balanced scheduling using a target algorithm to obtain scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling, weighted round-robin scheduling, and differential weighted round-robin. Finally, the scheduled net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets are input into the pre-set secondary scheduling module in the data processor network card 104. The secondary scheduling module performs round-robin scheduling using a pre-set round-robin scheduling algorithm to obtain the scheduling order of various TLP packets.
[0051] The external device / controller 102 can be a terminal, not limited to various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The external device / controller 102 can also be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0052] In one exemplary embodiment, such as Figure 2 As shown, a TLP message scheduling method is provided, which can be applied to... Figure 1 The following steps are used as an example to illustrate the process, including steps S201 to S203: (The data processor network card 104 is used as an example.)
[0053] Step S201: Obtain various TLP messages; these include: index_tlp message, ring_tlp message, net_desc_tlp message, blk_desc_tlp message, net_pkt_tlp message, and blk_pkt_tlp message; the index_tlp message is a TLP for obtaining index information, the ring_tlp message is a TLP for obtaining ring buffer information, the net_desc_tlp message is a TLP for obtaining network packet descriptors, the blk_desc_tlp message is a TLP for obtaining storage packet descriptors, the net_pkt_tlp message is a TLP for obtaining network packets, and the blk_pkt_tlp message is a TLP for obtaining storage packets. Each TLP is a non-published type TLP generated by the direct memory access part.
[0054] Among them, TLP (Transaction Layer Packet) messages can be understood as a data transmission format in the PCI Express (PCIe) protocol, used to transfer data between devices. Index_TLP messages can be understood as TLPs that obtain index information, ring_TLP messages can be understood as TLPs that obtain ring (ring buffer) information, net_desc_tlp messages can be understood as TLPs that obtain network packet descriptors, blk_desc_tlp messages can be understood as TLPs that obtain storage packet descriptors, net_pkt_tlp messages can be understood as TLPs that obtain network packets, and blk_pkt_tlp messages can be understood as TLPs that obtain storage packets. All of the above messages belong to the non-posted type TLPs generated by the DMA (Direct Memory Access) part.
[0055] For example, when the data processor network interface card 104 communicates with the external device / controller 102, it acquires non-posted TLPs such as index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp packets generated during the communication process. Acquiring a large number of TLP packets lays the data foundation for subsequent scheduling of the same TLP packets.
[0056] Step S202: Input the net_pkt_tlp and blk_pkt_tlp packets into the pre-configured first-level scheduling module in the data processor network card. Perform balanced scheduling through the target algorithm in the first-level scheduling module to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0057] The Weighted Round Robin (WRR) algorithm can be understood as allocating different resources and scheduling time to tasks with different priorities; the Deficient Weighted Round Robin (DWRR) algorithm can be understood as assigning a weight to each flow or task, and the weight determines the priority and time allocation of the task in the scheduling, maintaining a "difference" value to adjust the scheduling order and scheduling duration of the tasks.
[0058] Optionally, the data processor network interface card 104 inputs the net_pkt_tlp and blk_pkt_tlp packets into a pre-set primary scheduling module. The primary scheduling module then uses a target algorithm to perform balanced scheduling of the net_pkt_tlp and blk_pkt_tlp packets with network traffic and storage traffic, resulting in the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm is determined based on the current application scenario of the network interface card and can be any of the round-robin scheduling algorithm, weighted round-robin scheduling algorithm, or differential weighted round-robin algorithm. By selecting the most suitable target algorithm online according to different application scenarios, the balance of network traffic and storage traffic is ensured across various application scenarios.
[0059] Step S203: The scheduled net_pkt_tlp packets, blk_pkt_tlp packets, index_tlp packets, ring_tlp packets, net_desc_tlp packets, and blk_desc_tlp packets are input into the pre-set secondary scheduling module in the data processor network card. The pre-set round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of various TLP packets.
[0060] The Round-Robin Scheduling Algorithm (RR algorithm) can be understood as a fair allocation of resources, ensuring that each task receives a certain time slice in the loop. Each task is allocated a fixed-length time slice (segment). When a task's time slice expires, the scheduler suspends the task and allocates CPU resources to the next task.
[0061] Optionally, the data processor network interface card 104 inputs the degraded net_pkt_tlp, blk_pkt_tlp, index_tlp, ring_tlp, net_desc_tlp, and blk_desc_tlp packets into a pre-set secondary scheduling module. The secondary scheduling module then uses a pre-set round-robin scheduling algorithm to perform round-robin scheduling on these TLP packets. Based on the results of the round-robin scheduling, the order of the TLP queues is adjusted to obtain the scheduling order of various TLP packets. By round-robin scheduling of multiple non-posted TLP packets, the optimal processing order is adjusted, ensuring balanced scheduling of non-posted bus transactions, improving the stability of the data processor network interface card, and increasing the efficiency of DMA read requests.
[0062] In the aforementioned TLP packet scheduling method, index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp packets are obtained respectively. The net_pkt_tlp and blk_pkt_tlp packets are then input into a pre-configured first-level scheduling module in the data processor's network interface card. Balanced scheduling is performed using the target algorithm in the first-level scheduling objective to obtain the scheduled n. The `et_pkt_tlp` and `blk_pkt_tlp` packets are processed, and then the scheduled `net_pkt_tlp`, `blk_pkt_tlp`, `index_tlp`, `ring_tlp`, `net_desc_tlp`, and `blk_desc_tlp` packets are input into a pre-configured secondary scheduling module in the data processor's network interface card. The secondary scheduling module uses a pre-configured round-robin scheduling algorithm to determine the scheduling order of various TLP packets. By setting up multi-level packet scheduling, the primary scheduling ensures balanced scheduling of storage and network traffic, the secondary scheduling ensures balanced scheduling of various TLP packets, and single-level processing of single scheduling tasks improves the scheduling efficiency of TLP packets.
[0063] In one embodiment, balanced scheduling is performed using the target algorithm in the first-level scheduling module to obtain scheduled net_pkt_tlp packets and blk_pkt_tlp packets. This includes: performing balanced scheduling of network traffic for net_pkt_tlp packets and blk_pkt_tlp packets based on the packet lengths of net_pkt_tlp packets and blk_pkt_tlp packets using the target algorithm in the first-level scheduling module; and performing balanced scheduling of storage traffic for net_pkt_tlp packets and blk_pkt_tlp packets to obtain scheduled net_pkt_tlp packets and blk_pkt_tlp packets.
[0064] For example, the data processor network interface card 104 calculates the corresponding network traffic and storage traffic allocated to each of the net_pkt_tlp and blk_pkt_tlp packets based on their packet lengths using the target algorithm in the first-level scheduling module. This results in the scheduled net_pkt_tlp and blk_pkt_tlp packets. By using the target algorithm and packet lengths, the network traffic and storage traffic allocated to the net_pkt_tlp packets and the first-level blk_pkt_tlp packets are calculated, achieving balanced scheduling of network and storage traffic and ensuring the internal stability of the data processor network interface card.
[0065] In one embodiment, the first-level scheduling module includes a mode register and a state machine. Different modes of the mode register correspond to different candidate algorithms. The candidate algorithms include round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm.
[0066] Balanced scheduling is performed using the target algorithm in the first-level scheduling module, including: determining the current mode of the mode register based on the current application scenario information, identifying the candidate algorithm corresponding to the current mode as the target algorithm, and having the state machine perform balanced scheduling according to the target algorithm.
[0067] The mode register can be understood as a component that stores candidate algorithms, with one mode corresponding to one candidate algorithm. The state machine can be understood as a mathematical model for executing the target algorithm, used to calculate the resources that should be allocated to each TLP message under the target algorithm.
[0068] Optionally, the data processor network interface card 104 determines the current mode of the mode register based on the current application scenario information, identifies the candidate algorithm corresponding to the current mode as the target algorithm, and the state machine reads the determined target algorithm from the mode register and performs balanced scheduling according to the target algorithm. By selecting the target algorithm used in the primary scheduling module online through the current application scenario information, the adaptability of the target algorithm to the current application scenario is ensured, thereby ensuring balanced scheduling of network traffic and storage traffic under various scenarios.
[0069] In an exemplary embodiment, inputting net_pkt_tlp packets and blk_pkt_tlp packets into a pre-configured first-level scheduling module in the data processor network card includes: filtering the net_pkt_tlp packets and blk_pkt_tlp packets according to preset filtering conditions to obtain filtered net_pkt_tlp packets and blk_pkt_tlp packets; and inputting the filtered net_pkt_tlp packets and blk_pkt_tlp packets into the pre-configured first-level scheduling module in the data processor network card.
[0070] For example, the data processor's network interface card (NIC) filters and cleans net_pkt_tlp and blk_pkt_tlp packets according to preset filtering conditions, removing abnormal TLP packets to obtain filtered net_pkt_tlp and blk_pkt_tlp packets. Finally, the filtered net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the data processor's NIC. By performing TLP packet pre-filtering on net_pkt_tlp and blk_pkt_tlp packets, the validity and availability of TLP packets are ensured, thereby improving the balance of load balancing.
[0071] In one embodiment, net_pkt_tlp packets and blk_pkt_tlp packets are filtered according to preset filtering conditions to obtain filtered net_pkt_tlp packets and blk_pkt_tlp packets. This includes removing pkt_tlp packets containing invalid requested memory addresses, pkt_tlp packets missing SOP and EOP, and pkt_tlp packets whose actual packet length does not match the set packet length, thus obtaining filtered net_pkt_tlp packets and blk_pkt_tlp packets.
[0072] Here, SOP (start of packet) can be understood as the start flag of a TLP message, and similarly, EOP (end of packet) can be understood as the end flag of a TLP message.
[0073] Optionally, the data processor network card 104 removes pkt_tlp packets containing invalid requested memory addresses, pkt_tlp packets missing start and end flags, and pkt_tlp packets whose actual packet length does not match the set packet length from the net_pkt_tlp packets and blk_pkt_tlp packets, to obtain filtered net_pkt_tlp packets and blk_pkt_tlp packets.
[0074] Removing the above abnormal TLP packets achieves the following technical effects:
[0075] 1. By removing pkt_tlp packets that request invalid memory addresses, the network card ensures that it only processes valid and legitimate packets. This significantly reduces the number of error handling and retransmissions, improving the efficiency of data transmission.
[0076] 2. In network communication, start and end flags are crucial for ensuring message integrity. Removing messages missing these flags prevents data parsing errors and ensures that the receiver can correctly understand the structure and content of the data packets.
[0077] 3. Filtering messages whose actual message length differs from the set message length helps the system avoid processing incomplete or erroneously transmitted data, enhancing system robustness. This reduces system crashes or abnormal behavior caused by formatting errors, improving overall stability.
[0078] 4. By filtering out the above-mentioned illegal or incorrectly formatted messages, bandwidth usage can be reduced, bandwidth utilization can be improved, and the processing burden can also be reduced.
[0079] In one embodiment, a 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 TLP packet. This includes: traversing the current TLP packet queue using the round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain scheduling feedback information of the TLP packets; adjusting the original scheduling order of the TLP packets according to the scheduling feedback information until scheduling balance is achieved among various TLP packets, thereby obtaining the scheduling order of various TLP packets.
[0080] Among them, scheduling feedback information refers to the response feedback generated when a TLP message is scheduled in the current scheduling order.
[0081] For example, the data processor network interface card 104 uses a pre-set round-robin scheduling algorithm in its secondary scheduling module to traverse and schedule the TLP packets in the FIFO's TLP packet queue in sequence. It obtains the scheduling response feedback information for each TLP packet, adjusts the original scheduling order of the TLP packets based on this feedback, and then traverses the adjusted TLP packet queue. This process of adjusting the scheduling order of various TLP packets is repeated until scheduling balance is achieved among them, thus obtaining the final scheduling order of the various TLP packets. By using the round-robin scheduling algorithm in its secondary scheduling module, the data processor network interface card 104 dynamically traverses and adjusts the TLP packets in the FIFO, significantly improving the balance and fairness of the scheduling.
[0082] In one exemplary embodiment, a specific implementation of the TLP packet scheduling method is provided, wherein:
[0083] TLP: Transaction Layer Packet.
[0084] DMA: Direct Memory Access.
[0085] DPU: Data Processing Unit.
[0086] RR algorithm: Round-Robin Scheduling Algorithm.
[0087] WRR algorithm: Weighted Round Robin scheduling algorithm.
[0088] DWRR algorithm: Deficient Weighted Round Robin.
[0089] FPGA: Field Programmable Gate Array.
[0090] VirtIO: Virtual input & output.
[0091] sop: Start of packet.
[0092] eop: End of packet.
[0093] The device implementation scheme is as follows Figure 3As shown, the DMA section needs to generate six types of non-posted TLPs: TLP for retrieving index information (index_tlp), TLP for retrieving ring information (ring_tlp), TLP for retrieving network packet descriptors (net_desc_tlp), TLP for retrieving storage packet descriptors (blk_desc_tlp), TLP for retrieving network packets (net_pkt_tlp), and TLP for retrieving storage packets (blk_pkt_tlp). The TLPs for retrieving network packets (net_pkt_tlp) and storage packets (blk_pkt_tlp) undergo a first-level scheduling process to output the TLP for retrieving packets. This first-level scheduling uses three algorithms: RR, WRR, and DWRR, which can be selected online via the mode register. The output of the first-level scheduling is then combined with the other four TLPs through a second-level RR scheduling process before being output.
[0094] In implementing the specific solution, a simple and easily adjustable implementation method was chosen, taking into account the characteristics of FPGA. Specifically, as follows... Figure 4 As shown. In the `read_pkt_req_mux` module (the first-level scheduling module), the TLPs for retrieving network packets (`net_pkt_tlp`) and the TLPs for retrieving stored packets (`blk_pkt_tlp`) are pre-buried in a FIFO. A state machine is used to complete the selection and function of the RR, WRR, and DWRR algorithms. In the `mux_non_posted` module, the TLPs for retrieving index information (`index_tlp`), ring information (`ring_tlp`), network packet descriptors (`net_desc_tlp`), stored packet descriptors (`blk_desc_tlp`), and packets are first buffered in a FIFO after entering the module. A state machine is then used to schedule and output the RR algorithm.
[0095] The specific process for performing Level 1 scheduling is as follows: Figure 5 As shown, basic error checking is first performed on the TLP (net_pkt_tlp) for acquiring network packets and the TLP (blk_pkt_tlp) for acquiring storage packets. Abnormal DMA addresses, abnormal SOP and EOP flags (missing SOP, missing EOP), and abnormal read request packet lengths are filtered out. The filtered, normal non-posted TLPs are then cached in FIFOs. These two types of non-posted TLPs are then scheduled in a balanced manner according to the currently configured scheduling algorithm.
[0096] After the previous level of scheduling is completed, the non-posted TLP requesting the message then performs round-robin scheduling with other non-posted TLPs.
[0097] Compared with the prior art, this application has the following advantages:
[0098] (1) Multi-level scheduling of various TLPs of non-posted type in DMA. It can ensure balanced scheduling of storage traffic, network traffic and other non-posted bus transactions.
[0099] (2) It can select the TLP scheduling algorithm online according to different application scenarios. This ensures the balance of network traffic and storage traffic of the DPU network card in various application scenarios.
[0100] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0101] Based on the same inventive concept, this application also provides a TLP packet scheduling apparatus for implementing the TLP packet scheduling method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more TLP packet scheduling apparatus embodiments provided below can be found in the limitations of the TLP packet scheduling method described above, and will not be repeated here.
[0102] In one exemplary embodiment, such as Figure 6 As shown, a TLP message scheduling device is provided, including: a message acquisition module 601, a first-level scheduling module 602, and a second-level scheduling module 603, wherein:
[0103] The message acquisition module 601 is used to acquire various TLP messages. These TLP messages include: index_tlp messages, ring_tlp messages, net_desc_tlp messages, blk_desc_tlp messages, net_pkt_tlp messages, and blk_pkt_tlp messages. The index_tlp message is a TLP for acquiring index information, the ring_tlp message is a TLP for acquiring ring buffer information, the net_desc_tlp message is a TLP for acquiring network packet descriptors, the blk_desc_tlp message is a TLP for acquiring storage packet descriptors, the net_pkt_tlp message is a TLP for acquiring network packets, and the blk_pkt_tlp message is a TLP for acquiring storage packets. Each TLP is a non-publishing type TLP generated by the direct memory access part.
[0104] The first-level scheduling module 602 is used to input net_pkt_tlp packets and blk_pkt_tlp packets into the pre-configured first-level scheduling module 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 packets and blk_pkt_tlp packets; the target algorithm represents any one of the following algorithms: round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin algorithm;
[0105] The secondary scheduling module 603 is used to input the scheduled net_pkt_tlp packets, blk_pkt_tlp packets, index_tlp packets, ring_tlp packets, net_desc_tlp packets, and blk_desc_tlp packets into the secondary scheduling module pre-set in the data processor network card. The secondary scheduling module performs round-robin scheduling using a pre-set round-robin scheduling algorithm to obtain the scheduling order of various TLP packets.
[0106] In one embodiment, the first-level scheduling module 602 is further configured to perform balanced scheduling of network traffic for net_pkt_tlp packets and blk_pkt_tlp packets based on the packet length of net_pkt_tlp packets and the packet length of blk_pkt_tlp packets using the target algorithm in the first-level scheduling module, and to perform balanced scheduling of storage traffic for net_pkt_tlp packets and blk_pkt_tlp packets, thereby obtaining the scheduled net_pkt_tlp packets and blk_pkt_tlp packets.
[0107] In one embodiment, the first-level scheduling module includes a mode register and a state machine. Different modes of the mode register correspond to different candidate algorithms. The candidate algorithms include round-robin scheduling algorithm, weighted round-robin scheduling algorithm, and differential weighted round-robin 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 have the state machine perform balanced scheduling according to the target algorithm.
[0108] In an exemplary embodiment, the first-level scheduling module 602 further includes a message filtering submodule and a message input module, wherein:
[0109] The message filtering submodule is used to filter net_pkt_tlp and blk_pkt_tlp messages according to preset filtering conditions, so as to obtain filtered net_pkt_tlp and blk_pkt_tlp messages.
[0110] The message input submodule is used to input the filtered net_pkt_tlp and blk_pkt_tlp messages into the pre-configured first-level scheduling module in the data processor network card.
[0111] In one embodiment, the message filtering submodule is further configured to remove pkt_tlp messages containing invalid requested memory addresses, pkt_tlp messages missing SOP and EOP, and pkt_tlp messages whose actual message length does not match the set message length from the net_pkt_tlp messages and blk_pkt_tlp messages, thereby obtaining filtered net_pkt_tlp messages and blk_pkt_tlp messages.
[0112] In one embodiment, the secondary scheduling module 603 is further configured to traverse the current TLP message queue through a pre-set round-robin scheduling algorithm in the secondary scheduling module, obtain the scheduling feedback information of the TLP messages, adjust the original scheduling order of the TLP messages according to the scheduling feedback information, until scheduling balance is achieved among various TLP messages, and obtain the scheduling order of various TLP messages.
[0113] Each module in the aforementioned TLP packet scheduling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the data processor's network interface card (NIC) in hardware form or independent of it, or they can be stored in the memory of the NIC in software form, so that the processor can call and execute the corresponding operations of each module.
[0114] In one exemplary embodiment, a data processor network interface card (NIC) is provided. This NIC can be a server, and its internal structure diagram can be as follows: Figure 7 As shown, this data processor network card includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, blk_pkt_tlp, and algorithm data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a TLP message scheduling method.
[0115] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the solution of this application and does not constitute a limitation on the data processor network card to which the solution of this 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 different component arrangements.
[0116] In one exemplary embodiment, a data processor network interface card (NIC) is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the TLP packet scheduling method in the above embodiment.
[0117] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the TLP message scheduling method in the above embodiment.
[0118] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the TLP message scheduling method in the above embodiments.
[0119] 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, data stored, data displayed, 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 the relevant data must comply with relevant regulations.
[0120] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0121] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0122] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A TLP message scheduling method, characterized in that, Applied to a data processor network interface card, the method includes: The system acquires various TLP messages, including: index_tlp, ring_tlp, net_desc_tlp, blk_desc_tlp, net_pkt_tlp, and blk_pkt_tlp. The index_tlp message is a TLP for acquiring index information, the ring_tlp message is a TLP for acquiring ring buffer information, the net_desc_tlp message is a TLP for acquiring network packet descriptors, the blk_desc_tlp message is a TLP for acquiring storage packet descriptors, the net_pkt_tlp message is a TLP for acquiring network packets, and the blk_pkt_tlp message is a TLP for acquiring storage packets. Each TLP is a non-published type TLP generated by the direct memory access portion. The net_pkt_tlp and blk_pkt_tlp packets are input into a pre-configured first-level scheduling module in the network interface card of the data processor. Balanced scheduling is performed using a target algorithm within the first-level scheduling module to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling, weighted round-robin scheduling, and differential weighted round-robin scheduling. The scheduled net_pkt_tlp packets, blk_pkt_tlp packets, index_tlp packets, ring_tlp packets, net_desc_tlp packets, and blk_desc_tlp packets are input into the pre-set secondary scheduling module in the network card of the data processor. The pre-set round-robin scheduling algorithm in the secondary scheduling module is used to perform round-robin scheduling to obtain the scheduling order of the various TLP packets.
2. The method according to claim 1, characterized in that, The balanced scheduling is performed using the target algorithm in the first-level scheduling module, resulting in scheduled net_pkt_tlp and blk_pkt_tlp packets, including: Based on the packet lengths of the net_pkt_tlp and blk_pkt_tlp packets, the target algorithm in the first-level scheduling module performs balanced scheduling of the network traffic and storage traffic of the net_pkt_tlp and blk_pkt_tlp packets, resulting in the scheduled net_pkt_tlp and blk_pkt_tlp packets.
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. Different modes of the mode register correspond to different candidate algorithms. The candidate algorithms include the round-robin scheduling algorithm, the weighted round-robin scheduling algorithm, and the differential weighted round-robin algorithm. The balanced scheduling through the target algorithm in the first-level scheduling module includes: The current mode of the mode register is determined based on 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 and blk_pkt_tlp packets into the pre-configured first-level scheduling module in the data processor network card includes: According to the preset filtering conditions, the net_pkt_tlp packets and blk_pkt_tlp packets are filtered to obtain filtered net_pkt_tlp packets and blk_pkt_tlp packets; The filtered net_pkt_tlp and blk_pkt_tlp packets are input into the pre-configured first-level scheduling module in the network card of the data processor.
5. The method according to claim 4, characterized in that, The step of filtering the net_pkt_tlp and blk_pkt_tlp packets according to preset filtering conditions to obtain filtered net_pkt_tlp and blk_pkt_tlp packets includes: Remove pkt_tlp messages containing invalid requested memory addresses, pkt_tlp messages lacking SOP and EOP, and pkt_tlp messages whose actual message length does not match the set message length from the net_pkt_tlp messages and blk_pkt_tlp messages to obtain filtered net_pkt_tlp messages and blk_pkt_tlp messages.
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 obtain the scheduling order of each TLP packet, including: The round-robin scheduling algorithm pre-set in the secondary scheduling module is used to traverse the current TLP packet queue and obtain the scheduling feedback information of the TLP packets. The original scheduling order of the TLP packets is adjusted according to the scheduling feedback information until scheduling balance is achieved among various TLP packets, and the scheduling order of various TLP packets is obtained.
7. A TLP message scheduling device, characterized in that, The device, applied to a network interface card for a data processor, includes: The message acquisition module is used to acquire various TLP messages, including: index_tlp messages, ring_tlp messages, net_desc_tlp messages, blk_desc_tlp messages, net_pkt_tlp messages, and blk_pkt_tlp messages. The index_tlp message is a TLP for acquiring index information, the ring_tlp message is a TLP for acquiring ring buffer information, the net_desc_tlp message is a TLP for acquiring network packet descriptors, the blk_desc_tlp message is a TLP for acquiring storage packet descriptors, the net_pkt_tlp message is a TLP for acquiring network packets, and the blk_pkt_tlp message is a TLP for acquiring storage packets. Each TLP is a non-publishing type TLP generated by the direct memory access section. A primary scheduling module is used to input the net_pkt_tlp and blk_pkt_tlp packets into a pre-configured primary scheduling module in the data processor's network interface card. The primary scheduling module then performs balanced scheduling using a target algorithm to obtain the scheduled net_pkt_tlp and blk_pkt_tlp packets. The target algorithm represents any one of the following algorithms: round-robin scheduling, weighted round-robin scheduling, and differential weighted round-robin scheduling. The secondary scheduling module is used to input the scheduled net_pkt_tlp packets, blk_pkt_tlp packets, index_tlp packets, ring_tlp packets, net_desc_tlp packets, and blk_desc_tlp packets into the secondary scheduling module pre-set in the network card of the data processor, and perform round-robin scheduling through the round-robin scheduling algorithm pre-set in the secondary scheduling module to obtain the scheduling order of the various TLP packets.
8. A data processor network interface card (NIC), comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
QoS processing and control method and network interface controller
CN110581776A
Adaptive address translation caches
CN113454610A