Flow control method and device, medium and product

By scheduling message descriptors based on prefetched quantity levels and preset thresholds in virtual devices, the problem of network congestion in data traffic transmission is solved, network stability and resource utilization are improved, and service quality is guaranteed.

CN120602433APending Publication Date: 2025-09-05SANECHIPS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410734427.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

The prior art is difficult to effectively avoid network congestion in data traffic transmission, resulting in a decrease in network stability and low resource utilization, and cannot guarantee service quality.

Method used

By obtaining message descriptors from virtual devices based on the preset prefetch quantity level and storing message descriptors in the corresponding queue, and combining with the preset threshold scheduling message descriptors, flexible traffic control is achieved, reducing cache usage and improving cache utilization, ensuring that the data transmission rate does not exceed the system processing capacity.

Benefits of technology

It realizes accurate traffic control of multiple virtual devices and multiple queues in limited storage space, improves network transmission efficiency and performance, and ensures network stability and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602433A_ABST
    Figure CN120602433A_ABST
Patent Text Reader

Abstract

The invention provides a flow control method, which comprises the following steps: acquiring at least one group of corresponding message descriptors from virtual equipment according to at least one preset prefetch number level, the virtual equipment corresponding to at least one queue, and each queue corresponding to one prefetch number level; respectively storing the at least one group of message descriptors to at least one queue corresponding to the at least one prefetch quantity level; and scheduling the message descriptors from at least one queue corresponding to the virtual equipment according to a preset threshold, and stopping scheduling the message descriptors until the number of the scheduled message descriptors reaches the preset threshold. The invention further provides a flow control device, a computer readable medium and a computer program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of flow control, and in particular to a flow control method, device, computer-readable medium, and computer program product. Background Art

[0002] The rapid development of the internet and mobile communications technologies has led to a dramatic increase in data traffic, posing unprecedented challenges to networks. Network congestion not only degrades user experience but can also disrupt critical services. Therefore, implementing effective flow control methods in data traffic transmission scenarios is crucial to avoiding network congestion, maintaining network stability, improving resource utilization, and ensuring quality of service (QoS). Summary of the Invention

[0003] The present disclosure provides a flow control method, device, computer-readable medium, and computer program product.

[0004] In a first aspect, an embodiment of the present disclosure provides a flow control method, which includes: obtaining at least one corresponding group of packet descriptors from a virtual device according to at least one preset prefetch quantity level, wherein the virtual device corresponds to at least one queue, and each queue corresponds to a prefetch quantity level; storing at least one group of packet descriptors respectively in at least one queue corresponding to at least one prefetch quantity level; scheduling packet descriptors from at least one queue corresponding to the virtual device according to a preset threshold until the number of scheduled packet descriptors reaches the preset threshold, and then stopping scheduling the packet descriptors.

[0005] In a second aspect, an embodiment of the present disclosure provides a flow control device, which includes: a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the first aspect and any possible embodiment of the first aspect.

[0006] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the first aspect and any possible embodiment of the first aspect when the computer program is executed by a processor.

[0007] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the first aspect and any possible embodiment of the first aspect.

[0008] In the embodiment of the present disclosure, the packet descriptor is obtained according to the pre-fetch quantity level corresponding to the queue. Different queues may correspond to different pre-fetch quantity levels. The packet descriptor can be flexibly obtained according to the pre-fetch quantity level corresponding to each queue. There is no need to obtain all the packet descriptors, which can reduce cache occupancy and improve cache utilization. Moreover, the packet descriptors in the queue are scheduled according to the preset threshold, and the flow of the scheduled packet descriptors can be accurately controlled to ensure that the data transmission rate in the network does not exceed the system processing capacity, which can improve the accuracy of flow control. In this way, limited storage space can be used to achieve accurate flow control of multiple virtual devices and multiple queues, thereby improving network transmission efficiency and performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In the accompanying drawings of the embodiments of the present disclosure:

[0010] Figure 1 A flow chart of a flow control method provided in an embodiment of the present disclosure;

[0011] Figure 2 A flow chart of a method for obtaining a message descriptor provided in an embodiment of the present disclosure;

[0012] Figure 3 A flow chart of another flow control method provided by an embodiment of the present disclosure;

[0013] Figure 4 A schematic diagram of a flow control architecture provided by an embodiment of the present disclosure;

[0014] Figure 5 A schematic structural diagram of a flow control device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] To enable those skilled in the art to better understand the technical solution of the present disclosure, a flow control method, device, computer-readable medium, and computer program product provided by an embodiment of the present disclosure are described in detail below with reference to the accompanying drawings.

[0016] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, but the illustrated embodiments may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that the present disclosure will be thorough and complete and will fully understand the scope of the present disclosure to those skilled in the art.

[0017] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the detailed embodiments, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing the detailed embodiments with reference to the accompanying drawings.

[0018] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0019] The terms used in this disclosure are only used to describe specific embodiments and are not intended to limit the disclosure. As used in this disclosure, the term "and / or" includes any and all combinations of one or more related enumerated items. As used in this disclosure, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. As used in this disclosure, the terms "comprising" and "made of" specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0020] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meanings as those commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined in this disclosure.

[0021] In this disclosure, unless otherwise specified, the following technical terms should be understood as follows:

[0022] 1) A message descriptor is a data type that contains message metadata, such as the source, destination, length, type, status, and other control information. Message descriptors are used to identify and manage messages at various stages of data traffic transmission (e.g., sending, receiving, and processing).

[0023] 2) Flow control is a mechanism for managing and controlling the data flow transmission rate to prevent the sender from sending data too quickly, causing the receiver to be unable to process it in time.

[0024] 3) Virtual I / O Device (virtio) is a device driver architecture used in a virtualized environment. It allows a virtual machine (VM) to interact directly with the physical hardware below the virtualization layer. The virtio architecture is designed to improve the performance and efficiency of virtualized environments.

[0025] 4) Data processing unit (DPU) is a hardware unit used to process data efficiently. It is specially designed to handle some specific types of data processing tasks in data centers and servers.

[0026] In data traffic transmission scenarios, implementing effective flow control methods is crucial to avoiding network congestion, maintaining network stability, improving resource utilization, and ensuring QoS.

[0027] In view of this, embodiments of the present disclosure provide a flow control method, device, computer-readable medium, and computer program product that can be applied to a virtio-based paravirtualized backend flow control scenario, as described in detail below with reference to the accompanying drawings.

[0028] First, refer to the attached Figure 1 , is a flow chart of a flow control method provided in an embodiment of the present disclosure, which can be applied to flow control devices. The flow control devices may include, for example, server network cards, DPU network cards, and smart network cards. The method includes:

[0029] S101: Acquire at least one corresponding group of packet descriptors from a virtual device according to at least one preset prefetch quantity level.

[0030] In some embodiments, the number of virtual devices is at least one, wherein at least one includes one or more.

[0031] In the embodiments of the present disclosure, a virtual device may be, for example, a virtual machine. Each virtual device corresponds to at least one queue, meaning that at least one queue is configured for each virtual device. The at least one queue corresponding to each virtual device is used to store data or information used by the virtual device during flow control. Each queue corresponds to a prefetch quantity level, and different queues can correspond to the same or different prefetch quantity levels.

[0032] In the embodiment of the present disclosure, the prefetch quantity level and the prefetch quantity may be positively correlated, that is, a larger prefetch quantity level corresponds to a larger prefetch quantity.

[0033] In the embodiments of the present disclosure, the prefetch quantity level can be determined based on actual application scenarios and requirements. For example, in actual applications, the prefetch quantity level can be determined based on factors such as the traffic, processing power, and performance of the corresponding virtual device, as well as the cache and memory resources available in the system.

[0034] In one example, prefetch quantity levels can be divided according to the traffic volume of the virtual device. For virtual devices with large data traffic, a higher prefetch quantity level can be assigned to the corresponding queue, and more packet descriptors can be prefetched according to the higher prefetch quantity level. Conversely, for virtual devices with small data traffic, a lower prefetch quantity level can be assigned to the corresponding queue, and fewer packet descriptors can be prefetched according to the lower prefetch quantity level. In this way, the problem of virtual devices with small data traffic prefetching too many packet descriptors and thus wasting cache resources can be avoided, and the problem of virtual devices with large data traffic prefetching too few packet descriptors and thus causing front-end packet accumulation can be avoided.

[0035] In some embodiments, S101 can be implemented as follows: Figure 2 , is a flow chart of a method for obtaining a message descriptor provided in an embodiment of the present disclosure, the method comprising:

[0036] S1011: Determine a prefetch quantity corresponding to each prefetch quantity level in the at least one prefetch quantity level according to the preset at least one prefetch quantity level and a predetermined level-to-quantity correspondence.

[0037] In the disclosed embodiments, the predetermined level-quantity correspondence includes a correspondence between a prefetch quantity level and a prefetch quantity, and different prefetch quantity levels may correspond to different prefetch quantities. For each queue corresponding to a virtual device, the prefetch quantity corresponding to the prefetch quantity level corresponding to each queue may be determined based on the prefetch quantity level corresponding to each queue and the predetermined level-quantity correspondence.

[0038] S1012: According to the prefetch quantity corresponding to each prefetch quantity level in the at least one prefetch quantity level, obtain at least one group of prefetch quantity message descriptors corresponding to the at least one prefetch quantity level from the virtual device.

[0039] In the embodiment of the present disclosure, after determining the prefetch quantity corresponding to the prefetch quantity level corresponding to each queue of the virtual device, a group of message descriptors corresponding to each queue can be obtained from the virtual device according to the prefetch quantity.

[0040] In some embodiments, before executing S101, the method may further include: receiving a notification message sent by a virtual device, the notification message being used to instruct the acquisition of a packet descriptor from the virtual device. For example, in a virtio-based paravirtualized backend traffic control scenario, the notification message may be a kick notification message.

[0041] S102: Store at least one group of packet descriptors into at least one queue corresponding to at least one prefetch quantity level.

[0042] In the embodiment of the present disclosure, after obtaining at least one group of message descriptors from the virtual device by executing S101, they can be stored in corresponding queues respectively, so that the message descriptors obtained according to different pre-fetch quantity levels can be stored in queues corresponding to different pre-fetch quantity levels.

[0043] S103: Scheduling message descriptors from at least one queue corresponding to the virtual device according to a preset threshold until the number of scheduled message descriptors reaches the preset threshold, and then stopping scheduling the message descriptors.

[0044] In the disclosed embodiment, the preset threshold value can be configured according to actual application scenarios and requirements, for example, it can be determined based on factors such as the flow rate, processing capacity, performance of the virtual device, network congestion status, historical data flow, etc.

[0045] In some embodiments, after dispatching a message descriptor from at least one queue corresponding to the virtual device according to S103, the method further includes: obtaining a corresponding message from the virtual device according to the dispatched message descriptor, and sending the message from a physical port of the flow control device. For example, if the flow control device is a server network interface card (NIC), a DPU NIC, or a smart NIC, the corresponding physical port may be a NIC port.

[0046] Through the above method, the packet descriptor can be flexibly obtained according to the pre-fetch quantity level corresponding to each queue, without the need to obtain all the packet descriptors, which can reduce cache occupancy and improve cache utilization. Moreover, the packet descriptors in the queue are scheduled according to the preset threshold, and the flow of the scheduled packet descriptors can be accurately controlled to ensure that the data transmission rate in the network does not exceed the system processing capacity, which can improve the accuracy of flow control. In this way, limited storage space can be used to achieve precise flow control of multiple virtual devices and multiple queues, thereby improving network transmission efficiency and performance.

[0047] In the embodiments of the present disclosure, there is no limitation on the scheduling method.

[0048] In some embodiments, the scheduling comprises a round-robin scheduling.

[0049] In some embodiments, the preset threshold includes a preset first threshold corresponding to the virtual device. In this embodiment, S103 may include: scheduling packet descriptors from at least one queue corresponding to the virtual device according to the preset first threshold until the total number of packet descriptors scheduled from at least one queue within the flow control period reaches the preset first threshold, and then stopping scheduling the packet descriptors in each queue.

[0050] In some embodiments, the preset threshold includes a preset second threshold corresponding to the queue. In this embodiment, S103 may include: scheduling packet descriptors from at least one queue corresponding to the virtual device according to the preset second threshold until the number of packet descriptors scheduled from any queue within the flow control period reaches the preset second threshold corresponding thereto, and then stopping scheduling packet descriptors in any queue.

[0051] In some embodiments, the preset threshold includes a preset first threshold corresponding to the virtual device and a preset second threshold corresponding to the queue. In this embodiment, S103 may include: scheduling packet descriptors from at least one queue corresponding to the virtual device according to the preset first threshold and the preset second threshold; if the total number of packet descriptors scheduled from at least one queue within the flow control period reaches the preset first threshold, and the number of packet descriptors scheduled from any queue within the flow control period does not reach the preset second threshold corresponding thereto, then scheduling the packet descriptors in each queue is stopped; if the total number of packet descriptors scheduled from at least one queue within the flow control period does not reach the preset first threshold, and the number of packet descriptors scheduled from any queue within the flow control period reaches the preset second threshold corresponding thereto, then scheduling the packet descriptors in any queue is stopped.

[0052] In the embodiment of the present disclosure, the units of the preset first threshold and the preset second threshold may be bits per second (bps) or packets per second (pps).

[0053] By adopting the scheduling method disclosed in the present invention, first, the message descriptor can be flexibly obtained according to the pre-fetch quantity level corresponding to each queue, which can be understood as the first-level flow control. Further, the message descriptor can be scheduled from at least one queue corresponding to the virtual device according to the preset first threshold, which can be understood as the second-level flow control. At the same time, the message descriptor can be scheduled from at least one queue corresponding to the virtual device according to the preset second threshold, which can be understood as the third-level flow control. In this way, through the third-level flow control, the flow of the scheduled message descriptor can be accurately controlled using limited storage space to achieve precise flow control of multiple virtual devices and multiple queues, which can improve the accuracy of flow control.

[0054] In the embodiments of the present disclosure, the flow control period can be configured according to actual application scenarios and requirements.

[0055] In the embodiment of the present disclosure, in addition to scheduling the message descriptor according to the preset first threshold and the preset second threshold, scheduling can also be performed in combination with other strategies, for example, scheduling can also be performed in combination with queue priority.

[0056] In some embodiments, based on a preset second threshold and a preset priority corresponding to each queue corresponding to the virtual device, packet descriptors are scheduled from at least one queue corresponding to the virtual device, with packet descriptors in queues with higher priorities being prioritized until the number of packet descriptors scheduled from any queue within a flow control period reaches the preset second threshold corresponding thereto, at which point scheduling of packet descriptors in any queue is stopped. The preset priority corresponding to each queue can be configured based on the latency of sending packets by the virtual device corresponding to the queue. A queue corresponding to a virtual device with a higher requirement for packet sending latency (a smaller corresponding packet transmission latency) can be configured with a higher priority. Conversely, a queue corresponding to a virtual device with a lower requirement for packet sending latency (a larger corresponding packet transmission latency) can be configured with a lower priority.

[0057] In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the technical solutions provided by the embodiments of the present disclosure are further described below through specific examples:

[0058] Refer to the attached Figure 3 , is a flow chart of another flow control method provided by an embodiment of the present disclosure. In this embodiment, the virtual device is a virtual machine, and the number of virtual machines is multiple. Figure 4 , is a schematic diagram of a flow control architecture provided by an embodiment of the present disclosure, Figure 3 The flow control method shown can be applied to Figure 4 The flow control architecture shown. Figure 3 The method shown includes the following steps:

[0059] S301: Initializing preset parameters of each virtual machine and each queue corresponding to each virtual machine.

[0060] In this embodiment, the preset parameters include a preset prefetch quantity level, a preset first threshold, a preset second threshold, and a preset priority, wherein the preset prefetch quantity level corresponds to each queue corresponding to each virtual machine, the preset first threshold corresponds to each virtual machine, and the preset second threshold and the preset priority correspond to each queue corresponding to each virtual machine. Figure 4 The architecture shown can drive the configuration and initialization of preset parameters in the preset parameter management module according to the flow control requirements of each virtual machine.

[0061] S302: Receive a kick notification message sent by each virtual machine, wherein the kick notification message is used to instruct the traffic control device to obtain a packet descriptor from the virtual machine.

[0062] In this embodiment, the corresponding Figure 4 In the architecture shown, the packet descriptor reading module can receive kick notification messages from each virtual machine.

[0063] S303: Obtain corresponding packet descriptors from each virtual machine according to a preset pre-fetch quantity level.

[0064] In this embodiment, the corresponding Figure 4 In the illustrated architecture, the prefetch level initialized in S301 can be obtained from the preset parameter management module during S303. Each virtual machine corresponds to at least one queue, each queue corresponds to a prefetch level, and a packet descriptor is obtained based on the prefetch level corresponding to each queue.

[0065] S304: Store the obtained message descriptor into the corresponding queue.

[0066] In this embodiment, the corresponding Figure 4 In the architecture shown, the packet descriptor storage module may include a queue corresponding to each virtual machine, and when executing S304 , the acquired packet descriptor may be stored in the packet descriptor storage module.

[0067] S305: For each virtual machine, poll and schedule packet descriptors from the queue corresponding to the virtual machine according to the preset first threshold until the total number of packet descriptors scheduled from all queues corresponding to the virtual machine within the flow control period reaches the preset first threshold, then stop scheduling the packet descriptors in all queues corresponding to the virtual machine.

[0068] In this embodiment, the corresponding Figure 4 In the illustrated architecture, the virtual machine traffic scheduling module executes S305 , and before executing S305 , the preset first threshold corresponding to each virtual machine initialized in S301 can be obtained from the preset parameter management module.

[0069] S306: For each virtual machine, the packet descriptors are polled and scheduled from the queue corresponding to the virtual machine according to the preset second threshold and the preset priority, and the packet descriptors in the high-priority queue are scheduled first, until the number of packet descriptors scheduled from any queue within the flow control period reaches the corresponding preset second threshold, then the scheduling of the packet descriptors in the queue is stopped.

[0070] In this embodiment, the corresponding Figure 4 In the illustrated architecture, the queue traffic scheduling module executes S306 , and before executing S306 , the preset second threshold of each queue corresponding to each virtual machine initialized in S301 may be obtained from the preset parameter management module.

[0071] In this embodiment, a queue can only belong to one virtual machine, and a virtual machine can correspond to multiple queues. S305 and S306 are executed simultaneously. When the packet descriptor scheduled by the virtual machine reaches the preset first threshold, regardless of whether the packet descriptor scheduled from each queue reaches the preset second threshold corresponding to the queue, the scheduling of the packet descriptors in all queues corresponding to the virtual machine will be stopped within the flow control period.

[0072] S307: Obtain the corresponding message from the virtual machine according to the scheduled message descriptor.

[0073] In this embodiment, the corresponding Figure 4 In the illustrated architecture, the message reading module executes S307 to read the message to be sent stored in the virtual machine according to the message descriptor scheduled by the queue traffic scheduling module.

[0074] S308: Send a message from the physical port of the flow control device.

[0075] In this embodiment, the corresponding Figure 4 In the architecture shown, after the message reading module obtains the message from the virtual machine, it sends the message through the physical port.

[0076] Secondly, refer to the attached Figure 5 , is a schematic structural diagram of a flow control device provided in an embodiment of the present disclosure, comprising: at least one processor 501, at least one memory 502, and one or more I / O interfaces 503. The one or more I / O interfaces 503 are connected between the processor 501 and the memory 502. The memory 502 stores one or more computer programs, which are executed by the at least one processor 501 to enable the at least one processor 501 to implement the first aspect and any possible embodiment of the first aspect.

[0077] Among them, the processor 501 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 502 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface 503 (read-write interface) is connected between the processor 501 and the memory 502, and can realize information interaction between the processor 501 and the memory 502, including but not limited to a data bus (Bus), etc.

[0078] In a third aspect, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which implements the above-mentioned first aspect and any possible embodiment of the first aspect when the program is executed by a processor.

[0079] In a fourth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the first aspect and any possible embodiment of the first aspect.

[0080] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0081] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0082] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; compact disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cassettes, tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0083] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A flow control method, comprising: Obtaining at least one group of packet descriptors corresponding to at least one preset prefetch quantity level from a virtual device, wherein the virtual device corresponds to at least one queue, and each queue corresponds to one of the prefetch quantity levels; storing the at least one group of packet descriptors respectively in the at least one queue corresponding to the at least one prefetch quantity level; The message descriptors are scheduled from the at least one queue corresponding to the virtual device according to a preset threshold until the number of the scheduled message descriptors reaches the preset threshold, and then the scheduling of the message descriptors is stopped.

2. The method according to claim 1, wherein The number of the virtual device is at least one.

3. The method according to claim 1, wherein The preset threshold includes a preset first threshold corresponding to the virtual device; The step of scheduling the message descriptors from the at least one queue corresponding to the virtual device according to a preset threshold until the number of the scheduled message descriptors reaches the preset threshold, and then stopping scheduling the message descriptors, includes: The packet descriptors are scheduled from the at least one queue corresponding to the virtual device according to the preset first threshold until the total number of the packet descriptors scheduled from the at least one queue within the flow control period reaches the preset first threshold, then scheduling of the packet descriptors in each queue is stopped.

4. The method according to claim 1, wherein The preset threshold includes a preset second threshold corresponding to the queue; The step of scheduling the message descriptors from the at least one queue corresponding to the virtual device according to a preset threshold until the number of the scheduled message descriptors reaches the preset threshold, and then stopping scheduling the message descriptors, includes: The packet descriptors are scheduled from the at least one queue corresponding to the virtual device according to the preset second threshold until the number of the packet descriptors scheduled from any of the queues within the flow control period reaches the corresponding preset second threshold, then scheduling of the packet descriptors in any of the queues is stopped.

5. The method according to claim 3, wherein: The preset threshold value further includes a preset second threshold value corresponding to the queue; The step of scheduling the message descriptors from the at least one queue corresponding to the virtual device according to a preset threshold until the number of the scheduled message descriptors reaches the preset threshold, and then stopping scheduling the message descriptors, includes: The packet descriptors are scheduled from the at least one queue corresponding to the virtual device according to the preset first threshold and the preset second threshold. If the total number of the packet descriptors scheduled from the at least one queue within the flow control period reaches the preset first threshold, and the number of the packet descriptors scheduled from any of the queues within the flow control period does not reach the corresponding preset second threshold, then the scheduling of the packet descriptors in each of the queues is stopped. If the total number of the packet descriptors scheduled from the at least one queue within the flow control period does not reach the preset first threshold, and the number of the packet descriptors scheduled from any of the queues within the flow control period reaches the corresponding preset second threshold, then the scheduling of the packet descriptors in any of the queues is stopped.

6. The method according to claim 4, wherein: The method further comprises: According to the preset second threshold and the preset priority corresponding to each of the queues corresponding to the virtual device, the packet descriptors are scheduled from the at least one queue corresponding to the virtual device, and the packet descriptors in the queues with high priorities are scheduled first, until the number of the packet descriptors scheduled from any of the queues within the flow control period reaches the corresponding preset second threshold, then scheduling of the packet descriptors in any of the queues is stopped.

7. The method according to claim 1, wherein The obtaining, from the virtual device according to at least one preset prefetch quantity level, corresponding at least one group of message descriptors includes: Determining, according to at least one preset prefetch quantity level and a predetermined level-to-quantity correspondence, a prefetch quantity corresponding to each prefetch quantity level in the at least one prefetch quantity level; According to the prefetch quantity corresponding to each prefetch quantity level in the at least one prefetch quantity level, at least one group of message descriptors of the prefetch quantity corresponding to the at least one prefetch quantity level is obtained from the virtual device.

8. The method according to claim 1, wherein Before acquiring at least one corresponding group of packet descriptors from the virtual device according to at least one preset prefetch quantity level, the method further includes: A notification message sent by the virtual device is received, where the notification message is used to instruct to obtain a message descriptor from the virtual device.

9. The method according to claim 1, wherein After scheduling the message descriptor from the at least one queue corresponding to the virtual device, the method further includes: Obtaining a corresponding message from the virtual device according to the scheduled message descriptor; The message is sent from a physical port of the flow control device.

10. The method according to claim 1, wherein The scheduling includes polling scheduling.

11. A flow control device, comprising a memory and a processor; the memory stores a computer program executable by the processor, and the computer program implements the method according to any one of claims 1 to 10 when executed by the processor.

12. A computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

13. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Network card virtualization queue scheduling method and system

    CN110519180A

  • Data processing method and device, equipment and storage medium

    CN114327806A

  • Flow processing system and method

    CN115987925A

  • Quality of service traffic management in high-speed packet processing systems

    US20190280991A1