A flow table unloading method, system, device and medium suitable for smart network card

By merging multi-level flow tables and offloading them to the intelligent network card hardware, the problem of network forwarding performance degradation caused by multi-level flow tables is solved, efficient network packet processing and forwarding is achieved, and system performance and compatibility are improved.

CN118646723BActive Publication Date: 2024-12-31CORE YUNSHENG (HANGZHOU) ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411125680.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-31
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

In data centers and cloud computing networks, hardware offloading of multi-stage flow tables leads to degradation of network forwarding performance, and the prior art is difficult to effectively improve the processing efficiency of flow tables.

Method used

By determining whether the multi-level flow table can be merged, you only need to query the merged flow table once after the merge, reducing the search time and processing complexity, and directly offloading it to firmware or hardware to achieve efficient processing of the flow table.

Benefits of technology

It improves network forwarding performance, reduces CPU load, optimizes the forwarding efficiency and accuracy of network packets, and does not affect the software layer logic, and improves system compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646723B_ABST
    Figure CN118646723B_ABST
Patent Text Reader

Abstract

The present invention provides a flow table unloading method, system, device and medium applicable to an intelligent network card, including: step S1: determine whether the flow table is a multi-level flow table, if yes, execute step S2; if not, unload the flow table to firmware or hardware; step S2: save the id information in the matching domain of the multi-level flow table to the matching id table, and save the id information in the action domain of the multi-level flow table to the action id table; step S3: determine whether multiple multi-level flow tables can be merged according to the matching domain, merge the multiple multi-level flow tables that can be merged, obtain a merged flow table, and unload it to firmware or hardware. The present invention merges related multi-level flow tables into one, and only needs to query the merged multi-level flow table once, so that the network forwarding performance will not be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In data centers, cloud computing and other networks, smart NIC flow table offloading is often used to improve network forwarding performance. Flow table hardware offloading transfers network packet forwarding to the smart NIC for processing, reducing the pressure on the CPU to process network packets. Smart NIC (SmartNIC), also known as smart network interface card (NIC), is a programmable accelerator that optimizes data center networks, security and storage by offloading various tasks on the server CPU, such as network packet processing and security functions. The flow table is a data structure inside the smart NIC used to store and process network traffic rules, which determines how data packets are routed and processed.

[0003] Figure 1The flow chart of the current flow table unloading solution of the smart NIC is shown. At the software interface level, the flow table is unloaded through the interfaces of TCflower and RTE flow. At the driver level, the driver of the smart NIC converts the TC flower flow table or RTE flow flow table into the flow table format supported by the firmware / hardware of the NIC and sends it to the firmware / hardware. After the flow table is unloaded to the firmware / hardware of the smart NIC, the subsequent packets are processed by the firmware / hardware of the smart NIC. Only the first packet is forwarded in the software and the flow table is unloaded to the firmware / hardware of the smart NIC. The subsequent packets are forwarded by the firmware / hardware. TC Flower is a component in the TC (Traffic Control) module of the Linux kernel. It supports mapping specific traffic control rules (such as OpenFlow rules) to TC rules and allows these rules to be unloaded on hardware (such as NIC) to improve the efficiency and performance of packet processing. One of the main functions of TC Flower is to support hardware unloading. This means that the traffic control rules that originally need to be processed by the CPU can be transferred to hardware devices such as NICs for execution, thereby reducing the burden on the CPU and improving the overall performance of the system. RTE Flow is an API interface provided by DPDK, which is used to define and manage the rules of network traffic classification (FlowClassification) and traffic behavior (Flow Actions), and can implement functions such as traffic classification, traffic behavior and hardware offloading. Kernel Driver is part of the operating system kernel, responsible for controlling hardware devices and managing system resources, enabling the operating system to identify, manage and control hardware devices, and providing the necessary interface for the interaction between the operating system and the hardware. In Linux systems, Kernel Driver usually exists in the form of modules and can be dynamically loaded into or unloaded from the kernel. DPDK driver, that is, DPDK (Data Plane Development Kit) driver, is a core component of the DPDK framework. DPDK is an open source software development kit for building high-performance data plane applications. It provides a set of optimized user space libraries and drivers that enable the processing of network packets to achieve extremely high throughput and low latency on general-purpose servers.

[0004] In the prior art, in order to improve the performance of the flow table, the following measures are mainly taken:

[0005] Increase flow table capacity: Increase the storage space of the flow table to accommodate more flow table entries, thereby reducing flow table conflicts and lookup time.

[0006] Optimize flow table algorithm: Use efficient flow table search and update algorithms, such as hash tables, red-black trees, etc., to improve the processing speed of flow tables.

[0007] Utilize hardware acceleration: Use hardware accelerators such as FPGA (field programmable gate array) and ASIC (application-specific integrated circuit) to speed up the processing of flow tables.

[0008] However, for hardware offloading of multi-level flow tables, even if the smart network card supports the offloading of multi-level flow tables, the network forwarding performance will be greatly reduced because all flow table entries need to be queried multiple times.

[0009] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above content has been disclosed on the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention

[0010] In view of the defects in the prior art, the present invention merges the related multi-level flow tables into one, and only needs to query the merged multi-level flow table once, so that the network forwarding performance will not be reduced, the forwarding efficiency of network data packets is optimized, and the search time and processing complexity are reduced by intelligently processing the multi-level flow table.

[0011] According to the present invention, a flow table unloading method applicable to a smart network card includes the following steps:

[0012] Step S1: Determine whether the flow table is a multi-level flow table, if yes, execute step S2; if no, unload the flow table to firmware or hardware;

[0013] Step S2: saving the id information in the match field of the multi-level flow table to the match id table, and saving the id information in the action field of the multi-level flow table to the action id table;

[0014] Step S3: judging whether a plurality of the multi-level flow tables can be merged according to the matching domain, merging the plurality of the multi-level flow tables that can be merged to obtain a merged flow table, and unloading the merged flow table to the firmware or hardware.

[0015] Optionally, the flow table unloading method applicable to a smart network card is characterized by further comprising:

[0016] Step S4: The corresponding relationship between the multi-level flow table and the merged flow table is saved through the driver program, and all corresponding merged flow tables are searched through the multi-level flow table.

[0017] Optionally, the flow table unloading method applicable to a smart network card is characterized by further comprising:

[0018] Step S5: Delete the multi-level flow table and the merged flow table.

[0019] Optionally, the flow table unloading method applicable to a smart network card is characterized in that when judging whether a plurality of the multi-level flow tables can be merged according to the matching domain, it is achieved by judging whether each field in the matching domain contains the same matching interval.

[0020] Optionally, the flow table unloading method applicable to an intelligent network card is characterized in that if the action domain of the multi-level flow table includes a situation of modifying a certain field, the matching domain of the multi-level flow table is matched according to the modified field, and the fields in the matching domain of the multi-level flow table are merged.

[0021] Optionally, the flow table unloading method applicable to a smart network card is characterized in that step S3 comprises:

[0022] Step S31: searching the action id table for a first flow table entry having the same matching interval according to the id information of the matching domain;

[0023] Step S32: searching the matching id table for a second flow table entry having the same matching interval according to the id information of the action domain;

[0024] Step S33: merge the first flow table entry and the second flow table entry to obtain a merged flow table, and unload it to firmware or hardware.

[0025] Optionally, the flow table unloading method applicable to a smart network card is characterized in that when a plurality of the multi-level flow tables having the same matching interval are merged, the id field in the action domain is deleted.

[0026] A flow table unloading system applicable to a smart network card provided by the present invention includes the following modules:

[0027] A judging module, used to judge whether the flow table is a multi-level flow table, and if so, execute the table building module; if not, unload the flow table to firmware or hardware;

[0028] A table building module, used to save the id information in the match domain of the multi-level flow table to the match id table, and save the id information in the action domain of the multi-level flow table to the action id table;

[0029] The merging module is used to determine whether a plurality of the multi-level flow tables can be merged according to the matching domain, merge the plurality of the multi-level flow tables that can be merged to obtain a merged flow table, and unload it to the firmware or hardware.

[0030] A flow table unloading device applicable to a smart network card provided by the present invention includes:

[0031] processor;

[0032] a memory storing executable instructions of the processor;

[0033] The processor is configured to execute the steps of the flow table unloading method applicable to the smart network card by executing the executable instructions.

[0034] The computer-readable storage medium provided according to the present invention is used to store a program, and when the program is executed, the steps of the flow table unloading method applicable to the smart network card are implemented.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The present invention combines related multi-level flow tables into one, and only needs to query the combined multi-level flow table once, so that the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, the present invention not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding.

[0037] The present invention only needs to drive the support flow table merging function, does not need to modify the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings in the following descriptions are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious:

[0039] Figure 1 A flow chart of unloading a flow table of a smart network card in the prior art;

[0040] Figure 2 A flowchart of a flow table unloading method applicable to a smart network card in an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of a data structure in an embodiment of the present invention;

[0042] Figure 4 A flowchart of another method for unloading a flow table applicable to a smart network card in an embodiment of the present invention;

[0043] Figure 5A flowchart of another method for unloading a flow table applicable to a smart network card in an embodiment of the present invention;

[0044] Figure 6 A flowchart of the steps of unloading a multi-level flow table to firmware or hardware in an embodiment of the present invention;

[0045] Figure 7 A schematic diagram of a module of a flow table unloading system applicable to a smart network card in an embodiment of the present invention;

[0046] Figure 8 Schematic diagram of the structure of a flow table unloading device applicable to a smart network card in an embodiment of the present invention;

[0047] Fig. 9 Schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0049] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0050] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0051] The present invention provides a flow table unloading method applicable to a smart network card, aiming to solve the problems existing in the prior art.

[0052] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0053] It should be noted that this specification uses the IP address as an example to illustrate the matching interval, but those skilled in the art can understand that any ID information or ID field in the multi-level flow table that can be used to distinguish whether different flow tables belong to the same matching area can be used to achieve the purpose of the present invention. Therefore, methods, systems, devices or storage media that directly replace the IP address with other information or fields are within the scope of protection of the present invention.

[0054] Figure 2 FIG. 1 is a flow chart of a method for unloading a flow table applicable to a smart network card in an embodiment of the present invention. Figure 2 As shown, the steps of a flow table unloading method applicable to a smart network card in an embodiment of the present invention include:

[0055] Step S1: determine whether the flow table is a multi-level flow table, if yes, execute step S2; if no, unload the flow table to firmware or hardware.

[0056] In this step, a multi-level flow table refers to the presence of multiple flow tables in a network switch or router, which are used to process data packets in layers. Each flow table is responsible for a part of the logic in the data packet processing process, and the complex data packet processing function is realized through the collaborative work of multiple flow tables. The multi-level flow table divides the processing logic of the data packet into multiple sub-logics, and multiple flow tables are used to match and process them respectively. The data packet passes through each flow table in the switch or router in turn, and matches and performs corresponding operations according to the rules in the flow table. If the data packet matches the corresponding rule in a certain flow table, the operation specified by the rule will be executed, and it may jump to the next flow table for further processing according to the operation result. The multi-level flow table has the advantages of saving space, improving flexibility and supporting complex business logic. By checking the flow table structure, it can be determined whether the flow table is a multi-level flow table, that is, analyzing whether the flow table contains multiple levels, each level has different matching conditions and action sets. If the flow table is a single-level flow table (that is, there is no clear hierarchical structure), the flow table is directly unloaded to the firmware or hardware for processing. If the flow table is a multi-level flow table, continue to execute step S2.

[0057] Step S2: Save the id information in the match field of the multi-level flow table to the match id table, and save the id information in the action field of the multi-level flow table to the action id table.

[0058] In this step, the id information in the match domain and action domain of each level in the multi-level flow table is saved in the match id table and action id table respectively. The match id table is classified according to the id in the match domain. The action id table is classified according to the id in the action domain. The match id table and action id table do not store the information of the multi-level flow table, but are equivalent to the index of the multi-level flow table to improve the search efficiency. The data structure of the multi-level flow table is shown in Figure 3 .from Figure 3 As can be seen, both the match id table and the action id table include multiple id information, represented by (n+1), and each id information includes multiple entries, represented by n. The information of the multi-level flow table is placed in the multi-level flow table cache. Traverse each level of the multi-level flow table and extract the id information from the match domain and action domain. Save the extracted match domain id information to the match id table, and save the action domain id information to the action id table. These id information will be used as key identifiers when merging flow tables later.

[0059] Step S3: judging whether a plurality of the multi-level flow tables can be merged according to the matching domain, merging the plurality of the multi-level flow tables that can be merged to obtain a merged flow table, and unloading the merged flow table to the firmware or hardware.

[0060] In this step, the system compares the matching domains of different multi-level flow tables to find flow table entries with the same or similar matching conditions. For flow table entries with the same or similar matching conditions, the system merges them into a new flow table entry. When merging, the system also needs to consider the differences in the action domains and decide on the merged action (such as priority, override, etc.). Unload the merged multi-level flow table to firmware or hardware. This step usually involves programming the flow table entries into the flow table processing engine in the hardware chip or firmware for fast matching and forwarding when data packets arrive.

[0061] This embodiment caches all multi-level flow tables in the driver; according to the cached multi-level flow table matching field, the multi-level flow tables based on the same 5-tuple, 7-tuple or even more tuple matching information are merged into one; finally, the merged multi-level flow table is unloaded to the firmware / hardware, and only the merged multi-level flow table needs to be queried once, and the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, this embodiment not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding. This embodiment only needs the driver to support the flow table merging function, without modifying the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system.

[0062] In some embodiments, when judging whether the plurality of multi-level flow tables can be merged according to the matching domain, it is achieved by judging whether each field in the matching domain contains the same matching interval. The matching domain usually contains multiple fields, such as source IP address, destination IP address, source port, destination port, protocol type, etc. When judging whether the multi-level flow tables can be merged, the system needs to compare the matching conditions of these fields one by one. The method to determine whether the match domains can be merged is whether each field in the match domain contains the same match interval. The same match interval is the merged match field. For example, flow table 1 is match id 0 inport port 0 src ip 192.168.1.0 / 24 src port 1024 actions output port1, id 1, and flow table 2 is match id 1 inport port 0 src ip192.168.0.0 / 16 actions output port2. Flow table 1 matches the IP address 192.168.1.0 / 24, and flow table 2 matches the IP address 192.168.0.0 / 16. Flow table 1 and flow table 2 have the same match interval, so the merged flow table is matchinport port 0 src ip 192.168.1.0 / 24 src port 1024 actions output port1. outputport2, the merged IP address is 192.168.1.0 / 24; for another example, flow table 3 is match id 0 inport port 0src ip 192.168.1.0 / 24 actions output port1, id 1, and flow table 4 is match id 1 inportport 0 src ip 192.168.2.0 / 16 actions output port2. Flow table 3 matches the IP address 192.168.1.0 / 24, and flow table 4 matches the IP address 192.168.2.0 / 24. The two do not have the same match range and cannot be merged.

[0063] In some embodiments, if the action domain of the multi-level flow table includes a modification of a certain field, the matching domain of the multi-level flow table performs matching according to the modified field, and merges the fields in the matching domain of the multi-level flow table. This embodiment is aimed at the special case where the action domain includes the modification of a certain field. The particularity of this embodiment is that when matching, matching is performed according to the modified field, but when merging, merging is performed according to the field before the modification. For example, flow table 5 is match id 0 inport port 0 src ip 192.168.1.0 / 24 src port 1024actions set src ip 172.16.100.100 output port1, id 1, and flow table 6 is match id 1 inportport 0 src ip 172.16.100.100 action output port2. Flow table 5 contains the action of modifying the IP address. Flow table 6 matches the modified IP address. The merged flow table is match inport port 0 src ip 192.168.1.0 / 24 src port 1024 actions set src ip 172.16.100.100 output port1 output port2. The IP address after the two flow tables are merged is the IP address of the matching domain of flow table 5. For another example, flow table 7 is match id 0inport port 0 src ip 192.168.1.0 / 24 src port 1024 actions set src ip172.16.100.100 output port1, id 1. Flow table 8 is match id 1 inport port 0 src ip192.168.0.0 / 16 action output port2. Flow table 8 does not match the modified IP address of flow table 7 and cannot be merged.

[0064] In some embodiments, the id field in the matching domain has the function of merging multi-level flow tables by merging the flow tables of the same action domain and the matching domain, but the id field has no meaning in the merged flow table. Therefore, when merging the flow tables, the id field is directly ignored, so that the merged flow table corresponding to the matching domain does not contain the id field. It can be understood by those skilled in the art that, under the inspiration of this embodiment, the solution of first merging the id field into the merged flow table and then deleting it from the merged flow table belongs to the solution that can be directly thought of under the inspiration of this embodiment, and also belongs to the protection scope of the present invention.

[0065] In some embodiments, when merging a plurality of the multi-level flow tables having the same matching interval, the id field in the action domain is deleted. When merging action domains, the id field in the action domain is deleted, and the remaining action domain fields are merged. For example, the action domain of flow table 9 is id 1, port 1, and the action domain of flow table 10 is port 2, and the merged action domain is port 1, port2. It can be understood by those skilled in the art that, under the inspiration of this embodiment, the scheme of first merging the id field into the merged flow table and then deleting it in the merged flow table is a scheme that can be directly thought of under the inspiration of this embodiment, and also belongs to the protection scope of the present invention.

[0066] Figure 4 FIG. 1 is a flowchart of another method for unloading a flow table applicable to a smart network card in an embodiment of the present invention. Figure 4 As shown, compared with the above-mentioned embodiment, another flow table unloading method applicable to a smart network card in the embodiment of the present invention further includes:

[0067] Step S4: The corresponding relationship between the multi-level flow table and the merged flow table is saved through the driver program, and all corresponding merged flow tables are searched through the multi-level flow table.

[0068] In this step, the driver is the bridge between the smart NIC and the host system, responsible for handling the unloading of flow tables (including multi-level flow tables), saving correspondences, and providing query functions. It usually involves maintaining a mapping table in memory or in a database. After the multi-level flow tables are unloaded to the firmware or hardware for merging, the system needs to record these changes to ensure that the data packets can be forwarded correctly according to the new flow table rules. When a data packet arrives, the smart NIC needs to be able to quickly identify which merged flow table should be applied for processing based on the characteristics of the data packet. This process requires efficient search algorithms and data structures to maintain line-speed processing capabilities.

[0069] Flow table statistics are very important debugging information. After multi-level flow tables are merged, the merged flow table statistics can only be obtained from the firmware. After multi-level flow tables are merged, multiple merged flow tables will be generated. The statistics of these merged flow tables are added together to obtain the statistics of the multi-level flow tables. The calculation of the statistics is also implemented by the driver.

[0070] The driver saves the correspondence between the original flow table and the merged flow table. Each original flow table corresponds to multiple merged flow tables generated by it. After receiving the command to query the statistical information of the multi-level flow table, the driver obtains the statistical information of the merged flow table corresponding to all the multi-level flow tables. Adding up these statistical information is the statistical information of the multi-level flow table.

[0071] This embodiment not only realizes the merging and unloading of multi-level flow tables, but also saves the correspondence between the multi-level flow tables and the merged flow tables through the driver, provides flexible query functions, further enhances the performance and flexibility of the smart network card in network data packet forwarding, improves network performance and reduces latency.

[0072] Figure 5 FIG. 1 is a flowchart of another method for unloading a flow table applicable to a smart network card in an embodiment of the present invention. Figure 5 As shown, another flow table unloading method applicable to a smart network card in an embodiment of the present invention further includes:

[0073] Step S5: Delete the multi-level flow table and the merged flow table.

[0074] In this step, due to the characteristics of the multi-level flow table, multiple merged flow tables will be generated after the multi-level flow tables are merged. When the multi-level flow tables have been effectively merged and unloaded into the firmware or hardware, the multi-level flow tables in the smart network card and the generated merged flow tables should be deleted. The driver deletes the merged flow tables generated by the multi-level flow tables one by one according to the correspondence between the saved multi-level flow tables and the merged flow tables.

[0075] This embodiment not only helps to reasonably manage resources, but is also a key step to ensure the long-term stable operation of the smart network card. By regularly performing this step, the network equipment can be kept efficient and clean, thereby improving the performance and reliability of the entire network system.

[0076] In some embodiments, when the action domain id is not zero, the action domain id is used to match the id table to find all flow table entries with the same matching interval as the id; when the matching domain id is not zero, the matching domain id is used to match the action id table to find all flow table entries with the same matching interval as the id; when both the matching domain id and the action domain id are not zero, the matching domain id is used to first find all flow table entries with the id in the action id table, and then the action domain id is used to match the id table to find all flow table entries with the same matching interval as the id. This embodiment searches according to different situations to ensure the accuracy of multi-level flow table merging and avoid incorrect merged flow tables.

[0077] Figure 6 FIG. 1 is a flowchart of a step of unloading a multi-level flow table to firmware or hardware in an embodiment of the present invention. Figure 6 As shown, in an embodiment of the present invention, a step of unloading a multi-level flow table to firmware or hardware includes:

[0078] Step S31: searching the action id table for a first flow table entry having the same matching interval according to the id information of the matching domain.

[0079] In this step, a search is first performed based on the ID information of the matching domain, and the first flow table entry is found.

[0080] Step S32: searching the matching id table for a second flow table entry having the same matching interval according to the id information of the action field.

[0081] In this step, a search is performed based on the id information of the action field. The second flow table entry is found. When determining that the matching interval is the same, this step has the same judgment criteria as step S31.

[0082] Step S33: merge the first flow table entry and the second flow table entry to obtain a merged flow table, and unload it to firmware or hardware.

[0083] In this step, the first flow table entry and the second flow table entry obtained in the previous two steps are merged to obtain a merged flow table. It should be noted that in this embodiment, step S31 can be performed first, and then steps S32 and S33 can be performed, or step S32 can be performed first, and then steps S31 and S33 can be performed. In most cases, the results of the first flow table entry and the second flow table entry are the same, but in special cases, such as when performing field modification, the first flow table entry may be different from the second flow table entry.

[0084] This embodiment matches the matching domain and the action domain separately and then merges them, so that various special situations including the ID field being empty and the execution modification field can also be accurately identified, so that it can be applied to various situations, ensure the accuracy of the merged flow table, and improve the unloading efficiency.

[0085] Figure 7 FIG. 1 is a module diagram of a flow table unloading system applicable to a smart network card in an embodiment of the present invention. Figure 7 As shown, the present invention provides a flow table unloading system suitable for a smart network card, comprising the following modules:

[0086] A judging module, used to judge whether the flow table is a multi-level flow table, and if so, execute the table building module; if not, unload the flow table to firmware or hardware;

[0087] A table building module, used to save the id information in the match domain of the multi-level flow table to the match id table, and save the id information in the action domain of the multi-level flow table to the action id table;

[0088] The merging module is used to determine whether a plurality of the multi-level flow tables can be merged according to the matching domain, merge the plurality of the multi-level flow tables that can be merged to obtain a merged flow table, and unload it to the firmware or hardware.

[0089] This embodiment merges related multi-level flow tables into one, and only needs to query the merged multi-level flow table once, so the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, this embodiment not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding. This embodiment only needs to drive support for the flow table merging function, without modifying the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system.

[0090] The embodiment of the present invention also provides a flow table unloading device applicable to a smart network card, comprising a processor, a memory, in which executable instructions of the processor are stored, wherein the processor is configured to execute the steps of a flow table unloading method applicable to the smart network card by executing the executable instructions.

[0091] As mentioned above, this embodiment merges the related multi-level flow tables into one, and only needs to query the merged multi-level flow table once, so the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, this embodiment not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding. This embodiment only needs to drive support for the flow table merging function, without modifying the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system.

[0092] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "platform".

[0093] Figure 8 Schematic diagram of a flow table unloading device applicable to a smart network card in an embodiment of the present invention. Figure 8 The electronic device 600 according to this embodiment of the present invention is described. Figure 8 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0094] like Figure 8As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0095] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps of various exemplary embodiments of the present invention described in the above-mentioned flow table unloading method applicable to the smart network card of this specification. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .

[0096] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0097] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0098] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0099] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via the bus 630. It should be understood that although Figure 8Not shown, other hardware and / or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0100] In an embodiment of the present invention, a computer-readable storage medium is also provided for storing a program, and when the program is executed, the steps of a flow table unloading method applicable to a smart network card are implemented. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above-mentioned flow table unloading method applicable to a smart network card section of this specification.

[0101] As shown above, this embodiment merges the related multi-level flow tables into one. It only needs to query the merged multi-level flow table once, and the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, this embodiment not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding. This embodiment only needs to drive support for the flow table merging function, without modifying the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system.

[0102] Fig. 9 Schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. Fig. 9 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, apparatus or device.

[0103] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0104] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0105] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0106] This embodiment merges related multi-level flow tables into one, and only needs to query the merged multi-level flow table once, so the network forwarding performance will not be reduced, which helps to improve the network processing speed and efficiency, reduce the CPU load, and thus optimize the network performance. At the same time, this embodiment not only reduces the number of flow tables and the search time, but also improves the efficiency and accuracy of network data packet forwarding. This embodiment only needs to drive support for the flow table merging function, without modifying the application layer software such as OVS (openvswitch), does not affect the business logic of the software layer, and improves the compatibility of the system.

[0107] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. The above description of the disclosed embodiments enables professionals and technicians in this field to implement or use the present invention. Various modifications to these embodiments will be obvious to professionals and technicians in this field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this article, but will comply with the widest range consistent with the principles and novel features disclosed herein.

[0108] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.

Claims

1. A flow table unloading method applicable to a smart network card, characterized in that: The steps include: Step S1: Determine whether the flow table is a multi-level flow table, if yes, execute step S2; if no, unload the flow table to firmware or hardware; Step S2: saving the id information in the match field of the multi-level flow table to the match id table, and saving the id information in the action field of the multi-level flow table to the action id table; Step S3: judging whether the plurality of multi-level flow tables can be merged according to the matching domain, merging the plurality of multi-level flow tables that can be merged to obtain a merged flow table, and unloading it to the firmware or hardware; judging whether the plurality of multi-level flow tables can be merged according to the matching domain, by judging whether each field in the matching domain contains the same matching interval; if the action domain of the multi-level flow table contains a situation of modifying a certain field, the matching domain of the multi-level flow table is matched according to the modified field, and the fields in the matching domain of the multi-level flow table are merged; Step S3 includes: Step S31: searching the action id table for a first flow table entry having the same matching interval according to the id information of the matching domain; Step S32: searching the matching id table for a second flow table entry having the same matching interval according to the id information of the action domain; Step S33: merge the first flow table entry and the second flow table entry to obtain a merged flow table, and unload it to firmware or hardware.

2. A flow table unloading method applicable to a smart network card according to claim 1, characterized in that: Also includes: Step S4: The corresponding relationship between the multi-level flow table and the merged flow table is saved through the driver, and all corresponding merged flow tables are searched through the multi-level flow table.

3. A flow table unloading method applicable to a smart network card according to claim 1, characterized in that: Also includes: Step S5: Delete the multi-level flow table and the merged flow table.

4. A flow table unloading method applicable to a smart network card according to claim 1, characterized in that: When merging a plurality of the multi-level flow tables having the same matching interval, the id field in the action field is deleted.

5. A flow table unloading system suitable for a smart network card, characterized in that: Includes the following modules: A judging module, used to judge whether the flow table is a multi-level flow table, and if so, execute a table building module; if not, unload the flow table to firmware or hardware; A table building module, used to save the id information in the match domain of the multi-level flow table to the match id table, and save the id information in the action domain of the multi-level flow table to the action id table; A merging module, used to determine whether multiple multi-level flow tables can be merged according to the matching domain, merge the multiple multi-level flow tables that can be merged to obtain a merged flow table, and unload it to firmware or hardware; when determining whether multiple multi-level flow tables can be merged according to the matching domain, it is achieved by determining whether each field in the matching domain contains the same matching interval; if the action domain of the multi-level flow table contains the situation of modifying a certain field, the matching domain of the multi-level flow table is matched according to the modified field, and the fields in the matching domain of the multi-level flow table are merged; include: Searching the action id table for a first flow table entry having the same matching interval according to the id information of the matching domain; Searching for a second flow table entry having the same matching interval in the matching ID table according to the ID information of the action field; The first flow table entry and the second flow table entry are merged to obtain a merged flow table, and the merged flow table is unloaded to firmware or hardware.

6. A flow table unloading device suitable for a smart network card, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to execute the steps of a flow table unloading method applicable to a smart network card as described in any one of claims 1 to 4 by executing the executable instructions.

7. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the steps of a flow table unloading method applicable to a smart network card as described in any one of claims 1 to 4 are implemented.