Data processing method and device, storage medium and electronic device
By implementing extended instructions for network applications on programmable network cards, the problem of increasing data processing delay caused by the lack of instruction sets for network applications in the prior art is solved, and more efficient network packet processing is achieved.
Patent Information
- Application Number
- CN202411898008.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The lack of custom RISC-V instruction set expansion for network applications in the prior art leads to the need to use complex software logic to occupy a large amount of CPU resources and increase data processing delays when processing network traffic.
Provides a data processing method, which obtains pending data packets sent by multi-layer virtual switches through a programmable network card and performs stream processing operations on them. When the stream processing operation includes preset extension instructions for network applications, the programmable network card accelerates processing according to these instructions and sends the processing results to the host.
Optimize data processing through extended instructions for network applications, reduce the load on the host CPU, improve packet processing efficiency, and reduce data processing delays.
Smart Images

Figure CN119342020B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of technologies such as cloud computing and big data, the growth of network traffic and the increasing complexity of network management have made it difficult for traditional network architectures to meet the needs of modern data centers and cloud computing scenarios. In order to meet this challenge, software-defined network architectures have emerged. Software-defined network architectures achieve centralized and programmable control of network resources by separating the control plane and the data plane. However, traditional software-layer traffic processing methods based on the host CPU will impose a heavy burden on the system when processing large-scale network traffic, leading to performance bottlenecks.
[0003] In the related technologies, RISC-V is an emerging instruction set architecture. Through custom RISC-V instruction set extensions, chip manufacturers can customize chip functions according to the needs of specific application scenarios, thereby improving chip performance and efficiency. However, the current instruction set extensions for RISC-V are mainly concentrated in the fields of integer operations, floating-point operations, bit operations, vector operations, dynamic language translation, virtualization, etc. There is a lack of custom RISC-V instruction set extensions for network applications. Complex software logic is required to achieve network communication. When these operations are executed at the software level, they will occupy a large amount of CPU resources, resulting in increased data processing delays.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a data processing method and device, a storage medium and an electronic device, which at least to a certain extent overcome the problem of increased data processing delay caused by the lack of an instruction set for network applications in the related art.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a data processing method is provided, comprising: a programmable network card obtains a data packet to be processed issued by a multi-layer virtual switch; the programmable network card performs a flow processing operation on the data packet to be processed; when the flow processing operation includes a preset extension instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, wherein the preset extension instruction is oriented to a network application; and the programmable network card sends the processing result to a host.
[0008] In some embodiments, before obtaining the data packet to be processed sent by the multi-layer virtual switch, the method also includes: the multi-layer virtual switch obtains the data packet to be processed; the multi-layer virtual switch sends a flow table request to the open flow controller to obtain flow table information; the multi-layer virtual switch determines whether the programmable network card supports flow inlet action according to the flow table information; if the programmable network card supports flow inlet action, the multi-layer virtual switch sends the data packet to be processed to the programmable network card; if the programmable network card does not support flow inlet action, the multi-layer virtual switch performs flow processing on the data packet to be processed.
[0009] In some embodiments, after the programmable network card performs a stream processing operation on the data packet to be processed, the method further includes: the programmable network card determines whether the stream processing operation includes a preset extension instruction; if so, accelerates the processing of the data packet to be processed according to the preset extension instruction; if not, processes the data packet to be processed according to a general instruction.
[0010] In some embodiments, the programmable network card determines whether the stream processing operation includes preset extended instructions, including: the programmable network card stores preset extended instructions internally; when the stream processing operation is submitted to the programmable network card, the programmable network card traverses the preset extended instructions to determine whether the instructions in the stream processing operation exist in the preset extended instructions.
[0011] In some embodiments, when the preset extended instruction includes a message discard instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: clearing the message data in the first source register through the immediate number 0, and writing the processing result into the target register.
[0012] In some embodiments, when the preset extended instruction includes an instruction to modify a message specified domain, the programmable network card accelerates processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: using the field in the first source register to modify the message field of the specified domain in the second source register, and writing the processing result into the target register.
[0013] In some embodiments, when the preset extended instruction includes a multi-protocol label switching lifetime threshold message instruction, the programmable network card accelerates the processing of the to-be-processed data packet according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original multi-protocol label switching lifetime in the first source register, and writing the result into the target register.
[0014] In some embodiments, when the preset extended instruction includes a message instruction for setting the lifetime threshold of the Internet Protocol header, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original lifetime threshold of the Internet Protocol header in the first source register, and writing the result into the target register.
[0015] In some embodiments, when the preset extension instruction includes adding a new virtual LAN tag message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the virtual LAN tag field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements sequentially.
[0016] In some embodiments, when the preset extension instruction includes adding a new multi-protocol label switching label message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the multi-protocol label switching label field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements sequentially.
[0017] In some embodiments, when the preset extended instruction includes an instruction to delete the outermost virtual LAN label message, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: popping out the top multi-protocol label switching label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
[0018] In some embodiments, when the preset extended instruction includes an instruction to delete the outermost multi-protocol label switching label message, the programmable network card accelerates the processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: popping out the top virtual LAN label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
[0019] In some embodiments, when the preset extended instruction includes a multi-protocol label switching lifetime minus one message instruction, the programmable network card accelerates the processing of the to-be-processed data packet according to the preset extended instruction and saves the processing result, including: subtracting 1 from the original multi-protocol label switching lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
[0020] In some embodiments, when the preset extended instruction includes an Internet Protocol lifetime minus one message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including subtracting 1 from the original Internet Protocol lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
[0021] In some embodiments, when the preset extended instruction includes copying the outermost layer lifetime to the outermost layer message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: copying the outermost layer lifetime in the original data field in the first source register to the outermost layer, and storing the result in the target register.
[0022] In some embodiments, when the preset extended instruction includes copying the lifetime of the immediately outermost layer to the outermost message instruction, the programmable network card accelerates the processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: copying the lifetime of the immediately outermost layer in the original data field in the second source register to the outermost layer, and storing the result in the target register.
[0023] According to another aspect of the present disclosure, a data processing device is also provided, including: a module for acquiring data packets to be processed, used for a programmable network card to acquire data packets to be processed issued by a multi-layer virtual switch; a flow processing operation module, used for the programmable network card to perform flow processing operations on the data packets to be processed; an acceleration processing module, used for when the flow processing operation includes a preset extended instruction, the programmable network card accelerates the processing of the data packets to be processed according to the preset extended instruction and saves the processing results, wherein the preset extended instruction is oriented to network applications; and a host sending module, used for the programmable network card to send the processing results to the host.
[0024] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned data processing methods by executing the executable instructions.
[0025] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method described in any one of the above is implemented.
[0026] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned data processing methods is implemented.
[0027] The data processing method provided in the embodiment of the present disclosure obtains the data packets to be processed issued by the multi-layer virtual switch according to the programmable network card; the programmable network card performs flow processing operations on the data packets to be processed; when the flow processing operation includes a preset extended instruction, the programmable network card accelerates the processing of the data packets to be processed according to the preset extended instruction and saves the processing results, wherein the preset extended instruction is oriented to network applications; the programmable network card sends the processing results to the host. The present application optimizes the specific processing requirements of network data by extending instructions for network applications. The programmable network card uses these instructions to accelerate the processing and feeds back the processing results to the host, thereby reducing the load on the host CPU and solving the problem of increased data processing delay caused by the lack of an instruction set oriented to network applications.
[0028] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0030] Figure 1 A schematic diagram showing a data processing system structure in an embodiment of the present disclosure;
[0031] Figure 2 A flow chart of a data processing method in an embodiment of the present disclosure is shown;
[0032] Figure 3 A flow chart showing an example of a data processing method in an embodiment of the present disclosure;
[0033] Figure 4 A flowchart showing another example of a data processing method in an embodiment of the present disclosure;
[0034] Figure 5 A flowchart showing another example of a data processing method in an embodiment of the present disclosure;
[0035] Figure 6 A schematic diagram showing an instruction extension name corresponding to a custom open flow controller flow entry action in an embodiment of the present disclosure;
[0036] Figure 7a , Figure 7b and Figure 7c A schematic diagram showing an instruction set extension format description in an embodiment of the present disclosure;
[0037] Figure 8 A flowchart showing a specific example of a data processing method in an embodiment of the present disclosure;
[0038] Fig. 9 A schematic diagram showing the structure of accelerating network offloading on the data plane of a multi-layer virtual switch in an embodiment of the present disclosure is shown;
[0039] Fig.10 A schematic diagram of a data processing device in an embodiment of the present disclosure is shown;
[0040] Fig.11 A structural block diagram of a computer device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0042] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0043] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:
[0044] SDN: Software-Defined Networking, software-defined network;
[0045] CPU: Central Processing Unit, central processing unit;
[0046] OVS: Open vSwitch, a typical multi-layer virtual switch;
[0047] OpenFlow: OpenFlow is a network communication protocol;
[0048] TTL: Time To Live, survival time;
[0049] MPLS: Multi-Protocol Label Switching;
[0050] VLAN: Virtual Local Area Network;
[0051] RDMA: Remote Direct Memory Access, remote direct memory access.
[0052] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0053] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the data processing method in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include an OVS multi-layer virtual switch 101, a RISC-V system 102, and a server Host 103.
[0054] Among them, OVS includes the ows-ofctl command line tool for remote operation (Remote), which uses the ovs-ofctl command to add flow table entries, delete flow table entries, view flow tables, and modify flow table entries; User space (User space) of ovs-dpctl (kernel module datapath for configuring and managing OVS), ovs-appctl (used to interact with applications running on OVS switches, which can send control commands or obtain diagnostic information), ovs-vsctl (configure and manage OVS switches), ovs-tool (a tool for processing OVS databases, which can be used to check database structure, backup or restore databases), ovs-client (a command line tool that performs query or update operations), ovs-vswitchd (vswitchd, the core switch process of OVS, is responsible for processing data packet forwarding and traffic management), ovsdb-server (the database server of OVS, which stores all network configuration information, including ports, bridges, flow tables and OpenFlow rules of virtual switches, and provides OVSDB operation interfaces for controllers and ovs-vswitchd), ovsdb (a database of various configuration information stored in open virtual switches, which is a lightweight database developed for Open vSwitch); Kernel space (Kernel space) of ovs-dpctl (kernel module datapath for configuring and managing OVS), ovs-appctl (used to interact with applications running on OVS switches, which can send control commands or obtain diagnostic information), ovs-vsctl (configure and manage OVS switches), ovs-tool (a tool for processing OVS databases, which can be used to check database structure, backup or restore databases), ovs-client (a command line tool that performs query or update operations), ovs-vswitchd (vswitchd, the core switch process of OVS, is responsible for processing data packet forwarding and traffic management), ovsdb-server (the database server of OVS, which stores all network configuration information, including ports, bridges, flow tables and OpenFlow rules of virtual switches, and provides OVSDB operation interfaces for controllers and ovs-vswitchd), ovsdb (a database of various configuration information stored in open virtual switches, which is a lightweight database developed for Open vSwitch); space)'s openvswitch (the core module of datapath packet forwarding and processing functions), and ovs-vswitchd (the user-mode switch daemon) work together.
[0055] The RISC-V system includes Pcle Switch (PCIe switch), RDMA, flow table cache, packet processing and ports.
[0056] The server Host includes Driver and Socket.
[0057] In a specific example, in the OVS data plane accelerated network offload architecture after the OpenFlow flow table action instructions are customized with RISC-V instructions, after receiving the data flow, OVS will determine whether the current data flow rules can be offloaded to the network card. If so, the flow table rules will be sent to the hardware, and subsequent messages of the same data flow can be forwarded directly in the RISC-V system.
[0058] Figure 2 A flow chart of a data processing method in an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the data processing method provided in the embodiment of the present disclosure includes the following steps:
[0059] S202, the programmable network card obtains a data packet to be processed sent by the multi-layer virtual switch.
[0060] It should be noted that the above-mentioned programmable network card can be a hardware device with programmable logic, which can communicate directly with the host system and process and forward data packets during data transmission. For example, the above-mentioned programmable network card is an intelligent network card, which is used to process some tasks originally performed by the CPU, supports various virtualization functions, and adapts to the needs of software-defined network deployment. The above-mentioned multi-layer virtual switch can be a device that can provide multi-layer switching functions in a virtualized environment. For example, the above-mentioned multi-layer virtual switch is OVS, which supports virtualization environment and software-defined network technology. The above-mentioned data packets to be processed can be data packets waiting to be further processed or forwarded during network communication or data processing.
[0061] S204: The programmable network card performs a flow processing operation on the data packet to be processed.
[0062] It should be noted that the above stream processing may be a real-time data processing technology, that is, a method of continuously processing real-time incoming data.
[0063] S206, when the flow processing operation includes a preset extension instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, wherein the preset extension instruction is oriented to the network application.
[0064] It should be noted that the above-mentioned preset extended instructions may be custom extended instructions, such as RISC-V instructions. The above-mentioned network-oriented applications may be specially designed for the needs of network applications.
[0065] S208, the programmable network card sends the processing result to the host.
[0066] It should be noted that the above host may be a server, for example, a server host in a cloud computing scenario.
[0067] This application optimizes the specific processing requirements of network data by extending instructions for network applications. The programmable network card uses these instructions to accelerate processing and feeds back the processing results to the host, thereby reducing the load on the host CPU and solving the problem of increased data processing delays caused by the lack of an instruction set for network applications.
[0068] In one embodiment of the present disclosure, Figure 3 As shown, the data processing method provided in the embodiment of the present disclosure further includes the following steps before obtaining the data packet to be processed sent by the multi-layer virtual switch:
[0069] S302, the multi-layer virtual switch obtains a data packet to be processed;
[0070] S304, the multi-layer virtual switch sends a flow table request to the open flow controller to obtain flow table information;
[0071] S306, the multi-layer virtual switch determines whether the programmable network card supports the flow entry action according to the flow table information;
[0072] S308, if the programmable network card supports the flow entry action, the multi-layer virtual switch sends the data packet to be processed to the programmable network card;
[0073] S310: If the programmable network card does not support the flow entry action, the multi-layer virtual switch performs flow processing on the data packet to be processed.
[0074] Through the collaborative work of a multi-layer virtual switch and an open flow controller, the present application can dynamically obtain flow table information and determine the processing method of data packets based on the flow table information. At the same time, when the programmable network card supports flow entry actions, the multi-layer virtual switch can directly send the data packets to be processed to the programmable network card, and use the hardware acceleration capability of the programmable network card to process the data packets, thereby improving the processing efficiency of the data packets.
[0075] In one embodiment of the present disclosure, Figure 4 As shown, the data processing method provided in the embodiment of the present disclosure further includes the following steps after the programmable network card performs a flow processing operation on the data packet to be processed:
[0076] S402, the programmable network card determines whether the stream processing operation includes a preset extension instruction;
[0077] S404, if yes, accelerating the processing of the data packet to be processed according to the preset extended instruction;
[0078] S406: If not, process the data packet to be processed according to the general instruction.
[0079] The present disclosure adopts different processing strategies according to whether the flow processing operation contains preset extension instructions through a programmable network card, so that the programmable network card can more accurately control the processing flow of data packets, reduce unnecessary resource consumption, and achieve an improvement in the data packet processing speed.
[0080] In one embodiment of the present disclosure, Figure 5 As shown, in the data processing method provided in the embodiment of the present disclosure, the programmable network card determines whether the stream processing operation includes a preset extension instruction, including the following steps:
[0081] S502, the programmable network card stores preset extension instructions internally;
[0082] S504, when the stream processing operation is submitted to the programmable network card, the programmable network card traverses the preset extended instructions to determine whether the instructions in the stream processing operation exist in the preset extended instructions.
[0083] The present disclosure stores preset extended instructions in the programmable network card. When a stream processing operation is submitted, the network card can quickly traverse these preset instructions to determine whether the instructions in the stream processing operation exist. This fast matching mechanism reduces processing delays and improves the real-time processing capability of data packets.
[0084] In one example of the present disclosure, when the preset extended instruction includes a message discard instruction, the programmable network card accelerates processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: clearing the message data in the first source register through the immediate number 0, and writing the processing result into the target register.
[0085] In one example of the present disclosure, when the preset extended instruction includes an instruction to modify a message specified domain, the programmable network card accelerates processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: using the field in the first source register to modify the message field of the specified domain in the second source register, and writing the processing result into the target register.
[0086] In one example of the present disclosure, when the preset extended instruction includes a multi-protocol label switching lifetime threshold message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original multi-protocol label switching lifetime in the first source register, and writing the result into the target register.
[0087] In one example of the present disclosure, when the preset extended instruction includes a message instruction for setting the lifetime threshold of the Internet Protocol header, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original lifetime threshold of the Internet Protocol header in the first source register, and writing the result into the target register.
[0088] In one example of the present disclosure, when the preset extension instruction includes adding a new virtual LAN tag message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the virtual LAN tag field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements sequentially.
[0089] In one example of the present disclosure, when the preset extension instruction includes adding a new multi-protocol label switching label message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the multi-protocol label switching label field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements sequentially.
[0090] In one example of the present disclosure, when the preset extended instruction includes an instruction to delete the outermost virtual LAN label message, the programmable network card accelerates the processing of the data packet to be processed and saves the processing results according to the preset extended instruction, including: popping out the top multi-protocol label switching label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
[0091] In one example of the present disclosure, when the preset extended instruction includes an instruction to delete the outermost multi-protocol label switching label message, the programmable network card accelerates the processing of the data packet to be processed and saves the processing results according to the preset extended instruction, including: popping the top virtual LAN label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
[0092] In one example of the present disclosure, when the preset extended instruction includes a multi-protocol label switching lifetime minus one message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: subtracting 1 from the original multi-protocol label switching lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
[0093] In one example of the present disclosure, when the preset extended instruction includes an Internet Protocol lifetime minus one message instruction, the programmable network card accelerates processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including subtracting 1 from the original Internet Protocol lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
[0094] In one example of the present disclosure, when the preset extended instruction includes copying the outermost layer lifetime to the outermost layer message instruction, the programmable network card accelerates the processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: copying the outermost layer lifetime in the original data field in the first source register to the outermost layer, and storing the result in the target register.
[0095] In one example of the present disclosure, when the preset extended instruction includes copying the lifetime of the immediately outermost layer to the outermost message instruction, the programmable network card accelerates processing of the data packet to be processed and saves the processing result according to the preset extended instruction, including: copying the lifetime of the immediately outermost layer in the original data field in the second source register to the outermost layer, and storing the result in the target register.
[0096] Figure 6 A schematic diagram showing an instruction extension name corresponding to an OpenFlow flow table entry action of a custom OpenFlow controller in an embodiment of the present disclosure is shown as follows: Figure 6 As shown, the action name, function description, and RISC-V instruction name include the following information:
[0097] Dro, discard message, OFDROP;
[0098] Set field, modify the field specified in the message, OFSETF;
[0099] Set MPLS TTL, set the TTL threshold of MPLS, OFMPLS;
[0100] Set IP TTL, set the TTL threshold of the IP header, OFIP;
[0101] Push VLAN tag, add a new VLAN Tag, OFPUVLAN;
[0102] Push MPLS tag, add a new MPLS Tag OFPUMPLS;
[0103] Pop MPLS tag, delete the outermost MPLS Tag, OFPO MPLS;
[0104] Pop VLAN tag, delete the outermost VLAN Tag, OFPO VLAN;
[0105] Decrement MPLS TTL, MPLS TTL minus one, OFDECMPLS;
[0106] Decrement IP TTL, IP TTL minus one, OFDECIP;
[0107] Copy TTL inwards, copy the outermost TTL to the immediately outermost layer, OFCPIN;
[0108] Copy TTL outwards, copies the TTL immediately following the outermost layer to the outermost layer, OFCPOUT.
[0109] Figure 7a , Figure 7b and Figure 7c A schematic diagram showing an instruction set extension format description in an embodiment of the present disclosure.
[0110] Among them, the OFSETF instruction: use the fields in rs1 to modify the message fields of the specified domain in rs2, and write the results to rd;
[0111] OFMPLS instruction: Set the original MPLS TTL in rs1 using the TTL threshold stored in the immediate part and write the result to rd;
[0112] OFIP instruction: Use the TTL threshold stored in the immediate part to set the original TTL threshold of the IP header in rs1, and write the result to rd;
[0113] OFDROP instruction: clear the message data in rs1 through the immediate value 0, and write the result into rd;
[0114] OFDECMPLS instruction: decrements the original MPLS TTL stored in rs1 by the immediate value 1, and stores the result in rd;
[0115] OFDECIP instruction: subtract 1 from the TTL of the original IP stored in rs1 through the immediate value 1, and store the result in rd;
[0116] OFCPIN instruction: copies the outermost TTL in the original data field in rs1 to the outermost layer, and stores the result in rd;
[0117] OFCPOUT instruction: copies the outermost TTL in the original data field in rs2 to the outermost layer, and stores the result in rd;
[0118] OFPUVLAN: Add the VLAN Tag field content stored in rs1 to the original array data stored in rs2, store the result in rd, and shift the elements in sequence;
[0119] OFPUMPLS: Add the MPLS Tag field content stored in rs1 to the original array data stored in rs2, store the result in rd, and shift the elements sequentially;
[0120] OFPOPMPLS: Pop the top MPLS Tag field in rs2 and store it in rd, with the elements shifted sequentially;
[0121] OFPOPVLAN: Pop the top VLAN Tag field in rs2 and store it in rd, with the elements shifted sequentially.
[0122] The opcodes of the above instructions are all "0101011". The func7 of the OFSETF instruction is "0000000", and func3 is "100"; the func7 of the OFPUVLAN instruction is "0000010", and func3 is "001"; the func7 of the OFPUMPLS instruction is "0000100", and func3 is "011"; the func7 of the OFPOPMPLS instruction is "0000011", and func3 is "010"; the func7 of the OFPOPVLAN instruction is "0000010", func3 is "000"; func3 of OFSETF instruction is "001"; func3 of OFSETF instruction is "010"; func3 of OFDROP instruction is "000"; func3 of OFDECMPLS instruction is "011"; func3 of OFDECIP instruction is "100"; func3 of OFCPIN instruction is "110"; func3 of OFCPOUT instruction is "101".
[0123] Figure 8 A flowchart of a specific example of a data processing method in an embodiment of the present disclosure is shown as follows: Figure 8 As shown, the data processing method provided in the embodiment of the present disclosure includes the following steps:
[0124] S801, data packet arrives at server OVS;
[0125] S802, the server OVS requests a flow table from the OpenFlow controller;
[0126] S803, determine whether the smart network card supports the entry action, if so, execute S804, if not, execute S808;
[0127] S804, determine whether the stream processing operation involves RISC-V extended instructions, if so, execute S805, if not, execute S806;
[0128] S805, if the smart network card can perform flow processing and the flow processing involves RISC-V extended instructions, use the dedicated RISC-V circuit corresponding to the smart network card flow table action instruction to accelerate the flow processing, and jump to S807;
[0129] S806, if the smart network card can perform flow processing and does not involve RISC-V extended instructions, use general instructions to process data packets;
[0130] S807, record the flow processing result of the smart network card and return the result to the host, and end the process;
[0131] S808, if the SmartNIC does not support the flow entry action, the flow processing operation is performed directly through the server OVS;
[0132] S809, record the stream operation result and end the process.
[0133] In the SDN scenario, the present invention aims at accelerating the network offloading of the OVS data plane. By forwarding data packets in the RISC-V system, the data packet processing is offloaded to the hardware, which effectively reduces the load of the host CPU and further improves the network performance.
[0134] Fig. 9 The schematic diagram of the structure of the multi-layer virtual switch OVS data plane accelerating network offloading in the embodiment of the present disclosure is shown, including the hardware RISC-V system, kernel state and user state. In the specific implementation, the following process is included:
[0135] First packet processing: When the first data packet arrives at the RISC-V system, the RISC-V system queries the flow table cache based on the packet characteristics. If it hits, it is forwarded directly; if it does not hit, the data packet is reported to the OVS kernel state for processing.
[0136] Kernel state processing: If the OVS kernel state matches the flow table rule, the data packet is forwarded directly; if it does not match, the user state is notified through the netlink upcall mechanism for further processing;
[0137] User state processing: User state performs precise flow table and fuzzy flow table queries. If the fuzzy query hits, both the user state precise flow table and the kernel state precise flow table are refreshed; if the precise query hits, only the kernel state flow table is updated. At the same time, the user state will check whether the RISC-V system unloading is supported. If it is supported, the direct unloading of the flow table is completed.
[0138] Packet processing: After the flow table is refreshed, the packet is re-injected into the kernel datapath module for processing.
[0139] Flow table cache: Send flow table information to the RISC-V system for caching.
[0140] Subsequent message processing: Subsequent messages of the same data stream are directly forwarded through the RISC-V system.
[0141] Based on the same inventive concept, the present disclosure also provides a data processing device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0142] Fig.10 A schematic diagram of a data processing device in an embodiment of the present disclosure is shown. Fig.10 As shown, the device includes: a to-be-processed data packet acquisition module 1001, a stream processing operation module 1002, an acceleration processing module 1003 and a sending host module 1004.
[0143] The module 1001 for acquiring data packets to be processed is used for the programmable network card to acquire data packets to be processed sent by the multi-layer virtual switch.
[0144] The flow processing operation module 1002 is used for the programmable network card to perform flow processing operations on the data packets to be processed.
[0145] The acceleration processing module 1003 is used for accelerating the processing of the data packets to be processed according to the preset extension instructions and saving the processing results when the flow processing operation includes preset extension instructions, wherein the preset extension instructions are oriented to network applications.
[0146] The sending host module 1004 is used for the programmable network card to send the processing result to the host.
[0147] In one example of the present disclosure, the data processing device further includes a multi-layer virtual switch processing module, which is used for the multi-layer virtual switch to obtain data packets to be processed; the multi-layer virtual switch sends a flow table request to the open flow controller to obtain flow table information; the multi-layer virtual switch determines whether the programmable network card supports flow inlet actions based on the flow table information; if the programmable network card supports flow inlet actions, the multi-layer virtual switch sends the data packets to be processed to the programmable network card; if the programmable network card does not support flow inlet actions, the multi-layer virtual switch performs flow processing on the data packets to be processed.
[0148] In one example of the present disclosure, the above-mentioned acceleration processing module is also used for the programmable network card to determine whether the flow processing operation includes preset extension instructions; if so, to accelerate the processing of the processing data packet according to the preset extension instructions; if not, to process the processing data packet according to the general instructions.
[0149] In one example of the present disclosure, the above-mentioned acceleration processing module is also used for the programmable network card to determine whether the flow processing operation includes preset extended instructions, including: the preset extended instructions are stored inside the programmable network card; when the flow processing operation is submitted to the programmable network card, the programmable network card traverses the preset extended instructions to determine whether the instructions in the flow processing operation exist in the preset extended instructions.
[0150] In an example of the present disclosure, in the above-mentioned accelerated processing module, when the preset extended instruction includes a discard message instruction, the message data in the first source register is cleared by the immediate number 0, and the processing result is written into the target register.
[0151] In one example of the present disclosure, when the preset extended instruction in the above-mentioned accelerated processing module includes an instruction to modify a message specified domain, the field in the first source register is used to modify the message field of the specified domain in the second source register, and the processing result is written into the target register.
[0152] In one example of the present disclosure, in the above-mentioned accelerated processing module, when the preset extended instruction includes a multi-protocol label switching lifetime threshold message instruction, the lifetime threshold stored in the immediate part is used to set the original multi-protocol label switching lifetime in the first source register, and the result is written into the target register.
[0153] In one example of the present disclosure, when the preset extension instruction in the above-mentioned acceleration processing module includes a message instruction for setting the lifetime threshold of the Internet Protocol header, the lifetime threshold stored in the immediate part is used to set the original lifetime threshold of the IP header in the first source register, and the result is written into the target register.
[0154] In one example of the present disclosure, when the preset extension instruction in the above-mentioned acceleration processing module includes an instruction to add a new virtual LAN tag message, the virtual LAN tag field content stored in the first source register is added to the original array data stored in the second source register, the result is stored in the target register, and the elements are shifted sequentially.
[0155] In one example of the present disclosure, in the above-mentioned accelerated processing module, when the preset extension instruction includes adding a new multi-protocol label switching label message instruction, the multi-protocol label switching label field content stored in the first source register is added to the original array type data stored in the second source register, and the result is stored in the target register, and the elements are shifted sequentially.
[0156] In an example of the present disclosure, when the preset extension instruction in the above-mentioned acceleration processing module includes an instruction to delete the outermost virtual LAN label message, the top multi-protocol label switching label field in the second source register is popped out and stored in the target register, and the elements are shifted sequentially.
[0157] In an example of the present disclosure, when the preset extension instruction in the above-mentioned acceleration processing module includes an instruction to delete the outermost multi-protocol label switching label message, the top virtual local area network label field in the second source register is popped out and stored in the target register, and the elements are shifted sequentially.
[0158] In one example of the present disclosure, when the preset extended instruction in the above-mentioned accelerated processing module includes a multi-protocol label switching lifetime minus one message instruction, the lifetime of the original multi-protocol label switching stored in the first source register is subtracted by 1 through the immediate number 1, and the result is stored in the target register.
[0159] In one example of the present disclosure, when the preset extended instruction in the above-mentioned acceleration processing module includes an Internet Protocol lifetime minus one message instruction, the original Internet Protocol lifetime stored in the first source register is subtracted by 1 through the immediate number 1, and the result is stored in the target register.
[0160] In one example of the present disclosure, in the above-mentioned accelerated processing module, when the preset extended instruction includes copying the outermost layer lifetime to the outermost layer message instruction, the outermost layer lifetime in the original data field in the first source register is copied to the outermost layer, and the result is stored in the target register.
[0161] In one example of the present disclosure, in the above-mentioned accelerated processing module, when the preset extended instruction includes copying the outermost survival time to the outermost message instruction, the outermost survival time in the original data field in the second source register is copied to the outermost layer, and the result is stored in the target register.
[0162] It should be noted that the above-mentioned to-be-processed data packet acquisition module 1001, stream processing operation module 1002, acceleration processing module 1003 and sending host module 1004 correspond to S202 to S208 in the method embodiment, and the examples and application scenarios implemented by the above-mentioned modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0163] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0164] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0165] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: at least one processing unit 1110, at least one storage unit 1120, and a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110).
[0166] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps described in the above “exemplary method” section of this specification according to various exemplary embodiments of the present disclosure.
[0167] For example, the processing unit 1110 can execute the following steps of the above method embodiment: the programmable network card obtains the data packet to be processed sent by the multi-layer virtual switch; the programmable network card performs flow processing operations on the data packet to be processed; when the flow processing operation includes a preset extension instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result; the programmable network card sends the processing result to the host.
[0168] For example, the processing unit 1110 can execute the following steps of the above method embodiment: the multi-layer virtual switch obtains the data packet to be processed; the multi-layer virtual switch sends a flow table request to the open flow controller to obtain the flow table information; the multi-layer virtual switch determines whether the programmable network card supports the flow inlet action based on the flow table information; if the programmable network card supports the flow inlet action, the multi-layer virtual switch sends the data packet to be processed to the programmable network card; if the programmable network card does not support the flow inlet action, the multi-layer virtual switch performs flow processing on the data packet to be processed.
[0169] For example, the processing unit 1110 can execute the following steps of the above method embodiment: the programmable network card determines whether the flow processing operation includes preset extension instructions; if so, accelerates the processing of the processing data packet according to the preset extension instructions; if not, processes the processing data packet according to general instructions.
[0170] For example, the processing unit 1110 can execute the following steps of the above method embodiment: the programmable network card stores preset extended instructions internally; when the stream processing operation is submitted to the programmable network card, the programmable network card traverses the preset extended instructions to determine whether the instructions in the stream processing operation exist in the preset extended instructions.
[0171] For example, the processing unit 1110 may execute the following steps of the above method embodiment: when the preset extension instruction includes a discard message instruction, clear the message data in the first source register by using the immediate number 0, and write the processing result into the target register.
[0172] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes an instruction to modify the message specified field, the field in the first source register is used to modify the message field of the specified field in the second source register, and the processing result is written into the target register.
[0173] For example, the processing unit 1110 may execute the following steps of the above method embodiment: when the preset extended instruction includes a multi-protocol label switching lifetime threshold message instruction, the original multi-protocol label switching lifetime in the first source register is set using the lifetime threshold stored in the immediate part, and the result is written into the target register.
[0174] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes a message instruction for setting the lifetime threshold of the Internet Protocol header, the original lifetime threshold of the IP header in the first source register is set using the lifetime threshold stored in the immediate part, and the result is written into the target register.
[0175] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes adding a new virtual LAN tag message instruction, the virtual LAN tag field content stored in the first source register is added to the original array data stored in the second source register, the result is stored in the target register, and the elements are shifted sequentially.
[0176] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes adding a new multi-protocol label switching label message instruction, the multi-protocol label switching label field content stored in the first source register is added to the original array type data stored in the second source register, and the result is stored in the target register, and the elements are shifted sequentially.
[0177] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes an instruction to delete the outermost virtual LAN label message, the top multi-protocol label switching label field in the second source register is popped out and stored in the target register, and the elements are shifted sequentially.
[0178] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes an instruction to delete the outermost multi-protocol label switching label message, the top virtual local area network label field in the second source register is popped out and stored in the target register, and the elements are shifted sequentially.
[0179] For example, the processing unit 1110 may execute the following steps of the above method embodiment: when the preset extended instruction includes a multi-protocol label switching lifetime minus one message instruction, the original multi-protocol label switching lifetime stored in the first source register is subtracted by 1 through the immediate number 1, and the result is stored in the target register.
[0180] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extended instruction includes an Internet Protocol lifetime minus one message instruction, the original Internet Protocol lifetime stored in the first source register is subtracted by 1 through the immediate number 1, and the result is stored in the target register.
[0181] For example, the processing unit 1110 can execute the following steps of the above method embodiment: when the preset extension instruction includes copying the outermost survival time to the outermost message instruction, copy the outermost survival time in the original data field in the first source register to the outermost layer, and store the result in the target register.
[0182] For example, the processing unit 1110 can execute the following steps of the above-mentioned method embodiment: when the preset extension instruction includes a copy of the outermost survival time to the outermost message instruction, the outermost survival time in the original data field in the second source register is copied to the outermost layer, and the result is stored in the target register.
[0183] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 11201 and / or a cache storage unit 11202 , and may further include a read-only storage unit (ROM) 11203 .
[0184] The storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0185] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0186] The electronic device 1100 may also communicate with one or more external devices 1140 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or may communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1150. In addition, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 through a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0187] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0188] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above data processing method when executed by a processor.
[0189] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0190] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0191] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0192] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0193] In specific implementation, the program code for performing the operation of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0194] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0195] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0196] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation mode of the present disclosure.
[0197] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A data processing method, characterized in that: include: The programmable network card obtains the data packets to be processed sent by the multi-layer virtual switch; The programmable network card performs a flow processing operation on the data packet to be processed; The programmable network card has preset extension instructions stored inside; when a stream processing operation is submitted to the programmable network card, the programmable network card traverses the preset extension instructions to determine whether the instructions in the stream processing operation exist in the preset extension instructions; When the flow processing operation includes a preset extension instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, wherein the preset extension instruction is oriented to network applications; The programmable network card sends the processing result to the host.
2. The data processing method according to claim 1, characterized in that: Before obtaining the data packet to be processed sent by the multi-layer virtual switch, the method further includes: The multi-layer virtual switch obtains a data packet to be processed; The multi-layer virtual switch sends a flow table request to the open flow controller to obtain flow table information; The multi-layer virtual switch determines whether the programmable network card supports flow entry action according to the flow table information; If the programmable network card supports the flow entry action, the multi-layer virtual switch sends the data packet to be processed to the programmable network card; If the programmable network card does not support the flow entry action, the multi-layer virtual switch performs flow processing on the data packet to be processed.
3. The data processing method according to claim 1, characterized in that: After the programmable network card performs a flow processing operation on the data packet to be processed, the method further includes: The programmable network card determines whether the stream processing operation includes a preset extension instruction; If yes, accelerating the processing of the to-be-processed data packet according to the preset extended instruction; If not, the data packet to be processed is processed according to the general instruction.
4. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes a discard message instruction, the programmable network card accelerates the processing of the to-be-processed data packet according to the preset extended instruction and saves the processing result, including: clearing the message data in the first source register by the immediate number 0, and writing the processing result into the target register.
5. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes an instruction to modify a message specified domain, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: using the field in the first source register to modify the message field of the specified domain in the second source register, and writing the processing result into the target register.
6. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes a multi-protocol label switching lifetime threshold message instruction, the programmable network card accelerates the processing of the to-be-processed data packet according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original multi-protocol label switching lifetime in the first source register, and writing the result into the target register.
7. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes a message instruction for setting the lifetime threshold of the Internet Protocol header, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: using the lifetime threshold stored in the immediate part to set the original lifetime threshold of the Internet Protocol header in the first source register, and writing the result into the target register.
8. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extension instruction includes adding a new virtual LAN tag message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the virtual LAN tag field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements in sequence.
9. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extension instruction includes adding a new multi-protocol label switching label message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extension instruction and saves the processing result, including: adding the multi-protocol label switching label field content stored in the first source register to the original array data stored in the second source register, storing the result in the target register, and shifting the elements in sequence.
10. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes an instruction to delete the outermost virtual local area network label message, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: popping out the top multi-protocol label switching label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
11. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes an instruction to delete the outermost multi-protocol label switching label message, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: popping out the top virtual local area network label field in the second source register and storing it in the target register, and the elements are shifted sequentially.
12. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes a multi-protocol label switching lifetime minus one message instruction, the programmable network card accelerates the processing of the to-be-processed data packet according to the preset extended instruction and saves the processing result, including: subtracting 1 from the original multi-protocol label switching lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
13. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes an Internet Protocol lifetime minus one message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including subtracting 1 from the original Internet Protocol lifetime stored in the first source register through the immediate number 1, and storing the result in the target register.
14. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes copying the outermost layer lifetime to the outermost layer message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: copying the outermost layer lifetime in the original data field in the first source register to the outermost layer, and storing the result in the target register.
15. The data processing method according to any one of claims 1 to 3, characterized in that: When the preset extended instruction includes copying the lifetime of the immediately outermost layer to the outermost message instruction, the programmable network card accelerates the processing of the data packet to be processed according to the preset extended instruction and saves the processing result, including: copying the lifetime of the immediately outermost layer in the original data field in the second source register to the outermost layer, and storing the result in the target register.
16. A data processing device, characterized in that: include: The module for acquiring data packets to be processed is used for the programmable network card to acquire data packets to be processed sent by the multi-layer virtual switch; A flow processing operation module, used for the programmable network card to perform flow processing operations on the data packets to be processed, wherein the programmable network card internally stores preset extension instructions; an acceleration processing module, configured to, when a stream processing operation is submitted to the programmable network card, cause the programmable network card to traverse the preset extended instructions, determine whether the instructions in the stream processing operation exist in the preset extended instructions, and when the stream processing operation includes the preset extended instructions, cause the programmable network card to accelerate the processing of the data packet to be processed according to the preset extended instructions and save the processing result, wherein the preset extended instructions are oriented to network applications; The sending host module is used for the programmable network card to send the processing result to the host.
17. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the data processing method according to any one of claims 1 to 15 by executing the executable instructions.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 15 is implemented.
19. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the data processing method described in any one of claims 1 to 15.
Citation Information
Patent Citations
Data processing method, programmable network card equipment, physical server and storage medium
CN113821310A
Multi-mode network message processing method, device and equipment and readable storage medium
CN116668564A