Flow table unloading method, computer equipment and medium supporting mask matching

By flexibly setting the splicing method and configuration parameters of the three-state content addressing memory, the problems of large and low efficiency of mask matching flow table offloading resources in the prior art are solved, efficient flow table offloading and matching are achieved, and resource utilization and table lookup efficiency are improved.

CN119299371BActive Publication Date: 2025-03-11ZHUHAI XINGYUN ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411817039.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-11
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

In the prior art, a flow table offloading scheme that supports mask matching occupies a large amount of resources and is inefficient in operation, especially when matching a large number of network addresses is required.

Method used

By determining the flow table matching length, specification and message hierarchical matching information associated with the flow table forwarding service, flexibly set the splicing method of multiple three-state content addressing memory, and configure the enable domain, width splicing domain and depth splicing domain in the parameter register, thereby generating service configurations for different flow table forwarding services, realizing efficient unloading and matching of flow tables.

Benefits of technology

It realizes flow table offloading that supports mask matching, improves resource utilization, table lookup efficiency and flow table multiplexing, can dynamically divide flow table resources and provide fine-grained service configuration and message processing solutions in combination with user customized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299371B_ABST
    Figure CN119299371B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology and provides a flow table unloading method, computer equipment and medium that support mask matching. The present application generates corresponding service configurations by flexibly setting the splicing method and determining how to set the enable field, width splicing field and depth splicing field in the configuration parameter register of each ternary content addressable memory. In this way, the corresponding features can be extracted for table lookup operations through different service configurations for the flow table matching requirements of different flow table forwarding services, thereby realizing the flow table unloading that supports mask matching, which not only supports the dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a flow table unloading method, computer equipment and medium supporting mask matching. Background Art

[0002] With the development of technologies such as cloud computing, data centers, and network virtualization, a large number of virtual machines and virtual devices are used, and it is necessary to improve the traffic forwarding performance between virtual devices and external devices. The principle of traffic forwarding is to perform corresponding flow table operations, such as traffic forwarding and traffic analysis, based on the flow table item feature matching results. In the prior art, in order to improve the traffic forwarding performance, the traffic forwarding service is unloaded to dedicated hardware, such as smart network cards, through hardware unloading, so that dedicated hardware can store and maintain flow tables, perform flow table item feature matching, and perform flow table item operations. However, the flow table unloading scheme in the prior art is generally used for accurate matching flow tables, that is, flow table unloading that supports accurate matching. For flow tables that support mask matching, that is, mask matching flow tables, the flow table unloading scheme in the prior art occupies a large amount of resources and has low operating efficiency. For example, the network segment that needs to be matched is 1.1.0.0 and has a mask of 16. The mask in binary form is represented as 1 in the high 16 bits of 32 bits and 0 in the other bits. Therefore, based on the mask, in order to match all possible network addresses under the 1.1 network segment, the flow table unloading supporting exact matching needs to provide 255 times 255 flow table entries, which occupies a large amount of resources and has low table lookup efficiency.

[0003] To this end, the present application provides a flow table unloading method, computer device and medium supporting mask matching, which are used to address the technical difficulties in the prior art. Summary of the invention

[0004] In the first aspect, the present application provides a flow table unloading method that supports mask matching. The flow table unloading method includes: determining a first flow table matching length, a first flow table specification, and a first message layer matching information associated with a first flow table forwarding service, wherein the first flow table matching length is the data length of the flow table item feature used for mask matching of the first flow table forwarding service, the first flow table specification is the number of flow table items used for mask matching of the first flow table forwarding service, and the first message layer matching information indicates whether the first flow table forwarding service needs to match layer 2 message features, layer 3 message features, and layer 4 message features, respectively; based on a comparison between the first flow table matching length and the flow table item storage width and a comparison between the first flow table specification and the flow table item storage quantity, determining a first splicing method for multiple three-state content addressable memories, wherein each of the multiple three-state content addressable memories has the flow table item storage width and the flow table item storage quantity; according to the first splicing method, determining Determine how to set the enable field, width splicing field and depth splicing field in the configuration parameter registers of each of the multiple three-state content addressable memories, so as to obtain a first service configuration for the first flow table forwarding service, the first service configuration also includes the first message layer matching information, wherein the enable field indicates whether it is valid, the width splicing field indicates whether to start width splicing, and the depth splicing field indicates whether to start depth splicing; in response to the issuance of the first mask matching flow table of the first flow table forwarding service, obtain the first service configuration, based on the configuration parameter registers of each of the multiple three-state content addressable memories set according to the first service configuration, splice one or more three-state content addressable memories among the multiple three-state content addressable memories to obtain a first spliced ​​three-state content addressable memory for the first flow table forwarding service, and then store the first mask matching flow table in the first spliced ​​three-state content addressable memory.

[0005] Through the first aspect of the present application, by flexibly setting the splicing method and determining how to set the enable field, width splicing field and depth splicing field in the configuration parameter register of each ternary content addressable memory, the corresponding service configuration is generated. In this way, the corresponding features can be extracted for table lookup operations according to the flow table matching requirements of different flow table forwarding services through different service configurations, thereby realizing flow table unloading that supports mask matching. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0006] In a possible implementation of the first aspect of the present application, the flow table unloading method also includes: in response to a mask matching request of a first message of the first flow table forwarding service, obtaining the first service configuration, determining based on the first service configuration that one or more of the multiple three-state content addressable memories are the first spliced ​​three-state content addressable memories, and then, based on the first message layered matching information in the first service configuration, extracting features of the first message for performing a table lookup operation corresponding to the mask matching request of the first message in the first spliced ​​three-state content addressable memory.

[0007] In a possible implementation of the first aspect of the present application, a table lookup operation corresponding to the mask matching request of the first message is performed by a multi-level message processing module, and the multi-level message processing module includes a first-level message processing module for layer 2 message feature matching, a second-level message processing module for layer 3 message feature matching, and a third-level message processing module for layer 4 message feature matching.

[0008] In a possible implementation of the first aspect of the present application, the first-level message processing module, the second-level message processing module and the third-level message processing module are all pipeline processing models and perform cascade matching processing in the order from layer 2 message features to layer 3 message features and then to layer 4 message features.

[0009] In a possible implementation of the first aspect of the present application, a table lookup operation corresponding to the mask matching request of the first message is performed through the multi-level message processing module, including: generating a first cascade flow table identifier based on the first message layered matching information in the first service configuration, wherein the first cascade flow table identifier indicates whether the matching result of the previous level message processing module is a hit, and when the matching result of the current level message processing module is a hit, the first cascade flow table identifier also includes the matching result of the previous level message processing module for the next level message processing module.

[0010] In a possible implementation of the first aspect of the present application, the first message layered matching information indicates that the first flow table forwarding service needs to match a layer 2 message feature, or the first flow table forwarding service needs to match a layer 2 message feature and a layer 3 message feature, or the first flow table forwarding service needs to match a layer 2 message feature, a layer 3 message feature, and a layer 4 message feature.

[0011] In a possible implementation manner of the first aspect of the present application, the layer 2 message characteristics, the layer 3 message characteristics, and the layer 4 message characteristics are determined based on a communication protocol and a message format associated with the first flow table forwarding service.

[0012] In a possible implementation of the first aspect of the present application, the layer 2 message feature is a machine address, the layer 3 message feature is a network protocol address, and the layer 4 message feature is port information.

[0013] In a possible implementation manner of the first aspect of the present application, the layer 2 message feature is an Ethernet type, a connection identifier, or a communication protocol identifier.

[0014] In a possible implementation manner of the first aspect of the present application, the first splicing manner indicates the number of ternary content addressable memories required for width splicing and the number of ternary content addressable memories required for depth splicing.

[0015] In a possible implementation of the first aspect of the present application, the number of ternary content-addressable memories required for width splicing is the result of rounding up the first flow table matching length divided by a multiple of the flow table item storage width, and the number of ternary content-addressable memories required for depth splicing is the result of rounding up the first flow table specification divided by a multiple of the flow table item storage number.

[0016] In a possible implementation of the first aspect of the present application, the flow table unloading method also includes: setting the enable field in the configuration parameter register of the occupied / faulty ternary content addressable memory among the multiple ternary content addressable memories to invalid, thereby skipping the occupied / faulty ternary content addressable memory.

[0017] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.

[0018] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.

[0019] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 A flow chart of a flow table unloading method supporting mask matching provided in an embodiment of the present application;

[0022] Figure 2 A schematic flow chart of a first splicing method for a plurality of ternary content addressable memories provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of configuration parameter registers of a plurality of ternary content addressable memories provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of a multi-stage message processing module provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0027] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0028] Figure 1 A flow chart of a flow table unloading method supporting mask matching provided in an embodiment of the present application. Figure 1 As shown, the flow table unloading method includes the following steps.

[0029] Step S101: Determine the first flow table matching length, the first flow table specification and the first message layer matching information associated with the first flow table forwarding service, wherein the first flow table matching length is the data length of the flow table item characteristics used for mask matching of the first flow table forwarding service, the first flow table specification is the number of flow table items used for mask matching of the first flow table forwarding service, and the first message layer matching information indicates whether the first flow table forwarding service needs to match layer 2 message characteristics, layer 3 message characteristics and layer 4 message characteristics respectively.

[0030] Step S103: Based on a comparison between the first flow table matching length and the flow table item storage width and a comparison between the first flow table specification and the flow table item storage quantity, determine a first splicing method for multiple ternary content addressable memories, wherein each of the multiple ternary content addressable memories has the flow table item storage width and the flow table item storage quantity.

[0031] Step S105: According to the first splicing method, determine how to set the enable field, width splicing field and depth splicing field in the configuration parameter registers of each of the multiple ternary content addressable memories, so as to obtain a first service configuration for the first flow table forwarding service, wherein the first service configuration also includes the first message layer matching information, wherein the enable field indicates whether it is valid, the width splicing field indicates whether to start width splicing, and the depth splicing field indicates whether to start depth splicing.

[0032] Step S107: In response to the issuance of the first mask matching flow table for the first flow table forwarding service, the first service configuration is obtained, and based on the configuration parameter registers of each of the multiple three-state content addressable memories set according to the first service configuration, one or more three-state content addressable memories among the multiple three-state content addressable memories are spliced ​​to obtain a first spliced ​​three-state content addressable memory for the first flow table forwarding service, and then the first mask matching flow table is stored in the first spliced ​​three-state content addressable memory.

[0033] Figure 1 The flow table unloading method supporting mask matching shown in the figure uses a ternary content addressable memory (TCAM) to store a flow table supporting mask matching, and generates a corresponding service configuration by flexibly setting the splicing method and determining how to set the enable field, width splicing field and depth splicing field in the configuration parameter register of each ternary content addressable memory. In this way, the corresponding features can be extracted for table lookup operations through different service configurations according to the flow table matching requirements of different flow table forwarding services, thereby realizing the flow table unloading supporting mask matching, not only supporting dynamic division of flow table resources, but also providing fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate. Figure 1The flow table unloading method supporting mask matching shown can be applied to application scenarios such as cloud computing, data centers, and network virtualization. In these application scenarios, a large number of virtual machines and virtual devices need to perform large-scale traffic forwarding with external devices, so a large number of table lookup operations based on flow table item characteristics and flow table item operations based on matching results obtained from the table lookup operations are required. In addition, in order to improve traffic forwarding performance, the traffic forwarding service is unloaded to dedicated hardware, such as smart network cards, through hardware unloading, so that the dedicated hardware can store and maintain the flow table, perform flow table item feature matching, and perform flow table item operations. Figure 1 The flow table unloading method supporting mask matching shown can effectively unload the flow table supporting mask matching completely to dedicated hardware, and can save resource occupation, improve resource utilization and have good operating efficiency. There are three states for each bit in the three-state content addressable memory, namely "0", "1" and the third state. The design principle of the three-state content addressable memory is to use masks to achieve three states for each bit. Therefore, the third state of the bit can meet the needs of exact match search and fuzzy match search at the same time, and therefore can adapt to the distribution and table lookup operations of the mask matching flow table. The following is further explained in detail in conjunction with the specific embodiments and drawings of the present application.

[0034] See also Figure 1In step S101, the first flow table matching length, the first flow table specification and the first message layer matching information associated with the first flow table forwarding service are determined, wherein the first flow table matching length is the data length of the flow table item feature used for mask matching of the first flow table forwarding service, the first flow table specification is the number of flow table items used for mask matching of the first flow table forwarding service, and the first message layer matching information indicates whether the first flow table forwarding service needs to match the layer 2 message feature, the layer 3 message feature and the layer 4 message feature, respectively. Here, the first flow table forwarding service represents that a certain data service needs to match the flow table item feature and perform flow table item operation through the mask matching flow table. Depending on the user customization requirements, communication protocols, application scenarios, device characteristics, etc. related to the data service, various different requirements may be put forward for the mask matching flow table to be hardware unloaded. To this end, in step S101, the first flow table matching length, the first flow table specification and the first message layer matching information associated with the first flow table forwarding service are determined, so as to provide a basis for the subsequent steps, so as to realize the dynamic division of flow table resources and fine-grained service configuration. The first flow table match length is the data length of the flow table item feature used for mask matching of the first flow table forwarding service. For example, a certain service needs to send a mask matching flow table that can match a data length of 32 bits, which means that the first flow table match length is 32 bits. In other words, the data length of the flow table item feature used for mask matching is 32 bits, so in the subsequent dynamic division of flow table resources, it is necessary to ensure that there are flow table items with sufficient width to cache the 32-bit flow table item feature. Generally, the match length in the mask matching flow table to be sent, that is, the data length of the flow table item feature, is difficult to predict, and the ternary content addressable memory resources on the dedicated hardware are fixed. Therefore, it is necessary to consider the versatility of the hardware offloading solution and use the fixed ternary content addressable memory resources on the dedicated hardware to adapt to mask matching flow tables of various matching lengths. If the flow table item storage width of the ternary content addressable memory is much larger than the matching length, for example, a flow table item storage width of 320 bits is provided in the face of a 32-bit matching length, which means that a large amount of resources are wasted. In addition, the first flow table specification is the number of flow table entries used for mask matching of the first flow table forwarding service. For example, a certain service needs to send down a mask matching flow table that can match a data length of 32 bits, and needs to send down a maximum of 1024 such flow table entries, then the first flow table specification, that is, the number of flow table entries used for mask matching is 1024. By determining the first flow table matching length, width information is provided, and by determining the first flow table specification, depth information is provided. The first message layered matching information indicates whether the first flow table forwarding service needs to match layer 2 message characteristics, layer 3 message characteristics, and layer 4 message characteristics, respectively.In this way, considering factors such as message format, message encapsulation and decapsulation, and communication protocol, when performing table lookup operations, that is, matching flow table item features, it may be necessary to extract layer 2 message features such as machine address (MAC), layer 3 message features such as network protocol address (Internet Protocol, IP), and layer 4 message features such as port information. Generally, if only layer 2 message features need to be matched, then when sending down the mask matching flow table, only the corresponding layer 2 message features such as machine address can be sent to the hardware; if both layer 2 message features and layer 3 message features need to be matched, then when sending down the mask matching flow table, the corresponding layer 2 message features and layer 3 message features are sent to the hardware. In this way, by determining the matching length of the first flow table, width information is provided, by determining the specification of the first flow table, depth information is provided, and then by determining the first message layer matching information, a basis is provided for subsequent steps, which helps to flexibly configure fixed three-state content-addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and achieve efficient and reasonable utilization of three-state content-addressable memory resources. It not only supports dynamic division of flow table resources, but also can provide fine-grained business configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0035] Continue reading Figure 1In step S103, based on the comparison between the first flow table match length and the flow table item storage width and the comparison between the first flow table specification and the flow table item storage quantity, a first splicing method for multiple ternary content addressable memories is determined, wherein each of the multiple ternary content addressable memories has the flow table item storage width and the flow table item storage quantity. As described above, the first flow table forwarding service represents that a certain data service needs to perform flow table item feature matching and flow table item operation through the mask matching flow table. Depending on the user customization requirements, communication protocols, application scenarios, device characteristics, etc. related to the data service, various different requirements may be put forward for the mask matching flow table to be hardware unloaded. By determining the first flow table match length, information on width is provided, and by determining the first flow table specification, information on depth is provided. In this way, by comparing the first flow table match length with the flow table item storage width and comparing the first flow table specification with the flow table item storage quantity, the first splicing method can be determined. If the flow table item storage width of the ternary content addressable memory is much larger than the matching length, for example, a flow table item storage width of 320 bits is provided in the face of a matching length of 32 bits, this means that a large amount of resources are wasted. Therefore, by designing the ternary content addressable memory into a plurality of splicable blocks, splicing in the width direction and the depth direction can be achieved by splicing these blocks, thereby providing tailored dynamic division of flow table resources for the first flow table forwarding service and other flow table forwarding services, respectively. Moreover, each of the plurality of ternary content addressable memories has the same design specification, that is, each of the plurality of ternary content addressable memories has the flow table item storage width and the flow table item storage quantity. The flow table item storage width refers to the maximum data length that can be used to accommodate flow table item features. For example, a certain service needs to send a mask matching flow table that can match a data length of 78 bits, which means that the first flow table matching length is 78 bits. Therefore, if the flow table item storage width is 40 bits, it means that the 40-bit flow table item storage width on a single ternary content addressable memory cannot cache the flow table item characteristics with a first flow table matching length of 78 bits, so it is necessary to perform splicing in the width direction to make the equivalent flow table item storage width reach two 40 bits, that is, 80 bits. The flow table item storage quantity refers to the maximum number of flow table items that can accommodate the flow table item storage width.If a certain service needs to send a mask matching flow table that can match a data length of 78 bits and there are 1024 such flow table entries in the mask matching flow table, this means that the first flow table specification is 1024 entries. Therefore, if the number of flow table entry storage items is 512 entries, it means that the number of flow table entry storage items of 512 entries on a single ternary content addressable memory cannot cache the mask matching flow table with the first flow table specification of 1024 entries. Therefore, depth-wise splicing is required to make the equivalent number of flow table entry storage items reach two 512 entries, that is, 1024 entries. In this way, by designing the ternary content-addressable memory into multiple spliced ​​blocks, splicing these blocks can be used to achieve splicing in the width direction and the depth direction, so that the width splicing can be used to equivalently realize the flow table matching length of the mask matching flow table, and the depth splicing can be used to equivalently realize the flow table specification of the mask matching flow table under the flow table matching length, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services respectively, which helps to flexibly configure fixed ternary content-addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and realize efficient and reasonable utilization of ternary content-addressable memory resources. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0036] For an example of the first splicing method, please refer to Figure 2 . Figure 2 A schematic diagram of a first splicing method for multiple ternary content addressable memories provided in an embodiment of the present application. Figure 2 As shown, the plurality of ternary content addressable memories include a ternary content addressable memory A201, a ternary content addressable memory B203, a ternary content addressable memory C205, and a ternary content addressable memory D207. Figure 2 It is exemplified in that each of the ternary content addressable memory A201, the ternary content addressable memory B203, the ternary content addressable memory C205, and the ternary content addressable memory D207 has a consistent flow table entry storage width and flow table entry storage quantity, wherein the flow table entry storage width 211 is 40 bits, and the flow table entry storage quantity 213 is 512. Figure 2, the first flow table matching length 221 and the first flow table specification 223 associated with the first flow table forwarding service are exemplarily shown, wherein the first flow table matching length 221 is 78 bits, and the first flow table specification 223 is 1024. Therefore, the first flow table forwarding service may be, for example, a certain service needs to send a mask matching flow table that can match a data length of 78 bits and there are 1024 such flow table entries in the mask matching flow table, that is, the first flow table matching length 221 is 78 bits and the first flow table specification 223 is 1024; and each of the ternary content addressable memory A201, the ternary content addressable memory B203, the ternary content addressable memory C205, and the ternary content addressable memory D207 has a table entry storage width 211 of 40 bits and a flow table entry storage quantity 213 of 512 entries. Therefore, splicing in the width direction is required to make the equivalent flow table entry storage width reach two 40 bits, that is, 80 bits, and splicing in the depth direction is required to make the equivalent flow table entry storage quantity reach two 512 entries, that is, 1024 entries. Figure 2 In the example, in the width direction, the ternary content addressable memory A201 and the ternary content addressable memory B203 are width-joined, and the ternary content addressable memory C205 and the ternary content addressable memory D207 are width-joined; in the depth direction, the ternary content addressable memory A201 and the ternary content addressable memory C205 are depth-joined, and the ternary content addressable memory B203 and the ternary content addressable memory D207 are depth-joined. In this way, the first joining method for the plurality of ternary content addressable memories is determined. It should be understood that because each of the plurality of ternary content addressable memories has a consistent design specification, in step S103 and reference Figure 2 The splicing method obtained by the embodiment does not need to specify which specific ternary content addressable memories are to be used for splicing. The determined splicing method is used to provide a basis for subsequent steps. Considering that a given ternary content addressable memory may be faulty or occupied, it may not be suitable for the current first flow table forwarding service. For this reason, it may be necessary to skip one or several ternary content addressable memories, and finally obtain the ternary content addressable memory resource division scheme for the first flow table forwarding service through width splicing and depth splicing. In this way, based on the comparison between the first flow table matching length 221 and the flow table item storage width 211 and the comparison between the first flow table specification 223 and the flow table item storage quantity 213, the first splicing method for multiple ternary content addressable memories is determined.

[0037] See also Figure 1 and Figure 2By designing the ternary content addressable memory into multiple spliced ​​blocks, the blocks can be spliced ​​in width and depth directions, so that the width splicing is used to equivalently realize the flow table matching length of the mask matching flow table, and the depth splicing is used to equivalently realize the flow table specification of the mask matching flow table under the flow table matching length, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services respectively, which helps to flexibly configure fixed ternary content addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and realize efficient and reasonable utilization of ternary content addressable memory resources. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0038] Continue reading Figure 1 In step S105, according to the first splicing mode, it is determined how to set the enable field, width splicing field and depth splicing field in the configuration parameter register of each of the plurality of ternary content addressable memories, so as to obtain a first service configuration for the first flow table forwarding service, wherein the first service configuration also includes the first message layer matching information, wherein the enable field indicates whether it is valid, the width splicing field indicates whether to start width splicing, and the depth splicing field indicates whether to start depth splicing. As mentioned above, in step S103 and reference Figure 2The splicing method obtained by the embodiment does not need to specify which specific three-state content addressable memories are to be spliced, and the determined splicing method is used to provide a basis for subsequent steps. Considering that a given three-state content addressable memory may be faulty or occupied, it may not be suitable for the current first flow table forwarding service. For this reason, it may be necessary to skip one or several three-state content addressable memories, and finally obtain the three-state content addressable memory resource division scheme for the first flow table forwarding service through width splicing and depth splicing. In this way, based on the first splicing method determined in step S103, the first splicing method includes how to use width splicing to equivalently implement the flow table matching length of the mask matching flow table and how to use depth splicing to equivalently implement the flow table specification of the mask matching flow table under the flow table matching length. Here, in step S105, using the first splicing method, by setting the relevant fields in the configuration parameter registers of each of the multiple three-state content addressable memories, a first service configuration for the first flow table forwarding service can be established, and the first service configuration also includes the first message layer matching information. It should be understood that the first flow table forwarding service and other flow table forwarding services may have their own corresponding service configurations, which respectively record the corresponding flow table forwarding services, and put forward various different requirements for the mask matching flow table to be hardware unloaded in terms of flow table item feature matching and execution of flow table item operations. These requirements depend on various factors such as user customization requirements, communication protocols, application scenarios, and device characteristics related to data services. For example, assuming that there are three different flow table forwarding services, the requirements of the mask matching flow table to be hardware unloaded for each of these three flow table forwarding services are as follows: flow table forwarding service A, which can match the mask matching flow table with a data length of 68 bits and has 1000 flow table entries, and the message features that need to be matched are service identifier, Ethernet type and target machine address; flow table forwarding service B, which can match the mask matching flow table with a data length of 145 bits and has 1024 flow table entries, and the message features that need to be matched are service identifier, connection identifier and target network protocol address; flow table forwarding service C, which can match the mask matching flow table with a data length of 28 bits and has 500 flow table entries, and the message features that need to be matched are service identifier, communication protocol and target port information. Three corresponding service configurations can be provided for these three flow table forwarding services, and each service configuration includes how to set the enable domain, width splicing domain and depth splicing domain in the configuration parameter register of each of the multiple three-state content addressable memories. Table 1 below provides an example of setting configuration parameter registers of multiple ternary content addressable memories. Specifically, Table 1 provides:

[0039] Table 1

[0040]

[0041] See also Figure 1 As shown in Table 1, by flexibly setting the splicing mode and determining how to set the enable field, width splicing field and depth splicing field in the configuration parameter register of each ternary content addressable memory, the corresponding service configuration is generated. In this way, the flow table matching requirements of different flow table forwarding services can be targeted, and the corresponding features can be extracted through different service configurations for table lookup operations, thereby realizing flow table unloading that supports mask matching. It not only supports dynamic division of flow table resources, but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0042] For an example of how to set the enable field, width splicing field and depth splicing field in the configuration parameter registers of the plurality of ternary content addressable memories, please refer to Figure 3 . Figure 3 A schematic diagram of configuration parameter registers of multiple ternary content addressable memories provided in an embodiment of the present application. Figure 3The ternary content addressable memory E301 and the configuration parameter register E303 of the ternary content addressable memory E301 are shown as examples: enable field 1, width splicing field 1, depth splicing field 1; the ternary content addressable memory F311 and the configuration parameter register F313 of the ternary content addressable memory F311 are shown as examples: enable field 0, width splicing field 1, depth splicing field 1; the ternary content addressable memory G321 and the configuration parameter register G323 of the ternary content addressable memory G321 are shown as examples: enable field 1, width splicing field 0, depth splicing field 1 Connect domain 0; ternary content addressable memory H331 and configuration parameter register H333 of ternary content addressable memory H331: enable domain 1, width splicing domain 1, depth splicing domain 1; ternary content addressable memory I341 and configuration parameter register I343 of ternary content addressable memory I341: enable domain 1, width splicing domain 0, depth splicing domain 0; ternary content addressable memory J351 and configuration parameter register J353 of ternary content addressable memory J351: enable domain 1, width splicing domain 0, depth splicing domain 0. Here, "1" represents valid and "0" represents invalid. It should be understood that any domain definition with binary values ​​can be used to define each domain in the configuration parameter register to indicate whether the corresponding domain indication is valid or invalid. As described above, for the first splicing method of the first flow table forwarding service, instructions are provided on how to use width splicing to equivalently implement the flow table matching length of the mask matching flow table and how to use depth splicing to equivalently implement the flow table specifications of the mask matching flow table under the flow table matching length. However, the first splicing method itself does not specify which specific three-state content addressable memories are to complete the splicing. On the basis of the instructions for width splicing and depth splicing provided by the first splicing method, a first service configuration for the first flow table forwarding service can be established by setting the relevant fields in the configuration parameter registers of the multiple three-state content addressable memories. In this way, the definition of the relevant fields in the configuration parameter registers of the specific three-state content addressable memories in the first service configuration can be flexibly changed, thereby flexibly adapting to the real-time situation of the three-state content addressable memory resources, which helps to achieve efficient and reasonable utilization of the three-state content addressable memory resources and dynamic division of flow table resources. Figure 3For example, the configuration parameter register E303 of the ternary content addressable memory E301 defines an enable domain 1, a width splicing domain 1, and a depth splicing domain 1, so the ternary content addressable memory E301 is valid, and starts width splicing and starts depth splicing. The configuration parameter register F313 of the ternary content addressable memory F311 defines an enable domain 0, a width splicing domain 1, and a depth splicing domain 1, so the ternary content addressable memory F311 is invalid, that is, it is not used for width splicing or depth splicing under the first business configuration. This may be because the ternary content addressable memory F311 has a fault, or it has been occupied, or because it is not suitable for the current first business configuration, that is, it is not suitable for supporting the first flow table forwarding business for other reasons. Then, the configuration parameter register G323 of the ternary content addressable memory G321 defines an enable domain 1, a width splicing domain 0, and a depth splicing domain 0, so the ternary content addressable memory G321 is valid, and ends width splicing and ends depth splicing. In addition, the configuration parameter register H333 of the ternary content addressable memory H331 defines an enable field 1, a width splicing field 1, and a depth splicing field 1, so the ternary content addressable memory H331 is valid, and starts width splicing and starts depth splicing. The configuration parameter register I343 of the ternary content addressable memory I341 defines an enable field 1, a width splicing field 0, and a depth splicing field 0, so the ternary content addressable memory I341 is valid, and ends width splicing and ends depth splicing. Because the width splicing and depth splicing have been ended at the ternary content addressable memory I341, the definition of the configuration parameter register J353 of the ternary content addressable memory J351 has nothing to do with the current first business configuration. In this way, by flexibly setting the enable field, the width splicing field, and the depth splicing field in the configuration parameter register of each ternary content addressable memory, the starting point and end point of the width splicing, the starting point and end point of the depth splicing, and the invalid ternary content addressable memory in the middle can be selectively skipped. by Figure 3 For example, in the width direction, the ternary content addressable memory E301 and the ternary content addressable memory G321 are width-joined, and the ternary content addressable memory F311 whose enable field is 0, i.e., invalid, is skipped; in the depth direction, the ternary content addressable memory E301 and the ternary content addressable memory H331 are depth-joined, and the ternary content addressable memory G321 and the ternary content addressable memory I341 are depth-joined. In this way, a ternary content addressable memory resource partitioning scheme corresponding to the first business configuration is constructed by using the ternary content addressable memory E301 and the ternary content addressable memory G321, as well as the ternary content addressable memory H331 and the ternary content addressable memory I341, a total of four ternary content addressable memories. The ternary content addressable memory resource partitioning scheme including four ternary content addressable memories can be referred to. Figure 2The first splicing method shown.

[0043] See also Figure 1 , Figure 2 and Figure 3 By setting the definitions of the relevant fields in the configuration parameter registers of each ternary content-addressable memory to construct a division scheme of the ternary content-addressable memory resources corresponding to the first business configuration, it can not only meet the instructions of the first splicing method in terms of width splicing or depth splicing, thereby supporting the flow table matching length of the mask matching flow table and the flow table specifications of the mask matching flow table under the flow table matching length, but also can flexibly configure fixed ternary content-addressable memory resources to adapt to mask matching flow tables of various matching lengths. Furthermore, in some embodiments, the flow table forwarding service may require only adjacent continuously distributed ternary content addressable memory resources. This requirement can be achieved by constraining the definition of the relevant fields in the configuration parameter registers of each ternary content addressable memory. For example, it can be required that the width splicing field in the allocated ternary content addressable memory resources must be a continuous "1" and the depth splicing field must be a continuous "1". In this way, it can be ensured that the multiple ternary content addressable memories allocated to the flow table forwarding service are continuously distributed in both the width direction and the depth direction (it is also necessary to require that the valid fields are all continuous "1"), and there is no skipping of the intermediate ternary content addressable memory. Further, in some embodiments, the flow table forwarding service may have other requirements for the distribution of ternary content addressable memory resources, such as being able to skip at most one ternary content addressable memory, that is, in the width direction and the depth direction, there is at most one "0" between two "1". These storage space constraints reflect the characteristics of the mask design of the data flow level, that is, the mask matching flow table. By incorporating these mask design characteristics into the consideration of ternary content addressable memory resource division, it helps to make full use of limited and fixed ternary content addressable memory resources, and by providing ternary content addressable memories with consistent design specifications (that is, each of the multiple ternary content addressable memories has a consistent flow table entry storage width and flow table entry storage quantity), it also reduces costs and design complexity. Furthermore, by extracting the values ​​of the relevant fields in the configuration parameter registers of each ternary content addressable memory, that is, the values ​​of "0" or "1" of the relevant fields, a bit map or matrix can be established. Through bit map analysis and matrix analysis, a basis can be provided for decision-making, for example, it can be conveniently determined whether the constraints are met and whether there is room for optimization to maximize the utilization of ternary content addressable memory resources.

[0044] Continue reading Figure 3In step S107, in response to the issuance of the first mask matching flow table of the first flow table forwarding service, the first service configuration is obtained, and based on the configuration parameter registers of each of the multiple three-state content addressable memories set according to the first service configuration, one or more three-state content addressable memories among the multiple three-state content addressable memories are spliced ​​to obtain a first spliced ​​three-state content addressable memory for the first flow table forwarding service, and then the first mask matching flow table is stored in the first spliced ​​three-state content addressable memory. In this way, by designing the ternary content-addressable memory into multiple spliced ​​blocks, splicing these blocks can be used to achieve splicing in the width direction and the depth direction, so that the width splicing can be used to equivalently realize the flow table matching length of the mask matching flow table, and the depth splicing can be used to equivalently realize the flow table specification of the mask matching flow table under the flow table matching length, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services respectively, which helps to flexibly configure fixed ternary content-addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and realize efficient and reasonable utilization of ternary content-addressable memory resources. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0045] In a possible implementation, the flow table unloading method further includes: in response to a mask matching request of a first message of the first flow table forwarding service, obtaining the first service configuration, determining based on the first service configuration that one or more of the multiple three-state content addressable memories are the first spliced ​​three-state content addressable memories, and then, based on the first message layered matching information in the first service configuration, extracting features of the first message for performing a table lookup operation corresponding to the mask matching request of the first message in the first spliced ​​three-state content addressable memory. In this way, by designing the ternary content-addressable memory into multiple spliced ​​blocks, splicing these blocks can be used to achieve splicing in the width direction and the depth direction, so that the width splicing can be used to equivalently realize the flow table matching length of the mask matching flow table, and the depth splicing can be used to equivalently realize the flow table specification of the mask matching flow table under the flow table matching length, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services respectively, which helps to flexibly configure fixed ternary content-addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and realize efficient and reasonable utilization of ternary content-addressable memory resources. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate. In addition, by determining the first message layer matching information, taking into account factors such as message format, message encapsulation and decapsulation, and communication protocol, when performing a table lookup operation, that is, matching flow table item features, extracting relevant message features helps improve table lookup efficiency.

[0046] In some embodiments, the table lookup operation corresponding to the mask matching request of the first message is performed through a multi-level message processing module, and the multi-level message processing module includes a first-level message processing module for matching the second-layer message features, a second-level message processing module for matching the third-layer message features, and a third-level message processing module for matching the fourth-layer message features. In this way, through the multi-level message processing module, the flow efficiency and the table lookup efficiency are improved. The user can perform corresponding splicing according to different flow table service requirements, and determine the corresponding service configuration, and then when a table lookup is required, let the message enter the hardware and then pass through the multi-level message processing module in turn to extract message features and lookup matching. If the previous level message processing module hits, the message feature extraction and table lookup matching of the next level message processing module will be performed, and finally the complete matching result will be output. For example, some flow table forwarding services only need to match the second-layer message features, so they only need to be processed by the first-level message processing module, and skip other message processing modules. For another example, some flow table forwarding services need to match the second-layer message features and the third-layer message features. In this way, the first-level message processing module is used to process the message. After the second-layer message features are matched, the second-level message processing module is used to process the message, and other message processing modules are skipped. In this way, the multi-level flow table processing and pipeline processing model of the multi-level message processing module are used to improve the flow table reuse rate and finer granularity matching.

[0047] In some embodiments, the first-level message processing module, the second-level message processing module, and the third-level message processing module are all pipeline processing models and perform cascade matching processing in the order from layer 2 message features to layer 3 message features and then to layer 4 message features. In this way, the multi-level flow table processing and pipeline processing model of the multi-level message processing module are used to improve the flow table reuse rate and finer granularity matching.

[0048] In some embodiments, the table lookup operation corresponding to the mask matching request of the first message is performed by the multi-level message processing module, including: based on the first message hierarchical matching information in the first service configuration, generating a first cascade flow table identifier, wherein the first cascade flow table identifier indicates whether the matching result of the previous level message processing module is a hit, and when the matching result of the current level message processing module is a hit, the first cascade flow table identifier also includes the matching result of the previous level message processing module for the next level message processing module. In this way, the multi-level flow table processing and pipeline processing model of the multi-level message processing module are used to improve the flow table reuse rate and finer granularity matching.

[0049] In a possible implementation, the first message layer matching information indicates that the first flow table forwarding service needs to match the layer 2 message feature, or the first flow table forwarding service needs to match the layer 2 message feature and the layer 3 message feature, or the first flow table forwarding service needs to match the layer 2 message feature, the layer 3 message feature and the layer 4 message feature. In this way, flexible adaptation of message feature matching requirements is achieved, which helps to adapt factors such as message format, message encapsulation and decapsulation, and communication protocol.

[0050] In a possible implementation, the layer 2 message feature, the layer 3 message feature, and the layer 4 message feature are determined based on the communication protocol and message format associated with the first flow table forwarding service. In this way, flexible adaptation of message feature matching requirements is achieved, which helps to adapt factors such as message format, message encapsulation and decapsulation, and communication protocol.

[0051] In a possible implementation, the layer 2 message feature is a machine address, the layer 3 message feature is a network protocol address, and the layer 4 message feature is port information. In this way, flexible adaptation of message feature matching requirements is achieved, which helps to adapt factors such as message format, message encapsulation and decapsulation, and communication protocol.

[0052] In a possible implementation, the layer 2 message feature is an Ethernet type, a connection identifier, or a communication protocol identifier. In this way, flexible adaptation of message feature matching requirements is achieved, which helps to adapt factors such as message format, message encapsulation and decapsulation, and communication protocol.

[0053] In a possible implementation, the first splicing method indicates the number of ternary content addressable memories required for width splicing and the number of ternary content addressable memories required for depth splicing. In this way, by designing the ternary content addressable memory into a plurality of splicable blocks, the splicing in the width direction and the depth direction can be achieved by splicing these blocks, so that the flow table matching length of the mask matching flow table can be equivalently achieved by using the width splicing, and the flow table specification of the mask matching flow table under the flow table matching length can be equivalently achieved by using the depth splicing, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services, respectively, which helps to flexibly configure fixed ternary content addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of the hardware unloading solution, and realize the efficient and reasonable use of ternary content addressable memory resources, not only supporting the dynamic division of flow table resources, but also providing fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0054] In some embodiments, the number of ternary content-addressable memories required for width splicing is the result of rounding up the first flow table matching length divided by a multiple of the flow table entry storage width, and the number of ternary content-addressable memories required for depth splicing is the result of rounding up the first flow table specification divided by a multiple of the flow table entry storage number. In this way, by designing the ternary content-addressable memory into multiple spliced ​​blocks, splicing these blocks can be used to achieve splicing in the width direction and the depth direction, so that the width splicing can be used to equivalently realize the flow table matching length of the mask matching flow table, and the depth splicing can be used to equivalently realize the flow table specification of the mask matching flow table under the flow table matching length, thereby providing a tailored splicing method for the first flow table forwarding service and other flow table forwarding services respectively, which helps to flexibly configure fixed ternary content-addressable memory resources to adapt to mask matching flow tables of various matching lengths, improve the versatility of hardware offloading solutions, and realize efficient and reasonable utilization of ternary content-addressable memory resources. It not only supports dynamic division of flow table resources but also can provide fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate.

[0055] In a possible implementation, the flow table unloading method further includes: setting the enable field in the configuration parameter register of the occupied / faulty ternary content addressable memory among the multiple ternary content addressable memories to invalid, thereby skipping the occupied / faulty ternary content addressable memory. In this way, for the first splicing method of the first flow table forwarding service, instructions are provided on how to use width splicing to equivalently implement the flow table matching length of the mask matching flow table and how to use depth splicing to equivalently implement the flow table specifications of the mask matching flow table under the flow table matching length. However, the first splicing method itself does not specify which specific ternary content addressable memories are to be spliced. On the basis of the instructions for width splicing and depth splicing provided by the first splicing method, the first service configuration for the first flow table forwarding service can be established by setting the relevant fields in the configuration parameter registers of each of the multiple ternary content addressable memories. In this way, the real-time situation of the ternary content addressable memory resources can be flexibly adapted by flexibly changing the definition of the relevant fields in the configuration parameter register of the specific ternary content addressable memory in the first business configuration, which helps to achieve efficient and reasonable utilization of the ternary content addressable memory resources and dynamic division of flow table resources.

[0056] Figure 4A schematic diagram of a multi-level message processing module provided for an embodiment of the present application. The table lookup operation corresponding to the mask matching request of the first message is performed by the multi-level message processing module, and the multi-level message processing module includes a first-level message processing module 411 for layer 2 message feature matching, a second-level message processing module 413 for layer 3 message feature matching, and a third-level message processing module 415 for layer 4 message feature matching. Figure 4 Also shown is a message entry processing module 401, which is responsible for parsing message metadata, such as machine address, network protocol address, Transmission Control Protocol / Internet Protocol (TCP / IP), etc. Figure 4 Also shown is a ternary content addressable memory module 430, which is used to provide a spliced ​​ternary content addressable memory and store a flow table supporting mask matching. Figure 4 It is also shown that the output module 403 is used to provide the matching result corresponding to the table lookup operation, that is, whether the extracted message feature hits the flow table supporting mask matching sent to the three-state content addressable memory module 430. The three-state content addressable memory module 430 extracts the corresponding features for the table lookup operation through different service configurations according to the flow table matching requirements of different flow table forwarding services, thereby realizing the flow table unloading supporting mask matching, not only supporting the dynamic division of flow table resources, but also providing fine-grained service configuration and message processing solutions in combination with user customization needs, thereby improving resource utilization, table lookup efficiency and flow table reuse rate. Figure 4 As exemplarily shown in FIG. 4 , the ternary content addressable memory module 430 provides a service configuration A 441 , a service configuration B 443 , and a service configuration C 445 .

[0057] See also Figure 4, through the multi-level message processing module, the efficiency of the pipeline and the efficiency of table lookup are improved. The user can perform corresponding splicing according to different flow table service requirements, and determine the corresponding service configuration. Then, when a table lookup is required, the message enters the hardware and passes through the multi-level message processing module in turn for message feature extraction and table lookup matching. If the previous level message processing module hits, the message feature extraction and table lookup matching of the next level message processing module will be performed, and finally the complete matching result will be output. For example, some flow table forwarding services only need to match the second-layer message features, so they only need to be processed by the first-level message processing module 411, and other message processing modules are skipped. For another example, some flow table forwarding services need to match the second-layer message features and the third-layer message features, so they are first processed by the first-level message processing module 411, and after the second-layer message features are hit, they are processed by the second-level message processing module 413, and other message processing modules are skipped. In this way, the multi-level flow table processing and pipeline processing model of the multi-level message processing module are utilized to improve the flow table multiplexing rate and finer granularity matching.

[0058] Figure 5 : is a structural diagram of a computing device provided in an embodiment of the present application, and the computing device 500 includes: one or more processors 510, a communication interface 520 and a memory 530. The processor 510, the communication interface 520 and the memory 530 are interconnected via a bus 540. Optionally, the computing device 500 may also include an input / output interface 550, and the input / output interface 550 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 500 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 510 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the computing device 500 performing various operations can refer to the specific details in the above-mentioned embodiments, such as the processor 510 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 500 may be used to implement part or all of the functions of one or more components in the above-mentioned device embodiment. In addition, the communication interface 520 may be specifically used to perform the communication functions necessary to implement the functions of these devices and components, and the processor 510 may be specifically used to perform the processing functions necessary to implement the functions of these devices and components.

[0059] It should be understood that Figure 5The computing device 500 may include one or more processors 510, and the multiple processors 510 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 510 may form a processor sequence or a processor array, or the multiple processors 510 may be divided into a main processor and an auxiliary processor, or the multiple processors 510 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 5 The computing device 500 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 500 may include Figure 5 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0060] The processor 510 may have a variety of specific implementation forms. For example, the processor 510 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 510 may also be a single-core processor or a multi-core processor. The processor 510 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 510 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 520 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0061] The memory 530 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 530 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 530 may also be used to store program codes and data, so that the processor 510 calls the program codes stored in the memory 530 to execute some or all of the operation steps in the above method embodiments, or to execute the corresponding functions in the above device embodiments. Figure 5 Show more or fewer components, or have different component configurations.

[0062] The bus 540 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 540 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 540 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0063] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.

[0064] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0065] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.

[0066] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0067] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in sequence, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A flow table unloading method supporting mask matching, characterized in that: The flow table unloading method comprises: Determine a first flow table matching length, a first flow table specification, and a first message layer matching information associated with a first flow table forwarding service, wherein the first flow table matching length is a data length of a flow table item feature for mask matching of the first flow table forwarding service, the first flow table specification is the number of flow table items for mask matching of the first flow table forwarding service, and the first message layer matching information indicates whether the first flow table forwarding service needs to match a layer 2 message feature, a layer 3 message feature, and a layer 4 message feature, respectively; Determine a first splicing mode for a plurality of ternary content addressable memories based on a comparison between the first flow table match length and a flow table entry storage width and a comparison between the first flow table specification and a flow table entry storage quantity, wherein each of the plurality of ternary content addressable memories has the flow table entry storage width and the flow table entry storage quantity; According to the first splicing mode, determine how to set the enable domain, the width splicing domain and the depth splicing domain in the configuration parameter register of each of the multiple ternary content addressable memories, so as to obtain a first service configuration for the first flow table forwarding service, the first service configuration also including the first message layer matching information, wherein the enable domain indicates whether the ternary content addressable memory where the enable domain is located is valid, the width splicing domain indicates whether to start width splicing, and the depth splicing domain indicates whether to start depth splicing; In response to the issuance of the first mask matching flow table for the first flow table forwarding service, the first service configuration is obtained, and based on the configuration parameter registers of each of the multiple three-state content addressable memories set according to the first service configuration, one or more three-state content addressable memories among the multiple three-state content addressable memories are spliced ​​to obtain a first spliced ​​three-state content addressable memory for the first flow table forwarding service, and then the first mask matching flow table is stored in the first spliced ​​three-state content addressable memory.

2. The flow table unloading method according to claim 1, characterized in that: The flow table unloading method further includes: In response to a mask matching request of a first message of the first flow table forwarding service, the first service configuration is obtained, and based on the first service configuration, one or more of the multiple three-state content addressable memories are determined to be the first spliced ​​three-state content addressable memory, and then, based on the first message layered matching information in the first service configuration, features of the first message are extracted for performing a table lookup operation corresponding to the mask matching request of the first message in the first spliced ​​three-state content addressable memory.

3. The flow table unloading method according to claim 2, characterized in that: The table lookup operation corresponding to the mask matching request of the first message is performed through a multi-level message processing module, and the multi-level message processing module includes a first-level message processing module for layer 2 message feature matching, a second-level message processing module for layer 3 message feature matching, and a third-level message processing module for layer 4 message feature matching.

4. The flow table unloading method according to claim 3, characterized in that: The first-level message processing module, the second-level message processing module and the third-level message processing module are all pipeline processing models and perform cascade matching processing in the order from layer 2 message features to layer 3 message features and then to layer 4 message features.

5. The flow table unloading method according to claim 4, characterized in that: The table lookup operation corresponding to the mask matching request of the first message is performed by the multi-stage message processing module, including: Based on the first message layered matching information in the first business configuration, a first cascade flow table identifier is generated, wherein the first cascade flow table identifier indicates whether the matching result of the previous level message processing module is a hit, and when the matching result of the current level message processing module is a hit, the first cascade flow table identifier also includes the matching result of the previous level message processing module for the next level message processing module.

6. The flow table unloading method according to claim 1, characterized in that: The first message layer matching information indicates that the first flow table forwarding service needs to match the layer 2 message characteristics, or the first flow table forwarding service needs to match the layer 2 message characteristics and the layer 3 message characteristics, or the first flow table forwarding service needs to match the layer 2 message characteristics, the layer 3 message characteristics and the layer 4 message characteristics.

7. The flow table unloading method according to claim 1, characterized in that: The layer 2 message characteristics, the layer 3 message characteristics, and the layer 4 message characteristics are determined based on a communication protocol and a message format associated with the first flow table forwarding service.

8. The flow table unloading method according to claim 7, characterized in that: The layer 2 message feature is the machine address, the layer 3 message feature is the network protocol address, and the layer 4 message feature is the port information.

9. The flow table unloading method according to claim 7, characterized in that: The layer 2 message feature is an Ethernet type, a connection identifier, or a communication protocol identifier.

10. The flow table unloading method according to claim 1, characterized in that: The first splicing mode indicates the number of ternary content addressable memories required for width splicing and the number of ternary content addressable memories required for depth splicing.

11. The flow table unloading method according to claim 10, characterized in that: The number of ternary content addressable memories required for width splicing is the result of rounding up the first flow table matching length divided by a multiple of the flow table item storage width, and the number of ternary content addressable memories required for depth splicing is the result of rounding up the first flow table specification divided by a multiple of the flow table item storage number.

12. The flow table unloading method according to claim 1, characterized in that: The flow table unloading method further includes: setting the enable field in the configuration parameter register of the occupied / faulty ternary content addressable memory among the plurality of ternary content addressable memories to be invalid, thereby skipping the occupied / faulty ternary content addressable memory.

13. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data search method and device, computer equipment and storage medium

    CN107818151A

  • Data compression method and device, computer equipment and readable storage medium

    CN118264255A