Sharing processor based on TCAM cluster and data processing method and system

By designing a shared processor based on TCAM clusters, dynamic management and allocation of TCAM resources are achieved, the problem of low TCAM resource utilization is solved and the resource utilization efficiency is improved.

CN119988260AActive Publication Date: 2025-05-13DAPUSTOR CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411994666.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-13
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The fixed allocation method of TCAM resources leads to low resource utilization, and it is impossible to redistribute idle TCAM resources after the application is closed.

Method used

A shared processor based on TCAM cluster is designed to realize dynamic management and allocation of TCAM resources through a combination of input management unit, output management unit, control unit and TCAM cluster.

Benefits of technology

The utilization rate of TCAM resources is improved. By dynamically managing the organization of TCAM units, resources can be reassigned after the application is closed and resource waste can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988260A_ABST
    Figure CN119988260A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of data processing, and discloses a shared processor based on a TCAM cluster and a data processing method and system.The shared processor comprises an input management unit, an output management unit, a control unit and the TCAM cluster, the TCAM cluster comprises a plurality of TCAM units, and the control unit analyzes control information at an interface and sends the control information to the output management unit; and the analyzed control information is transmitted to the input management unit and the output management unit, and the input management unit and the output management unit are respectively connected with a plurality of groups of external input and output interfaces. Search keys are switched to corresponding TCAM units through an input management unit according to input control information of multiple sets of peripherals (interfaces) to obtain matching information, multiple TCAMs are integrated through an output management unit according to the control information of the TCAMs and the matching information output by the TCAMs to obtain a new matching vector, and a matching result is obtained based on the new matching information. By dynamically allocating the TCAM resources, the utilization rate of the TCAM resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a shared processor based on a TCAM cluster, a data processing method and a system. Background Art

[0002] TCAM (Ternary Content Addressable Memory) is a ternary content addressable memory used to search and match data. TCAM can compare multiple entries in parallel within one clock cycle to achieve fast search. Therefore, TCAM is crucial in application scenarios that require low latency and high throughput.

[0003] In actual application scenarios, TCAM resources are usually allocated according to application requirements. After TCAM resources are allocated to an application, if the application closes TCAM, the TCAM will be idle and cannot be reallocated. This fixed way of allocating TCAM resources leads to low utilization of TCAM resources. Summary of the invention

[0004] The embodiments of the present application provide a shared processor, a data processing method and a system based on a TCAM cluster, which can improve the utilization rate of TCAM resources.

[0005] To solve the above technical problems, the present application provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a shared processor based on a TCAM cluster, the shared processor comprising: an input management unit, an output management unit, a control unit and a TCAM cluster, wherein the TCAM cluster comprises a plurality of TCAM units; wherein,

[0007] The input management unit is connected to the multiple input interfaces, and is used to receive the control information and search keys input by the multiple input interfaces, and map the search keys to the corresponding TCAM units according to the control information;

[0008] A control unit, used for parsing control information of multiple input interfaces, and transmitting the parsed control information to an input management unit and an output management unit, and for dynamically managing the organization of multiple TCAM units;

[0009] A TCAM unit connected to the input management unit and the output management unit, configured to receive a search key input by the input management unit to generate first matching information, and send the first matching information to the output management unit;

[0010] The output management unit is connected to multiple TCAM units and multiple output interfaces, and is used to integrate the first matching information output by the multiple TCAM units to obtain second matching information, and generate matching results based on the second matching information to output the matching results to multiple output interfaces, wherein the input interface and the output interface correspond one to one.

[0011] In some embodiments, the input management unit includes an interface arbitrator and a key mapping unit, each input interface corresponds to a search key, and each search key includes a plurality of sub-keys;

[0012] An interface arbitrator connected to the key mapping unit, used to obtain control information corresponding to the plurality of input interfaces, and determine the input interface mapped to the TCAM unit according to the control information, and send the search key corresponding to the input interface to the key mapping unit, wherein each TCAM unit corresponds to a matching key one by one;

[0013] The key mapping unit is connected to the interface arbitrator and the TCAM cluster, and is used to map a number of sub-keys corresponding to each search key to the TCAM units corresponding to the matching key.

[0014] In some embodiments, the control information includes TCAM enable information;

[0015] The interface arbitrator is specifically used for:

[0016] When TCAM enable information corresponding to different input interfaces overlaps, one of the input interfaces is selected, and the search key corresponding to the input interface is sent to the key mapping unit;

[0017] When there is no overlap in TCAM enable information corresponding to different input interfaces, all input interfaces are selected, and the search keys corresponding to all input interfaces are sent to the key mapping unit.

[0018] In some embodiments, the control information includes extended matching information, priority information, and mapping interface information, and the output management unit includes a matching information integration unit, an address unit, and a selection unit;

[0019] A matching information integration unit, connected to the TCAM cluster and the address unit, for integrating a plurality of first matching information corresponding to each interface according to the extended matching information to obtain a plurality of second matching information;

[0020] an address unit connected to the matching information integration unit and the selection unit, and configured to convert the second matching information into an address according to the priority information to determine a matching result, wherein the matching result includes an address;

[0021] The selection unit is connected with the address unit and the plurality of output interfaces, and is used for obtaining mapping interface information, and sending the matching result to the corresponding output interface based on the mapping interface information.

[0022] In some embodiments,

[0023] The matching information integration unit is specifically used for:

[0024] According to the extended matching information, a plurality of first matching information are subjected to a bitwise OR operation and / or a bitwise AND operation to obtain a plurality of second matching information to extend the rule length and / or the number of rules.

[0025] In some embodiments, the priority information includes high address priority or low address priority, the second matching information includes a bit string, and the address unit is specifically used for:

[0026] When the priority information is high address first, the first sequence number of the bit string with a high level from high to low is used as the address;

[0027] When the priority information is low address first, the first serial number of the bit string with a high level from low to high is used as the address.

[0028] In some embodiments, the control information includes a mapping key, and the shared processor includes a control unit connected to the interface arbitrator, the key mapping unit, the matching information integration unit, the address unit, and the selection unit;

[0029] A control unit is used to obtain control information corresponding to each input interface received by the interface arbitrator, and send the mapping key in the control information corresponding to each input interface to the key mapping unit, send the extended matching information to the matching information integration unit, send the priority information to the address unit, and send the mapping interface information to the selection unit.

[0030] In a second aspect, an embodiment of the present application provides a data processing method, which is applied to a shared processor based on a TCAM cluster according to any one of claims 1 to 7, wherein the shared processor is connected to a plurality of interfaces, and the method comprises:

[0031] Acquire control information of multiple interfaces, wherein the control information includes extended matching information;

[0032] Based on the control information, calling the TCAM cluster to obtain a plurality of first matching information corresponding to each interface;

[0033] Based on the extended matching information, a plurality of first matching information corresponding to each interface is integrated to obtain a matching result corresponding to each interface.

[0034] In some embodiments, the method further comprises:

[0035] Get the number of interfaces, rule length, and number of rules;

[0036] Determine the number of TCAM cells and the specifications of the TCAM cells based on the number of interfaces, the rule length, and the number of rules;

[0037] Based on the number of interfaces, the number of TCAM units, and the specifications of the TCAM units, determine an upper limit value of the number of rules corresponding to each interface and an upper limit value of the length of the rules corresponding to each interface;

[0038] According to the rule length and the number of rules of each interface, a control information table is established for each interface, wherein each interface corresponds to a control information and a search key one by one.

[0039] In a third aspect, an embodiment of the present application provides a data processing system, the system comprising:

[0040] A first aspect is a shared processor based on a TCAM cluster;

[0041] A plurality of input interfaces and a plurality of output interfaces, wherein the input interfaces and the output interfaces correspond one to one.

[0042] The beneficial effects of the embodiments of the present application are as follows: different from the prior art, the embodiments of the present application provide a shared processor based on a TCAM cluster, the shared processor comprising: an input management unit, an output management unit, a control unit and a TCAM cluster, wherein the TCAM cluster comprises a plurality of TCAM units; wherein the input management unit is connected to a plurality of input interfaces, and is used to receive control information and a search key input by the plurality of input interfaces, and maps the search key to a corresponding TCAM unit according to the control information; the control unit is used to parse the control information of the plurality of input interfaces, and transmit the parsed control information to the input management unit and the output management unit, and is used to dynamically manage the organization of the plurality of TCAM units; the TCAM unit is connected to the input management unit and the output management unit, and is used to receive the search key input by the input management unit to generate first matching information, and sends the first matching information to the output management unit; the output management unit is connected to the plurality of TCAM units and the plurality of output interfaces, and is used to integrate the first matching information output by the plurality of TCAM units to obtain second matching information, and generates a matching result according to the second matching information, and outputs the matching result to the plurality of output interfaces, wherein the input interface and the output interface correspond one to one.

[0043] The control information of the input interface is parsed by the control unit, and the parsed control information is transmitted to the input management unit and the output management unit. The input management unit transfers the search key to the corresponding TCAM unit based on the control information input by multiple groups of peripherals (interfaces), obtains the matching information through the TCAM unit, and integrates the matching information output by the TCAM based on the control information of multiple TCAMs through the output management unit to obtain a new matching vector. Based on the new matching information, the matching result is obtained, and the utilization rate of TCAM resources is improved by dynamically allocating TCAM resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0045] Figure 1 It is a structural diagram of a shared processor based on a TCAM cluster provided in an embodiment of the present application;

[0046] Figure 2 is a structural diagram of an input management unit provided in an embodiment of the present application;

[0047] Figure 3A It is a schematic diagram of an interface arbiter determining an interface when the enabling information of a TCAM does not overlap, provided by an embodiment of the present application;

[0048] Figure 3B It is a schematic diagram of an interface arbiter determining an interface when enabling information of a TCAM overlaps, provided by an embodiment of the present application;

[0049] Figure 4 is a schematic diagram of mapping a search key to a TCAM unit provided by an embodiment of the present application;

[0050] Figure 5 is a structural diagram of an output management unit provided in an embodiment of the present application;

[0051] Figure 6 This is an example schematic diagram of a bitwise AND operation and a bitwise OR operation provided in an embodiment of the present application;

[0052] Fig. 7A This is an example schematic diagram of extending the length of a matching rule provided in an embodiment of the present application;

[0053] Figure 7B This is an example schematic diagram of an expanded matching rule quantity provided in an embodiment of the present application;

[0054] Figure 7CThis is an example schematic diagram of an extended matching rule length and the number of matching rule lengths provided in an embodiment of the present application;

[0055] Fig. 8A is an example schematic diagram of converting second matching information into an address based on low-order first provided by an embodiment of the present application;

[0056] Figure 8B is an example schematic diagram of converting second matching information into an address based on high-order first provided in an embodiment of the present application;

[0057] Figure 8C is another exemplary schematic diagram of converting the second matching information into an address based on high-order first provided by an embodiment of the present application;

[0058] Fig. 9A This is an example diagram of a selector of a selection unit where a matching result is mapped to the selector provided in an embodiment of the present application;

[0059] Fig. 9B is another exemplary schematic diagram of mapping a matching result to a selector of a selection unit provided in an embodiment of the present application;

[0060] Fig.10 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0061] Fig.11 It is a flowchart of determining the number of rules corresponding to each interface and the upper limit of the rule length provided by an embodiment of the present application;

[0062] Fig.12 It is a structural diagram of a data processing system provided in an embodiment of the present application;

[0063] Fig.13 It is a schematic diagram of the structure of another shared processor based on TCAM cluster provided in an embodiment of the present application.

[0064] Description of Figure Numbers:

[0065] DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0067] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0068] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0069] Before introducing the embodiments of the present application, a brief introduction to the prior art known to the inventors of the present application is first given to facilitate subsequent understanding of the embodiments of the present application.

[0070] TCAM (Ternary Content Addressable Memory) is a three-state content addressable memory. TCAM is used for data search and matching. TCAM can compare multiple entries in parallel within one clock cycle to achieve fast search. Therefore, TCAM is crucial in application scenarios that require low latency and high throughput. In switching chips, TCAM is used for packet parsing (Parser), switching (Switch), access control list (Access Control List, ACL), flow direction (Flow Director, FD) and receive side scaling (Receive Side Scaling, RSS), etc.

[0071] However, due to the high power consumption and manufacturing cost of TCAM, and the fact that TCAM resources are usually allocated according to application requirements, after TCAM resources are allocated to an application, if the application shuts down TCAM, the TCAM will be idle and the idle TCAM resources cannot be reallocated. This fixed way of allocating TCAM resources results in low utilization of TCAM resources.

[0072] In response to the above problems, the present application provides a shared processor based on a TCAM cluster, wherein the shared processor of the TCAM cluster includes: an input management unit, an output management unit, a control unit and a TCAM cluster, wherein the TCAM cluster includes multiple TCAM units, and the control unit parses the control information of the input interface, and then transmits the parsed control information to the input management unit and the output management unit, and the input management unit transfers the search keys of multiple groups of peripherals (interfaces) to the corresponding TCAM units according to the control information input by them, and obtains matching information through the TCAM units, and the output management unit integrates the matching information output by the TCAM according to the control information of multiple TCAMs to obtain a new matching vector, and obtains a matching result based on the new matching information, and improves the utilization rate of TCAM resources by dynamically allocating TCAM resources.

[0073] The technical solution of this application is described in detail below with reference to the accompanying drawings:

[0074] See also Figure 1 , Figure 1 It is a structural diagram of a shared processor based on a TCAM cluster provided in an embodiment of the present application.

[0075] like Figure 1 As shown, the TCAM cluster-based shared processor 100 includes an input management unit 101 , a control unit 102 , a TCAM cluster 103 , and an output management unit 104 .

[0076] Wherein, the TCAM cluster 103 includes a plurality of TCAM units, such as TCAM0, TCAM1 ... TCAMS-1, S is a positive integer, each TCAM unit is an independent storage and search device, the TCAM unit can search its internal storage unit according to the input data (or query keyword), and return the matching information, the TCAM unit adopts three-state logic, that is, each storage unit can represent three states (0, 1 and X, where X represents irrelevant). This three-state logic enables TCAM to perform more flexible matching operations, such as fuzzy matching, complete matching, prefix matching, and priority matching. When the input data is sent to the TCAM unit, all entries stored in the storage unit of the TCAM unit will be compared, and each entry can be defined as a set of rules, and the matching of the input data is simplified by setting X.

[0077] The input management unit 101 is connected to the control unit 102 and the TCAM cluster 103. The input management unit 101 is used to receive control information CTRL and search keys input by multiple input interfaces, and map the search keys to corresponding TCAM units according to the control information. The input interface is used to receive data acquisition requests from users, and each input interface corresponds to a search key one by one.

[0078] The control unit 102 is connected to the input management unit 101 and the output management unit 104. The control unit 102 is used to parse the control information of multiple input interfaces and transmit the parsed control information to the input management unit 101 and the output management unit 104, and is used to dynamically manage the organization of multiple TCAM units.

[0079] The TCAM cluster 103 is connected to the input management unit 101 and the output management unit 102 . The TCAM cluster 103 is used to receive the search key input by the input management unit 101 to generate first matching information, and send the first matching information to the output management unit 104 .

[0080] The input management unit 104 is connected to the TCAM cluster 103, the control unit 102, and multiple output interfaces. The input management unit 104 is used to integrate the first matching information output by multiple TCAM units to obtain second matching information, and generate matching results based on the second matching information to output the matching results to multiple output interfaces, wherein the input interface and the output interface correspond one to one.

[0081] In an embodiment of the present application, each input interface corresponds to a search key KEY, and each search key KEY includes multiple sub-keys, KEY = {key(i, j)|0≤i≤N-1, |0≤j≤S-1}, key(i, j) represents the j-th sub-key in the i-th interface search key, the sub-key length is s bits, N is the number of input interfaces, and S is the number of TCAM units.

[0082] Each TCAM unit corresponds to a matching key, for example, TCAM0 corresponds to key 0, TCAM1 corresponds to key 1, and TCAMMS-1 corresponds to key S-1 , key 0, key 1...key S-1 That is, the matching key, which is the unique identifier of the TCAM unit. The input interface can be mapped to the TCAM unit through the matching key.

[0083] In an embodiment of the present application, the input interface is mapped to multiple TCAM units, that is, the search key KEY of the input interface is mapped to the matching key of the TCAM unit, and a mapping relationship is established between each input interface and the TCAM unit to assign the data acquisition request task of the user received by each input interface to the TCAM unit, so as to obtain the matching information corresponding to the data acquisition request through the TCAM unit.

[0084] In the embodiment of the present application, the control information ctrl includes: (1) an arbitration interface TCAM_EN, which is used to specify the enable information of multiple groups of TCAM units; (2) a mapping key KEY_MAP, which is used to determine the association information between the subkey key (i, j) in the interface and the S groups of TCAM; (3) extended matching information EXTEND, which is used to integrate multiple groups of first matching information into second matching information; (4) priority information PRIORITY, which is used to convert the second matching information into an address; (5) mapping interface information INF_MAP, which is used to determine the association information between multiple groups of interfaces and multiple groups of addresses.

[0085] The enable information is used to control whether the TCAM unit can be accessed or perform operations. When the enable signal is valid (for example, high level), the TCAM unit is in an active state and can accept queries, perform matching operations, etc. On the contrary, when the enable signal is invalid (for example, low level), the TCAM unit is in an active state and does not respond to any external operations.

[0086] In an embodiment of the present application, the control unit 102 parses the control information of multiple input interfaces to obtain parsed control information, which includes a mapping key KEY_MAP, extended matching information EXTEND, priority information PRIORITY, and mapping interface information INF_MAP. The control unit 102 sends the mapping key KEY_MAP to the input management unit 101, and the input management unit 101 sends the search keys of multiple groups of input interfaces to multiple TCAM units through the mapping key KEY_MAP. At the same time, the control unit 102 sends the extended matching information EXTEND, priority information PRIORITY, and mapping interface information INF_MAP to the output management unit 104, and the output management unit 104 integrates the matching information output by the TCAM according to the control information sent by the control unit 102 to obtain a matching result.

[0087] In an embodiment of the present application, control information is managed by the control unit 102 to align the control information between the input management unit 101 and the output management unit 104, and the organization of multiple TCAM units is dynamically managed through the control information, so that the allocation of multiple TCAM units is more flexible.

[0088] See also Figure 2 , Figure 2 It is a structural diagram of an input management unit provided in an embodiment of the present application.

[0089] like Figure 2 As shown, the input management unit 101 includes an interface arbitrator 111 and a key mapping unit 112 .

[0090] The interface arbiter 111 is connected to the key mapping unit 112 and the control unit 102. The interface arbiter 111 is also connected to multiple groups of input interfaces (not shown). The interface arbiter 111 is used to obtain control information corresponding to the multiple groups of input interfaces, wherein the control information includes TCAM enable information. According to the TCAM enable information corresponding to the multiple groups of input interfaces, the interface mapped to the TCAM unit is determined, that is, the mapping key KEY_MAP of each group of input interfaces is determined.

[0091] In an embodiment of the present application, the interface mapped to the TCAM unit is determined based on the TCAM enable information corresponding to each group of interfaces, specifically including: when there is overlap in the TCAM enable information corresponding to different input interfaces, one of the input interfaces is selected and the search key corresponding to the input interface is sent to the key mapping unit 112; when there is no overlap in the TCAM enable information corresponding to different input interfaces, all the input interfaces are selected and the search keys corresponding to all the input interfaces are sent to the key mapping unit 112.

[0092] After determining that each input interface corresponds to a TCAM unit, the interface arbiter 111 sends the mapping key KEY_MAP to the control unit 102 , and the control unit 102 sends the mapping keys KEY_MAP of the multiple groups of input interfaces to the key mapping unit 112 .

[0093] For example, see Figure 3A , Figure 3A 1 is a schematic diagram of an interface arbiter determining an interface when the enabling information of a TCAM does not overlap, provided in an embodiment of the present application. Figure 3AAs shown, control information of two interfaces is currently received, namely interface 0 and interface 1, and there are 5 TCAM units, namely TCAM0, TCAM1, TCAM2, TCAM3, and TCAM4. The search key of interface 0 includes a subkey key (0, 0), and the enable information TCAM corresponding to interface 0 is TCAM_EN0={0, 0, 0, 0, 1}. The search key of interface 1 includes a subkey key (1, 0), and the enable information TCAM corresponding to interface 1 is TCAM_EN0={0, 0, 0, 1, 0}. The "0" in the enable information of TCAM indicates that TCAM is not selected, and "1" indicates that TCAM is selected. The enable information TCAM corresponding to interface 0 is TCAM_EN0={0, {0, 0, 0, 1} indicates that TCAM0 is selected as the TCAM unit corresponding to interface 0, TCAM1, TCAM2, TCAM3, and TCAM4 are not selected, and the enable information of TCAM corresponding to interface 1 TCAM_EN0={0, 0, 0, 1, 0} indicates that TCAM1 is selected as the TCAM unit corresponding to interface 1, and TCAM0, TCAM2, TCAM3, and TCAM4 are not selected. At this time, TCAM0 corresponds to the subkey key (0, 0) of interface 0, and TCAM1 corresponds to the subkey key (1, 0) of interface 1. The interfaces corresponding to TCAM0 and TCAM1 are different, indicating that the enable information of TCAM does not overlap, and the search keys corresponding to interface 0 and interface 1 are sent to the key mapping unit.

[0094] For another example, see Figure 3B , Figure 3B 1 is a schematic diagram of an interface arbiter determining an interface when enabling information of a TCAM overlaps, provided by an embodiment of the present application. Figure 3BAs shown, control information of two interfaces is currently received, namely interface 0 and interface 1, and there are 5 TCAM units, namely TCAM0, TCAM1, TCAM2, TCAM3, and TCAM4. The search key of interface 0 includes a subkey key(0,0), and the enable information of the TCAM corresponding to interface 0 is TCAM_EN0={0,0,0,0,1}. The search key of interface 1 includes two subkeys key(1,1) and key(1,0), and the enable information of the TCAM corresponding to interface 1 is TCAM_EN0={0,0,0,1,1}. CAM_EN0={0,0,0,0,1} indicates that TCAM0 is selected as the TCAM unit corresponding to interface 0, and the enable information of TCAM corresponding to interface 1. TCAM_EN0={0,0,0,1,1} indicates that TCAM0 and TCAM1 are selected as the TCAM units corresponding to interface 1. Since TCAM0 is selected for both interface 0 and interface 1 at the same time, that is, the enable information of TCAM overlaps, one of the interfaces is selected for execution first. For example, if the control information of interface 0 is received first, the search key of interface 0 is selected first and sent to the key mapping unit. After the request of interface 0 is processed, interface 1 is selected.

[0095] In the embodiment of the present application, after the interface arbiter 111 determines the TCAM units corresponding to several sub-keys of the search key of each interface, the mapping key KEY_MAP is sent to the control unit 102.

[0096] After receiving the mapping key KEY_MAP, the control unit 102 sends the mapping key KEY_MAP to the key mapping unit 112 .

[0097] In the embodiment of the present application, after determining whether there is overlap between arbitration interfaces in the control information corresponding to different interfaces, the interface arbitrator 111 determines the association information between the subkey in the search key corresponding to each interface and the TCAM unit, where the association information refers to the mapping relationship between the subkey and the TCAM unit, for example, Figure 3A As shown, there are currently 5 TCAM units, namely TCAM0, TCAM1, TCAM2, TCAM3, and TCAM4. There is no overlap in the arbitration interfaces of interface 0 and interface 1. TCAM_EN0 = {0, 0, 0, 0, 1} indicates that TCAM0 is selected, and TCAM_EN1 = {0, 0, 0, 1, 0} indicates that TCAM1 is selected. The mapping key KEY_MAP = {key (0, 0) -> key 0, key (1, 0) -> key 1} is determined, wherein key 0 is the matching key of TCAM0, and key 1 is the matching key of TCAM1.

[0098] The key mapping unit 112 is connected to the interface arbiter 111, the TCAM cluster 103, and the control unit 102, and is used to map several subkeys corresponding to the search key corresponding to each input interface to the TCAM unit corresponding to the matching key according to the mapping key KEY_MAP sent by the control unit 102.

[0099] Specifically, after the key mapping unit 112 receives the search keys corresponding to several interfaces sent by the interface arbitrator 111 and the mapping key KEY_MAP sent by the control unit 102, it sends several sub-keys of the search key corresponding to each interface to its corresponding TCAM unit according to the mapping key KEY_MAP, so that each sub-key is mapped to a matching key of a TCAM unit.

[0100] For example, see Figure 4 , Figure 4 is a schematic diagram of mapping a search key to a TCAM unit provided by an embodiment of the present application, such as Figure 4 As shown, the key mapping unit 112 receives the search key KEY0 = {key(0,0)} of interface 0 and the search key KEY1 = {key(1,0)} of interface 1, and receives KEY_MAP = {key(0,0)->key0, key(1,0)->key1} sent by the control unit 102, then sends the subkey key(0,0) of the search key of interface 0 to TCAM0 through the matching key (key0) of TCAM0, and sends the subkey key(1,0) of the search key of interface 1 to TCAM1 through the matching key (key1) of TCAM1.

[0101] In an embodiment of the present application, after several sub-keys of the search key corresponding to each input interface are sent to the TCAM unit, the TCAM unit performs data query within the TCAM unit based on the received sub-keys to obtain matching information (i.e., the data requested by the interface), and sends the matching information to the output management unit 104 of the shared processor.

[0102] In the embodiment of the present application, since the search key corresponding to each interface may contain multiple sub-keys, the multiple sub-keys are sent to different TCAM units respectively, so that the matching information returned by different TCAM units can be obtained.

[0103] In an embodiment of the present application, different sub-keys of the search key corresponding to the same interface are sent to different TCAM units for processing, so that each TCAM unit only processes part of the sub-keys, thereby reducing the load of a single TCAM unit and the redundancy of matching information.

[0104] See also Figure 5 , Figure 5 It is a structural diagram of an output management unit provided in an embodiment of the present application.

[0105] like Figure 5 As shown, the output management unit 104 includes a matching information integration unit 141, an address unit 142, and a selection unit 143, wherein the address unit 142 includes multiple addresses, such as address 0, address 1...address S-1, and the number of addresses in the address unit 142 is consistent with the number of TCAM units.

[0106] The matching information integration unit 141 is connected to the TCAM cluster 103, the address unit 142, and the control unit 102. The matching information integration unit 141 is used to integrate a plurality of first matching information corresponding to each interface according to the extended matching information to obtain a plurality of second matching information.

[0107] The extended matching information is used to extend the length of the matching rule or the number of the matching rules.

[0108] Specifically, the matching information integration unit 141 receives the extended matching information sent by the control unit 102, and performs a bitwise OR operation on a number of first matching information according to the extended matching information, and / or performs a bitwise AND operation on a number of first matching information according to the extended matching information to obtain a number of second matching information to extend the rule length and / or the number of rules.

[0109] In an embodiment of the present application, each TCAM unit supports s bits of matching rules, and the number of matching rules supported is n. When there are N input interfaces and S TCAM units (TCAM (n, s)), the maximum matching rule length is S*s bits, and the maximum number of matching rules is S*n.

[0110] In the embodiment of the present application, the principle of the bitwise OR operation is based on the truth table characteristics of the OR gate. When "1" and "X" are ORed together, its value is "1", and when "0" and "X" are ORed together, its value is "X". The principle of the bitwise AND operation is based on the truth table characteristics of the AND gate. When "1" and "X" are ANDed together, its value is "X", and when "0" and "X" are ANDed together, its value is "0".

[0111] For example, see Figure 6 , Figure 7A-7C , Figure 6 is an example schematic diagram of a bitwise AND operation and a bitwise OR operation provided in an embodiment of the present application, Fig. 7A is an example schematic diagram of extending the length of a matching rule provided in an embodiment of the present application. Figure 7B is an example schematic diagram of an expanded matching rule quantity provided in an embodiment of the present application. Figure 7C This is an example schematic diagram of an extended matching rule length and the number of matching rule lengths provided in an embodiment of the present application.

[0112] like Figure 6 , Fig. 7A As shown, there are currently four TCAM units, namely TCAM0, TCAM1, TCAM2, and TCAM3. When the current extended matching information is used to extend the length of the matching rule, the extended matching information EXTEND=3'b000, "0" means that the matching information of the previous TCAM participates in the operation of the matching information of the next TCAM, EXTEND[0]=0, EXTEND[1]=0, EXTEND[2]=0, and the process of performing bitwise OR operation and bitwise AND operation on several first matching information output by TCAM based on the extended matching information includes: (1) TCAM0 outputs the first matching information 0, inputs the first matching information 0 and EXTEND[0] into the OR gate to obtain the first matching information 0, and then inputs the first matching information 0 and TCAM3 into the OR gate to obtain the first matching information 0. The first match information 1 output by CAM1 is input into the AND gate to obtain the second match information 1, which includes the first match information 0 and the first match information 1; (2) the second match information 1 and EXTEND[1] are input into the OR gate to obtain the second match information 1, the second match information 1 and the first match information 2 output by TCAM2 are input into the AND gate to obtain the second match information 2, which includes the second match information 1 and the first match information 2; (3) the second match information 2 and EXTEND[2] are input into the OR gate to obtain the second match information 2, the second match information 2 and the first match information 3 output by TCAM3 are input into the AND gate to obtain the second match information 3, which includes the second match information 2 and the first match information 3, that is, Fig. 7A As shown in , the first matching information 0, the first matching information 1, the first matching information 2, and the first matching information 3 are integrated to obtain the second matching information 3.

[0113] like Figure 6 , Figure 7BAs shown, there are currently four TCAM units, namely TCAM0, TCAM1, TCAM2, and TCAM3. When the current extended matching information is used to expand the number of matching rules, the extended matching information EXTEND=3'b111, "1" means that the matching information of the previous TCAM does not participate in the operation of the matching information of the next TCAM, EXTEND[0]=1, EXTEND[1]=1, EXTEND[2]=1, and the process of alternately performing OR operation and AND operation on several first matching information output by TCAM based on the extended matching information includes: (1) TCAM0 outputs the first matching information 0, and the first matching information 0 and EXTEND[0] are input into the OR gate to obtain "1". , and use the first match information 0 as the second match information 0, input "1" and the first match information 1 output by TCAM1 into the AND gate to obtain the second match information 1, and the second match information 1 includes the first match information 1; (2) input the second match information 1 and EXTEND[1] into the OR gate to obtain "1", input "1" and the first match information 2 output by TCAM2 into the AND gate to obtain the second match information 2, and the second match information 2 includes the first match information 2; (3) input the second match information 2 and EXTEND[2] into the OR gate to obtain "1", input "1" and the first match information 3 output by TCAM3 into the AND gate to obtain the second match information 3, and the second match information 3 includes the first match information 3, that is, Figure 7B As shown in , after bitwise OR operation and bitwise AND operation are performed on the first matching information 0, the first matching information 1, the first matching information 2, and the first matching information 3, the second matching information 0, the second matching information 1, the second matching information 2, and the second matching information 3 are obtained.

[0114] like Figure 6 , Figure 7CAs shown, there are currently four TCAM units, namely TCAM0, TCAM1, TCAM2, and TCAM3. When the current extended matching information is used to simultaneously extend the length of the matching rule and the number of matching rules, the extended matching information EXTEND=3'b010, "0" means that the matching information of the previous TCAM participates in the calculation of the matching information of the next TCAM, "1" means that the matching information of the previous TCAM does not participate in the calculation of the matching information of the next TCAM, EXTEND[0]=0, EXTEND[1]=1, EXTEND[2]=0, and the process of alternately performing OR operations and AND operations on a plurality of first matching information output by the TCAM based on the extended matching information includes: (1) TCAM0 outputs the first matching information 0, and the first matching information 0 and EXTEND are combined. D[0] is input into the OR gate to obtain the first match information 0, and the first match information 0 and the first match information 1 output by TCAM1 are input into the AND gate to obtain the second match information 1, which includes the first match information 0 and the first match information 1; (2) the second match information 1 and EXTEND[1] are input into the OR gate to obtain "1", and "1" and the first match information 2 output by TCAM2 are input into the AND gate to obtain the second match information 2, which includes the first match information 2; (3) the second match information 2 and EXTEND[2] are input into the OR gate to obtain the second match information 2, and the second match information 2 and the first match information 3 output by TCAM3 are input into the AND gate to obtain the second match information 3, which includes the second match information 2 and the first match information 3, that is, Figure 7C As shown in , after performing bitwise OR operation and bitwise AND operation on the first matching information 0, the first matching information 1, the first matching information 2, and the first matching information 3, the second matching information 1 and the second matching information 3 are obtained. The second matching information 1 includes the first matching information 0 and the first matching information 1, and the second matching information 3 includes the first matching information 2 and the first matching information 3.

[0115] It should be noted that Figure 7A-7C This is only an example. How to expand the matching rules depends on specific needs.

[0116] In the embodiment of the present application, the matching information output by different TCAM units is integrated based on the extended matching information, so that the length of the matching rules or the number of matching rules supported by each input interface can be flexibly changed within a certain range.

[0117] The address unit 142 is connected to the matching information integration unit 141, the selection unit 143, and the control unit 102. The address unit 142 is used to convert the plurality of second matching information into addresses according to the priority information to determine the matching result, wherein the matching result includes the address. The priority information includes high address priority or low address priority, and the second matching information includes a bit string.

[0118] Specifically, when the priority information is high address first, the first sequence number of the bit string with a high level appearing from high to low is used as the address.

[0119] Specifically, when the priority information is low address first, the first sequence number of the bit string from low to high that appears at a high level is used as the address.

[0120] Among them, a high level is represented by "1" and a low level is represented by "0".

[0121] For example, see Fig. 8A , Fig. 8A is an example schematic diagram of converting the second matching information into an address based on low-order first provided in an embodiment of the present application, such as Fig. 8A As shown, the second matching information includes 00011010, and the current priority information is low address first. Then, in the order from the low bit to the high bit of the bit string, the first appearing "1" is retained, and all other bits are cleared to 0, and the sequence number of the first appearing "1" in the bit string from low to high is used as the address. The sequence number of the first appearing "1" in 00011010 is 1, and all other bits are cleared to 0, that is, 00000010, the sequence number of "1" is the first, then 1 is used as the address, and the matching result output by the address unit 142 is {hit, 1}, wherein the 0 in the second matching information 00011010 indicates a miss, and 1 indicates a hit.

[0122] For another example, see Figure 8B , Figure 8B is an example schematic diagram of converting the second matching information into an address based on high-order first according to an embodiment of the present application, such as Figure 8B As shown, the second matching information includes 00011010, and the current priority information is high address first. Then, in the order from high to low bits of the bit string, the first appearing "1" is retained, and all other bits are cleared to 0, and the sequence number of the first appearing "1" in the bit string from high to low is used as the address. The sequence number of the first appearing "1" in 00011010 is 3, and all other bits are cleared to 0, that is, 00010000, and the sequence number of "1" is the third, so 3 is used as the address, and the matching result output by the address unit 142 is {hit, 3}, wherein the 0 in the second matching information 00011010 indicates a miss, and 1 indicates a hit.

[0123] For another example, see Figure 8C , Figure 8C is another exemplary schematic diagram of converting the second matching information into an address based on high-order first provided in an embodiment of the present application, such as Figure 8C As shown, the second matching information includes 00000000, and the current priority information is high address first. In the order from high to low bits of the bit string, the first appearing "1" is retained, and all other bits are cleared to 0, and the sequence number of the first appearing "1" from high to low bits in the bit string is used as the address. If "1" does not appear in 00000000, the address unit 122 outputs the matching result as {miss, 0}.

[0124] It should be noted that the address of the bit string is read starting from 0, for example, from low to high, the 0th bit of the bit string 00011010 is 0 and the 1st bit is 1.

[0125] The selection unit 143 is connected to the address unit 142, multiple output interfaces, and the control unit 102, and is used to obtain the mapping interface information sent by the control unit 102, and send the matching result to the corresponding output interface based on the mapping interface information.

[0126] Among them, the selection unit 143 includes multiple selectors, such as selector 0, selector 1...selector N-1, the number of selectors in the selection unit 143 is equal to the number of output interfaces, and each selector corresponds to an output interface one by one, for example, selector 0 corresponds to interface 0, and selector 1 corresponds to interface 1. Each selector is connected to all addresses in the address unit 142, for example, selector 0 is connected to addresses 0, 1...S-1, and selector 1 is connected to addresses 0, 1...S-1.

[0127] Specifically, the selection unit 143 sends the matching result to the corresponding output interface according to the mapping interface information INF_MAP.

[0128] In an embodiment of the present application, the number of TCAM units in the TCAM cluster 103 is equal to the number of addresses in the address unit 142, the first matching information 0 output by TCAM0 will be output to address 0, and the first matching information 1 output by TCAM1 will be output to address 1. After the first matching information output by multiple TCAM units is integrated according to the extended matching information, the valid matching information is obtained according to the mapping interface information INF_MAP and input into the address corresponding to the address unit 142.

[0129] For example, see again Figure 7C Also see Fig. 9A , Fig. 9A is an example schematic diagram of a selector of a selection unit mapped to a matching result provided by an embodiment of the present application, such as Figure 7C , Fig. 9A As shown, if the input interface 0 includes two sub-keys, the two sub-keys are respectively mapped to TCAM0 and TCAM1, TCAM0 outputs the first matching information 0, TCAM1 outputs the first matching information 1, and the extended matching information is the extended matching information length, then based on the extended matching information length, the first matching information 0 is integrated into the first matching information 1 to obtain the second matching information 1, and the second matching information 1 includes the first matching information 0 and the first matching information 1, then the matching information corresponding to TCAM1 is the second matching information 1, and TCAM1 corresponds to address 1, then the address 1 in the address unit 142 converts the second matching information 1 into a matching result, and since the second matching information 1 is the matching information requested by the input interface 0, the selector 0 in the selection unit 143 obtains the matching result output by the address 1 in the address unit 142, and the selection unit 143 outputs the obtained matching result to the output interface 0.

[0130] For another example, see Figure 7C Also see Fig. 9B , Fig. 9B is another example schematic diagram of mapping a matching result to a selector of a selection unit provided in an embodiment of the present application, such as Figure 7C , Fig. 9B As shown, if interface 1 includes two sub-keys, the two sub-keys are respectively mapped to TCAM2 and TCAM3, TCAM2 outputs the first matching information 2, TCAM3 outputs the first matching information 3, and the extended matching information is the extended matching information length, then based on the extended matching information length, the first matching information 2 is integrated into the first matching information 3 to obtain the second matching information 3, that is, the matching information corresponding to TCAM3 is the second matching information 3, TCAM3 corresponds to address 3, then the second matching information 3 is converted into a matching result by address 3 in address unit 142, and since the second matching information 3 is the matching information requested by input interface 1, the selector 1 in selection unit 143 obtains the matching result output by address 3 in address unit 142, and selection unit 143 outputs the obtained matching result to output interface 1.

[0131] See also Fig.10 , Fig.10 It is a flowchart of a data processing method provided in an embodiment of the present application.

[0132] The data processing method is applied to a shared processor. Specifically, the execution subject of the data processing method is one or at least two processors of the shared processor.

[0133] like Fig.10 As shown, the data processing method includes:

[0134] Step S1001: Acquire control information of multiple interfaces.

[0135] Among them, the control information ctrl of each interface includes: (1) arbitration interface TCAM_EN, used to specify the enable information of multiple groups of TCAM units; (2) mapping key KEY_MAP, used to determine the association information between the subkey key (i, j) in the interface and S groups of TCAM; (3) extended matching information EXTEND, used to integrate multiple groups of first matching information into second matching information; (4) priority information PRIORITY, used to convert the second matching information into an address; (5) mapping interface information INF_MAP, used to determine the association information between multiple groups of interfaces and multiple groups of addresses.

[0136] In the embodiment of the present application, each interface is used to receive a user's data acquisition request.

[0137] Step S1002: Based on the control information, call the TCAM cluster to obtain a plurality of first matching information corresponding to each interface.

[0138] In the embodiment of the present application, each interface corresponds to a search key, and each search key includes a number of sub-keys.

[0139] In an embodiment of the present application, the control information includes TCAM enabling information, and the TCAM enabling information is used to determine the association relationship between each interface and the TCAM unit.

[0140] Specifically, TCAM enabling information of multiple input interfaces is obtained, and it is determined whether TCAM enabling information corresponding to different input interfaces overlaps. If TCAM enabling information corresponding to different input interfaces overlaps, one of the input interfaces is selected, and if TCAM enabling information corresponding to different input interfaces does not overlap, all input interfaces are selected. If TCAM enabling information corresponding to different input interfaces overlaps, one of the interfaces may be selected according to the order of the acquisition time of control information of each interface.

[0141] Specifically, after the selected interface is determined, a mapping key KEY_MAP is determined, and the mapping key KEY_MAP is used to determine the association information between the sub-keys in the interface and the S groups of TCAM units, wherein one sub-key corresponds to one TCAM unit.

[0142] Specifically, based on the mapping key KEY_MAP, several sub-keys in the search key are sent to the corresponding TCAM unit, and matching information is obtained through the TCAM unit to obtain several first matching information corresponding to each interface.

[0143] Step S1003: Based on the extended matching information, a plurality of first matching information corresponding to each interface is integrated to obtain a matching result corresponding to each interface.

[0144] In the embodiment of the present application, the shared processor includes an address unit and a selection unit.

[0145] The extended matching information is used to extend the length of the matching rule, or to extend the number of matching rules.

[0146] Specifically, according to the extended matching information, a plurality of first matching information are subjected to a bitwise OR operation and / or a bitwise AND operation to obtain a plurality of second matching information to extend the rule length and / or the number of rules.

[0147] Specifically, a bitwise OR operation and a bitwise AND operation are performed on the extended matching information and a plurality of first matching information to obtain the second matching information.

[0148] In the embodiment of the present application, before the first matching information corresponding to each interface is obtained, the specification and number of each TCAM unit need to be determined to determine the number of rules corresponding to each interface and the upper limit of the rule length. For the specific process, please refer to Fig.11 .

[0149] See also Fig.11 , Fig.11 It is a flowchart of determining the number of rules corresponding to each interface and the upper limit of the rule length provided in an embodiment of the present application.

[0150] like Fig.11 As shown, the upper limit of the number of rules and the length of rules corresponding to each interface is determined, including:

[0151] Step S1101: Obtain the number of interfaces, rule length, and rule quantity.

[0152] Step S1102: Determine the number of TCAM units and the specifications of the TCAM units based on the number of interfaces, the rule length, and the number of rules.

[0153] In an embodiment of the present application, the expected data traffic of each interface is pre-evaluated, including the peak traffic and the average traffic, and the amount of TCAM resources required for each interface is estimated based on the peak traffic and the number of interfaces, so that a TCAM unit of corresponding specifications can be called based on the amount of TCAM resources. For example, if the TCAM unit can query 512 streams and the length of each stream is 40 bits, the length of the rules supported by the TCAM unit is s bits (bits), and the number of supported rules is 40.

[0154] Specifically, the number of TCAM units and the specifications of the TCAM units are determined based on the number of interfaces, the rule length, and the number of rules.

[0155] In the embodiment of the present application, the rule length and the number of rules are determined according to specific needs.

[0156] Step S1103: Based on the number of interfaces, the number of TCAM units, and the specifications of the TCAM units, determine an upper limit value of the number of rules corresponding to each interface and an upper limit value of the length of rules corresponding to each interface.

[0157] The number of rules refers to the number of different rules stored in each TCAM unit, and the rule length refers to the number of bits of each rule in each TCAM unit.

[0158] Specifically, based on the number of interfaces, the number of TCAM units, and the specifications of the TCAM units, an upper limit value of the number of rules corresponding to each interface and an upper limit value of the length of the rules corresponding to each interface are determined.

[0159] For example, the number of interfaces is N, the number of TCAM units is S, the specification of the TCAM unit is TCAM (n, s), n is the number of rules of the TCAM unit, s is the rule length of the TCAM unit, then the upper limit of the number of rules corresponding to each interface is D i =S*n, the upper limit value W of the rule length corresponding to each interface i =S*s, where i represents the i-th interface.

[0160] Step S1104: according to the rule length and the number of rules of each interface, a control information table is established for each interface, wherein each interface corresponds to a control information and a search key one by one.

[0161] The control information table includes arbitration interface TCAM_EN, mapping key KEY_MAP, extended matching information EXTEND, priority information PRIORITY, and mapping interface information INF_MAP.

[0162] The extended matching information EXTEND and the priority information PRIORITY are determined by specific requirements.

[0163] For example, it is currently determined that the length of the matching rule supported by each TCAM unit is 2, the number of matching rules supported is 8, and there are 4 TCAM units in total. Currently, a table entry search with a depth of 2 and a length of 32 is required, with high addresses first. The corresponding control information is:

[0164] TCAM_EN-4'b1111; KEY_MAP-key0-TCAM0, key1-TCAM1, key2-TCAM2, key3-TCAM3; EXTEND-3'b000; PRIORITY-high address priority; INF_MAP-interface 0-TCAM3.

[0165] In an embodiment of the present application, the TCAM unit is called according to the needs of each interface, and the combination of different TCAM units is adjusted to adjust the rule length or the number of rules, so that the rule length and the number of rules of each interface are flexibly variable within a certain range, and the resource utilization of the TCAM is improved.

[0166] See also Fig.12 , Fig.12 It is a structural diagram of a data processing system provided in an embodiment of the present application.

[0167] like Fig.12 As shown, the data processing system includes a shared processor 100, multiple input interfaces, and multiple output interfaces, wherein each input interface corresponds one-to-one to an output interface, the shared processor 100 includes a TCAM cluster, the TCAM cluster includes multiple TCAM units, and each input interface corresponds one-to-one to a search key.

[0168] The input interface is used to obtain control information, and the shared processor 100 is used to parse the control information corresponding to the input interface, and send the search key to the TCAM unit based on the parsed control information to obtain first matching information through the TCAM unit. The shared processor 100 integrates multiple first matching information to obtain second matching information, and generates matching results based on the second matching information to output the matching results to multiple output interfaces.

[0169] The shared processor 100 further includes an input management unit, an output management unit, and a control unit. The input management unit includes an interface arbitrator and a key mapping unit, and the output management unit includes a matching information integration unit, an address unit, and a selection unit.

[0170] The control unit is used to parse the control information of multiple input interfaces and transmit the parsed control information to the input management unit and the output management unit, and to dynamically manage the organization of multiple TCAM units.

[0171] The interface arbitrator is connected to the key mapping unit and is used to obtain control information corresponding to multiple input interfaces, and determine the input interface mapped to the TCAM unit based on the control information, and send the search key corresponding to the input interface to the key mapping unit, wherein each of the TCAM units corresponds to a matching key one by one.

[0172] The key mapping unit is connected to the interface arbitrator and the TCAM cluster, and is used to map a number of sub-keys corresponding to each search key to the TCAM units corresponding to the matching key.

[0173] The matching information integration unit is connected to the TCAM cluster and the address unit, and is used to integrate a plurality of first matching information corresponding to each interface according to the extended matching information to obtain a plurality of second matching information.

[0174] The address unit is connected to the matching information integration unit, the selection unit and the control unit, and is used to convert the second matching information into an address according to the priority information to determine a matching result, wherein the matching result includes an address.

[0175] The selection unit is connected with the address unit and the plurality of output interfaces, and is used for obtaining mapping interface information, and sending the matching result to the corresponding output interface based on the mapping interface information.

[0176] In an embodiment of the present application, the TCAM resources corresponding to each interface are flexibly adjusted based on the number of interfaces. When the application scenario changes, for example, interface 0 reduces two TCAM units, while interface 1 and interface 2 each need to add one TCAM unit, the TCAM units released by interface 0 are reallocated to interface 1 and interface 2, which can effectively reduce the waste of TCAM resources.

[0177] Furthermore, by extending the matching information and integrating the matching information output by each TCAM unit, the rule length or the number of rules supported by each group of interfaces can be flexibly changed within a certain range.

[0178] See also Fig.13 , Fig.13 It is a schematic diagram of the structure of another shared processor based on TCAM cluster provided in an embodiment of the present application;

[0179] like Fig.13 As shown, the shared processor 100 based on the TCAM cluster includes one or more processors 105 and a memory 106. Fig.13 A processor 105 is taken as an example.

[0180] The processor 105 and the memory 106 may be connected via a bus or other means. Fig.13 The example of connecting through bus is taken in the following.

[0181] The processor 105 is used to provide computing and control capabilities to control the shared processor 100 based on the TCAM cluster to perform corresponding tasks, for example, to control the shared processor 100 based on the TCAM cluster to perform the data processing method in any one of the above-mentioned method embodiments, the method comprising: obtaining control information of multiple interfaces, wherein the control information comprises extended matching information, based on the control information, calling the TCAM cluster to obtain a plurality of first matching information corresponding to each interface, and based on the extended matching information, integrating the plurality of first matching information corresponding to each interface to obtain a matching result corresponding to each interface.

[0182] The processor 105 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), 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.

[0183] The memory 106, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the data processing method in the embodiment of the present application. The processor 105 can implement the data processing method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 106. Specifically, the memory 106 may include a volatile memory (volatile memory, VM), such as a random access memory (random access memory, RAM); the memory 106 may also include a non-volatile memory (non-volatile memory, NVM), such as a read-only memory (read-only memory, ROM), a flash memory (flash memory), a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD) or other non-transitory solid-state storage devices; the memory 106 may also include a combination of the above types of memories.

[0184] The memory 106 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 106 may optionally include a memory remotely arranged relative to the processor 105, and these remote memories may be connected to the processor 105 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0185] One or more modules are stored in the memory 106, and when executed by one or more processors 105, perform the data processing method in any of the above method embodiments, for example, perform the above described data processing method. Fig.10 The steps shown.

[0186] In an embodiment of the present application, the shared processor 100 based on the TCAM cluster may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The shared processor 100 based on the TCAM cluster may also include other components for realizing device functions, which will not be repeated here.

[0187] The present application also provides a non-volatile computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the data processing method in the above embodiment. For example, the non-volatile computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.

[0188] The present application also provides a computer program product, which includes one or more program codes, which are stored in a non-volatile computer-readable storage medium. The processor of the flash memory device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the method steps of the data processing method provided in the above embodiment.

[0189] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a non-volatile computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0190] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute various embodiments or certain parts of the embodiments.

[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A shared processor based on a TCAM cluster, characterized in that: The shared processor comprises: an input management unit, an output management unit, a control unit and a TCAM cluster, wherein the TCAM cluster comprises a plurality of TCAM units; wherein, The input management unit is connected to a plurality of input interfaces, and is used to receive control information and search keys input by the plurality of input interfaces, and map the search keys to corresponding TCAM units according to the control information; The control unit is used to parse the control information of the plurality of input interfaces and transmit the parsed control information to the input management unit and the output management unit, and to dynamically manage the organization of the plurality of TCAM units; The TCAM unit is connected to the input management unit and the output management unit, and is used to receive the search key input by the input management unit to generate first matching information, and send the first matching information to the output management unit; The output management unit is connected to multiple TCAM units and multiple output interfaces, and is used to integrate the first matching information output by the multiple TCAM units to obtain second matching information, and generate matching results based on the second matching information to output the matching results to multiple output interfaces, wherein the input interfaces and the output interfaces correspond one to one.

2. The shared processor according to claim 1, characterized in that: The input management unit includes an interface arbitrator and a key mapping unit, each of the input interfaces corresponds to a search key, and each of the search keys includes a plurality of sub-keys; The interface arbitrator is connected to the key mapping unit, and is used to obtain control information corresponding to multiple input interfaces, and determine the input interface mapped to the TCAM unit according to the control information, and send the search key corresponding to the input interface to the key mapping unit, wherein each of the TCAM units corresponds to a matching key one by one; The key mapping unit is connected to the interface arbitrator and the TCAM cluster, and is used to map a plurality of sub-keys corresponding to each of the search keys to the TCAM units corresponding to the matching keys.

3. The shared processor according to claim 2, characterized in that: The control information includes TCAM enabling information; The interface arbitrator is specifically used for: When TCAM enable information corresponding to different input interfaces overlaps, one of the input interfaces is selected, and the search key corresponding to the input interface is sent to the key mapping unit; When there is no overlap in TCAM enable information corresponding to different input interfaces, all input interfaces are selected, and the search keys corresponding to all input interfaces are sent to the key mapping unit.

4. The shared processor according to claim 1, characterized in that: The control information includes extended matching information, priority information, and mapping interface information, and the output management unit includes a matching information integration unit, an address unit, and a selection unit; The matching information integration unit is connected to the TCAM cluster and the address unit, and is used to integrate a plurality of first matching information corresponding to each of the interfaces according to the extended matching information to obtain a plurality of second matching information; The address unit is connected to the matching information integration unit and the selection unit, and is used to convert the second matching information into an address according to the priority information to determine the matching result, wherein the matching result includes the address; The selection unit is connected to the address unit and multiple output interfaces, and is used to obtain the mapping interface information and send the matching result to the corresponding output interface based on the mapping interface information.

5. The shared processor according to claim 4, characterized in that: The matching information integration unit is specifically used for: According to the extended matching information, a plurality of first matching information are subjected to a bitwise OR operation and / or a bitwise AND operation to obtain a plurality of second matching information to extend the rule length and / or the number of rules.

6. The shared processor according to claim 4, characterized in that: The priority information includes high address priority or low address priority, the second matching information includes a bit string, and the address unit is specifically used for: When the priority information is high address first, the first sequence number of the bit string with a high level from high to low is used as the address; When the priority information is low address first, the first sequence number of the bit string with a high level from low to high is used as the address.

7. The shared processor according to claim 4, characterized in that: The control information includes a mapping key, and the shared processor includes a control unit connected to the interface arbitrator, the key mapping unit, the matching information integration unit, the address unit, and the selection unit; The control unit is used to obtain the control information corresponding to each of the input interfaces received by the interface arbitrator, and send the mapping key in the control information corresponding to each of the input interfaces to the key mapping unit, send the extended matching information to the matching information integration unit, send the priority information to the address to unit, and send the mapping interface information to the selection unit.

8. A data processing method, characterized in that: The method is applied to a shared processor based on a TCAM cluster as claimed in any one of claims 1 to 7, wherein the shared processor is connected to a plurality of interfaces, and the method comprises: Acquire control information of multiple interfaces, wherein the control information includes extended matching information; Based on the control information, calling the TCAM cluster to obtain a plurality of first matching information corresponding to each of the interfaces; Based on the extended matching information, a plurality of first matching information corresponding to each of the interfaces are integrated to obtain a matching result corresponding to each of the interfaces.

9. The method according to claim 8, characterized in that The method further comprises: Obtain the number of the interfaces, the rule length, and the number of rules; Determine the number of TCAM units and the specifications of the TCAM units based on the number of the interfaces and the rule length and the rule quantity; Based on the number of interfaces, the number of TCAM units, and the specifications of the TCAM units, determine an upper limit value of the number of rules corresponding to each interface and an upper limit value of the rule length corresponding to each interface; According to the rule length and the number of rules of each interface, a control information table is established for each interface, wherein each interface corresponds to a control information and a search key one by one.

10. A data processing system, characterized in that: The system comprises: A shared processor based on a TCAM cluster as described in any one of claims 1 to 7; A plurality of input interfaces and a plurality of output interfaces, wherein the input interfaces and the output interfaces correspond one to one.

Citation Information

Patent Citations

  • TCAM (Ternary Content Addressable Memory) multi-mode character string matching method and device

    CN102253957A

  • Architecture For Tcam Sharing

    CN103970829A

  • TCAM asynchronous moving method based on multiple tasks

    CN115809125A

  • Systems, apparatus, and methods for managing computer workload availability and performance

    US11272013B1