A notification suppression method, electronic device, and storage medium

CN122601599BActive Publication Date: 2026-09-25SHANGHAI YUNMAI XINLIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611080767.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-09-25
Estimated Expiration
2046-07-21

AI Technical Summary

Technical Problem

[0002]物理网卡在通过PCIE(Peripheral Component Interconnect Express)协议通道与主机侧进行数据通讯时,物理网卡每接收或发送一次报文,主机侧就会发起一次数据传输通知(PCIE事件通知,Notification或doorbell),在极端场景中,数据传输通知的数量是较为庞大的,如网络流量达到100Mpps时,数据传输通知的pps(packets per second,每秒处理的数据包数量,用于衡量网络设备每秒传输或转发的数据包数量)一般为100/128≈0.78Mpps,这就意味着每秒要进行78万次额外的PCIE写事务,会严重挤占CPU(CentralProcessing Unit,中央处理器)的缓存和总线带宽,导致CPU软中断(SiSoft)飙高,性能损失极大,因此就需要设计一种可以使数据传输通知的处理数量降低的抑制方法

Benefits of technology

本发明的通知抑制方法,当物理网卡接收到主机侧发起的数据传输通知时,获取数据传输通知对应的虚拟队列的预设的通知抑制配置规则,若数据传输通知对应的虚拟队列的预设的通知抑制配置规则表征为数据传输通知对应的虚拟队列需要进行通知抑制,则获取数据传输通知对应的虚拟队列的通知抑制状态,若数据传输通知对应的虚拟队列的通知抑制状态为未启用通知抑制状态,则将数据传输通知对应的虚拟队列的已用环的标志位字段调整为禁止通知字段,以启动通知抑制机制,并将数据传输通知对应的虚拟队列的已用环的标志位字段的调整时刻更新至队列抑制计时列表中,轮询队列抑制计时列表,若任一虚拟队列对应的标志位字段的调整时刻与当前时刻之间的时长大于该虚拟队列对应的预设通知发起时长,且该虚拟队列对应的标志位字段为禁止通知字段,则表征物理网卡可以处理该虚拟队列中存放的描述符,因此物理网卡向主机侧发起一次该虚拟队列对应的数据传输通知,以通过物理网卡对每一虚拟队列的等待时长的验证,由物理网卡的硬件向主机侧的软件适时发送数据传输通知,来降低数据传输通知的发送频率,节省写寄存器的带宽。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601599B_ABST
    Figure CN122601599B_ABST
Patent Text Reader

Abstract

The application provides a notification suppression method, an electronic device and a storage medium. The method comprises the following steps: when a physical network card receives a data transmission notification initiated by a host side, if a notification suppression configuration rule of a virtual queue corresponding to the data transmission notification represents that notification suppression is needed, and a notification suppression state of the virtual queue is an un-enabled notification suppression state, a flag bit field of the virtual queue is adjusted to a forbidden notification field; an adjustment time of the flag bit field of the virtual queue is updated to a queue suppression timing list; if a time length between the adjustment time of the flag bit field of any virtual queue and a current time is greater than a preset notification initiation time length corresponding to the virtual queue, and the flag bit field is the forbidden notification field, the physical network card initiates a data transmission notification, so that the hardware timely sends the data transmission notification to the software, so as to reduce the sending frequency of the data transmission notification and save the bandwidth of the write register.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network interface card (NIC) data processing notification, and in particular to a notification suppression method, electronic device, and storage medium. Background Technology

[0002] When a physical network interface card (NIC) communicates with the host via the PCIe (Peripheral Component Interconnect Express) protocol channel, the host initiates a data transmission notification (PCIe event notification, or doorbell) for each message received or sent by the NIC. In extreme scenarios, the number of data transmission notifications can be quite large. For example, when network traffic reaches 100 Mpps, the pps (packets per second, a measure of the number of data packets processed per second by a network device) of data transmission notifications is typically 100 / 128 ≈ 0.78 Mpps. This means that 780,000 additional PCIe write transactions are required per second, which severely strains the CPU's (Central Processing Unit) cache and bus bandwidth, causing a spike in CPU soft interrupts (SiSoft) and significant performance loss. Therefore, it is necessary to design a method to reduce the number of data transmission notifications processed. Summary of the Invention

[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to one aspect of this application, a notification suppression method is provided, comprising: Step S100: In response to the physical network card receiving a data transmission notification initiated by the host side, the preset notification suppression configuration rules of the virtual queue corresponding to the data transmission notification are obtained; the host side communicates with the physical network card through the PCIe protocol channel. Step S200: If the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification indicates that the virtual queue corresponding to the data transmission notification needs to be suppressed, then obtain the notification suppression status of the virtual queue corresponding to the data transmission notification. Step S300: If the notification suppression state of the virtual queue corresponding to the data transmission notification is not enabled, then adjust the flag field of the used ring of the virtual queue corresponding to the data transmission notification to the disabled notification field. Step S400: Update the adjustment time of the used ring flag field of the virtual queue corresponding to the data transmission notification to the preset queue suppression time list; the queue suppression time list includes the latest flag field and the latest flag field adjustment time of each virtual queue corresponding to the physical network card; Step S500: Poll the queue suppression timer list. If the duration between the adjustment time of the flag field corresponding to any virtual queue and the current time is greater than the preset notification initiation duration corresponding to the virtual queue, and the flag field corresponding to the virtual queue is a notification prohibition field, then the physical network card initiates a data transmission notification corresponding to the virtual queue to the host side.

[0004] According to another aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the aforementioned notification suppression method.

[0005] According to another aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0006] The present invention has at least the following beneficial effects: The notification suppression method of the present invention, when the physical network card receives a data transmission notification initiated by the host side, obtains the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification. If the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification indicates that the virtual queue corresponding to the data transmission notification needs to be suppressed, then the notification suppression status of the virtual queue corresponding to the data transmission notification is obtained. If the notification suppression status of the virtual queue corresponding to the data transmission notification is a disabled notification suppression status, then the flag field of the used ring of the virtual queue corresponding to the data transmission notification is adjusted to a disabled notification field to start the notification suppression mechanism, and the used ring of the virtual queue corresponding to the data transmission notification is adjusted accordingly. The adjustment time of the flag field is updated in the queue suppression timer list. The queue suppression timer list is polled. If the duration between the adjustment time of the flag field corresponding to any virtual queue and the current time is greater than the preset notification initiation duration corresponding to the virtual queue, and the flag field corresponding to the virtual queue is a notification prohibition field, it indicates that the physical network card can process the descriptors stored in the virtual queue. Therefore, the physical network card initiates a data transmission notification corresponding to the virtual queue to the host side. By verifying the waiting time of each virtual queue by the physical network card, the hardware of the physical network card sends data transmission notifications to the software on the host side in a timely manner to reduce the sending frequency of data transmission notifications and save the bandwidth of writing registers. Attached Figure Description

[0007] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0008] Figure 1 A flowchart of a notification suppression method provided in an embodiment of the present invention. Detailed Implementation

[0009] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0010] This application proposes a notification suppression method, such as Figure 1 As shown, it includes: Step S100: In response to the physical network card receiving a data transmission notification initiated by the host side, obtain the preset notification suppression configuration rules of the virtual queue corresponding to the data transmission notification; The host communicates with the physical network card via the PCIe protocol channel.

[0011] Data transmission notifications, also known as interrupt notifications, are typically sent by the physical network interface card (NIC) after processing each data packet (whether sent or received) to the CPU to retrieve or send the data. In high-traffic scenarios, this high-frequency interruption can cause significant overhead, leading to the CPU being too busy processing interrupts to attend to other tasks. This phenomenon is called an "interrupt storm." Therefore, it is necessary to "suppress" these interrupt notifications by accumulating multiple interrupt notifications and then sending them at the appropriate time, thereby significantly reducing the interrupt frequency and improving the overall throughput of the system. The notification mentioned above used to notify the CPU to send and receive data is a data transmission notification, also called a doorbell, or a "doorbell" mechanism.

[0012] Virtual queues, or VQs, are mechanisms primarily responsible for bulk data transfer between virtual machines (Guests) and host machines within the Virtio virtualization standard (a standardized I / O (input / output) paravirtualization solution for virtualization environments).

[0013] The virtual queue contains descriptors corresponding to the data to be sent and received. The descriptors include descriptive information such as the length of the data to be received or sent and the storage address.

[0014] Each virtual queue corresponds to a preset notification suppression configuration rule. The notification suppression configuration rule is a rule preset by the staff for each virtual queue to determine whether notification suppression is required. Since the depth of several virtual queues or the data processing efficiency of the data devices connected to the virtual queues are different, the specifications between several virtual queues are different, which will lead to different requirements for notification suppression. Therefore, it is necessary to configure a corresponding notification suppression configuration rule for each virtual queue to indicate whether the corresponding virtual queue needs to suppress notifications.

[0015] The virtual queue corresponding to the data transmission notification is the virtual queue that the data transmission notification points to, that is, the virtual queue that the doorbell indicates for data transmission and reception.

[0016] Step S200: If the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification indicates that the virtual queue corresponding to the data transmission notification needs to be suppressed, then obtain the notification suppression status of the virtual queue corresponding to the data transmission notification. Step S300: If the notification suppression state of the virtual queue corresponding to the data transmission notification is not enabled, then adjust the flag field of the used ring of the virtual queue corresponding to the data transmission notification to the disabled notification field. If the notification suppression status of the virtual queue corresponding to the data transmission notification is not enabled, it means that the virtual queue is not currently performing notification suppression. However, if the notification suppression configuration rule corresponding to the virtual queue indicates that the virtual queue needs to perform notification suppression, then the notification suppression mechanism of the virtual queue will be enabled. This means that the flag field of the used ring of the virtual queue will be adjusted to the notification-disabled field VIRTQ_USED_F_NO_NOTIFY, and the bit (flag) in the header of the used ring used to control the notification suppression mechanism will be adjusted from 0 to 1.

[0017] Step S400: Update the adjustment time of the flag field of the used ring of the virtual queue corresponding to the data transmission notification to the preset queue suppression time list; The queue suppression timing list includes the latest flag field and the latest flag field adjustment time for each virtual queue corresponding to the physical network card. By viewing the queue suppression timing list, you can know the current status of the flag field used to control notification suppression for each virtual queue, as well as the time when the flag field was last adjusted.

[0018] Furthermore, step S400 includes steps S410-S440: Step S410: Obtain the information entry corresponding to each virtual queue in the queue suppression timing list to obtain the information entry list A=(A1,A2,...,A...).i ,...,A j ); where i = 1, 2, ..., j; j is the number of virtual queues corresponding to the physical network card; A i This refers to the information entry in the queue suppression timer list corresponding to the i-th virtual queue corresponding to the physical network card. A i =(A i1 A i2 A i3 A i1 A is the queue identifier corresponding to the i-th virtual queue; i2 A is the latest flag field corresponding to the i-th virtual queue; i3 This is the adjustment time for the latest flag field corresponding to the i-th virtual queue; Step S420: Determine the virtual queue corresponding to the data transmission notification as the target queue; Step S430: Traverse each information entry in the queue suppression timing list, and identify the information entry whose queue identifier is the same as the identifier of the target queue as the target entry; The target entry is the information entry of the target queue in the queue suppression timer list.

[0019] Step S440: Update the adjustment time of the flag field in the target entry to the adjustment time of the flag field of the used ring in the target queue.

[0020] The flag field of the control notification suppression mechanism for each virtual queue is scanned in real time. If the flag field of one of the virtual queues changes, the time of the change and the changed flag field are updated in the queue suppression timer list to maintain the flag field of each virtual queue.

[0021] Step S500: Poll the queue suppression time list. If the duration between the adjustment time of the flag field corresponding to any virtual queue and the current time is greater than the preset notification initiation duration corresponding to the virtual queue, and the flag field corresponding to the virtual queue is a notification prohibition field, then the physical network card initiates a data transmission notification corresponding to the virtual queue to the host side. Each virtual queue has a corresponding notification initiation duration, which is set according to the data traffic of each virtual queue. The notification initiation duration represents the longest interval between two data transmission notifications of the virtual queue. That is, after the previous data transmission notification is initiated, the next data transmission notification must be initiated after the longest interval of this notification initiation duration. This is to avoid queue congestion caused by the failure to initiate the next data transmission notification due to the enabling of notification suppression.

[0022] Furthermore, step S500 includes steps S510-S540: Step S510: Obtain the preset notification initiation duration B corresponding to the i-th virtual queue. i ; Step S520: Obtain the adjustment time C of the flag field corresponding to the i-th virtual queue in the queue suppression timing list. i ; Step S530: Determine the notification initiation time T corresponding to the i-th virtual queue. i =C i +B i ; Step S540: Poll the queue suppression timer list; if T now >T i If the flag field corresponding to the i-th virtual queue in the queue suppression timer list is the prohibition notification field, then the physical network card initiates a data transmission notification for the i-th virtual queue to the host side. Among them, T now This refers to the current moment.

[0023] Step S610: Adjust the flag field of the virtual queue that meets the preset conditions according to the number of descriptor chains processed by the physical network card and the number of descriptors stored in any virtual queue. Furthermore, step S610 includes steps S611-S613: Step S611: When the physical network card receives or initiates a data transmission notification, the virtual queue corresponding to the data transmission notification is identified as a critical queue. Step S612: Obtain the number of descriptor chains consumed and the number of descriptors stored in the critical queue corresponding to the physical network card; Step S612 includes steps S6121-S6122: Step S6121: After the physical network card finishes processing each descriptor chain, it increments the internal consumed pointer by one to determine the current number of descriptor chains consumed by the physical network card. After a physical network interface card (NIC) finishes processing a descriptor chain, its internal "consumed pointer" vq_next_cid advances one position to indicate the number of descriptor chains consumed by the physical NIC.

[0024] Step S6122: Read the index of the available ring in physical memory to determine the number of descriptors already stored in the critical queue.

[0025] When the virtual machine driver sends a new doorbell (Kick notification), the physical network card hardware responds to this data transmission notification by immediately reading the index (idx) of the "Available Ring" in shared memory to find out how many descriptors the driver has put in the critical queue, and records the total number as vq_next_pid, which is the number of descriptors that have been stored.

[0026] Step S613: If the number of consumed items is equal to the number of descriptors stored in the critical queue, and the flag field corresponding to the critical queue is a prohibited notification field, then the physical network card initiates a write operation to the head of the used ring in physical memory to adjust the flag field corresponding to the critical queue to a permitted notification field.

[0027] If vq_next_cid = vq_next_pid, it means the critical queue is empty (the hardware is processing faster than the driver is producing, and has just finished processing the previous batch of data). Since the critical queue is empty, if the hardware (i.e., the physical network card) is still enabled with "Do Not Disturb" (suppression enabled), then the descriptors of newly added data packets by the virtual machine driver will not send data transmission notification doorbells because they see the "Do Not Disturb" flag. Therefore, to avoid "deadlock" (the driver thinks the hardware is busy, and the hardware waits for the driver to kick it), the hardware decides to immediately disable notification suppression (clear the NO_NOTIFY flag) and enter a standby state of "waiting for the software to generate new descriptors". So, the hardware initiates a write operation (PCIe Write) to the header of the "Used Ring" in shared memory, changing the "NO_NOTIFY" flag to 0 (i.e. disabling notification suppression), which means that data transmission notification doorbells can be sent.

[0028] Step S620: Process and verify the virtual queue whose flag field has been adjusted; Furthermore, step S620 includes steps S621-S622: Step S621: After the physical network card receives the response notification of the write operation sent by the physical memory, it initiates a read operation; After the write operation in step S613 is executed, once an ACK (acknowledgment response) for the write operation is received from memory, it is ensured that the flag for disabling notification suppression has been actually written into physical memory. Then, the hardware initiates another read operation to refresh the internal cache of the hardware (or to ensure that subsequent operations can see the latest memory value) and ensure that the "disabling notification suppression" state has been firmly effective.

[0029] Step S622: After the physical network card receives the response notification of the read operation sent by the physical memory, it reads the index of the available ring in the physical memory. If there is a descriptor in the critical queue, the descriptor is processed.

[0030] Because during the write operation in step S613 and the confirmation of "disabling notification suppression" in step S621 (which may take a few microseconds), the virtual machine driver may have taken the opportunity to stuff new data packet descriptors into the critical queue. Therefore, after receiving the read operation response notification, the hardware does not rely on the old vq_next_pid, but actively reads the index virtq_avail.idx of the available ring again. If there is new data, it updates vq_next_pid and continues processing; if not, the hardware safely enters sleep mode, waiting for the driver to ring the doorbell (i.e., data transmission notification) to wake it up. The step of adjusting the flag field of the virtual queue in step S620 is the last insurance against "stampede".

[0031] Wherein, the preset notification initiation duration B corresponds to the i-th virtual queue. i Determined according to steps S501-S503: Step S501: Obtain the data processing traffic E of the i-th virtual queue within the target time period. i ; The end time of the target time period is before the current time, and the duration of the target time period is the preset duration.

[0032] Step S502: Obtain each traffic segment from the preset duration mapping table to obtain a traffic segment list D=(D1,D2,...,D...). m ,...,D n ); where m=1,2,...,n; n is the number of traffic segments included in the duration mapping table; D m This refers to the m-th traffic segment included in the duration mapping table; D m =(D m1 D m2 );D m1 D represents the lower limit of the traffic for the m-th traffic segment included in the duration mapping table. m2 This represents the upper limit of the traffic for the m-th traffic segment included in the duration mapping table; The duration mapping table includes several traffic segments and the notification duration corresponding to each traffic segment; The duration mapping table is a mapping table of traffic segments and notification durations set by staff based on historical experience. There is a negative feedback relationship between the average traffic in a traffic segment and the corresponding notification duration. That is, the higher the average traffic in a traffic segment, the shorter the corresponding notification duration. This ensures that the longest interval between two adjacent data transmission notifications in virtual queues with high data traffic is short, avoiding queue congestion caused by long-term notification suppression. For virtual queues with low data traffic, the corresponding notification duration can be extended as appropriate.

[0033] Step S503, if D m1 ≤E i <D m2 Then the notification duration corresponding to the m-th traffic segment is determined to be the preset notification initiation duration B corresponding to the i-th virtual queue. i .

[0034] The notification suppression method of the present invention, when the physical network card receives a data transmission notification initiated by the host side, obtains the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification. If the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification indicates that the virtual queue corresponding to the data transmission notification needs to be suppressed, then the notification suppression status of the virtual queue corresponding to the data transmission notification is obtained. If the notification suppression status of the virtual queue corresponding to the data transmission notification is a disabled notification suppression status, then the flag field of the used ring of the virtual queue corresponding to the data transmission notification is adjusted to a disabled notification field to start the notification suppression mechanism, and the used ring of the virtual queue corresponding to the data transmission notification is adjusted accordingly. The adjustment time of the flag field is updated in the queue suppression timer list. The queue suppression timer list is polled. If the duration between the adjustment time of the flag field corresponding to any virtual queue and the current time is greater than the preset notification initiation duration corresponding to the virtual queue, and the flag field corresponding to the virtual queue is a notification prohibition field, it indicates that the physical network card can process the descriptors stored in the virtual queue. Therefore, the physical network card initiates a data transmission notification corresponding to the virtual queue to the host side. By verifying the waiting time of each virtual queue by the physical network card, the hardware of the physical network card sends data transmission notifications to the software on the host side in a timely manner to reduce the sending frequency of data transmission notifications and save the bandwidth of writing registers.

[0035] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0036] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0037] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0038] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0039] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”

[0040] An electronic device according to this embodiment of the invention. The electronic device is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the invention.

[0041] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).

[0042] The storage device stores program code that can be executed by the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of the present invention.

[0043] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0044] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0045] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.

[0046] Electronic devices can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable users to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed through input / output (I / O) interfaces. Furthermore, electronic devices can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapters.

[0047] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0048] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.

[0049] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0050] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0051] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0052] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0053] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0054] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0055] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A notification suppression method, characterized in that, include: Step S100: In response to the physical network card receiving a data transmission notification initiated by the host side, the preset notification suppression configuration rules of the virtual queue corresponding to the data transmission notification are obtained; the host side communicates with the physical network card through the PCIe protocol channel. Step S200: If the preset notification suppression configuration rule of the virtual queue corresponding to the data transmission notification indicates that the virtual queue corresponding to the data transmission notification needs to be suppressed, then obtain the notification suppression status of the virtual queue corresponding to the data transmission notification. Step S300: If the notification suppression state of the virtual queue corresponding to the data transmission notification is not enabled, then adjust the flag field of the used ring of the virtual queue corresponding to the data transmission notification to the disabled notification field. Step S400: Update the adjustment time of the used ring flag field of the virtual queue corresponding to the data transmission notification to the preset queue suppression timing list; the queue suppression timing list includes the latest flag field and the latest flag field adjustment time of each virtual queue corresponding to the physical network card; Step S500: Poll the queue suppression timer list. If the duration between the adjustment time of the flag field corresponding to any virtual queue and the current time is greater than the preset notification initiation duration corresponding to the virtual queue, and the flag field corresponding to the virtual queue is a notification prohibition field, then the physical network card initiates a data transmission notification corresponding to the virtual queue to the host side.

2. The method according to claim 1, characterized in that, Step S400 includes: Step S410: Obtain the information entry corresponding to each virtual queue in the queue suppression timing list to obtain the information entry list A=(A1,A2,...,A1). i ,...,A j ); where i = 1, 2, ..., j; j is the number of virtual queues corresponding to the physical network card; A i The information entry in the queue suppression timing list corresponding to the i-th virtual queue corresponding to the physical network card; A i =(A i1 A i2 A i3 A i1 A is the queue identifier corresponding to the i-th virtual queue; i2 A is the latest flag field corresponding to the i-th virtual queue; i3 This is the adjustment time for the latest flag field corresponding to the i-th virtual queue; Step S420: Determine the virtual queue corresponding to the data transmission notification as the target queue; Step S430: Traverse each information entry in the queue suppression timing list, and determine the information entry whose queue identifier is the same as the identifier of the target queue as the target entry; Step S440: Update the adjustment time of the flag field in the target entry to the adjustment time of the flag field of the used ring in the target queue.

3. The method according to claim 2, characterized in that, Step S500 includes: Step S510: Obtain the preset notification initiation duration B corresponding to the i-th virtual queue. i ; Step S520: Obtain the adjustment time C of the flag field corresponding to the i-th virtual queue in the queue suppression timing list. i ; Step S530: Determine the notification initiation time T corresponding to the i-th virtual queue. i =C i +B i ; Step S540: Poll the queue suppression timer list. If T now >T i If the flag field corresponding to the i-th virtual queue in the queue suppression timer list is a prohibit notification field, then the physical network card initiates a data transmission notification corresponding to the i-th virtual queue to the host side. Among them, T now This refers to the current moment.

4. The method according to claim 3, characterized in that, The preset notification initiation duration B corresponds to the i-th virtual queue. i Determine according to the following steps: Step S501: Obtain the data processing traffic E of the i-th virtual queue within the target time period. i The end time of the target time period is before the current time, and the duration of the target time period is a preset duration. Step S502: Obtain each traffic segment from the preset duration mapping table to obtain a traffic segment list D=(D1,D2,...,D...). m ,...,D n ); where m=1,2,...,n; n is the number of traffic segments included in the duration mapping table; D m This refers to the m-th traffic segment included in the duration mapping table; D m =(D m1 D m2 );D m1 D is the lower limit of the traffic flow for the m-th traffic segment included in the duration mapping table; m2 The upper limit of the traffic for the m-th traffic segment included in the duration mapping table; The duration mapping table includes several traffic segments and the notification duration corresponding to each traffic segment; Step S503, if D m1 ≤E i <D m2 Then the notification duration corresponding to the m-th traffic segment is determined to be the preset notification initiation duration B corresponding to the i-th virtual queue. i .

5. The method according to claim 4, characterized in that, Following step S500, the method further includes: Step S610: Adjust the flag field of the virtual queue that meets the preset conditions according to the number of descriptor chains processed by the physical network card and the number of descriptors stored in any virtual queue; Step S620: Process and verify the virtual queue whose flag field has been adjusted.

6. The method according to claim 5, characterized in that, Step S610 includes: Step S611: When the physical network card receives or initiates a data transmission notification, the virtual queue corresponding to the data transmission notification is determined as a critical queue. Step S612: Obtain the number of descriptor chains consumed and the number of descriptors stored in the key queue corresponding to the physical network card; Step S613: If the consumed quantity is equal to the number of descriptors stored in the critical queue, and the flag field corresponding to the critical queue is a prohibited notification field, then the physical network card initiates a write operation to the head of the used ring in physical memory to adjust the flag field corresponding to the critical queue to a permitted notification field.

7. The method according to claim 6, characterized in that, Step S612 includes: Step S6121: After the physical network card finishes processing each descriptor chain, it increments the internal consumed pointer by one to determine the current number of descriptor chains consumed by the physical network card. Step S6122: Read the index of the available ring in physical memory to determine the number of descriptors already stored in the critical queue.

8. The method according to claim 7, characterized in that, Step S620 includes: Step S621: After the physical network card receives the response notification of the write operation sent by the physical memory, it initiates a read operation; Step S622: After the physical network card receives the response notification of the read operation sent by the physical memory, it reads the index of the available ring in the physical memory. If there is a descriptor in the critical queue, the descriptor is processed.

9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the method as described in any one of claims 1-8.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.

Citation Information

Patent Citations

  • Data processing method and system and related components

    CN116401079A

  • Data transmission method and related device

    WO2025180321A1