Data packet processing method, apparatus, device, medium and computer program product

By generating and loading different types of framework drivers, and selecting the appropriate driver to process data packets according to the network card hardware interface type, the problem of network card hardware interface type limitations in the existing technology is solved, achieving more efficient data packet processing and reducing maintenance workload.

CN115827515BActive Publication Date: 2026-04-14SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing packet processing systems have requirements for the hardware interface of network cards, which limits the packet processing speed and results in a large amount of maintenance work in the later stages.

Method used

Generate the first frame driver corresponding to the input/output frame and the second frame driver corresponding to the data plane development kit. Select the appropriate driver to process data packets according to the network card hardware interface type, including using different drivers under the peripheral component interconnect standard interface or the high-speed serial computer expansion bus standard interface.

Benefits of technology

It improves data packet processing speed, reduces post-maintenance workload, and enhances system flexibility and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115827515B_ABST
    Figure CN115827515B_ABST
Patent Text Reader

Abstract

The application provides a data packet processing method, device, equipment, medium and computer program product, the method comprising: generating a first framework driver corresponding to an input / output framework and a second framework driver corresponding to a data plane development kit; adapting a structure of the data plane development kit to the input / output framework, loading the first framework driver and the second framework driver; in the case that a network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, processing a data packet according to the second framework driver; in the case that the network card hardware interface is not the peripheral component interconnect standard interface and the high-speed serial computer expansion bus standard interface, processing a data packet according to the first framework driver, which reduces the maintenance work in the later stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data packet processing technology, and in particular to a data packet processing method, apparatus, device, medium, and computer program product. Background Technology

[0002] In application areas such as 5G smart gateways, routers, load balancers, firewalls, and video streaming, network performance, throughput, and latency are becoming increasingly important in today's network communications. However, existing input / output architectures have requirements for the hardware interface of network cards, which hinders the development of high-speed data packet processing and increases the workload of later maintenance. Summary of the Invention

[0003] This invention provides a data packet processing method, apparatus, device, medium, and computer program product to solve the technical problem of high post-processing maintenance workload in existing data packet processing methods.

[0004] This invention provides a data packet processing method, comprising:

[0005] Generate the first frame driver corresponding to the input / output framework and the second frame driver corresponding to the data plane development kit;

[0006] Adapt the structure of the data plane development kit to the input / output framework, and load the first framework driver and the second framework driver;

[0007] When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the second frame driver.

[0008] When the network card hardware interface is not a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the first framework driver.

[0009] According to a data packet processing method provided by the present invention, the step of generating a first frame driver corresponding to an input / output frame and a second frame driver corresponding to a data plane development kit includes:

[0010] Set the cross-compilation environment variables for the input / output framework and data plane development kits to generate the first framework driver and the second framework driver, respectively.

[0011] According to a data packet processing method provided by the present invention, the step of adapting the structure of the data plane development kit to the input / output framework includes:

[0012] By analyzing the structure of the data plane development kit, the input / output framework and the data plane development kit are uniformly analyzed, and it is determined that the structure of the data plane development kit is compatible with the input / output framework.

[0013] According to a data packet processing method provided by the present invention, when the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the step of processing data packets according to the second frame driver includes:

[0014] When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded second frame driver.

[0015] According to a data packet processing method provided by the present invention, the step of processing data packets according to the first frame driver when the network card hardware interface is not a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface includes:

[0016] When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded first frame driver.

[0017] According to a data packet processing method provided by the present invention, when the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the method includes the following steps before the step of processing data packets according to the second frame driver:

[0018] Based on the interface type of the network card hardware interface, the network card hardware interface includes peripheral component interconnection standard interface, high-speed serial computer expansion bus standard interface, and other interfaces.

[0019] The present invention also provides a data packet processing apparatus, comprising:

[0020] The driver generation module is used to generate the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit.

[0021] The structure adaptation module is used to adapt the structure of the data plane development kit to the input / output framework and load the first framework driver and the second framework driver.

[0022] The first data packet processing module is used to process data packets according to the second frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0023] The second data packet processing module is used to process data packets according to the first framework driver when the network card hardware interface is not a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0024] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the data packet processing methods described above.

[0025] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data packet processing method as described above.

[0026] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the data packet processing methods described above.

[0027] The data packet processing method, apparatus, device, medium, and computer program product provided by this invention, in the technical solution of this invention, firstly generates a first frame driver corresponding to the input / output frame and a second frame driver corresponding to the data plane development kit, then adapts the structure of the data plane development kit to the input / output frame, loads the first frame driver and the second frame driver on the board, and finally processes data packets according to the first frame driver when the network card hardware interface is not a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface, and processes data packets according to the second frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface, thereby reducing the subsequent maintenance work. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0029] Figure 1 This is a flowchart illustrating the data packet processing method provided by the present invention;

[0030] Figure 2 This is a schematic diagram of the data packet processing device provided by the present invention;

[0031] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0033] The following is combined Figure 1 The data packet processing method of the present invention is described.

[0034] Please refer to Figure 1 The present invention provides a data packet processing method, comprising:

[0035] Step 100: Generate the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit;

[0036] Specifically, Netmap is a high-speed network I / O architecture based on the zero-copy concept (i.e., the input / output framework in this embodiment). It can achieve the line-speed packet transmission and reception of network cards on gigabit or 10-gigabit network cards while saving computer resources. Zero copy means that when devices such as hosts and routers interact with the network card, the CPU does not need to copy data from one memory area to another. By reducing the number of data copies or shared bus operations, zero copy eliminates unnecessary copying of communication data, effectively improving communication efficiency, saving storage space and processing time. The DPDK (Data Plane Development Kit) application uses its own data plane library for packet transmission and reception, bypassing the Linux kernel-level protocol stack to improve packet processing efficiency.

[0037] Set the cross-compilation environment variables for the input / output framework, compile and generate the input / output framework driver, which is the first framework driver in this embodiment; set the cross-compilation environment variables for the data plane development kit, compile and generate the data plane development kit driver, which is the second framework driver in this embodiment.

[0038] Step 200: Adapt the structure of the data plane development kit to the input / output framework, and load the first framework driver and the second framework driver;

[0039] Specifically, after compiling and generating the Netmap driver and DPDK driver, the DPDK structure is adapted to Netmap so that the DPDK and Netmap share the DPDK structure when parsing and assembling the interface, reducing the workload of later maintenance. Then, the Netmap driver and DPDK driver are loaded on the target board respectively.

[0040] Step 300: When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packet is processed according to the second frame driver.

[0041] Specifically, this solution can accelerate data packets according to the hardware interface of the network card. If the hardware interface of the network card (i.e., the network card hardware interface in this embodiment) is PCI (Peripheral Component Interconnect) or PCIE (Peripheral Component Interconnect Express), DPDK is used, that is, the data packets are processed according to the second frame driver.

[0042] Step 400: If the network card hardware interface is not a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, process the data packet according to the first framework driver.

[0043] Specifically, this solution can accelerate data packet processing according to the hardware interface of the network card. If the network card hardware interface is neither a peripheral component interconnection standard interface nor a high-speed serial computer expansion bus standard interface, Netmap is used, that is, data packets are processed according to the first frame driver.

[0044] In this embodiment, a first frame driver corresponding to the input / output frame and a second frame driver corresponding to the data plane development kit are first generated. Then, the structure of the data plane development kit is adapted to the input / output frame, and the first and second frame drivers are loaded on the board. Finally, when the network card hardware interface is not a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the first frame driver. When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the second frame driver, reducing subsequent maintenance work.

[0045] In one embodiment, the data packet processing method provided in this application may further include:

[0046] Step 110: Set the cross-compilation environment variables for the input / output framework and data plane development kit to generate the first framework driver and the second framework driver, respectively.

[0047] Specifically, the cross-compilation environment variables for the input / output framework are set, and the input / output framework driver is compiled and generated. The specific implementation method is as follows:

[0048] export ARCH=arm64

[0049] export CROSS_COMPILE=aarch64-linux-gnu-

[0050] export CROSS=aarch64-linux-gnu-

[0051] export CROSS_PREFIX=aarch64-linux-gnu

[0052] export CC=aarch64-linux-gnu-gcc

[0053] . / configure --kernel-dir= / home / yb / xxx / … (--kernel-dir= is followed by the kernel path)

[0054] Make

[0055] Configure the cross-compilation environment variables for the data plane development kit, and compile to generate the data plane development kit driver. The specific implementation method is as follows:

[0056] export RTE_SDK = $PWD

[0057] export RTE_TARGET=arm64-dpaa-linuxapp-gcc

[0058] export ARCH=arm64

[0059] export CROSS_COMPILE=aarch64-linux-gnu-

[0060] export CROSS=aarch64-linux-gnu-

[0061] export CROSS_PREFIX=aarch64-linux-gnu

[0062] export CC=aarch64-linux-gnu-gcc

[0063] export RTE_KERNELDIR= / home / yb / xxx / … (RTE_KERNELDIR= followed by the kernel path)

[0064] In the root directory of the DPDK source code, run the script . / usertools / dpdk-setup.sh, select the corresponding option for arm64-dpaa-linuxapp-gcc to compile, and the ko file used on the target board will be generated.

[0065] This embodiment generates the Netmap driver and DPDK driver by setting cross-compilation environment variables.

[0066] In one embodiment, the data packet processing method provided in this application may further include:

[0067] Step 210: Through the structure of the data plane development kit, uniformly parse the input / output framework and the data plane development kit, and determine that the structure of the data plane development kit is compatible with the input / output framework.

[0068] Specifically, by successfully adapting DPDK's structure to Netmap, DPDK and Netmap can share the same structure when parsing and assembling packets, reducing the workload of later maintenance. The specific implementation method is as follows:

[0069] stream=nm_nextpkt(NM_FD,&h);

[0070] struct rte_ether_hdr*ehdr_netmap=(struct rte_ether_hdr*)stream;

[0071] if(ehdr_netmap->ether_type==rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)){

[0072] structrte_ipv4_hdr*ip_hdr_netmap=(structrte_ipv4_hdr*)(stream+sizeof(struct rte_ether_hdr));

[0073] if(ip_hdr_netmap->next_proto_id==IPPROTO_UDP){

[0074] structrte_udp_hdr*udp_hdr_netmap=(structrte_udp_hdr*)((unsignedchar*)ip_hdr_netmap+sizeof(struct rte_ipv4_hdr));

[0075] ……

[0076] This embodiment adapts the input / output framework using the structure of the data plane development kit, reducing the workload of later maintenance.

[0077] In one embodiment, the data packet processing method provided in this application may further include:

[0078] Step 410: When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded second frame driver.

[0079] Specifically, this solution can accelerate data packet processing according to the hardware interface form of the network card. When the network card hardware interface is neither a standard interface for interconnecting peripheral components nor a standard interface for high-speed serial computer expansion bus, Netmap is used, that is, the data packets sent by the core network are processed through the loaded second frame driver.

[0080] In this embodiment, when the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded second frame driver.

[0081] In one embodiment, the data packet processing method provided in this application may further include:

[0082] Step 310: When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded first frame driver.

[0083] Specifically, this solution can accelerate data packets according to the hardware interface of the network card. When the hardware interface of the network card is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface, DPDK is used, that is, the data packets sent by the core network are processed by the loaded first frame driver.

[0084] In this embodiment, when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded first frame driver.

[0085] In one embodiment, the data packet processing method provided in this application may further include:

[0086] Step 10: Based on the interface type of the network card hardware interface, determine that the network card hardware interface includes a peripheral component interconnect standard interface, a high-speed serial computer expansion bus standard interface, and other interfaces.

[0087] Specifically, this solution can accelerate data packet processing according to the hardware interface form of the network card. Therefore, the hardware interface of the network card can be determined according to the interface form of the network card hardware interface, including peripheral component interconnection standard interface, high-speed serial computer expansion bus standard interface and other interfaces, such as USB (Universal Serial Bus) interface.

[0088] This embodiment determines the types of network card hardware interfaces by examining the interface format of the network card hardware interface.

[0089] The data packet processing apparatus provided by the present invention is described below. The data packet processing apparatus described below can be referred to in correspondence with the data packet processing method described above.

[0090] Please refer to Figure 2 The present invention also provides a data packet processing apparatus, comprising:

[0091] The driver generation module 201 is used to generate the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit.

[0092] The structure adaptation module 202 is used to adapt the structure of the data plane development kit to the input / output framework and load the first framework driver and the second framework driver.

[0093] The first data packet processing module 203 is used to process data packets according to the second frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0094] The second data packet processing module 204 is used to process data packets according to the first framework driver when the network card hardware interface is not a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0095] Optionally, the driver generation module includes:

[0096] The driver generation unit is used to set the cross-compilation environment variables for the input / output framework and data plane development kit, and to generate the first framework driver and the second framework driver, respectively.

[0097] Optionally, the structure adaptation module includes:

[0098] The structure adaptation unit is used to uniformly parse the input / output framework and the data plane development kit through the structure of the data plane development kit, and determine whether the structure of the data plane development kit is compatible with the input / output framework.

[0099] Optionally, the first data packet processing module includes:

[0100] The first data packet processing unit is used to process data packets sent from the core network by loading the second frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0101] Optionally, the second data packet processing module includes:

[0102] The second data packet processing unit is used to process data packets sent from the core network by loading the first frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

[0103] Optionally, the data packet processing device includes:

[0104] The determination module is used to determine, based on the interface type of the network card hardware interface, whether the network card hardware interface includes a peripheral component interconnect standard interface, a high-speed serial computer expansion bus standard interface, and other interfaces.

[0105] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communications interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a data packet processing method.

[0106] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0107] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the data packet processing methods provided by the above methods.

[0108] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the data packet processing methods provided by the methods described above.

[0109] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data packet processing method, characterized in that, include: Generate the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit; Adapt the structure of the data plane development kit to the input / output framework, and load the first framework driver and the second framework driver; When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the second frame driver. When the network card hardware interface is not a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, data packets are processed according to the first framework driver.

2. The data packet processing method according to claim 1, characterized in that, The steps for generating the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit include: Set the cross-compilation environment variables for the input / output framework and data plane development kits to generate the first framework driver and the second framework driver, respectively.

3. The data packet processing method according to claim 1, characterized in that, The step of adapting the structure of the data plane development kit to the input / output framework includes: By using the structure of the data plane development kit, the input / output framework and the data plane development kit are uniformly analyzed to determine whether the structure of the data plane development kit is compatible with the input / output framework.

4. The data packet processing method according to claim 1, characterized in that, When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the steps of processing data packets according to the second frame driver include: When the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the data packets sent by the core network are processed by the loaded second frame driver.

5. The data packet processing method according to claim 1, characterized in that, When the network card hardware interface is not a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the steps of processing data packets according to the first frame driver include: When the network card hardware interface is not a standard interface for interconnecting peripheral components or a standard interface for high-speed serial computer expansion bus, the data packets sent by the core network are processed by the loaded first frame driver.

6. The data packet processing method according to claim 1, characterized in that, In the case where the network card hardware interface is a peripheral component interconnect standard interface or a high-speed serial computer expansion bus standard interface, the step of processing data packets according to the second frame driver includes: Based on the interface type of the network card hardware interface, the network card hardware interface includes peripheral component interconnection standard interface, high-speed serial computer expansion bus standard interface, and other interfaces.

7. A data packet processing apparatus, characterized in that, include: The driver generation module is used to generate the first frame driver corresponding to the input / output frame and the second frame driver corresponding to the data plane development kit. The structure adaptation module is used to adapt the structure of the data plane development kit to the input / output framework and load the first framework driver and the second framework driver. The first data packet processing module is used to process data packets according to the second frame driver when the network card hardware interface is a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface. The second data packet processing module is used to process data packets according to the first framework driver when the network card hardware interface is not a peripheral component interconnection standard interface or a high-speed serial computer expansion bus standard interface.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the data packet processing method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data packet processing method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data packet processing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Power consumption optimizing method based on DPDK data packet processing platform

    CN107368178A

  • Data processing method and device

    CN112073512A