Data processing method, intelligent network card and electronic device
By storing the flow identifier and message matching domain information in the hardware layer in the smart network card but not storing the execution actions, and combining the fast path module in the software layer to process the target execution actions, the problem of low data forwarding performance and inflexibility of the existing smart network cards is solved. Efficient and flexible data processing is achieved.
Patent Information
- Application Number
- CN202211513275.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-11-29
AI Technical Summary
When existing smart network cards process network data, their data forwarding performance is low and inflexible, and they cannot meet the needs of rapid iteration and evolution of network services. In particular, the hardware part cannot support flexible and changeable action processing.
A smart network card is designed. The hardware layer includes a message parsing module, a first storage module and a first flow table lookup module. It stores flow identification information and message matching domain information but does not include execution action information. The fast path module of the software layer is responsible for Find the target flow identification information and process the message based on the target execution action information, using batch processing to improve forwarding performance.
Data processing performance and flexibility are improved. The hardware layer completes time-consuming parsing and search tasks, and the software layer handles flexible execution actions. The forwarding performance and processing efficiency are improved through batch processing.
Smart Images

Figure CN116074131B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a smart network card and a data processing method. The present application also relates to a computer storage medium and an electronic device. Background Art
[0002] Traditional data centers are based on the von Neumann architecture, and all data needs to be sent to the CPU (central processing unit) for processing. With the rapid development of data centers, Moore's Law has gradually slowed down and failed, causing the marginal cost of general-purpose CPU performance growth to rise rapidly, and the CPU processing rate can no longer meet the requirements of data processing. In order to cope with the development of network bandwidth from mainstream 10G to 25G, 40G, 100G, 200G and even 400G, the computing architecture has changed from the CPU-centric Onload mode to the data-centric Offload mode, and the responsibility of reducing the burden on the CPU falls on the network card (network adapter), which is also one of the factors that promote the rapid development of network cards. With the continuous development of technology, network cards have evolved from basic function network cards to smart network cards (first-generation smart network cards) and smart network card DPUs (second-generation smart network cards, DPU: Data Processing Unit is a dedicated processor with data-centric structure).
[0003] Whether it is the first-generation smart network card or the second-generation DPU smart network card, it not only realizes the Ethernet network connection of the traditional basic function network card, but also removes the data packet processing work of network transmission from the CPU, that is, it can unload the CPU's network processing workload and related tasks, such as virtual switching, security isolation, QoS (Quality of Service: Quality of Service) and other network operation management tasks, as well as some high-performance computing (HPC: High Performance Computing) and artificial intelligence (AI: Artificial Intelligence) machine learning, thereby freeing up CPU cores and saving CPU resources for the processing of application business tasks.
[0004] Therefore, on the one hand, the smart network card can reduce the CPU load and improve the overall performance of the data; on the other hand, it can increase the CPU's processing speed for application tasks. Summary of the invention
[0005] The present application provides a data processing method to solve the problem of low performance and inflexibility of data forwarding in the prior art.
[0006] The present application provides a smart network card, comprising: a hardware layer and a software layer;
[0007] The hardware layer includes a message parsing module, a first storage module, a first flow table lookup module, and a first sending module; wherein the message parsing module is used to parse messages to obtain message information; the first storage module is used to store a first forwarding flow table, the first forwarding flow table includes flow identification information, and message matching domain information corresponding to the flow identification information, and the first forwarding flow table does not include execution action information corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information that matches the message information, and the flow identification information corresponding to the message matching domain information; the first sending module is used to send the flow identification information found by the first flow table lookup module and the message information to the fast path module of the software layer;
[0008] The software layer includes a fast path module; the fast path module includes a second storage module, a second flow table lookup module and a processing module; the second storage module stores a second forwarding flow table, the second forwarding flow table includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the processing module is used to process the received message information according to the execution action information corresponding to the target flow identification information.
[0009] In some embodiments, the software layer also includes a slow path module; the slow path module includes a generation module and a third sending module; the generation module is used to generate a third forwarding flow table entry based on processing of the message information and / or the first packet message when there is no message matching domain information matching the message information in the first forwarding flow table, and / or when the message is the first packet message, the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; the third sending module is used to send the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module of the hardware layer; and send the third forwarding flow table entry to the second storage module of the fast path module.
[0010] In some embodiments, the hardware layer further includes a data cache area, the data cache area includes a plurality of data cache queues, for caching a preset batch of message information after the first forwarding flow table search is completed, and caching message information belonging to the same flow identification information into the same data cache queue;
[0011] The first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time;
[0012] The processing module in the fast path module is used to perform the same processing on the message information in the same data cache queue according to searching for matching target flow identification information in the second forwarding flow table and according to the target execution action information corresponding to the target flow identification information.
[0013] The present application also provides a data processing method, which is applied to the above-mentioned smart network card, and the method includes:
[0014] The hardware layer receives the message to be processed, parses the message to be processed to obtain message information, and searches in the first forwarding flow table whether there is message matching domain information matching the message information;
[0015] If yes, the flow identification information corresponding to the message matching domain information and the message information are sent to the software layer;
[0016] The fast path module of the software layer searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and determines the target execution action information corresponding to the message information according to the target flow identification information;
[0017] The fast path module processes the message information according to the target execution action information.
[0018] In some embodiments, it also includes:
[0019] When the search result in the first forwarding flow table is that there is no message matching domain information matching the message information, and / or when the message to be processed is the first packet message, the hardware layer sends the message information and / or the first packet message to the slow path module of the software layer;
[0020] The slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, wherein the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; sends the third forwarding flow table entry to the second storage module of the fast path module; sends the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module of the hardware layer;
[0021] The second storage module of the fast path module updates the second forwarding flow table according to the received third forwarding flow table entry, and processes the message information according to the execution action information corresponding to the message information recorded in the updated second forwarding flow table;
[0022] The first storage module of the hardware layer updates the first forwarding flow table according to the flow identification information and the message matching domain information in the received third forwarding flow table entry.
[0023] In some embodiments, it also includes:
[0024] The hardware layer divides the message information after the first forwarding flow table search is completed in a preset batch into the same group of messages according to the same flow identification information and stores them in the data cache queue of the hardware layer, wherein the message information belonging to the same flow identification information is cached in the same data cache queue;
[0025] Sending the flow identification information in the same group of messages and the message information of the same group of messages to the fast path module at the same time;
[0026] The fast path module searches the second forwarding flow table for target flow identification information that matches the flow identification information based on the flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the message information of the same group of messages determined by the target flow identification information.
[0027] In some embodiments, the sending the flow identification information in the same group of messages and the message information of the same group of messages to the fast path module includes:
[0028] Sending the flow identification information of the same group of messages to the fast path module in a vector manner; wherein the vector includes the same flow identification information of the same group of messages;
[0029] The fast path module searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and processes the message information in the same group of messages according to the target flow identification information. The fast path module processes the message information in the same group of messages according to the target flow identification information.
[0030] The fast path module searches the second forwarding flow table for target flow identification information that matches the same flow identification information based on the same flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the target flow identification information.
[0031] The present application also provides a smart network card, comprising: a hardware layer and a software layer;
[0032] The hardware layer includes a message parsing module, a first storage module, a first flow table lookup module, a first sending module, and a first processing module; wherein the message parsing module is used to parse messages to obtain message information; the first storage module stores a first forwarding flow table, the first forwarding flow table including flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information that matches the message information, and the flow identification information corresponding to the message matching domain information; the first processing module is used to process the message information according to the execution action information when the first forwarding flow table includes the execution action information corresponding to the flow identification information; the first sending module is used to send the flow identification information and the message information to the fast path module of the software layer when the first forwarding flow table does not include the execution action information corresponding to the flow identification information;
[0033] The software layer includes a fast path module, which includes a second storage module, a second flow table lookup module and a second processing module; the second storage module stores a second forwarding flow table, which includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the second processing module is used to process the message information according to the target execution action information corresponding to the target flow identification information.
[0034] In some embodiments, the first sending module is further used to send the message information to the slow path module of the software layer when the first forwarding flow table does not include message matching domain information matching the message information;
[0035] The slow path module of the software layer includes a generation module and a third sending module. The generation module is used to generate a third forwarding flow table entry according to the processing of the message information when there is no message matching domain information matching the message information in the first forwarding flow table and / or when the message is the first packet message, the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; the third sending module is used to send the third forwarding flow table entry to the second storage module, and when the hardware layer does not support the processing of the execution action information, send the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module; when the hardware layer supports the processing of the execution action information, send the third forwarding flow table entry to the first storage module.
[0036] In some embodiments, the hardware layer further includes a data cache area, the data cache area includes a plurality of data cache queues, for caching a preset batch of message information after the first forwarding flow table search is completed, and caching message information belonging to the same flow identification information into the same data cache queue;
[0037] The first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time;
[0038] The processing module in the fast path module is used to perform the same processing on the message information in the same data cache queue according to searching for matching target flow identification information in the second forwarding flow table and according to the target execution action information corresponding to the target flow identification information.
[0039] The present application also provides a data processing method, which is applied to the above-mentioned smart network card, and the method includes:
[0040] The hardware layer receives the message to be processed, parses the message to be processed to obtain message information, and searches in the first forwarding flow table whether there is message matching domain information and flow identification information matching the message information;
[0041] If the first forwarding flow table contains message matching domain information and flow identification information that match the message information, determining whether the first forwarding flow table contains execution action information corresponding to the message matching domain information;
[0042] When there is no execution action information corresponding to the message matching domain information in the first forwarding flow table, sending the message information and the flow identification information to a fast path module of the software layer;
[0043] The fast path module searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information;
[0044] The fast path module processes the message information according to the target execution action information corresponding to the target flow identification information;
[0045] When execution action information corresponding to the message matching domain information exists in the first forwarding flow table, the hardware layer processes the message information according to the execution action information corresponding to the message matching domain information.
[0046] In some embodiments, the method further includes: when the first forwarding flow table does not include message matching domain information matching the message information, and / or when the message to be processed is a first packet message, sending the message information and / or the first packet message to the slow path module of the software layer;
[0047] The slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, wherein the third forwarding flow table entry includes flow identification information corresponding to the message information and / or the first packet message, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information;
[0048] The third forwarding flow table entry is sent to the second storage module, and when the hardware layer does not support the processing of the execution action information, the flow identification information corresponding to the message information and the message matching domain information corresponding to the flow identification information in the third forwarding flow table entry are sent to the first storage module; when the hardware layer supports the processing of the execution action information, the third forwarding flow table entry is sent to the first storage module.
[0049] The present application also provides a data processing method, which is applied to a hardware network card, wherein a first forwarding flow table is stored in the hardware network card, wherein the first forwarding flow table includes flow identification information and message matching domain information corresponding to the flow identification information, and the first forwarding flow table does not include execution action information corresponding to the message matching domain information;
[0050] The method includes:
[0051] Obtaining a message to be processed, and parsing the message to be processed to obtain message information;
[0052] According to the message information, searching in the first forwarding flow table whether there is flow identification information and message matching domain information matching the message information;
[0053] If yes, sending the message information and the flow identification information;
[0054] When the flow identification information and the message matching domain information corresponding to the message information do not exist in the first forwarding flow table, the message information is sent.
[0055] The present application also provides a data processing method, which is applied to a software network card, wherein the software network card stores a second forwarding flow table, wherein the second forwarding flow table includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information;
[0056] The method includes:
[0057] Receive the flow identification information and parsed message information sent by the hardware network card;
[0058] Searching in the second forwarding flow table whether there is target flow identification information matching the flow identification information sent by the hardware network card;
[0059] If so, the message information is processed according to the target execution action information corresponding to the target flow identification information.
[0060] The present application also provides an electronic device, including:
[0061] processor;
[0062] The intelligent network card is used to receive the execution task of the processor and process the execution task according to the above data processing method.
[0063] The present application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0064] When the program is read and executed by the processor, the above-mentioned data processing method is executed.
[0065] Compared with the prior art, this application has the following advantages:
[0066] An intelligent network card provided by the present application stores flow identification information and message matching domain information corresponding to the flow identification information in the first forwarding flow table of the hardware layer, but does not store execution action information corresponding to the message matching domain information. Therefore, during the message processing, the hardware layer is responsible for parsing and searching, and the fast path module of the software layer searches for the target flow identification information matching the received flow identification information in the second forwarding flow table, and then determines the target execution action information according to the target flow identification information, and processes the received message information according to the target execution action information, so that the more time-consuming actions of message parsing and flow identification information search can be put into the hardware layer for processing, and the execution action information with more changes can be handed over to the software layer for processing, thereby ensuring effectiveness and improving processing performance while also ensuring flexibility.
[0067] The data processing method provided by the present application distinguishes message information by using flow identification information, and at the same time, stores the message matching domain information and flow identification information in the first forwarding flow table of the hardware layer; stores the flow identification information, the message matching domain information and the execution action information in the second forwarding flow table of the fast path module of the software layer. When the hardware layer has message matching domain information that matches the message information, the flow identification information corresponding to the message matching domain information is obtained, and the hardware layer sends the message information and the flow identification information to the fast path module of the software layer. The fast path module searches for the matching target flow identification information and the target execution action information according to the flow identification information, and then processes the message information accordingly according to the target action execution information. On the one hand, this data processing method can utilize the high processing performance of the hardware layer, and the fixed and time-consuming processing processes such as parsing and searching of message information are completed by the hardware layer, and the flexible and changeable operations (action, i.e., execution actions) are handed over to the software layer to complete, which improves both processing performance and flexibility. On the other hand, by using the hardware layer to batch process the message information, the software layer does not need to process the messages one by one according to the execution action information. Instead, the messages with the same flow identification information are treated as a group and processed in the same way, thereby improving the processing performance. At the same time, for the hardware layer, because of the use of batch processing, the forwarding performance of forwarding message information to the software layer is also improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a schematic diagram of the evolution of the development stages of smart network cards in the prior art;
[0069] Figure 2 It is a structural diagram of a first embodiment of a smart network card provided by the present application;
[0070] Figure 3 is a flow chart of a first embodiment of a data processing method provided by the present application;
[0071] Figure 4It is a schematic diagram of the processing process of a batch processing method in a data processing method provided by the present application;
[0072] Figure 5 is a structural diagram of a second embodiment of a smart network card provided by the present application;
[0073] Figure 6 is a flow chart of a second embodiment of a data processing method provided by the present application;
[0074] Figure 7 is a flow chart of a third embodiment of a data processing method provided by the present application;
[0075] Figure 8 is a flow chart of a fourth embodiment of a data processing method provided by the present application;
[0076] Fig. 9 It is a structural schematic diagram of an electronic device embodiment provided by the present application. DETAILED DESCRIPTION
[0077] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0078] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", are not limitations on quantity or sequence, but are used to distinguish the same type of information from each other.
[0079] Based on the above background technology, it can be known that the smart network card plays a vital role in the CPU processing speed and forwarding logic performance. Then, how does the smart network card achieve hardware offloading and performance improvement? The following is a description based on the existing technology.
[0080] First, the smart network card is described. According to the above background technology, it can be understood that the smart network card can be divided into basic function network card, first-generation smart network card, and second-generation DPU smart network card according to the development stage.
[0081] like Figure 1 As shown, Figure 1This is a schematic diagram of the evolution of the development stages of smart NICs in the prior art. Among them, the basic function NIC (also known as ordinary NIC) provides 2x10G or 2x25G bandwidth throughput, has less hardware offload capabilities, mainly Checksum, LRO (Large Receive Offload: large receive offload) / LSO (Large Segment Offload: large segment offload), etc., supports SR-IOV (Single Root I / O Virtualization: single root virtualization), and limited multi-queue capabilities. In the cloud platform virtualized network, there are three ways for basic function network cards to provide network access to virtual machines (VMs): one is for the operating system kernel driver to take over the network card and distribute network traffic to the virtual machine (VM); the second is for OVS-DPDK (Open vSwitch: open source virtual machine, DPDK: Data Plane Development Kit) to take over the network card and distribute network traffic to the virtual machine (VM); the third is to provide network access capabilities to virtual machines (VMs) through SR-IOV (Single Root I / O Virtualization) in high-performance scenarios.
[0082] The first generation of Smart NICs (also called hardware offload NICs) have rich hardware offload capabilities, such as: RDMA (Remote Direct Memory Access) network hardware offload based on RoCEv1 (RDMA over Converged Ethernet: network protocol V1) and RoCEv2 (network protocol V2), hardware offload of lossless network capabilities in converged networks (PFC: Priority-based Flow Control, ECN: Explicit Congestion Notification, ETS: Enhanced Transmission Selection, etc.), hardware offload of NVMe-oF (non-volatile memory express over Fabrics: a protocol that uses various common transport layer protocols to implement NVMe functions) in the storage field, and data plane offload for secure transmission, etc. The first generation of Smart NICs mainly focuses on data plane offload, which is used to accelerate mission-critical data center applications such as security, virtualization, SDN (Software Defined Network) / NFV (Network Function Virtualization), big data, machine learning, and storage.
[0083] The second-generation smart NIC (also known as DPU) is a dedicated processor built with data as the center. It uses software-defined technology to support infrastructure layer resource virtualization and supports infrastructure layer services such as storage, security, and service quality management. It is positioned as the "third main chip" after the CPU and GPU (graphics processing unit) in the data center. DPU has a high-performance "CPU + programmable hardware" PCIe (peripheral component interconnect express) network card device that accelerates the IO data plane forwarding. Therefore, the second-generation smart NIC DPU can also be called a programmable smart NIC. DPU can build its own bus system and exist independently of the host CPU (host CPU), so as to control and manage other devices. DPU unloads processing tasks that the system CPU usually handles, and is suitable for unloading and accelerating various general tasks and elastic acceleration scenarios of business, such as container scenarios, load balancing, network security, and advanced customized networks.
[0084] Secondly, how the smart network card DPU can reduce the CPU load, improve the overall performance of the data, and increase the CPU's processing speed for application tasks is described below in combination with the existing technology.
[0085] Based on the background technology, it can be known that due to the slowdown of Moore's Law, the marginal cost of general CPU performance growth has risen rapidly. In order to cope with the development of network bandwidth from mainstream 10G to 25G, 40G, 100G, 200G and even 400G, the CPU performance is improved by offloading the processing of network virtualization to the smart network card DPU. The most typical one is to offload the virtual switch (vswitch) to the smart network card DPU.
[0086] In the prior art, the software vswitch processing on the CPU in the smart NIC DPU is divided into two parts: slowpath and fastpath. The slowpath includes a complete processing flow of a data message, such as routing, ACL, speed limit, etc. Usually, the first packet of a data stream must be completely processed by the slowpath; after the first packet of the message passes through the slowpath, a forwarding flow entry will be generated according to multiple logical results such as routing, ACL, speed limit, etc. The flow entry includes message matching domain information (match) and execution action information (action), where match can include message data information, such as: five-tuple information; action includes operations performed on the message, such as encapsulation / decapsulation, forwarding, speed limit, etc. Subsequent messages will first search the fastpath forwarding flow table (flow table). If the corresponding flow entry is found, the message will be directly processed based on the execution action information (action) in the forwarding flow table to improve processing performance. In addition, when slowpath sends flow entries to fastpath, it also sends flow entries to the hardware in the smart NIC DPU. Therefore, the same flow table exists on both software and hardware. If the packet hits the flow table on the hardware first, the hardware will directly process it according to the action in the flow table, thereby further improving processing performance.
[0087] The above are the reasons why the Smart NIC DPU can reduce the CPU load and improve CPU performance in the forwarding logic.
[0088] However, in the prior art, due to the rapid iteration and evolution of network services, it is necessary to add and / or modify the forwarding action, which requires fastpath to have strong flexibility, and the hardware part in the smart network card DPU cannot meet the flexibility requirements. Because the hardware in the smart network card DPU is usually not modifiable, for example: when the hardware adopts ASIC (Application Specific Integrated Circuit), the action cannot be modified. When the hardware adopts FPGA (Field Programmable Gate Array), it is also limited by factors such as development cycle and hardware resources, and cannot support flexible and changeable actions.
[0089] Based on this, the present application provides a smart network card, such as Figure 2 As shown, Figure 2 20 is a schematic diagram of the structure of an intelligent network card embodiment provided by the present application. In this embodiment, the intelligent network card DPU includes a hardware layer 201 and a software layer 202.
[0090] The hardware layer may be an FPGA (Field Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit), etc. Specifically, the hardware layer may include a message parsing module, a first storage module, a first flow table lookup module, and a first sending module; wherein the message parsing module is used to parse a message to obtain message information; the first storage module is used to store a first forwarding flow table (flow table), the first forwarding flow table includes flow identification information (flow id) and message matching domain information (match) corresponding to the flow identification information, and the first forwarding flow table does not include execution action information (action) corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information corresponding to the message information, and the flow identification information corresponding to the message matching domain information; the first sending module is used to send the flow identification information and the message information found by the first flow table lookup module to the fast path module of the software layer. In this embodiment, the flow identification information in the first forwarding flow table and the message matching domain information corresponding to the flow identification information can be used as a forwarding flow entry of a message, and the forwarding flow entry does not include execution action information, that is, the first forwarding flow table includes flow identification information and message matching domain information, but does not include execution action information. Among them, the message matching domain information (match) is used to record the message information of the parsed message, for example: the five-tuple of the message, namely: source / destination IP (address), source / destination port (port), protocol, etc., which are not listed here one by one.
[0091] The software layer may be software on a CPU, such as a vswitch (virtual switch) and an operating system (OS). In this embodiment, the software layer may include a fastpath module; the fastpath module may include a second storage module, a second flow table lookup module, and a processing module; the second storage module stores a second forwarding flow table, the second forwarding flow table includes flow identification information (flow id), message matching domain information (match) corresponding to the flow identification information, and execution action information (action) corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the processing module is used to process the received message information according to the execution action information corresponding to the target flow identification information. In this embodiment, each forwarding flow table entry in the second forwarding flow table may include a message as flow identification information (flow id), message matching domain information (match) corresponding to the flow identification information, and execution action information (action) corresponding to the message matching domain information, that is, the second forwarding flow table stores information of flow identification information, message matching domain information, and execution action information. The action information is used to record the processing information performed on the message information, such as encapsulation / decapsulation, forwarding, speed limiting, etc., which are not listed here one by one.
[0092] The software layer may also include a slowpath module; the slowpath module includes a generation module and a third sending module. The generation module is used to generate a third forwarding flow entry (flow entry) according to the processing of the message information and / or the first packet message when there is no message matching domain information matching the message information in the first forwarding flow table, and / or when the message is the first packet message, the third forwarding flow entry includes message matching domain information (match) corresponding to the message information and / or the first packet message, flow identification information (flow id) corresponding to the message matching domain information, and execution action information (action) corresponding to the message matching domain information; the third sending module is used to send the flow identification information and the message matching domain information in the third forwarding flow entry to the first storage module of the hardware layer; and send the third forwarding flow entry to the second storage module of the fast path module.
[0093] It should be noted that when the message matching domain information that matches the message information does not exist in the first forwarding flow table, the message may be the first packet message, or an exception may occur in the message parsing or in the first forwarding flow table, so that the matching message matching domain information cannot be found in the first forwarding flow table at the hardware layer.
[0094] In this embodiment, the slow path module can perform a complete processing flow for a data message, such as routing, ACL, speed limit, etc. Usually, the first packet of a data stream must be completely processed by slowpath. After the first packet of the message passes through slowpath, a forwarding flow entry (flow entry) will be generated according to multiple logical results such as routing, ACL, speed limit, etc. The forwarding flow entry may include flowid, match and action, wherein the match part may include message information (such as message five-tuple: source / destination IP, source / destination port, protocol, etc.), and the action includes the information of the action to be performed on the message, such as encapsulation / decapsulation, forwarding, speed limit, etc. The slowpath can send flow entry to the fastpath while also sending flowentry to the hardware layer. The first forwarding flow table stored on the hardware layer is different from the second forwarding flow table stored in the fastpath in that the first forwarding flow table of the hardware layer stores flowid and match, and does not include the corresponding action part. The similarity is that the flowid and match of the same message stored in the first forwarding flow table and the second forwarding flow table are the same.
[0095] To further improve the processing performance of the smart network card and reduce the CPU load. The hardware layer may also include: a data cache area. The data cache area may include multiple data cache queues for caching the message information of a preset batch after completing the first forwarding flow table search, and caching the message information belonging to the same flow identification information in the same data cache queue. In this embodiment, the preset batch is a batch processing mode (batch), and the number of messages obtained during each batch processing can be set according to the processing requirements, for example: pre-setting the acquisition batch, or setting the acquisition batch in real time according to the processing capacity of the smart network card, or setting it in real time according to the CPU load. Each batch can be set to obtain the number of messages, etc. In this embodiment, there is no limitation on the message acquisition batch and the acquisition number. In addition, in this embodiment, obtaining messages by batch processing can also be batched according to a set time period, and of course, batch acquisition can also be set in combination with relevant information such as processing requirements. The batch processing method will be described in detail in the following data processing method embodiment, please refer to the subsequent content.
[0096] Based on the batch processing mode, the first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time;
[0097] The processing module in the fast path module performs the same processing on the message information in the same data cache queue according to searching the corresponding target flow identification information in the second forwarding flow table, and according to the target execution action information corresponding to the target flow identification information. In order to improve the forwarding performance, the message information and the flow identification information in the same group of messages can be sent to the fast path module in the form of a vector; the identification information (vector1) of the vector corresponds to the same flow identification information (flowid1), and the fast path module searches the second forwarding flow table for the target flow identification information that matches the identification information of the vector, and processes the message information in the same group of messages according to the target execution action information corresponding to the target flow identification information. For details, refer to the contents of the data processing method embodiment.
[0098] The above is a description of the first embodiment of a smart network card provided by the present application. The smart network card provided in this embodiment can implement parsing and searching of messages at the hardware layer, and after finding the matching message matching domain information and the flow identification information corresponding to the message matching domain information according to the parsed message information, the flow identification information and the message information are sent to the fast path module of the software layer. When the fast path module finds the matching target flow identification information according to the flow identification information, the corresponding target execution action information is determined, and the message information is processed according to the target execution action information. Thus, when processing the message, the more time-consuming and fixed processing of message parsing and flow identification search can be completed by the hardware layer, and the execution action information with more changes can be processed by the software layer, while ensuring effectiveness and improving processing performance. At the same time, flexibility can also be guaranteed. In addition, the hardware layer can divide the message information with the same flow identification information into a group by batch processing the message, and forward it to the software layer in the form of a group, thereby improving the forwarding performance of the hardware layer, and the software layer can process the same group of message information with the same execution action information, which can also further improve the processing performance.
[0099] Based on the above, the present application also provides a data processing method, such as Figure 3 As shown, Figure 3 It is a flow chart of the first embodiment of a data processing method provided by the present application; the first embodiment of the method is mainly described by taking the smart network card as an example. It can be understood that the software layer and the hardware layer described in this embodiment and subsequent embodiments can be processed by different devices respectively, or by other hardware devices, such as: hardware gateway devices, hardware load balancing devices, etc. Therefore, the hardware layer and the software layer are not limited to being set on the smart network card, but can also be set on other hardware devices, or respectively set on different hardware devices. The first embodiment of the data processing method can specifically include:
[0100] Step S301: The hardware layer receives a message to be processed, and parses the message to be processed to obtain message information; and searches in a first forwarding flow table whether there is message matching domain information matching the message information;
[0101] Step S302: If yes, the flow identification information corresponding to the message matching domain information and the message information are sent to the software layer;
[0102] Step S303: the fast path module of the software layer searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and determines the target execution action information corresponding to the message information according to the target flow identification information;
[0103] Step S304: the fast path module processes the message information according to the target execution action information.
[0104] The above steps are described in detail below.
[0105] The step S301: the hardware layer receives a message to be processed, parses the message to be processed to obtain message information, and searches in the stored first forwarding flow table whether there is message matching domain information matching the message information.
[0106] The message information in step S301 may be a five-tuple of message information, such as source / destination IP (address), source / destination port (port), protocol, etc. The message information may be message information in a data stream, wherein a message is a data unit exchanged and transmitted in a network, and is also a unit of network transmission. The message information may include complete data information to be sent, and the length may not be consistent. The message information is continuously encapsulated into packets, packages, frames, etc. for transmission during the transmission process, and the encapsulation method is to add a header composed of some control information, i.e., a message header. The message belongs to the prior art and will not be described in detail here.
[0107] In this embodiment, the hardware layer is an FPGA or ASIC chip, and the software layer is a virtual switch (vswitch) as an example for description.
[0108] The specific implementation process of step S301 may include:
[0109] Step S301-11: parsing the acquired message to obtain message information; wherein the message information includes tuple information;
[0110] Step S301-12: Compare the tuple information in the message information with the tuple information in the message matching domain information to determine whether the tuple information in the message information matches the tuple information in the message matching domain information;
[0111] Step S301 - 13: If yes, determine whether there is message matching domain information matching the message information in the first forwarding flow table of the hardware layer.
[0112] In this embodiment, step S301-11 can parse the acquired message through the hardware layer to obtain tuple information in the message information, and the tuple information can be five-tuple information of the message, such as: source IP address information, destination IP address information, source port information (port), destination port information (port), protocol information, etc.
[0113] The step S301-12 can compare the source IP address information and the destination IP address information in the five-tuple information with the source IP address information and the destination IP address information recorded in the message matching domain information in the first forwarding flow table of the hardware layer to determine whether the same source IP address information and destination IP address information exist in the message matching domain information.
[0114] For example, the first forwarding flow table can be in the following form:
[0115] flowid (flow identification information) match (message matching domain information) 1 1.1.1.1:80 (source IP) -> 2.2.2.2:90 (destination IP) 2 1.1.1.1:90 (source IP) -> 2.2.2.2:90 (destination IP) 3 1.1.1.2:90 (source IP) -> 2.2.2.2:90 (destination IP)
[0116] The source IP address information in the quintuple information is 1.1.1.1:90, and the destination IP address information is 2.2.2.2:90, which matches the source IP address information 1.1.1.1:90 and the destination IP address information 2.2.2.2:90 in the message information.
[0117] It should be noted that the above message matching domain information only uses the source IP address information and the destination IP address information as an example for explanation. In fact, the information included in the message matching domain information may also include: source port, destination port, protocol type (TCP / UDP / ICMP, etc.), and other information such as tunnel information, i.e., information in the message. The above table is only an example and does not limit the information stored in the message matching domain information.
[0118] Step S302: If yes, the flow identification information corresponding to the message matching domain information and the message information are sent to the software layer;
[0119] The specific implementation process of the step 302 may be, based on the determination result in the step S301 being yes, determining the flow identification information corresponding to the message matching domain information found in the hardware layer, and then sending the flow identification information and the message information to the software layer, following the above example, that is, sending flowid=2 and the message information to the fast path module of the software layer.
[0120] The above is a description of the step S302 being executed when the determination result of step S301 is yes.
[0121] It can be further understood that the determination result of step S301 may also include a negative situation. Therefore, this embodiment may also include:
[0122] Step S30a-1: when the search result in the first forwarding flow table is that there is no message matching domain information matching the message information, and / or when the message to be processed is the first packet message, the hardware layer sends the message information and / or the first packet message to the slow path module of the software layer;
[0123] Step S30a-2: the slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; the third forwarding flow table entry is sent to the second storage module of the fast path module; the flow identification information and the message matching domain information in the third forwarding flow table entry are sent to the first storage module of the hardware layer; usually, when the message information is the first packet message, the message matching domain information that matches the message information cannot be found in the first forwarding flow table. Of course, there may also be some abnormal situations, such as: failure to update the first forwarding flow table and / or the second forwarding flow table or record abnormalities, etc. Therefore, regardless of whether it is the first packet message information or the message information with exceptions, if the search result is non-existent, the first packet message or the message information will be sent to the software layer by the hardware layer. The message information is based on the slow path module in the software layer, and generates a third forwarding flow table entry according to routing, ACL (Access Control List: access control list), speed limit and other processing logics.
[0124] Step S30a-3: the second storage module of the fast path module updates the second forwarding flow table according to the received third forwarding flow table entry, and processes the message information according to the execution action information corresponding to the message information recorded in the updated second forwarding flow table;
[0125] Step S30a-4: The first storage module of the hardware layer updates the first forwarding flow table according to the flow identification information and the message matching domain information in the received third forwarding flow table entry.
[0126] In this embodiment, the fast path module can update the second forwarding flow table according to the third forwarding flow table item provided by the slow path module, and the hardware layer can update the first forwarding flow table according to the third forwarding flow table item provided by the slow path module. The specific form in which the slow path module of the software layer sends down the message related information is not limited, and thus the fast path module of the software layer updates the second forwarding flow table in any way, and the hardware layer updates the first forwarding flow table in any way, as long as the message matching domain information and flow identification information recorded in the first forwarding flow table and the second forwarding flow table for the same message information are the same.
[0127] In this embodiment, the flow identification information, message matching domain information and execution action information in the third forwarding flow table entry are recorded in the second forwarding flow table, and the flow identification information and the message matching domain information in the third forwarding flow table entry are recorded in the first forwarding flow table. The second forwarding flow table can be stored in the second storage module of the fast path module, and the first forwarding flow table can be stored in the first storage module of the hardware layer. Of course, the slow path module can also store the relevant information in the third forwarding flow table entry. The categories of the third forwarding flow table entries included in the first forwarding flow table and the second forwarding flow table are different, but the information corresponding to the same category of the same message is the same, for example: in this embodiment, the third forwarding flow table entry included in the first forwarding flow table is: flow identification information and message matching domain information for message information A; the third forwarding flow table entry included in the second forwarding flow table is: flow identification information, message matching domain information and execution action information for message information A, then the flow identification information and message matching domain information for message information A in the first forwarding flow table and the second forwarding flow table are the same.
[0128] The fast path module in step S30a-3 processes the message information; specifically, the message information is processed according to the execution action information corresponding to the message matching domain information recorded in the updated second forwarding flow table. Therefore, even if the corresponding message matching domain information is not found in the hardware layer, the message information can also be processed accordingly in the fast path module of the software layer, thereby ensuring the real-time processing of the message information and improving the CPU performance.
[0129] The above steps S30a-1 to S30a-4 are mainly for describing how to process the message information when the matching result in step S301 is negative.
[0130] The step S303: the fast path module of the software layer searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and determines the target execution action information corresponding to the message information according to the target flow identification information;
[0131] Based on the description of the above steps S301 and S302, it can be known that the first forwarding flow table of the hardware layer stores flow identification information and message matching domain information; the second forwarding flow table of the software layer stores flow identification information, message matching domain information, and execution action information. The second forwarding flow table in the software layer can be shown in the following table:
[0132] flowid (flow identification information) match (message matching domain information) Action (execution action information) 1 1.1.1.1:80 (source IP) -> 2.2.2.2:90 (destination IP) vxlan encap (encapsulation) 2 1.1.1.1:90 (source IP) -> 2.2.2.2:90 (destination IP) nat(forwarding) 3 1.1.1.2:90 (source IP) -> 2.2.2.2:90 (destination IP) Output port2
[0133] The specific implementation process of step S303 may include:
[0134] Step S303-11: The fast path module in the software layer determines the target flow identification information corresponding to the flow identification information in the second forwarding flow table according to the received flow identification information. Continuing with the above example, when the flow identification information sent in step S302 is 2, that is, flowid=2, the value of the flow identification information 2 is searched in the second forwarding flow table stored by the fast path module, and the flow identification information with the flow identification information 2 is determined as the target flow identification information; the execution action information nat (forwarding) corresponding to the target flow identification information is determined as the target execution action information (as shown in the third row of the above table).
[0135] Step S304: the fast path module processes the message information according to the target execution action information;
[0136] The purpose of step S304 is to perform corresponding action information on the message information according to the target action information, because the software layer obtains the flow identification information based on step S303, and therefore, the corresponding target action information can be determined directly according to the target flow identification information matched by the flow identification information, and then the message information can be directly processed for the corresponding action without parsing, searching, etc. the message. Since the parsing, searching, etc. of the message are performed by the hardware layer, the processing efficiency of the message information can be improved, and the processing performance of the smart network card can be improved.
[0137] Based on the above, it can be understood that in order to further improve the processing performance of the smart network card and reduce the CPU load, the message information in this embodiment can be processed in a batch manner, such as Figure 4 As shown, Figure 4 This is a schematic diagram of a batch processing method in a data processing method provided by the present application. The specific implementation process of batch processing may include:
[0138] Step S30-b1: the hardware layer divides the message information of the preset batch after the first forwarding flow table search is completed into the same group of messages according to the same flow identification information and stores them in the data cache queue of the hardware layer, wherein the message information belonging to the same flow identification information is cached in the same data cache queue;
[0139] Usually a data stream may include multiple message information, and the first message information may be the first packet message. Each of the multiple data streams may include multiple message information, and the batch processing mode (batch) may be to obtain messages, which may be a pre-set batch, or a real-time setting batch according to the processing capability of the smart network card, or a real-time setting according to the CPU load. In this embodiment, there is no limitation on whether the batch of messages to be obtained is preset or set in real time. The triggering mode of batch processing can be triggered according to a set time period, and of course it can also be triggered in combination with relevant information such as processing requirements. The acquisition of the multiple messages may be a batch of message information obtained based on different data streams, or it may be a plurality of message information obtained based on the same data stream, for example: 64 message information or packets.
[0140] In step S30-b1, the same message information can be stored as a group of messages in a ring buffer of the hardware layer, and stored in the form of a queue, for example Figure 3 As shown in, message 1 and message 2 belong to flowid1 and are divided into the same group of messages and stored in the cache in the form of columns, such as the first column; message 1 and message 2 belong to flowid2 and are divided into the same group of messages and stored in the cache in the form of columns, such as the second column; message 1 and message 2 belong to flowid3 and are divided into the same group of messages and stored in the cache in the form of columns, such as the third column.
[0141] The step S30-b1 may be to determine whether the messages obtained in the preset batches have matching message matching domain information in the first forwarding flow table stored in the hardware layer after parsing the multiple message information; that is: to determine whether each message information in the multiple message information has matching message matching domain information in the first forwarding flow table, and similarly, the search may be performed by comparing the tuple information in the message information with the message matching domain information in the first forwarding flow table. The message information with the same flow identification information is stored as the same group of messages in the data cache queue of the hardware layer.
[0142] Step S30-b2: sending the flow identification information in the same group of messages and the message information of the same group of messages to the fast path module at the same time;
[0143] Step S30-b3: The fast path module searches for target flow identification information that matches the flow identification information in the second forwarding flow table based on the flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the message information of the same group of messages determined by the target flow identification information.
[0144] The specific implementation process of step S30-b2 may include:
[0145] The flow identification information of the same group of messages is sent to the fast path module in a vector manner; wherein the vector includes the same flow identification information of the same group of messages.
[0146] The specific implementation process of step S30-b3 may include:
[0147] The fast path module searches the second forwarding flow table for target flow identification information matching the same flow identification information based on the same flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the target flow identification information.
[0148] Continuing with the example of the above-mentioned message and flow identification information, in the step S30-b1, the vector of the message 1 and the message 2 as a group of messages is vector1, and the same flow identification information in vector1 is flowid=1; the vector of the message 3 and the message 4 as a group of messages is vector2, and the same flow identification information in vector2 is flowid=2; the vector of the message 5 and the message 6 as a group of messages is vector3, and the same flow identification information in vector3 is flowid=3.
[0149] The vector1 may include the message information of message 1 and message 2, and the same flow identification information flowid1, and the number of messages in the group of messages may be recorded in the message head packet of the group of messages in the vector1, for example: 2;
[0150] The vector2 may include the message information of message 1 and message 2, and the same flow identification information flowid2, and the number of messages in the group of messages may be recorded in the message first packet of the group of messages in the vector2, for example: 2;
[0151] The vector3 may include tuple information of message 1 and message 2, and the same flow identification information flowid3, and may also record the number of messages in the group of messages in the message header packet of the group of messages in the vector3, for example: 2; the above only takes messages 1 to 6 as examples, and is not used to limit the number of processed messages.
[0152] The progress of processing the messages can be known by the number of recorded messages, and / or the timing of jumping from the first column to the second column for processing or the time of jumping from the first group of messages to the second group of messages for processing. In addition, it can be known from the content included in the above vector that the messages belonging to the same group of messages have the same flowid.
[0153] Using the above example, step S30-b2 can send vector1, vector2 and vector3 to the fast path module of the software layer, which can be sent simultaneously or separately. When the separate sending method is adopted, the jump to the next group of sending can be triggered according to the processing status of the previous group of sending, and the specific sending method is not limited.
[0154] Therefore, in step S303: the fast path module of the software layer searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and determines the target execution action information corresponding to the message information according to the target flow identification information, which may specifically include:
[0155] Step S303-21: the software layer determines the target flow identification information matched in the second forwarding flow table according to the same flow identification information received in the vector;
[0156] Step S303-22: Determine the execution action information corresponding to the target flow identification information in the second forwarding flow table as the target execution action information corresponding to the message information of the same group of messages.
[0157] Based on this, the specific process of step S304 may include:
[0158] Step S304-21: The fast path module of the software layer processes the message information of the same group of messages with the same flow identification information according to the target execution action information. Because each vector includes the same flow identification information, the fast path module does not need to search for the flow identification information of the message information of the same group of messages one by one, but can search according to the same flow identification information of the vector, and perform the same processing on the message information of the same group of messages according to the target execution action information corresponding to the same flow identification information in the vector, thereby further improving the processing performance of the software layer, and further improving the forwarding performance of the hardware layer in forwarding the flow identification information and message information.
[0159] It should be noted that the data processing method in this embodiment is not limited to application to smart network cards. In the scenario of software and hardware integration, in order to improve the performance of the CPU, the software layer and the hardware layer can be deployed on hardware devices other than smart network cards, such as: hardware gateway devices, hardware load balancing devices, hardware auxiliary processing devices, etc.
[0160] The above is a description of an embodiment of a data processing method provided by the present application. The embodiment of the method distinguishes message information by using flowid, and at the same time, records the message matching domain information and flow identification information in the first forwarding flow table and stores it in the hardware layer. Because the hardware layer has certain limitations and poor flexibility for executing action information, the execution action information is not stored in the first forwarding flow table of the hardware layer. In this embodiment, when the hardware layer has message matching domain information that matches the message information, the flow identification information corresponding to the message matching domain information and the message information are sent to the software layer, and the software layer searches for the corresponding target flow identification information according to the flow identification information, determines the corresponding target execution action information according to the target flow identification information, and then processes the message information accordingly according to the target execution action information. Thus, on the one hand, the fixed time-consuming processing such as parsing and searching of message information can be completed through the hardware layer, and the flexible and changeable execution action information (action) is completed through the fast path module of the software layer, thereby improving the processing performance of the intelligent network card and improving the flexibility of processing. On the other hand, by using the batch processing method of the hardware layer for message information, the hardware layer can improve the forwarding performance of message information, and further improve the processing performance of the software layer.
[0161] The above is a detailed description of the first embodiment of a data processing method provided by the present application. Based on this, the present application also discloses a smart network card. Figure 5 , Figure 5 The structure of the second embodiment of a smart network card provided by the present application is a schematic diagram, and the embodiment also includes: a hardware layer 501 and a software layer 502;
[0162] The hardware layer includes a message parsing module, a first storage module, a first flow table lookup module, a first sending module, and a first processing module; wherein the message parsing module is used to parse messages to obtain message information; the first storage module stores a first forwarding flow table, the first forwarding flow table including flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information that matches the message information, and the flow identification information corresponding to the message matching domain information; the first processing module is used to process the message information according to the execution action information when the first forwarding flow table includes the execution action information corresponding to the flow identification information; the first sending module is used to send the flow identification information and the message information to the fast path module of the software layer when the first forwarding flow table does not include the execution action information corresponding to the flow identification information;
[0163] The software layer includes a fast path module, which includes a second storage module, a second flow table lookup module and a second processing module; the second storage module stores a second forwarding flow table, which includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the second processing module is used to process the message information according to the target execution action information corresponding to the target flow identification information.
[0164] Said Figure 5 The second embodiment of the smart network card shown is similar to the Figure 2 The first embodiment of the smart network card shown is different in that:
[0165] From a structural perspective, the hardware layer in the first embodiment does not include the first processing module, and the hardware layer in the second embodiment includes the first processing module.
[0166] From a functional perspective, the first forwarding flow table of the hardware layer in the first embodiment stores flow identification information and message matching domain information, but does not include execution action information; the first forwarding flow table of the hardware layer in the second embodiment may include flow identification information, message matching domain information, and execution action information. In the second embodiment, if the hardware layer finds matching message matching domain information in the first forwarding flow table for the message information obtained after message parsing, it determines whether there is corresponding execution action information in the first forwarding flow table. If there is, the hardware layer processes the message information according to the execution action information. If not, the flow identification information corresponding to the message matching domain information and the message information are sent to the fast path module of the software layer. Thus, when the hardware layer has the ability to process execution action information, the message information can be processed when there is execution action information matching the message information in the first forwarding flow table; when the hardware layer has the ability to process execution action information, and when there is no execution action information matching the message information in the first forwarding flow table, it is sent to the fast path module of the software layer for processing.
[0167] The first sending module is also used to send the message information to the slow path module of the software layer when the first forwarding flow table does not include message matching domain information that matches the message information.
[0168] In the second embodiment, the software layer may also include: a slow path module, the slow path module includes a generation module and a third sending module, the generation module is used to generate a third forwarding flow table entry according to the processing of the message information when there is no message matching domain information matching the message information in the first forwarding flow table, and / or when the message is the first packet message, the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; the third sending module is used to send the third forwarding flow table entry to the second storage module, and when the hardware layer does not support the processing of the execution action information, send the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module; when the hardware layer supports the processing of the execution action information, send the third forwarding flow table entry to the first storage module.
[0169] In this embodiment, the hardware layer may also include a data cache area, the data cache area includes a plurality of data cache queues, which are used to cache a preset batch of message information after the first forwarding flow table search is completed, and cache the message information belonging to the same flow identification information into the same data cache queue;
[0170] The first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time;
[0171] The processing module in the fast path module is used to perform the same processing on the message information in the same data cache queue according to searching for matching target flow identification information in the second forwarding flow table and according to the target execution action information corresponding to the target flow identification information.
[0172] Only the differences between the first embodiment and the second embodiment are described here. For other related contents of the second embodiment, reference may be made to the first embodiment, which will not be described in detail here.
[0173] Based on the above second embodiment, the present application also provides a second embodiment of a data processing method, such as Figure 6 As shown, the second embodiment of the method is also described by taking the smart network card as an example, and specifically may include:
[0174] Step S601: The hardware layer receives a message to be processed, parses the message to be processed to obtain message information, and searches in a first forwarding flow table whether there is message matching domain information and flow identification information matching the message information;
[0175] Step S602: If the first forwarding flow table contains message matching domain information and flow identification information that match the message information, determining whether the first forwarding flow table contains execution action information corresponding to the message matching domain information;
[0176] Step S603: When there is no execution action information corresponding to the message matching domain information in the first forwarding flow table, the message information and the flow identification information are sent to the fast path module of the software layer;
[0177] Step S604: the fast path module searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information;
[0178] Step S605: the fast path module processes the message information according to the target execution action information corresponding to the target flow identification information;
[0179] Step S606: When there is execution action information corresponding to the message matching domain information in the first forwarding flow table, the hardware layer processes the message information according to the execution action information corresponding to the message matching domain information.
[0180] In the second embodiment of the above method, after the hardware layer obtains and parses the message, the first forwarding flow table in the hardware layer is searched for the message matching domain information that matches the message information. If the matching message matching domain information is found, it is determined whether there is execution action information corresponding to the message matching domain information. If so, the hardware layer processes the message information according to the execution action information. If not, the hardware layer sends the flow identification information corresponding to the message matching domain information and the message information to the fast path module of the software layer. The fast path module searches for the matching target flow identification information according to the flow identification information, and processes the message information according to the target execution action information corresponding to the target flow table identification information.
[0181] When the first forwarding flow table does not include message matching domain information matching the message information, and / or when the message to be processed is a first packet message, sending the message information and / or the first packet message to the slow path module of the software layer;
[0182] The slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, wherein the third forwarding flow table entry includes flow identification information corresponding to the message information and / or the first packet message, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information;
[0183] The third forwarding flow table entry is sent to the second storage module, and when the hardware layer does not support the processing of the execution action information, the flow identification information corresponding to the message information and the message matching domain information corresponding to the flow identification information in the third forwarding flow table entry are sent to the first storage module; when the hardware layer supports the processing of the execution action information, the third forwarding flow table entry is sent to the first storage module.
[0184] The difference from the first embodiment of the above method is that, in the second embodiment, the first forwarding flow table of the hardware layer stores flow identification information, message matching domain information and execution action information. If there is message matching domain information and execution action information matching the message information in the first forwarding flow table of the hardware layer, the hardware layer processes the message information according to the matching execution action information. Otherwise, the second forwarding flow table of the software layer is searched for matching execution action information according to the flow identification information, and the message information is processed according to the found execution action information.
[0185] It should be noted that the flow identification information and message matching domain information for the same message information in the first forwarding flow table of the hardware layer and the second forwarding flow table of the fast path module of the software layer are the same, and both can be issued by the slow path module.
[0186] It can be understood that when there is no message matching domain information matching the message information in the first forwarding flow table of the hardware layer, the message information can be sent to the slow path module of the software layer for corresponding processing and generating a third forwarding flow table entry. As described in the first embodiment of the above-mentioned data processing method, the message information can also be sent to the fast path module of the software layer first, and the matching target message matching domain information is searched for in the second forwarding flow table of the fast path module. If found, the message information is processed according to the target execution action information corresponding to the target message matching domain information, thereby avoiding the problem of resource waste caused by anomalies in the first forwarding flow table (for example: update anomalies) that make the search unsuccessful, and then directly sending the message information to the slow path module of the software layer to generate the third forwarding flow table entry again.
[0187] Based on the above, the present application also provides a data processing method, such as Figure 7 As shown, Figure 7 It is a flowchart of the third embodiment of a data processing method provided by the present application, and the third embodiment is mainly described from the perspective of the hardware layer of the smart network card. When there is a combination of software and hardware, in order to improve the performance of the CPU, the software layer and the hardware layer can be processed by different devices respectively, such as: hardware gateway devices, hardware load balancing devices, etc. Therefore, the hardware layer and the software layer are not limited to being set on the smart network card, but can also be set on other hardware devices, or set on different hardware devices respectively.
[0188] The third embodiment of the method can be applied to a hardware network card, wherein a first forwarding flow table is stored in the hardware network card, wherein the first forwarding flow table includes flow identification information and message matching domain information corresponding to the flow identification information, and the first forwarding flow table does not include execution action information corresponding to the message matching domain information, and the method includes:
[0189] Step S701: Obtain a message to be processed, and parse the message to be processed to obtain message information;
[0190] Step S702: According to the message information, searching in the first forwarding flow table whether there is flow identification information and message matching domain information matching the message information;
[0191] Step S703: If yes, send the message information and the flow identification information.
[0192] It can be understood that when there is no message matching domain information matching the message information in the first forwarding flow table, the message information is sent.
[0193] The steps S701 to S703 may refer to the description of the first embodiment and the second embodiment of the above-mentioned data processing method. The flow identification information and the message information sent in step S703 may be sent to the fast path module of the software layer of the smart network card, or may be a fast path module of the software layer set in other hardware devices. Therefore, the data processing method in this embodiment is not limited to application to smart network cards.
[0194] Based on the above, the present application also provides a data processing method, such as Figure 8 As shown, Figure 8 It is a flow chart of the fourth embodiment of a data processing method provided by the present application; the fourth embodiment is mainly described from the perspective of the smart network card software layer. When there is a scenario where software and hardware are combined, in order to improve the performance of the CPU, the software layer and the hardware layer can be processed by different devices respectively, such as: hardware gateway devices, hardware load balancing devices, etc. Therefore, the hardware layer and the software layer are not limited to being set on the smart network card, but can also be set on other hardware devices, or data processing can be performed on different hardware devices respectively. In this embodiment, the smart network card is used as an example for description. The fourth embodiment can be applied to a software network card, in which a second forwarding flow table is stored, and the second forwarding flow table includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information. The method includes:
[0195] Step S801: receiving flow identification information and parsed message information sent by the hardware network card;
[0196] Step S802: Searching in the second forwarding flow table to see whether there is target flow identification information matching the flow identification information sent by the hardware network card;
[0197] Step S803: If yes, the message information is processed according to the target execution action information corresponding to the target flow identification information.
[0198] The contents of step S801 to step S803 can refer to the description of the first and second embodiments of the above-mentioned data processing method, and will not be described in detail here. Similarly, when the determination result of step S802 is no, the slow path module of the software layer is required to process, and the specific processing process is the same as the first and second embodiments above, that is, it may include:
[0199] Step S804-1: The software layer slow path module processes the received message information and generates a third forwarding flow table entry for the message information; the third forwarding flow table entry includes: message matching domain information corresponding to the message information, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information;
[0200] Step S804-2: Send the third forwarding flow table entry to the fast path module. To ensure that the information in the first forwarding flow table of the hardware layer is synchronized or identical with the information in the second forwarding flow table of the software layer, the following may also be included: Step S804-3: Send the flow identification information and the message matching domain information in the third forwarding flow table entry to the hardware layer.
[0201] Based on the above content, the present application also provides an electronic device, such as Fig. 9 As shown, Fig. 9 It is a structural diagram of an electronic device embodiment provided by the present application, including: a processor 901 and a smart network card 902; the smart network card is used to receive the execution task of the processor 901, and process the execution task according to the relevant contents recorded in the above steps S301 to S304; or, according to the relevant contents recorded in the above steps S601 to S606; or, according to the relevant contents recorded in the above steps S701 to S703; or according to the relevant contents recorded in the above steps S801 to S803.
[0202] Based on the above, the present application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0203] When the program is read and executed by a processor, the steps in the above data processing method embodiment are executed.
[0204] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0205] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0206] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0207] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0208] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A smart network card, characterized in that: include: Hardware layer and software layer; The hardware layer includes a message parsing module, a first storage module, a first flow table lookup module, and a first sending module; wherein the message parsing module is used to parse messages to obtain message information; the first storage module is used to store a first forwarding flow table, the first forwarding flow table includes flow identification information, and message matching domain information corresponding to the flow identification information, and the first forwarding flow table does not include execution action information corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information that matches the message information, and the flow identification information corresponding to the message matching domain information; the first sending module is used to send the flow identification information found by the first flow table lookup module and the message information to the fast path module of the software layer; The software layer includes a fast path module; the fast path module includes a second storage module, a second flow table lookup module and a processing module; the second storage module stores a second forwarding flow table, the second forwarding flow table includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the processing module is used to process the received message information according to the execution action information corresponding to the target flow identification information.
2. The smart network card according to claim 1, characterized in that: The software layer also includes a slow path module; the slow path module includes a generation module and a third sending module; the generation module is used to generate a third forwarding flow table entry based on processing of the message information and / or the first packet message when there is no message matching domain information matching the message information in the first forwarding flow table, and / or when the message is the first packet message, the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; The third sending module is used to send the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module of the hardware layer; The third forwarding flow entry is sent to the second storage module of the fast path module.
3. The smart network card according to claim 1, characterized in that: The hardware layer also includes a data cache area, which includes a plurality of data cache queues for caching a preset batch of message information after the first forwarding flow table search is completed, and caching message information belonging to the same flow identification information into the same data cache queue; The first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time; The processing module in the fast path module is used to perform the same processing on the message information in the same data cache queue according to searching for matching target flow identification information in the second forwarding flow table and according to the target execution action information corresponding to the target flow identification information.
4. A data processing method, characterized in that: Applied to the smart network card according to any one of claims 1 to 3, the method comprises: The hardware layer receives the message to be processed, parses the message to be processed to obtain message information, and searches in the first forwarding flow table whether there is message matching domain information matching the message information; If yes, the flow identification information corresponding to the message matching domain information and the message information are sent to the software layer; The fast path module of the software layer searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and determines the target execution action information corresponding to the message information according to the target flow identification information; The fast path module processes the message information according to the target execution action information.
5. The data processing method according to claim 4, characterized in that: Also includes: When the search result in the first forwarding flow table is that there is no message matching domain information matching the message information, and / or when the message to be processed is the first packet message, the hardware layer sends the message information and / or the first packet message to the slow path module of the software layer; The slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, wherein the third forwarding flow table entry includes message matching domain information corresponding to the message information and / or the first packet message, flow identification information corresponding to the message matching domain information, and execution action information corresponding to the message matching domain information; Sending the third forwarding flow entry to the second storage module of the fast path module; Sending the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module of the hardware layer; The second storage module of the fast path module updates the second forwarding flow table according to the received third forwarding flow table entry, and processes the message information according to the execution action information corresponding to the message information recorded in the updated second forwarding flow table; The first storage module of the hardware layer updates the first forwarding flow table according to the flow identification information and the message matching domain information in the received third forwarding flow table entry.
6. The data processing method according to claim 5, characterized in that: Also includes: The hardware layer divides the message information after the first forwarding flow table search is completed in a preset batch into the same group of messages according to the same flow identification information and stores them in the data cache queue of the hardware layer, wherein the message information belonging to the same flow identification information is cached in the same data cache queue; Sending the flow identification information in the same group of messages and the message information of the same group of messages to the fast path module at the same time; The fast path module searches the second forwarding flow table for target flow identification information that matches the flow identification information based on the flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the message information of the same group of messages determined by the target flow identification information.
7. The data processing method according to claim 6, characterized in that: The sending the flow identification information in the same group of messages and the message information of the same group of messages to the fast path module includes: Sending the flow identification information of the same group of messages to the fast path module in a vector manner; wherein the vector includes the same flow identification information of the same group of messages; The fast path module searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information, and processes the message information in the same group of messages according to the target flow identification information. The fast path module processes the message information in the same group of messages according to the target flow identification information. The fast path module searches the second forwarding flow table for target flow identification information that matches the same flow identification information based on the same flow identification information, and processes the message information in the same group of messages based on the target execution action information corresponding to the target flow identification information.
8. A smart network card, characterized in that: include: Hardware layer and software layer; The hardware layer includes a message parsing module, a first storage module, a first flow table lookup module, a first sending module, and a first processing module; wherein the message parsing module is used to parse messages to obtain message information; the first storage module stores a first forwarding flow table, the first forwarding flow table including flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the first flow table lookup module is used to search the first forwarding flow table for the message matching domain information that matches the message information, and the flow identification information corresponding to the message matching domain information; the first processing module is used to process the message information according to the execution action information when the first forwarding flow table includes the execution action information corresponding to the flow identification information; the first sending module is used to send the flow identification information and the message information to the fast path module of the software layer when the first forwarding flow table does not include the execution action information corresponding to the flow identification information; The software layer includes a fast path module, which includes a second storage module, a second flow table lookup module and a second processing module; the second storage module stores a second forwarding flow table, which includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; the second flow table lookup module is used to search the second forwarding flow table for target flow identification information that matches the flow identification information sent by the first sending module; the second processing module is used to process the message information according to the target execution action information corresponding to the target flow identification information.
9. The smart network card according to claim 8, characterized in that: The first sending module is further used for sending the message information to the slow path module of the software layer when the first forwarding flow table does not include the message matching domain information corresponding to the message information; The slow path module of the software layer includes a generation module and a third sending module, the generation module is used to generate a third forwarding flow table entry according to the processing of the message information when there is no message matching domain information matching the message information in the first forwarding flow table, and / or when the message is the first packet message, the third forwarding flow table entry includes the message matching domain information corresponding to the message information and / or the first packet message, the flow identification information corresponding to the message matching domain information, and the execution action information corresponding to the message matching domain information; The third sending module is used to send the third forwarding flow table entry to the second storage module, and when the hardware layer does not support the processing of the execution action information, send the flow identification information and the message matching domain information in the third forwarding flow table entry to the first storage module; When the hardware layer supports processing of the execution action information, the third forwarding flow table entry is sent to the first storage module.
10. The smart network card according to claim 8, characterized in that: The hardware layer also includes a data cache area, which includes a plurality of data cache queues for caching a preset batch of message information after the first forwarding flow table search is completed, and caching message information belonging to the same flow identification information into the same data cache queue; The first sending module of the hardware layer is used to send the message information and the flow identification information of the same group of messages stored in the same data cache queue to the fast path module of the software layer at the same time; The processing module in the fast path module is used to perform the same processing on the message information in the same data cache queue according to searching for matching target flow identification information in the second forwarding flow table and according to the target execution action information corresponding to the target flow identification information.
11. A data processing method, characterized in that: Applied to the smart network card according to any one of claims 8 to 10, the method comprises: The hardware layer receives the message to be processed, parses the message to be processed to obtain message information, and searches in the first forwarding flow table whether there is message matching domain information and flow identification information matching the message information; If the first forwarding flow table contains message matching domain information and flow identification information that match the message information, determining whether the first forwarding flow table contains execution action information corresponding to the message matching domain information; When there is no execution action information corresponding to the message matching domain information in the first forwarding flow table, sending the message information and the flow identification information to a fast path module of the software layer; The fast path module searches the second forwarding flow table for target flow identification information matching the flow identification information according to the flow identification information; The fast path module processes the message information according to the target execution action information corresponding to the target flow identification information; When execution action information corresponding to the message matching domain information exists in the first forwarding flow table, the hardware layer processes the message information according to the execution action information corresponding to the message matching domain information.
12. The method according to claim 11, characterized in that Also includes: When the first forwarding flow table does not include message matching domain information corresponding to the message information, and / or when the message to be processed is a first packet message, sending the message information and / or the first packet message to the slow path module of the software layer; The slow path module generates a third forwarding flow table entry according to the processing of the message information and / or the first packet message, wherein the third forwarding flow table entry includes flow identification information corresponding to the message information and / or the first packet message, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; Sending the third forwarding flow table entry to the second storage module, and when the hardware layer does not support the processing of the execution action information, sending the flow identification information corresponding to the message information and the message matching domain information corresponding to the flow identification information in the third forwarding flow table entry to the first storage module; When the hardware layer supports processing of the execution action information, the third forwarding flow table entry is sent to the first storage module.
13. A data processing method, characterized in that: Applied to a hardware network card and a software network card, the hardware network card stores a first forwarding flow table, the first forwarding flow table includes flow identification information and message matching domain information corresponding to the flow identification information, and the first forwarding flow table does not include execution action information corresponding to the message matching domain information; the software network card stores a second forwarding flow table, the second forwarding flow table includes flow identification information, message matching domain information corresponding to the flow identification information, and execution action information corresponding to the message matching domain information; The method includes: The hardware network card obtains the message to be processed, and parses the message to be processed to obtain message information; The hardware network card searches, according to the message information, the first forwarding flow table to see whether there is flow identification information and message matching domain information that match the message information; If yes, the hardware network card sends the message information and the flow identification information; When the flow identification information and the message matching domain information corresponding to the message information do not exist in the first forwarding flow table, the hardware network card sends the message information; The software network card receives the flow identification information and the parsed message information sent by the hardware network card; Searching in the second forwarding flow table whether there is target flow identification information matching the flow identification information sent by the hardware network card; If so, the message information is processed according to the target execution action information corresponding to the target flow identification information.
14. An electronic device comprising: processor; An intelligent network card, configured to receive an execution task from the processor and to process data according to any one of claims 4 to 7 above; Alternatively, the data processing method described in any one of claims 11 to 13 above processes the execution task.
15. A computer storage medium for storing data generated by a network platform and a program for processing the data generated by the network platform; When the program is read and executed by a processor, it executes the data processing method described in any one of claims 4 to 7; or, it executes the data processing method described in any one of claims 11 to 13.
