Data processing method and device, electronic equipment and chip

By receiving interrupt instructions and pseudo-descriptor processing flow of multi-queue network cards, the problem of data packet out of order during queue switching is solved, and the network data processing speed and throughput is improved.

CN120378391APending Publication Date: 2025-07-25BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410642286.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

During packet processing, multi-queue network cards can easily lead to out-of-order data packets during queue switching, affecting the reception and throughput of network data, especially when the data traffic is large or the configuration hardware is delayed.

Method used

By receiving the interrupt instruction sent by the multi-queue network card, the application's data packet is read from the associated queue according to the interrupt instruction, and in response to reading the pseudo-descriptor, the packet processing flow matching the pseudo-descriptor type is performed, and the queue switching control is performed using the pseudo-descriptor.

Benefits of technology

It solves the problem of out-of-order packets during queue switching of multi-queue network cards, and improves the processing speed and throughput of network data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378391A_ABST
    Figure CN120378391A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, electronic equipment and a chip, and relates to the technical field of computers. The method specifically comprises the following steps: receiving an interrupt instruction sent by a multi-queue network card; reading a data packet of an application program from an associated queue according to the interrupt instruction, wherein the associated queue is an original queue or a target queue of the application program; and in response to the read pseudo descriptor of the queue, executing a data packet processing flow matched with the type of the pseudo descriptor, so that queue switching control is performed through the pseudo descriptor of the queue, the problem of data packet disorder caused by queue switching of a multi-queue network card is solved, and the processing speed of network data and the network throughput are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and particularly to a data processing method, apparatus, electronic device, and chip. Background Art

[0002] In related technologies, when processing data packets, the receiving architecture software in the Linux network protocol stack is usually used to determine that the receiving queue is empty and perform stream switching. The hardware responds passively and there are no switching signals and switching completion signals. Therefore, it completely relies on software logic to ensure that data packets are not out of order. However, in the above method, for scenarios with large data traffic and latency in configuring hardware, for example: during the configuration process, if the original queue receives packets of the flow that was originally to be switched away, and if the receiving software processes the flow packets in the switched queue first without receiving the original queue first, it will cause the data packets to be out of order and affect the reception of network data. For the packet accumulation scenario, for example: in order to improve network throughput, Internet Protocol (IP) packets are accumulated in the delivery queue of the network card, and the IP packets are delivered only when the number of IP packets reaches a certain amount. Then, it is impossible to confirm whether there are accumulated packets that have not been delivered, which cannot meet the requirements and causes the data packets to be out of order. Summary of the Invention

[0003] The present disclosure provides a data processing method, apparatus, electronic device, and chip.

[0004] The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a data processing method is provided. The method includes: receiving an interrupt instruction sent by a multi-queue network card; reading data packets of an application program from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program; and in response to reading a pseudo descriptor of the queue, executing a data packet processing process that matches the type of the pseudo descriptor.

[0006] According to a second aspect of an embodiment of the present disclosure, a data processing method is provided. The method includes: receiving data packets of an application program and determining whether the application program performs queue switching; in response to determining that the application program performs queue switching, determining the original queue and the target queue of the application program; writing respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different; and sending an interrupt instruction to the CPU to instruct the CPU to process the data packets in the original queue or the target queue according to the pseudo descriptor.

[0007] According to a third aspect of the embodiments of the present disclosure, there is provided a data processing device, the device comprising: a receiving module, configured to receive an interrupt instruction sent by a multi-queue network card; a reading module, configured to read a data packet of an application program from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program; an execution module, configured to, in response to reading a pseudo descriptor of a queue, execute a data packet processing process matching the type of the pseudo descriptor.

[0008] According to a fourth aspect of the embodiments of the present disclosure, there is provided a data processing device, the device comprising: a judging module, configured to receive a data packet of an application program and judge whether the application program performs queue switching; a determining module, configured to, in response to determining that the application program performs queue switching, determine the original queue and the target queue of the application program; a writing module, configured to write respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different; a sending module, configured to send an interrupt instruction to the CPU to instruct the CPU to process the data packet in the original queue or the target queue according to the pseudo descriptor.

[0009] According to a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, it implements the data processing method provided in the first aspect or the second aspect of the embodiments of the present disclosure.

[0010] According to a sixth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, where when an instruction in the computer-readable storage medium is executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method provided in the first aspect or the second aspect of the embodiments of the present disclosure.

[0011] According to a seventh aspect of the embodiments of the present disclosure, there is provided a computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, it implements the data processing method provided in the first aspect or the second aspect of the present disclosure.

[0012] According to an eighth aspect of the embodiments of the present disclosure, there is provided a chip system, comprising a processing unit and an interface circuit, where the processing unit obtains program instructions through the interface circuit, and the program instructions are executed by the processing unit, and the processing unit is configured to execute the steps of the data processing method provided in the first aspect or the second aspect.

[0013] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0014] A data processing method according to an embodiment of the present disclosure receives an interrupt instruction sent by a multi-queue network card, reads data packets of an application program from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program, and in response to reading a pseudo descriptor of the queue, executes a data packet processing process matching the type of the pseudo descriptor. Thus, the present disclosure controls queue switching through the pseudo descriptor of the queue, solves the problem of out-of-order data packets caused by queue switching in a multi-queue network card, and improves the processing speed of network data and network throughput.

[0015] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation of the present disclosure.

[0017] Figure 1 is a schematic flowchart of a data processing method shown according to an exemplary embodiment.

[0018] Figure 2 is a schematic flowchart of another data processing method shown according to an exemplary embodiment.

[0019] Figure 3 is a schematic flowchart of another data processing method shown according to an exemplary embodiment.

[0020] Figure 4 is a schematic flowchart of a data processing method shown according to an exemplary embodiment.

[0021] Figure 5 is a schematic diagram of a data processing method shown according to an exemplary embodiment.

[0022] Figure 6 is a block diagram of a data processing device shown according to an exemplary embodiment.

[0023] Figure 7 is a block diagram of a data processing device shown according to an exemplary embodiment.

[0024] Figure 8 is a block diagram of an electronic device shown according to an exemplary embodiment.

[0025] Figure 9 is a block diagram of a chip system shown according to some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0028] It should be noted that in order to solve the problem of out-of-order packets caused by queue switching in a multi-queue network card, the present disclosure provides a data processing method. The multi-queue network card receives packets from an application program, determines whether the application program performs queue switching, and in response to determining that the application program performs queue switching, determines the original queue and the target queue of the application program, and writes respective pseudo-descriptors at the tails of the original queue and the target queue. The multi-queue network card then sends an interrupt instruction to the central processing unit. The central processing unit receives the interrupt instruction sent by the multi-queue network card and reads the packets of the application program from the associated queue according to the interrupt instruction. In response to reading the pseudo-descriptor of the queue, the central processing unit executes a packet processing process matching the type of the pseudo-descriptor.

[0029] Figure 1 It is a schematic flowchart of a data processing method provided by an embodiment of the present disclosure.

[0030] As Figure 1 shown, the data processing method includes the following steps:

[0031] S101, receiving an interrupt instruction sent by a multi-queue network card.

[0032] It should be noted that after the multi-queue network card determines that an application program (abbreviated as APP) performs queue switching, it can determine the original queue and the target queue of the application program according to the flow table in the multi-queue network card, insert a pseudo-descriptor into the original queue, and the multi-queue network card then sends an interrupt instruction to the central processing unit (abbreviated as CPU) before the application program switches. Correspondingly, the CPU can receive the interrupt instruction sent by the multi-queue network card, determine that the number of packets in the target queue reaches a set number, and the multi-queue network card then sends an interrupt instruction to the CPU after the application program switches. Correspondingly, the CPU can receive the interrupt instruction sent by the multi-queue network card.

[0033] In an embodiment of the present disclosure, before receiving an interrupt instruction sent by a multi-queue network card, the receiving CPU of the current stream of each of multiple application programs running on the CPU and the recorded target CPU may be determined. According to the receiving CPU of the current stream of each application program and the recorded target CPU, it is determined whether there is an application program in which the receiving CPU and the target CPU are inconsistent among the multiple application programs. In response to the existence of an application program in which the receiving CPU and the target CPU are inconsistent, configuration information is sent to the multi-queue network card, and the configuration information is used to configure the multi-queue network.

[0034] Optionally, it is determined whether the target CPU meets the switching condition. If the switching condition is met, the driver software is called to send configuration information to the multi-queue network card, and the configuration information is used to update the flow table in the multi-queue network card, and the flow table is used to determine the original queue and the target queue of the application program.

[0035] S102, read the data packet of the application program from the associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program.

[0036] In an embodiment of the present disclosure, after receiving the interrupt instruction sent by the multi-queue network card, the data packet of the application program may be read from the associated queue according to the interrupt instruction, where the associated queue is the original queue Old Queue or the target queue New Queue of the application program.

[0037] S103, in response to reading the pseudo descriptor of the queue, execute the data packet processing flow that matches the type of the pseudo descriptor.

[0038] In an embodiment of the present disclosure, the CPU may determine whether the pseudo descriptor of the queue is read. During the process of not reading the pseudo descriptor of the original queue, continuously read and cache the data packets in the read target queue. During the process of not reading the pseudo descriptor of the target queue, continuously read the data packets in the original queue and maintain the record of the pseudo descriptor of the original queue.

[0039] Among them, the pseudo descriptor not only needs to record the information of the target queue and the original queue, but also needs some configuration information, such as configuration information such as hash value hash and RSS index index to be provided to the driver software to prevent affecting the reception of other streams of the APP.

[0040] Optionally, the specific information of the pseudo-descriptor includes at least the following fields: (1) Descriptor_Type, which is used to distinguish from the normal descriptor and has a different value from the normal descriptor; (2) Switch_type, which indicates whether it is aRFS, RSS, or others; (3) The type of switch, which indicates whether it is start or hold; (4) Old Queue ID, which indicates the source queue ID of the switch; (4) New Queue ID, which indicates the target queue ID of the switch, and is the queue that is held or started; (5) hash, which indicates the hash of the flow and is used for flow control of the block hash flow; (6) User_data, which indicates other data, such as five-tuple data.

[0041] In the embodiments of the present disclosure, the CPU can determine whether a pseudo-descriptor of a queue is read. In response to reading the pseudo-descriptor of the queue, a packet processing process matching the type of the pseudo-descriptor is executed, where the type of the pseudo-descriptor is start or hold.

[0042] Optionally, in response to the type of the pseudo-descriptor being the pseudo-descriptor of the target queue, the packets in the read target queue are cached until the pseudo-descriptor of the original queue is read, and then the reading and consumption of the packets in the target queue are resumed.

[0043] For example, if the type of the pseudo-descriptor is the pseudo-descriptor of the target queue, that is, the hold descriptor of the target queue New Queue, then the reception of the previous flow in the New Queue is paused, and the packets in the read target queue are cached until the pseudo-descriptor of the original queue, that is, the start descriptor of Old Queue, is read, and then the reading and consumption of the packets in the target queue are resumed.

[0044] Optionally, in response to the type of the pseudo-descriptor being the pseudo-descriptor of the original queue, the pseudo-descriptor of the original queue is recorded until the pseudo-descriptor of the target queue is read, the recorded pseudo-descriptor of the original queue is cleared, and the reading and consumption of the packets in the target queue are continued.

[0045] For example, if the type of the pseudo-descriptor is the pseudo-descriptor of the original queue, that is, the start descriptor of the original queue Old Queue, then the start descriptor of Old Queue is recorded until the pseudo-descriptor of the target queue, that is, the hold descriptor of NewQueue, is read, and then the recorded pseudo-descriptor of the original queue is cleared, and the reading and consumption of the packets in the target queue are continued.

[0046] It should be noted that when the software discovers during the process of receiving packets through the network protocol that the CPU for receiving packets of the current flow is inconsistent with the target CPU, that is, the application consuming the packets has switched CPUs, the network card driver will be called to update the hardware flow table to ensure that the queue identifier calculated for the next packet of the current flow is consistent with the corresponding CPU and the CPU where the application is located. The update process is initiated by the software and responded to by the hardware, and out-of-order situations may occur during this configuration process, affecting the reception of network data.

[0047] It should be noted that the data processing method proposed in this disclosure is a supplement and extension to the receive-side regulation technology and optimized receive flow steering technology for multi-queue network cards, and is used to solve the problem of out-of-order packets during the queue switching process.

[0048] Among them, the receive-side scaling (RSS) technology is a technology to improve network throughput in a multi-core system. For traditional network data processing, the network card can only use a single CPU core for processing, which limits the improvement of network throughput. However, the RSS technology can distribute the packets received from the network card to multiple CPU cores for processing, thus improving network throughput. Since the RSS technology only balances the packets to different CPU cores for processing, but the application program for receiving the packets and the soft interrupt processing are not necessarily on the same CPU, it will have a great impact on the cache of the CPU. Based on the receive flow steering (RFS) technology, it can be ensured that the CPU for the application program and the soft interrupt processing is the same to make full use of the CPU cache. RSS and RFS are often configured together to achieve the best optimization effect. Accelerated RFS (aRFS) for RFS is equivalent to RSS for receive packet steering (RPS). aRFS can select the correct queue on the hardware and then trigger the interrupt of the CPU where the flow to which the packet belongs is located.

[0049] A data processing method according to an embodiment of the present disclosure receives an interrupt instruction sent by a multi-queue network card, reads the data packets of the application program from the associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program, and in response to reading the pseudo-descriptor of the queue, executes a data packet processing process that matches the type of the pseudo-descriptor. Thus, the present disclosure controls the queue switching through the pseudo-descriptor of the queue, solves the problem of out-of-order data packets caused by the multi-queue network card during queue switching, and improves the processing speed of network data and network throughput.

[0050] Figure 2It is a schematic flowchart of a data processing method according to an embodiment of the present disclosure. On the basis of the above embodiment, further combined with Figure 2 , the specific process of the data processing method is explained as follows:

[0051] S201, Receive an interrupt instruction sent by a multi-queue network card.

[0052] S202, Read the data packets of the application program from the associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program.

[0053] For the specific steps of steps S201 - S202, reference can be made to the above embodiment and will not be elaborated here.

[0054] S203, In response to the type of the pseudo-descriptor being the pseudo-descriptor of the target queue, cache the data packets in the read target queue until the pseudo-descriptor of the original queue is read, and resume reading and consuming the data packets in the target queue.

[0055] Optionally, the first relevant information of the original queue can be extracted from the pseudo-descriptor of the original queue and the second relevant information of the target queue can be extracted from the pseudo-descriptor of the target queue, match the first relevant information and the second relevant information, in response to the first relevant information and the second relevant information matching, resume reading and consuming the data packets in the target queue, in response to the first relevant information and the second relevant information not matching, enter the data packet processing flow matching the pseudo-descriptor of the original queue,

[0056] S204, In response to the type of the pseudo-descriptor being the pseudo-descriptor of the original queue, record the pseudo-descriptor of the original queue until the pseudo-descriptor of the target queue is read, clear the recorded pseudo-descriptor of the original queue, and continue to read and consume the data packets in the target queue.

[0057] Optionally, in response to the first relevant information and the second relevant information not matching, enter the data packet processing flow matching the pseudo-descriptor of the original queue, in response to the first relevant information and the second relevant information not matching, clear the pseudo-descriptor of the original queue.

[0058] A data processing method according to an embodiment of the present disclosure receives an interrupt instruction sent by a multi-queue network card, reads a data packet of an application program from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program, determines whether a pseudo descriptor of the queue is read, if the pseudo descriptor is read, determines the type of the pseudo descriptor, in response to the type of the pseudo descriptor being the pseudo descriptor of the target queue, caches the data packets in the read target queue until the pseudo descriptor of the original queue is read, resumes reading and consuming the data packets in the target queue, in response to the type of the pseudo descriptor being the pseudo descriptor of the original queue, records the pseudo descriptor of the original queue until the pseudo descriptor of the target queue is read, clears the recorded pseudo descriptor of the original queue, and continues to read and consume the data packets of the target queue. Thus, the present disclosure controls queue switching through the pseudo descriptor of the queue, solves the problem of out-of-order data packets caused by queue switching of the multi-queue network card, and improves the processing speed of network data and network throughput.

[0059] Figure 3 It is a schematic flowchart of a data processing method provided by an embodiment of the present disclosure.

[0060] As Figure 3 shown, the data processing method includes the following steps:

[0061] S301, receive a data packet of an application program, and determine whether the application program performs queue switching.

[0062] Among them, the network interface card, that is, the network card (Network Interface Card, abbreviated as NIC), provides a hardware interface between the computer and the network, enabling the computer to connect to the network. The multi-queue network card (N Queue NIC) supports distributing the data packet volume to multiple queues to improve the network processing performance and throughput of the system.

[0063] In an embodiment of the present disclosure, configuration information sent by the CPU can be obtained, the flow table in the multi-queue network card is updated according to the configuration information, the original queue and the target queue of the application program are determined according to the flow table, and in response to the original queue and the target queue being different, it is determined that the application program performs queue switching.

[0064] For example, when the original queue of the application program is Queue1 and the target queue is Queue2, and the original queue and the target queue of the application program are different, it is determined that the application program performs queue switching.

[0065] S302, in response to determining that the application program performs queue switching, determine the original queue and the target queue of the application program.

[0066] Optionally, configuration information sent by the CPU can be obtained, the flow table in the multi-queue network card can be updated according to the configuration information, and the original queue and target queue of the application program can be determined according to the flow table.

[0067] S303. Write respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different.

[0068] It should be noted that the present disclosure does not limit the type of the pseudo descriptor, and it can be selected according to the actual situation.

[0069] Optionally, the pseudo descriptor can be a start pseudo descriptor; optionally, the pseudo descriptor can be a hold pseudo descriptor.

[0070] For example, a start pseudo descriptor can be written at the tail of the original queue, and a hold pseudo descriptor can be written at the tail of the target queue.

[0071] S304. Send an interrupt instruction to the CPU to instruct the CPU to process the data packets in the original queue or the target queue according to the pseudo descriptor.

[0072] In the embodiment of the present disclosure, in response to the insertion of a pseudo descriptor in the original queue, an interrupt instruction is sent to the CPU before the application program is switched, and in response to the number of data packets in the target queue reaching the set number, an interrupt instruction is sent to the CPU after the application program is switched.

[0073] It should be noted that after sending the interrupt instruction to the CPU, correspondingly, the CPU can receive the interrupt instruction sent by the multi-queue network card, and then the CPU can process the data packets in the original queue or the target queue according to the pseudo descriptor, that is, execute the data packet processing process matching the type of the pseudo descriptor.

[0074] A data processing method according to an embodiment of the present disclosure, by receiving data packets of an application program, determining whether the application program performs queue switching, in response to determining that the application program performs queue switching, determining the original queue and the target queue of the application program, writing respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different, and sending an interrupt instruction to the CPU to instruct the CPU to process the data packets in the original queue or the target queue according to the pseudo descriptor. Thus, the present disclosure controls queue switching through the pseudo descriptors of the queues, solves the problem of out-of-order data packets caused by queue switching in the multi-queue network card, enables the multi-queue network card to accumulate data packets, reduces the interrupts of the CPU receiving data packets, and improves the processing speed of network data and network throughput.

[0075] The application scenario of the data processing method of the present disclosure will be explained below.

[0076] For example, in the application scenarios of intelligent consumer electronic products for the fifth-generation mobile communication technology (5th-Generation Mobile Communication Technology, abbreviated as 5G), the network data processing speed is one of the core capabilities and is very sensitive to the latency and throughput of network data. In traditional network data processing, the network card can only use a single CPU core for processing, which limits the improvement of network throughput.

[0077] For example, in order to improve the throughput of the network in a multi-core system, the data packets received from the network card are distributed to multiple CPU cores for processing, and the received data packets are sent to the queue corresponding to the core that consumes the data packets as much as possible, so that the soft interrupt of the queue directly sends the data to the consumer to improve the network data processing speed. As Figure 4 shown, the multi-queue network card (N Queue NIC) receives the data packet of application program 0, that is, Packet1 (for App0). When the number of data packets in the target queue reaches the set number, an interrupt instruction (Interupt request, abbreviated as Irq) is sent to CPU2 (online CPU) after the application program switches. CPU2 reads the data packets in Queue2 in the receive queue and sends the data packets in Queue2 to App0.

[0078] The following explains the specific process of the data processing method proposed in the present disclosure.

[0079] For example, as Figure 5As shown in the figure, the multi-queue network card receives data packets from the application program (packet reception), and determines whether the receiving CPU (receiving core) of the current stream of each application program and the recorded target CPU (target core) are not the same core. If they are the same core, the multi-queue network card continues to receive packets normally. If they are not the same core, it determines whether the network protocol stack core switching condition is met. If the network protocol stack core switching condition is not met, the multi-queue network card continues to receive packets normally. If the network protocol stack core switching condition is met, it calls the driver software for hardware configuration. The hardware receives the configuration information sent by the CPU, and updates the entries in the flow table in the multi-queue network card according to the configuration information. The CPU (software) configuration needs to generate a pseudo descriptor, and write the start pseudo descriptor at the end of the original queue. When an interruption occurs in the original queue, the original queue is actively submitted, and the hold pseudo descriptor is written in the target queue. The CPU receives the interruption instruction sent by the multi-queue network card and starts to read the data packets of the application program from the software. If the CPU does not read the pseudo descriptor of the queue, it continues to receive packets. If the CPU reads the pseudo descriptor of the queue, it extracts the queue information and flow information from the pseudo descriptor, and determines whether the first read pseudo descriptor is the hold pseudo descriptor of the target queue. If it is the hold pseudo descriptor of the target queue, it caches the data packets in the read target queue, continues to receive packets, and caches the data packets in the target queue. The CPU reads the pseudo descriptor of the queue, extracts the queue information and flow information from the pseudo descriptor. If it is the start pseudo descriptor of the original queue, it determines whether the first related information of the original queue and the second related information of the target queue match. If they match, it resumes reading and consuming the data packets in the target queue. If they do not match, it enters the data packet processing flow that matches the start pseudo descriptor of the original queue. If it is not the hold pseudo descriptor of the target queue, that is, the start pseudo descriptor of the original queue, it records the pseudo descriptor and flow information of the original queue until it reads the pseudo descriptor of the target queue, extracts the queue information and flow information from the pseudo descriptor. If it is the hold pseudo descriptor of the target queue, it matches the information with the recorded hold pseudo descriptor, clears the recorded pseudo descriptor of the original queue, and continues to cache the data packets in the target queue.

[0080] In summary, according to a data processing method of an embodiment of the present disclosure, the problem of packet disorder caused by queue switching in aRFS or RSS is solved. The multi-queue network card can accumulate data packets, reduce the interruption of the CPU receiving data packets, improve the network throughput and network processing speed, and the action of switching queues no longer depends on the queue being empty, and is no longer affected by various situations such as throughput, configuration delay, and packet accumulation, improving the stability and reliability in the data processing process.

[0081] Figure 6It is a block diagram of a data processing device shown according to an exemplary embodiment.

[0082] As Figure 6 shown, the data processing device 1000 includes: a receiving module 110, a reading module 120, a judging module 130, and an executing module 140.

[0083] The receiving module 110 is configured to receive an interrupt instruction sent by a multi-queue network card;

[0084] The reading module 120 is configured to read a data packet of an application program from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program;

[0085] The executing module 130, in response to reading a pseudo descriptor of a queue, executes a data packet processing flow that matches the type of the pseudo descriptor.

[0086] Further, the executing module 140 is further configured to: in response to the type of the pseudo descriptor being the pseudo descriptor of the target queue, cache the data packets in the read target queue until the pseudo descriptor of the original queue is read, and resume reading and consuming the data packets in the target queue.

[0087] Further, the executing module 140 is further configured to: in response to the type of the pseudo descriptor being the pseudo descriptor of the original queue, record the pseudo descriptor of the original queue until the pseudo descriptor of the target queue is read, clear the recorded pseudo descriptor of the original queue, and continue to read and consume the data packets in the target queue.

[0088] Further, the executing module 140 is further configured to: extract first relevant information of the original queue from the pseudo descriptor of the original queue; extract second relevant information of the target queue from the pseudo descriptor of the target queue; and match the first relevant information and the second relevant information.

[0089] Further, the executing module 140 is further configured to: in response to the first relevant information and the second relevant information matching, resume reading and consuming the data packets in the target queue.

[0090] Further, the device 1000 is further configured to: in response to the first relevant information and the second relevant information not matching, enter a data packet processing flow that matches the pseudo descriptor of the original queue.

[0091] Further, the executing module 140 is configured to: in response to the first relevant information and the second relevant information matching, enter a data packet processing flow that matches the pseudo descriptor of the target queue.

[0092] Further, the apparatus 1000 is further configured to: in response to the first relevant information and the second relevant information not matching, clear the pseudo descriptors of the original queue.

[0093] Further, the apparatus 1000 is further configured to: during the process of not reading the pseudo descriptors of the original queue, continuously read and cache the data packets in the read target queue.

[0094] Further, the apparatus 1000 is further configured to: during the process of not reading the pseudo descriptors of the target queue, continuously read the data packets in the original queue and maintain the record of the pseudo descriptors of the original queue.

[0095] Further, the apparatus 1000 is further configured to: determine the receiving CPUs and the recorded target CPUs of the current flows of multiple application programs running on the CPU; according to the receiving CPUs and the recorded target CPUs of the current flows of the respective application programs, determine whether there is an application program in the multiple application programs where the receiving CPU and the target CPU are inconsistent; in response to there being an application program where the receiving CPU and the target CPU are inconsistent, send configuration information to the multi-queue network card, and the configuration information is used to configure the multi-queue network.

[0096] Further, the apparatus 1000 is further configured to: determine whether the target CPU meets the switching condition, and if it meets the switching condition, call the driver software to send configuration information to the multi-queue network card, and the configuration information is used to update the flow table in the multi-queue network card, and the flow table is used to determine the original queue and the target queue of the application program.

[0097] According to an embodiment of the present disclosure, a data processing apparatus, by receiving an interrupt instruction sent by a multi-queue network card, reads data packets of an application program from an associated queue, where the associated queue is the original queue or the target queue of the application program, and in response to reading the pseudo descriptors of the queue, executes a data packet processing process matching the type of the pseudo descriptors. Thus, the present disclosure controls queue switching through the pseudo descriptors of the queue, solves the problem of out-of-order data packets caused by queue switching in the multi-queue network card, and improves the processing of network data and network throughput.

[0098] Figure 7 It is a block diagram of a data processing apparatus shown according to an exemplary embodiment.

[0099] As Figure 7 shown, the data processing apparatus 2000 includes: a receiving module 210, a determining module 220, a writing module 230, and a sending module 240.

[0100] A judgment module 210, configured to receive data packets of an application program and judge whether the application program performs queue switching;

[0101] A determination module 220, configured to, in response to determining that the application program performs queue switching, determine an original queue and a target queue of the application program;

[0102] A writing module 230, configured to respectively write respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different;

[0103] A sending module 240, configured to send an interrupt instruction to a CPU to instruct the CPU to process data packets in the original queue or the target queue according to the pseudo descriptor.

[0104] Furthermore, the apparatus 2000 is further configured to: obtain configuration information sent by the CPU, update a flow table in the multi-queue network card according to the configuration information; determine the original queue and the target queue of the application program according to the flow table; in response to the original queue and the target queue being different, determine that the application program performs queue switching.

[0105] Furthermore, the sending module 240 is further configured to: in response to the pseudo descriptor being inserted into the original queue, send the interrupt instruction to the CPU before the application program switches.

[0106] Furthermore, the sending module 240 is further configured to: in response to the number of data packets in the target queue reaching a set number, send the interrupt instruction to the CPU after the application program switches.

[0107] According to a data processing apparatus of an embodiment of the present disclosure, by receiving data packets of an application program, judging whether the application program performs queue switching, in response to determining that the application program performs queue switching, determining an original queue and a target queue of the application program, respectively writing respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different, and sending an interrupt instruction to the CPU to instruct the CPU to process data packets in the original queue or the target queue according to the pseudo descriptor, thus, the present disclosure controls queue switching through the pseudo descriptors of the queues, solves the problem of out-of-order data packets caused by queue switching in a multi-queue network card, the multi-queue network card can accumulate data packets, reduces the interrupts of the CPU receiving data packets, and improves the processing speed of network data and network throughput.

[0108] To implement the above embodiment, the present disclosure further provides a communication device, such as Figure 8As shown, the communication device 3000 includes: a processor 301; one or more memories 302 for storing executable instructions of the processor 301; wherein, the processor 301 is configured to execute the data processing method described in the above embodiments. The processor 301 and the memory 302 are connected through a communication bus.

[0109] To implement the above embodiments, the present disclosure also provides a computer-readable storage medium including instructions, such as the memory 302 including instructions, and the above instructions can be executed by the processor 301 of the device 3000 to complete the above method. Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0110] To implement the above embodiments, the present disclosure also provides a computer program product including a computer program, characterized in that when the computer program is executed by a processor, it implements the data processing method described in the above embodiments.

[0111] To implement the above embodiments, the present disclosure also provides a chip system, as Figure 9 shown, the chip system includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 can be interconnected through a line. For example, the interface circuit 902 can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit 902 can be used to send signals to other devices (such as the processor 901). Exemplarily, the interface circuit 902 can read the instructions stored in the memory and send the instructions to the processor 901. When the instructions are executed by the processor 901, it can cause the port selection device to execute each step of the data processing method described in the above embodiments. Of course, the chip system can also include other discrete devices, and some embodiments of the present disclosure do not specifically limit this.

[0112] In some embodiments of the present disclosure, the interface circuit 902 can obtain data, program instructions, and / or information, etc. in the internal storage area of the chip system; it can also obtain data, program instructions, and / or information, etc. from outside the chip system.

[0113] Optionally, the chip system further includes a memory for storing necessary computer programs and data.

[0114] Those skilled in the art can also understand that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether such a function is implemented by hardware or software depends on the specific application and the design requirements of the entire system. For each specific application, those skilled in the art can use various methods to implement the described function, but such implementation should not be construed as exceeding the scope protected by the embodiments of the present application.

[0115] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0116] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A data processing method, characterized in that, The method includes: Receiving an interrupt instruction sent by a multi-queue network card; Reading application program data packets from an associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application program; In response to reading a pseudo-descriptor of a queue, executing a data packet processing flow that matches the type of the pseudo-descriptor.

2. The method according to claim 1, wherein The executing a data packet processing flow that matches the type of the pseudo-descriptor includes: In response to the type of the pseudo-descriptor being the pseudo-descriptor of the target queue, caching the data packets in the read target queue until the pseudo-descriptor of the original queue is read, and resuming the reading and consumption of the data packets in the target queue.

3. The method according to claim 1, characterized in that, The executing a data packet processing flow that matches the type of the pseudo-descriptor includes: In response to the type of the pseudo-descriptor being the pseudo-descriptor of the original queue, recording the pseudo-descriptor of the original queue until the pseudo-descriptor of the target queue is read, clearing the recorded pseudo-descriptor of the original queue, and continuing to read and consume the data packets of the target queue.

4. The method according to claim 2 or 3, characterized in that, The executing a data packet processing flow that matches the type of the pseudo-descriptor further includes: Extracting first relevant information of the original queue from the pseudo-descriptor of the original queue; Extracting second relevant information of the target queue from the pseudo-descriptor of the target queue; Matching the first relevant information and the second relevant information.

5. The method according to claim 4, characterized in that The resuming the reading and consumption of the data packets in the target queue includes: In response to the first relevant information and the second relevant information matching, resuming the reading and consumption of the data packets in the target queue.

6. The method according to claim 4, wherein The method further includes: In response to the first relevant information and the second relevant information not matching, entering a data packet processing flow that matches the pseudo-descriptor of the original queue.

7. The method according to claim 4, characterized in that The resuming the reading and consumption of the data packets in the target queue includes: In response to the first relevant information and the second relevant information matching, entering a data packet processing flow that matches the pseudo-descriptor of the target queue.

8. The method according to claim 4, characterized in that, The clearing the recorded pseudo-descriptor of the original queue includes: In response to the first relevant information and the second relevant information not matching, clearing the pseudo-descriptor of the original queue.

9. The method according to claim 2, wherein The method further includes: During the process of not reading the pseudo-descriptor of the original queue, continuously reading and caching the data packets in the read target queue.

10. The method according to claim 3, wherein The method further includes: During the process of not reading the pseudo-descriptor of the target queue, continuously reading the data packets in the original queue and maintaining the recording of the pseudo-descriptor of the original queue.

11. The method according to claim 1, characterized in that, Before receiving the interrupt instruction sent by the multi-queue network card, it further includes: Determining the receiving CPU and the recorded target CPU of the respective current flows of multiple application programs running on the CPU; Judging whether there is an application program in the multiple application programs where the receiving CPU and the target CPU are inconsistent according to the receiving CPU and the recorded target CPU of the respective current flows of the application programs; In response to the existence of an application where the receiving CPU and the target CPU are inconsistent, send configuration information to the multi-queue network card, and the configuration information is used to configure the multi-queue network.

12. The method according to claim 11, wherein The sending the configuration information to the multi-queue network card includes: Judge whether the target CPU meets the switching condition. If the switching condition is met, call the driver software to send configuration information to the multi-queue network card. The configuration information is used to update the flow table in the multi-queue network card, and the flow table is used to determine the original queue and the target queue of the application.

13. A data processing method, characterized in that, The method includes: Receive the data packet of the application and judge whether the application performs queue switching; In response to determining that the application performs queue switching, determine the original queue and the target queue of the application; Write respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different; Send an interrupt instruction to the CPU to instruct the CPU to process the data packet in the original queue or the target queue according to the pseudo descriptor.

14. The method according to claim 13, wherein Before receiving the data packet of the application and judging whether the application performs queue switching, it includes: Obtain the configuration information sent by the CPU and update the flow table in the multi-queue network card according to the configuration information; Determine the original queue and the target queue of the application according to the flow table; In response to the original queue and the target queue being different, determine that the application performs queue switching.

15. The method according to claim 13, wherein The sending the interrupt instruction to the CPU includes: In response to the pseudo descriptor being inserted into the original queue, send the interrupt instruction to the CPU before the application switches.

16. The method according to claim 11, wherein The sending the interrupt instruction to the CPU where the application is located includes: In response to the number of data packets in the target queue reaching the set number, send the interrupt instruction to the CPU after the application switches.

17. A data processing device, characterized in that, The device includes: A receiving module, configured to receive an interrupt instruction sent by the multi-queue network card; A reading module, configured to read the data packet of the application from the associated queue according to the interrupt instruction, where the associated queue is the original queue or the target queue of the application; An execution module, configured to execute a data packet processing process matching the type of the pseudo descriptor in response to reading the pseudo descriptor of the queue.

18. A data processing device, characterized in that, The device includes: A judging module, configured to receive the data packet of the application and judge whether the application performs queue switching; A determining module, configured to determine the original queue and the target queue of the application in response to determining that the application performs queue switching; A writing module, configured to write respective pseudo descriptors at the tails of the original queue and the target queue, where the types of the pseudo descriptors written in the original queue and the target queue are different; A sending module, configured to send an interrupt instruction to the CPU to instruct the CPU to process the data packet in the original queue or the target queue according to the pseudo descriptor.

19. An electronic device, characterized in that, Includes: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, a data processing method according to any one of claims 1-12 or claims 13-16 is implemented.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, a data processing method according to any one of claims 1-12 or claims 13-16 is implemented.

21. A computer program product, comprising a computer program which, when executed by a processor, implements a data processing method according to any one of claims 1-12 or claims 13-16.

22. A chip system, characterized in that, The chip system includes a processing unit and an interface circuit. The processing unit obtains program instructions through the interface circuit, and the program instructions are executed by the processing unit. The processing unit is configured to execute the steps of a data processing method according to any one of claims 1-12 or claims 13-16.