A hardware-based interrupt aggregation method and device

By using time counters and quantity counters on the network card end, combined with the hardware interrupt aggregation method of register condition values, the problems of short aggregation time and inaccurate aggregation value in the prior art are solved, and more efficient processor performance and accurate aggregation value are achieved. sex.

CN117573209BActive Publication Date: 2024-12-03YUSUR TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311387490.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2024-12-03
Estimated Expiration
2043-10-24

AI Technical Summary

Technical Problem

In the existing interrupt aggregation scheme, the aggregation time can only reach the microsecond level, the aggregation value does not support artificial adjustment, and the preset aggregation value deviates from the actual aggregation value, resulting in the inability to guarantee the accuracy.

Method used

The hardware-based interrupt aggregation method is adopted, and the time counter and quantity counter are counted on the network card end, combined with the register condition value, logical control of interrupts is realized, allowing artificial setting of the aggregation time and quantity to ensure the accuracy of the aggregation value.

Benefits of technology

The number of interrupts is controlled through hardware logic, which reduces processor occupancy, improves processor performance, and solves the problem of inaccurate aggregation value setting, achieving a larger range of aggregation value setting and adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117573209B_ABST
    Figure CN117573209B_ABST
Patent Text Reader

Abstract

The present invention provides a hardware-based interrupt aggregation method and device. After receiving and processing a data packet, the network card sends the data packet to the host, generates an interrupt, and enters an aggregation state; in the aggregation state, the time counter counts; when the time counter count reaches the aggregation time, it is determined whether a data packet enters the network card during the counting period, and if so, an interrupt is generated; or when the time counter count does not reach the aggregation time, but the host writes a conditional value to the register, it is determined whether a data packet enters the network card from entering the aggregation state to writing the conditional value, and if so, an interrupt is generated; the aggregation state is ended, and the time counter and the register are restored to the initial value; according to the interrupt, the host takes the data packet received during the aggregation state from the host memory for processing. The method provided by the present invention controls the number of interrupts through hardware logic, improves processor performance, has a large aggregation value setting range, and solves the problem of deviation from the actual aggregation value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interrupt aggregation, and in particular to a hardware-based interrupt aggregation method and device. Background Art

[0002] At present, with the continuous development of servers, the amount of input / output (I / O) data of server networks is increasing, and the number of data packets received by the network port per unit time is increasing. In the conventional interrupt method, every time the network card pushes a data packet to the host, it will immediately push an interrupt corresponding to this data packet. The host processor executes the corresponding instructions according to the interrupt and takes the data packet out of the memory for subsequent processing. Under this interrupt method, when the network card pushes a large number of data packets to the host, the processor will be occupied by a large number of interrupts and cannot process other services, which greatly reduces the utilization rate of the processor; further, when a large number of interrupts are pushed, the processor may not be able to process all of them, so that some data packets are still in the memory and have not been taken away, and are covered by new data packets, resulting in data packet loss. Therefore, the concept of interrupt aggregation is introduced to reduce the number of interrupts and the overhead of interrupt processing to improve the performance and reliability of the processor.

[0003] The commonly used interrupt aggregation scheme is an interrupt aggregation method based on software implementation. The aggregation value is set by a software tool. When the aggregation value is reached, an interrupt is generated. The processor executes the corresponding instructions according to the interrupt and takes the corresponding data packets from the memory. Among them, the aggregation value includes the aggregation time and the aggregation quantity, such as how many microseconds to generate an interrupt (aggregation time) and how many data packets to generate an interrupt (aggregation quantity). Taking the Linux environment as an example, ethtool-c can be used to set the aggregation value. Compared with the conventional interrupt method, this method reduces the number of interrupts, thereby reducing the overhead of interrupt processing and improving the performance of the processor. However, the aggregation value set based on ethtool-c is small, such as the aggregation time can only reach the microsecond level, and ethtool-c is a tool that comes with the Linux system. Its setting of the aggregation value is not completely controlled by the engineer. There are multiple versions of ethtool-c, and there are differences between each version, which will cause the preset aggregation value to deviate from the actual aggregation value, and the accuracy cannot be guaranteed. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a hardware-based interrupt aggregation method and device to eliminate or improve one or more defects existing in the prior art, and to solve the problems existing in the existing interrupt aggregation scheme that the aggregation time can only reach the microsecond level, the aggregation value does not support manual adjustment, and there is a deviation between the preset aggregation value and the actual aggregation value, and the accuracy cannot be guaranteed.

[0005] On the one hand, the present invention provides a hardware-based interrupt aggregation method, which is executed in a network card end, and the network card is interconnected with a host. In one cycle, the method includes the following steps:

[0006] receiving and processing a data packet, sending the processed data packet to the host, generating an interrupt, and entering an aggregation state; wherein the host takes the data packet from its memory for processing according to the generated interrupt;

[0007] In the aggregation state, the time counter starts counting; when the time counter counts to the preset aggregation time, it is determined whether there is a data packet entering during the counting period, and if so, an interrupt is generated; or when the time counter counts to the aggregation time, the host writes a preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value, and if so, an interrupt is generated;

[0008] End the aggregation state and restore the time counter and the register to initial values;

[0009] The host executes corresponding instructions according to the generated interrupt to fetch the data packets received during the aggregation state from the memory of the host for processing.

[0010] In some embodiments of the present invention, receiving and processing a data packet, and sending the processed data packet to the host, further includes:

[0011] The network card pushes the data packet to the memory of the host based on direct memory access technology.

[0012] In some embodiments of the present invention, determining whether a data packet enters during the counting period further includes:

[0013] When the data packet enters the network card, a mark bit is set;

[0014] When the time counter reaches a preset aggregation time, checking the state of the flag bit;

[0015] A determination result is obtained according to the state of the flag bit, and the flag bit is restored to an initial value.

[0016] In some embodiments of the present invention, when the time counter reaches a preset aggregation time and it is determined that no data packet enters the network card during the counting period, the aggregation state is ended and the network card waits for receiving data packets again.

[0017] In some embodiments of the present invention, when the time counter counts less than the aggregation time, but the host writes the conditional value to the register, and it is determined that no data packet enters the network card from entering the aggregation state to writing the conditional value, the aggregation state is ended, and the network card waits for receiving data packets again.

[0018] On the other hand, the present invention provides a hardware-based interrupt aggregation method, which is executed on a network card, the network card is interconnected with a host, and in one cycle, the method comprises the following steps:

[0019] receiving and processing a data packet, sending the processed data packet to the host, generating an interrupt, and entering an aggregation state; wherein the host takes the data packet from its memory for processing according to the generated interrupt;

[0020] In the aggregation state, the number counter is used to start counting the received data packets; when the number counter reaches the preset aggregation number, an interrupt is generated; or when the number counter does not reach the aggregation number and the host writes a preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value, and if so, an interrupt is generated;

[0021] End the aggregation state and restore the quantity counter and the register to initial values;

[0022] The host executes corresponding instructions according to the generated interrupt to fetch the data packets received during the aggregation state from the memory of the host for processing.

[0023] In some embodiments of the present invention, receiving and processing a data packet, and sending the processed data packet to the host, further includes:

[0024] The network card pushes the data packet to the memory of the host based on direct memory access technology.

[0025] On the other hand, the present invention provides a hardware-based interrupt aggregation device, the device is used to implement the hardware-based interrupt aggregation method described above, the device comprising:

[0026] A network card; the network card comprises a data transceiver module, a counting module, a judgment module and an interruption generating module; the data transceiver module is used to receive and process data packets, and send the processed data packets and corresponding interruptions to a host; the counting module is provided with a time counter and a quantity counter, which are respectively used to count the time in the aggregation state and the number of received data packets; the judgment module is used to judge whether the count of the time counter reaches a preset aggregation time, whether the count of the quantity counter reaches a preset aggregation number, and whether a preset condition value is written in a register, and generate a judgment result; the interruption generating module is used to decide whether to generate an interruption according to the judgment result;

[0027] Host; the host is used to receive and store data packets sent by the network card, to receive interrupts sent by the network card, and to take away data packets stored in the memory for processing according to the interrupts, and to write preset conditional values ​​to registers to forcibly end the aggregation state.

[0028] On the other hand, the present invention provides an electronic device, comprising a processor and a memory; when the processor executes a computer program stored in the memory, the hardware-based interrupt aggregation method as described above is implemented.

[0029] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the hardware-based interrupt aggregation methods mentioned above.

[0030] The beneficial effects of the present invention are at least:

[0031] The present invention provides a hardware-based interrupt aggregation method and device. After a network card receives and processes a data packet, it sends the processed data packet to a host, generates an interrupt, and enters an aggregation state; in the aggregation state, a time counter starts counting; when the time counter counts to a preset aggregation time, it is determined whether a new data packet enters the network card during the counting period, and if so, an interrupt is generated; or when the time counter counts not to the aggregation time, but the host writes a preset conditional value to a register, it is determined whether a data packet enters the network card from entering the aggregation state to writing the conditional value, and if so, an interrupt is generated; the aggregation state is ended, and the time counter and the register are restored to the initial value; the host, according to the generated interrupt, takes all the data packets received during the aggregation state from the host memory for processing. The method provided by the present invention can realize interrupt aggregation, and control the number of interrupts generated by hardware logic, reduce the processor occupancy rate, and improve the processor performance. Furthermore, compared with the interrupt aggregation method based on software implementation, the aggregation value can be manually set and modified, and the value setting range is larger, which solves the problem of deviation between the preset aggregation value and the actual aggregation value.

[0032] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0033] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0035] Figure 1 The figure is a schematic diagram of the steps of a hardware-based interrupt aggregation method in one embodiment of the present invention.

[0036] Figure 2 The figure is a flowchart of a hardware-based interrupt aggregation method in one embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0038] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0039] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0040] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0041] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0042] It should be emphasized here that the step marks mentioned below are not intended to limit the order of the steps, but it should be understood that the steps can be executed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be executed simultaneously.

[0043] In order to solve the problems in the existing interrupt aggregation scheme that the aggregation time can only reach the microsecond level, the aggregation value does not support manual adjustment, and the preset aggregation value and the actual aggregation value have deviations, and the accuracy cannot be guaranteed, the present invention proposes a hardware-based interrupt aggregation method, which is executed in the network card end, and the host end and the network card end are interconnected, such as Figure 1 As shown, in one cycle, the method includes the following steps S101 to S104:

[0044] Step S101: receiving and processing a data packet, sending the processed data packet to the host, generating an interrupt, and entering an aggregation state, wherein the host takes the data packet from the host memory for processing according to the generated interrupt.

[0045] Step S102: In the aggregation state, the time counter starts counting; when the time counter counts to the preset aggregation time, it is determined whether there is a data packet entering during the counting period, and if so, an interrupt is generated; or when the time counter counts not reaching the aggregation time, the host writes a preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value, and if so, an interrupt is generated.

[0046] Step S103: End the aggregation state and restore the time counter and register to the initial value.

[0047] Step S104: the host executes corresponding instructions according to the generated interruption to fetch the data packets received during the aggregation state from the host's memory for processing.

[0048] like Figure 2 Shown is a flowchart of a hardware-based interrupt aggregation method.

[0049] In step S101, the network card waits to receive a data packet. In the initial state, the network card does not receive a data packet and does not generate an interrupt. When the network card receives the first data packet, it processes the data packet and sends it to the host, generates an interrupt, and enters the aggregation state. The host processor executes the corresponding instructions according to the generated interrupt, and takes the received data packet from the host's memory for subsequent processing of the data packet. Based on the above description, it can be seen that in one cycle, when the network card receives the first data packet, a corresponding separate interrupt will be generated.

[0050] In some embodiments, the network card pushes the data packet to the host's memory based on direct memory access (DMA) technology. Direct memory access technology is a technology that can bypass the processor to directly access the memory. Using direct memory access technology can achieve high-speed data transmission, save processor time, and improve system performance. Direct memory access transmits data autonomously from the peripheral by establishing a data transmission link. This method avoids the overhead of the processor periodically copying data when transmitting data, thereby reducing the processor burden and latency, and allows the processor to perform other tasks during data transmission.

[0051] In step S102, after entering the aggregation state, a preset time counter starts counting. During the aggregation state, the network card end will not generate an interrupt directly due to receiving a data packet, and an interrupt will be generated only after a preset condition is met, such as reaching a preset aggregation time and other conditions. Therefore, the aggregation time needs to be set in advance. It should be noted that the aggregation time can be manually set according to actual conditions, and can also be manually adjusted according to changes in actual conditions. Its value is not limited in the present invention.

[0052] In the present invention, two situations are set during the aggregation state to determine whether an interrupt needs to be generated. One is to determine based on the aggregation time: when the time counter reaches the preset aggregation time, it is determined whether a data packet enters the network card during the counting period. If so, an interrupt is generated. The generated interrupt is pushed up to the host, and the host uses the generated interrupt to take all the data packets received during the aggregation state from its memory.

[0053] In some embodiments, when the time counter reaches the preset aggregation time, but it is determined after judgment that no new data packets enter the network card during the counting period, the aggregation state is directly ended and returned to the initial state, that is, step S101, and the network card waits for receiving data packets again.

[0054] The second is to make a judgment based on the conditional value written by the host to the register: when the time counter count does not reach the preset aggregation time, but the host writes the preset conditional value to the register, it is judged whether there are data packets entering the network card from entering the aggregation state to writing the conditional value. If so, an interrupt is generated. The generated interrupt is pushed up to the host, and the host uses the generated interrupt to take all the data packets received during the aggregation state from its memory. It can be seen that when the time counter count does not reach the aggregation time, the aggregation state can be forced to end by writing the register value by the host.

[0055] In some embodiments, when the time counter count does not reach the preset aggregation time, and the host writes a conditional value to the register, but after judgment it is determined that no new data packet enters the network card from entering the aggregation state to writing the conditional value, the aggregation state is directly ended and returned to the initial state, that is, step S101, and the network card waits for receiving the data packet again.

[0056] In some embodiments, when determining whether a data packet enters the network card within a corresponding period, a flag bit detection method may be used, including the following steps:

[0057] When a data packet enters the network card, a flag is set. For example, a Boolean variable is set to "true" when a data packet enters.

[0058] When the time counter reaches the preset aggregation time, the state of the mark bit is checked. Specifically, if the mark bit is "true", it means that a new data packet enters the network card during the counting period; if the mark bit is "false", it means that no new data packet enters the network card during the counting period.

[0059] The judgment result is obtained according to the state of the mark bit, and whether to generate an interrupt is determined according to the judgment result. That is, if the mark bit is "true", it means that a new data packet enters the network card during the counting period, and an interrupt is generated. If the mark bit is "false", it means that no new data packet enters the network card during the counting period, and no interrupt is generated, the aggregation state ends, and returns to the initial state. At the same time, after the judgment is completed, the mark bit needs to be restored to the initial value to avoid affecting the accuracy of the next round of judgment results.

[0060] In some embodiments, when determining whether a data packet enters the network card during a corresponding period, methods such as data packet quantity count value detection and memory status change detection may also be used.

[0061] In step S103, the aggregation state is terminated according to the judgment result of step S102, and the time counter and register are restored to the initial value to avoid affecting the accuracy of the next round of judgment results. The initial value can be pre-set according to actual conditions, and its value is not limited in the present invention.

[0062] In step S104, if an interrupt is generated according to the judgment result in step S102, the network card pushes the generated interrupt to the host, and the host takes all data packets received during the aggregation state from the host memory according to the generated interrupt for subsequent processing.

[0063] In the present invention, the interrupt aggregation scheme is mainly implemented by setting the aggregation time, but the interrupt aggregation scheme can also be implemented by setting the aggregation number (the number of data packets). It should be noted that the interrupt aggregation scheme implemented by setting the aggregation time is better than the interrupt aggregation scheme implemented by setting the aggregation number, and still has excellent performance in the application scenario of ultra-large traffic.

[0064] In some embodiments, the interrupt aggregation scheme implemented by setting the aggregation number is further described. Similarly, the method is also executed in the network card end, the network card is interconnected with the host, and in one cycle, the method includes the following steps:

[0065] Receive and process data packets, send the processed data packets to the host, generate an interrupt, and enter the aggregation state. In this state, the host takes the data packets from its memory for processing according to the generated interrupt.

[0066] In the aggregation state, the number counter is used to start counting the received data packets; when the number counter reaches the preset aggregation number, an interrupt is generated; or when the number counter does not reach the aggregation number and the host writes the preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value. If so, an interrupt is generated.

[0067] End the aggregation state and restore the quantity counters and registers to their initial values.

[0068] Based on the generated interrupt, the host executes corresponding instructions to fetch the data packets received during the aggregation state from the host's memory for processing.

[0069] This method is similar to the hardware-based interrupt aggregation method described above, except that the aggregation value used to determine whether an interrupt is generated is changed from aggregation time to aggregation quantity. Therefore, the implementation examples supplemented above are also applicable to this method and will not be repeated here.

[0070] Correspondingly, corresponding to the method, the present invention also provides a hardware-based interrupt aggregation device, which is used to implement the hardware-based interrupt aggregation method as described above, and the device includes a network card and a host, specifically:

[0071] The network card also includes a data transceiver module, a counting module, a judgment module and an interrupt generation module. Among them, the data transceiver module is used to receive and process data packets, and send the processed data packets and corresponding interrupts to the host. The counting module is provided with a time counter and a quantity counter, which are used to count the time in the aggregation state and the number of received data packets respectively. The judgment module is used to judge whether the count of the time counter reaches the preset aggregation time, whether the count of the quantity counter reaches the preset aggregation number, and whether the preset condition value is written in the register, and generate a judgment result. The interrupt generation module is used to decide whether to generate an interrupt according to the judgment result.

[0072] The host is used to receive and store data packets sent by the network card, to receive interrupts sent by the network card, and to take data packets stored in the memory for processing according to the interrupts, and to write preset conditional values ​​to the registers to forcibly end the aggregation state.

[0073] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the hardware-based interrupt aggregation method are implemented.

[0074] Corresponding to the above method, the present invention also provides a device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the method described above.

[0075] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0076] In summary, the present invention provides a hardware-based interrupt aggregation method and device. After the network card receives and processes a data packet, it sends the processed data packet to the host, generates an interrupt, and enters the aggregation state; in the aggregation state, the time counter starts counting; when the time counter counts to the preset aggregation time, it is determined whether there is a new data packet entering the network card during the counting period, and if so, an interrupt is generated; or when the time counter count does not reach the aggregation time, but the host writes a preset conditional value to the register, it is determined whether there is a data packet entering the network card from entering the aggregation state to writing the conditional value, and if so, an interrupt is generated; the aggregation state is ended, and the time counter and register are restored to the initial value; according to the generated interrupt, the host takes all the data packets received during the aggregation state from the host memory for processing. The method provided by the present invention can realize interrupt aggregation, and control the number of interrupts generated by hardware logic, reduce the processor occupancy rate, and improve the processor performance. Furthermore, compared with the interrupt aggregation method based on software implementation, the aggregation value can be manually set and modified, and the value setting range is larger, which solves the problem of deviation between the preset aggregation value and the actual aggregation value.

[0077] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0078] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0079] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A hardware-based interrupt aggregation method, characterized in that: The method is executed on a network card, the network card is interconnected with a host, and in one cycle, the method comprises the following steps: receiving and processing data packets, pushing the processed data packets to the memory of the host based on direct memory access technology, generating an interrupt, and entering an aggregation state; wherein the host takes the data packets from its memory for processing according to the generated interrupt; In the aggregation state, the time counter starts counting; when the time counter counts to the preset aggregation time, it is determined whether there is a data packet entering during the counting period, and if so, an interrupt is generated; or when the time counter counts not reaching the aggregation time, the host writes a preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value, and if so, an interrupt is generated; wherein the method for determining whether there is a data packet entering during the counting period comprises: when the data packet enters the network card, a flag bit is set; when the time counter counts to the preset aggregation time, the state of the flag bit is checked; a determination result is obtained according to the state of the flag bit, and the flag bit is restored to the initial value; End the aggregation state and restore the time counter and the register to initial values; The host executes corresponding instructions according to the generated interrupt to fetch the data packets received during the aggregation state from the memory of the host for processing.

2. The hardware-based interrupt aggregation method according to claim 1, characterized in that: When the time counter reaches the preset aggregation time and it is determined that no data packet enters the network card during the counting period, the aggregation state is ended and the network card waits for receiving data packets again.

3. The hardware-based interrupt aggregation method according to claim 1, characterized in that: When the time counter count does not reach the aggregation time, but the host writes the conditional value to the register, and it is determined that no data packet enters the network card from entering the aggregation state to writing the conditional value, the aggregation state is ended, and the network card waits for receiving data packets again.

4. A hardware-based interrupt aggregation method, characterized in that: The method is executed in a network card, which is interconnected with a host. In one cycle, the method comprises the following steps: receiving and processing data packets, pushing the processed data packets to the memory of the host based on direct memory access technology, generating an interrupt, and entering an aggregation state; wherein the host takes the data packets from its memory for processing according to the generated interrupt; In the aggregation state, the number counter is used to start counting the received data packets; when the number counter reaches the preset aggregation number, an interrupt is generated; or when the number counter does not reach the aggregation number and the host writes a preset condition value to the register, it is determined whether there is a data packet entering from entering the aggregation state to writing the condition value, and if so, an interrupt is generated; End the aggregation state and restore the quantity counter and the register to initial values; The host executes corresponding instructions according to the generated interrupt to fetch the data packets received during the aggregation state from the memory of the host for processing.

5. The hardware-based interrupt aggregation method according to claim 4, characterized in that: Receiving and processing data packets, and sending the processed data packets to the host, further comprising: The network card pushes the data packet to the memory of the host based on direct memory access technology.

6. A hardware-based interrupt aggregation device, characterized in that: The device is used to implement the hardware-based interrupt aggregation method according to any one of claims 1 to 5, and the device includes: A network card; the network card comprises a data transceiver module, a counting module, a judgment module and an interruption generating module; the data transceiver module is used to receive and process data packets, and push the processed data packets and corresponding interruptions to the memory of the host based on direct memory access technology; the counting module is provided with a time counter and a quantity counter, which are respectively used to count the time in the aggregation state and the number of received data packets; the judgment module is used to judge whether the count of the time counter reaches the preset aggregation time, whether the count of the quantity counter reaches the preset aggregation number, and whether the preset condition value is written in the register, and generate a judgment result; the interruption generating module is used to decide whether to generate an interruption according to the judgment result; Host; the host is used to receive and store data packets sent by the network card, to receive interrupts sent by the network card, and to take away data packets stored in the memory for processing according to the interrupts, and to write preset conditional values ​​to registers to forcibly end the aggregation state.

7. An electronic device, characterized in that: The method comprises a processor and a memory; when the processor executes a computer program stored in the memory, the hardware-based interrupt aggregation method as claimed in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the hardware-based interrupt aggregation method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for preventing interruption from being lost and interruption controller

    CN113986789A

  • Multi-channel multi-mapping interrupt controller

    CN114048156A

  • Network card interrupt aggregation method and device, equipment and medium

    CN115576698A

  • Adaptive hardware interrupt moderation

    US20140006667A1

  • Internet of things device card binding pool management method and device, and related medium

    WO2023125674A1