TCAM table item dynamic updating method and query circuit, electronic equipment and storage medium
By prioritizing the processing of message query requests in the TCAM table entry query circuit to complete the table entry KEY comparison and update, the problem of TCAM table entry cannot be dynamically updated is solved, and the working efficiency and performance of the message forwarding chip is improved.
Patent Information
- Application Number
- CN202411820856.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-28
AI Technical Summary
The TCAM table entry cannot be updated dynamically, resulting in the impact of the working efficiency and performance of the message forwarding chip.
When obtaining software update requests and message query requests at the same time, priority will be given to processing the message query requests, reading the contents of the table entry KEY memory for comparison, and writing the new table entry KEY and contents after completion of the comparison.
It realizes that the software update request is completed without interrupting the message query request, thereby dynamically updating the TCAM table entry, solving the problem of not being able to update dynamically.
Smart Images

Figure CN119719432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of circuit control technology, and in particular to a TCAM table entry dynamic update method and query circuit, electronic device and storage medium. Background Art
[0002] The TCAM table query circuit generally consists of three parts: control circuit, TCAM IP and MEMORY. The functions of each part are described as follows:
[0003] The control circuit is responsible for the read and write process control of TCAM IP and MEMORY.
[0004] TCAM IP, responsible for storing table entry KEY.
[0005] MEMORY, responsible for storing table entry contents.
[0006] The TCAM table entry query during normal operation requires a read operation on the TCAM IP and MEMORY, and the table entry update request initiated by the software requires a write operation on the TCAM IP and MEMORY. In terms of the functional characteristics of the two circuits of TCAM IP and MEMORY, it is impossible to support simultaneous read and write operations. After the chip completes initialization and normal operation, the software operation cannot sense whether there is a forwarding message using the TCAM table entry query function, that is, the software update request and the forwarding message query request may occur at the same time. In addition, since the forwarding message query TCAM process has timing requirements in terms of function, it cannot be interrupted. Therefore, the software update request in the related technology will conflict with the forwarding message query request, resulting in the inability to dynamically update the TCAM table entry, thereby affecting the working efficiency and performance of the message forwarding chip.
[0007] It can be seen that there is a problem in the related art that TCAM table entries cannot be updated dynamically. Summary of the invention
[0008] The present application provides a TCAM table entry dynamic update method and query circuit, electronic device and storage medium, so as to at least solve the problem that TCAM table entries cannot be dynamically updated in the related art.
[0009] According to one aspect of an embodiment of the present application, a method for dynamically updating a TCAM table entry is provided, including:
[0010] In the case of simultaneously acquiring a software update request and a message query request, reading the content of the table entry KEY memory in response to the message query request, and performing a table entry KEY comparison;
[0011] When the comparison of the table entry KEY is completed, writing the new table entry KEY corresponding to the software update request into the table entry KEY storage;
[0012] Reading the table entry content in the table entry content memory according to the hit flag bit after the table entry KEY is compared;
[0013] After the entry content is read, the new entry content corresponding to the software update request is written into the entry content memory.
[0014] Optionally, as in the aforementioned method, the method further comprises:
[0015] Obtaining the new entry KEY and the content of the new entry to be updated by the software update request;
[0016] Temporarily storing the new entry KEY and the new entry content in a register;
[0017] The step of writing the new table entry KEY corresponding to the software update request into the table entry KEY memory upon completion of the table entry KEY comparison comprises: writing the new table entry KEY in the register into the table entry KEY memory upon completion of the table entry KEY comparison;
[0018] After completing the reading of the table entry content, writing the new table entry content corresponding to the software update request into the table entry content memory includes: after completing the reading of the table entry content, writing the new table entry content in the register into the table entry content memory.
[0019] Optionally, as in the aforementioned method, according to the hit flag bit after the table entry KEY is compared, reading the table entry content in the table entry content memory includes:
[0020] When it is determined that the table entry to be updated by the software update request and the table entry to be queried by the message query request are both target table entries, the new table entry content is obtained from the register.
[0021] Optionally, as in the aforementioned method, the method further comprises:
[0022] The message query result obtained by reading the table entry content is sent to the next destination corresponding to the message query request.
[0023] According to another aspect of the embodiment of the present application, a TCAM table entry query circuit is also provided, including: a table entry KEY controller, a table entry content controller, a table entry KEY memory, and a table entry content memory;
[0024] When the table entry KEY controller obtains the software update request and the message query request at the same time, it reads the content of the table entry KEY memory in response to the message query request and performs table entry KEY comparison;
[0025] The table entry KEY controller writes the new table entry KEY corresponding to the software update request into the table entry KEY memory when the table entry KEY comparison is completed;
[0026] The table entry content controller reads the table entry content from the table entry content memory according to the hit flag bit after the table entry KEY is compared;
[0027] After completing the reading of the entry content, the entry content controller writes the new entry content corresponding to the software update request into the entry content memory.
[0028] Optionally, the TCAM table entry query circuit as described above further includes: a register;
[0029] The register obtains the new table entry KEY and the new table entry content to be updated by the software update request, and temporarily stores the new table entry KEY and the new table entry content;
[0030] The table entry KEY controller writes the new table entry KEY in the register into the table entry KEY memory when the table entry KEY comparison is completed;
[0031] After completing the reading of the table entry content, the table entry content controller writes the new table entry content in the register into the table entry content memory.
[0032] Optionally, as in the aforementioned TCAM table entry query circuit, the table entry content controller is further used for:
[0033] When it is determined that the table entry to be updated by the software update request and the table entry to be queried by the message query request are both target table entries, the new table entry content is obtained from the register.
[0034] Optionally, as in the aforementioned TCAM table entry query circuit, the table entry content controller is further used for:
[0035] The message query result obtained by reading the table entry content is sent to the next destination corresponding to the message query request.
[0036] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0037] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0038] In the embodiment of the present application, a TCAM table entry dynamic update method and a query circuit, an electronic device and a storage medium are adopted, and the dynamic update method includes: when a software update request and a message query request are obtained at the same time, the content of the table entry KEY memory is read in response to the message query request, and the table entry KEY comparison is performed; when the table entry KEY comparison is completed, the new table entry KEY corresponding to the software update request is written into the table entry KEY memory; according to the flag bit hit after the table entry KEY comparison, the table entry content is read in the table entry content memory; after the table entry content is read, the new table entry content corresponding to the software update request is written into the table entry content memory. Since in the case of obtaining the software update request and the message query request, by making the message query request be processed before the software update request, the processing of the software update request can be completed without interrupting the message query request, thereby achieving the purpose of dynamic updating of the TCAM table entry, thereby solving the problem that the dynamic updating of the TCAM table entry cannot be achieved in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 is a schematic diagram of a hardware environment of an optional TCAM table entry dynamic update method according to an embodiment of the present application;
[0042] Figure 2It is a flowchart of an optional TCAM table entry dynamic update method according to an embodiment of the present application;
[0043] Figure 3 It is a flowchart of an optional TCAM table entry dynamic update method according to an application example of the present application;
[0044] Figure 4 is a schematic diagram of an optional TCAM table entry query circuit according to an embodiment of the present application;
[0045] Figure 5 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] In the related art, when performing a message query, the control circuit will first read the TCAM IP content and perform a table entry KEY comparison; if the table entry KEY matches, the table entry content stored in the corresponding MEMORY is read. Because message processing is generally continuous, the TCAM table entry query process is required not to be interrupted, and the query results need to be returned within the specified timing. In addition, according to the requirements of the chip application scenario, the software will request to update the existing table entry or write a new table entry for forwarding message query during normal operation. In the related art, the software will initiate a TCAM table entry update request, and the control circuit needs to write the new table entry KEY and table entry content to the TCAM IP and MEMORY respectively. It can be seen that the TCAM table entry query during normal operation requires a read operation on the TCAMIP and MEMORY, and the table entry update request initiated by the software requires a write operation on the TCAM IP and MEMORY. In addition, due to the functional characteristics of the two circuits of TCAM IP and MEMORY, it is impossible to support simultaneous read and write operations. Moreover, after the chip completes initialization and normal operation, the software operation cannot sense whether there is a forwarding message using the TCAM table entry query function, that is, the software update request and the forwarding message query request may occur at the same time. Functionally, the forwarding message query TCAM process has a timing requirement and cannot be interrupted. Therefore, the software update request will conflict with the forwarding message query request, resulting in the inability to dynamically update the TCAM table entry, thereby affecting the working efficiency and performance of the message forwarding chip.
[0049] In order to overcome the problems existing in the above-mentioned related technologies, according to one aspect of an embodiment of the present application, a method for dynamically updating TCAM table entries is provided. As an optional implementation, in this embodiment, the above-mentioned method for dynamically updating TCAM table entries can be applied to Figure 1 In the hardware environment composed of terminal 1402 and server 1404 shown in FIG. Figure 1 As shown, server 1404 is connected to terminal 1402 via a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 1404.
[0050] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.
[0051] The TCAM table entry dynamic update method of the embodiment of the present application can be executed by a server, a terminal, or a server and a terminal together. The terminal can also execute the TCAM table entry dynamic update method of the embodiment of the present application by a client installed thereon.
[0052] Taking the method for dynamically updating TCAM entries in this embodiment executed by a terminal as an example, Figure 2 A method for dynamically updating TCAM entries provided in an embodiment of the present application includes the following steps:
[0053] Step S202: when a software update request and a message query request are obtained at the same time, the content of the table entry KEY memory is read in response to the message query request to perform table entry KEY comparison.
[0054] The method for dynamically updating TCAM table entries in this embodiment can be applied to the scenario where TCAM table entries are updated during the normal operation of the chip.
[0055] The message query request may be a request for querying a TCAM table entry during a message forwarding process. The software update request may be a request for updating an existing table entry or writing a new table entry for querying a forwarded message during normal operation according to the chip application scenario requirements. In this embodiment, the software update request and the message query request are obtained at the same time.
[0056] When a software update request and a message query request are obtained at the same time, in this embodiment, the message query request is first responded to to read the contents of the table entry KEY memory. For example, after receiving the message query request, the TCAM IP controller performs a TCAM read operation on the TCAM IP (i.e., the table entry KEY memory) used to store the table entry KEY at a specific time (e.g., time 2), and compares the query KEY in the message query request with the KEY in the TCAM table entry stored in the TCAM IP to perform a table entry KEY comparison.
[0057] Step S204: When the comparison of the table entry KEY is completed, the new table entry KEY corresponding to the software update request is written into the table entry KEY storage.
[0058] After the comparison of the table entry KEY is completed, the new table entry KEY in the software update request can be written into the table entry KEY memory in response to the aforementioned software update request, so that the reading and writing of the table entry KEY memory will not be performed at the same time.
[0059] Step S206, reading the table entry content from the table entry content memory according to the hit flag bit after the table entry KEY is compared.
[0060] The table entry KEY comparison has been performed in the aforementioned step S202, and further, if there is a matching table entry, the table entry KEY memory will return a hit flag (Hit Flag), for example: if the flag is hit, the table entry KEY memory will return 1 (indicating that a match is found), and then the next step can be performed; further, if the flag is not hit, the table entry KEY memory will return 0 (indicating that no match is found), and then the corresponding processing measures described below can be taken, such as discarding the message or performing default processing.
[0061] According to the hit flag, the table entry content controller can read the table entry content from the associated table entry content memory according to the hit flag. Optionally, the table entry content may include forwarding actions, priority information, etc., which are used for subsequent message processing. Further, the table entry content memory can process the message according to the read table entry content, such as forwarding to a specified port, modifying the message header information, etc.
[0062] As an optional implementation, as in the above method, the method further includes: sending the message query result obtained by reading the table content to the next destination corresponding to the message query request. Optionally, the table content storage can send the message query result to the next destination after obtaining the message query result.
[0063] Step S208: After the entry content is read, the new entry content corresponding to the software update request is written into the entry content storage.
[0064] Specifically, after the reading of the table item content is completed, the new table item content in the software update request can be obtained, and the new table item content can be written into the table item content memory through the table item content controller. Since the operation of writing the new table item content into the table item content memory is performed without interrupting the message processing (i.e., after the reading of the table item content is completed), the continuous operation of the chip is ensured.
[0065] In the embodiment of the present application, since when a software update request and a message query request are obtained, the message query request is processed before the software update request, the processing of the software update request can be completed without interrupting the message query request, thereby achieving the purpose of dynamic update of TCAM table entries, thereby solving the problem of being unable to achieve dynamic update of TCAM table entries in related technologies.
[0066] As an optional implementation, as in the aforementioned method, the method further includes the following steps: obtaining the new table item KEY and the new table item content to be updated by the software update request; temporarily storing the new table item KEY and the new table item content in the register. Before executing step S204, the register may parse the received software update request to extract the new table item KEY and the new table item content to be updated. Optionally, the new table item KEY and the new table item content may be transmitted in the form of structured data, such as JSON or binary format. Furthermore, before temporarily storing the new table item KEY and the new table item content in the register, the register may verify the software update request in advance to ensure the legality and integrity of the software update request. The verification process may include but is not limited to: checking the format of the table item KEY, the validity of the content, and authority verification. When the software update request is verified, the new table item KEY and the new table item content may be temporarily stored in the register. Furthermore, the selection of the register may be configured according to actual needs, such as using a general register or a dedicated register.
[0067] When the comparison of the table entry KEY is completed, the new table entry KEY corresponding to the software update request is written into the table entry KEY memory, including: when the comparison of the table entry KEY is completed, the new table entry KEY in the register is written into the table entry KEY memory. That is, after the comparison of the table entry KEY is completed, the new table entry KEY temporarily stored in the register in the above method is written into the table entry KEY memory.
[0068] After the table item content is read, the new table item content corresponding to the software update request is written into the table item content memory, including: after the table item content is read, the new table item content in the register is written into the table item content memory. That is, after the table item content is read, the new table item content temporarily stored in the register in the above method is written into the table item content memory.
[0069] Through the method of this embodiment, by storing the new table item KEY and the new table item content corresponding to the software update request in the register, since the register is a high-speed storage device in the CPU, the access speed is very fast. Temporarily storing the software update request in the register can quickly respond to subsequent update operations, avoiding the delay of reading data from the memory or other low-speed storage devices; and, compared with storing the new table item KEY and the new table item content in the main memory (such as RAM), it can avoid frequent reading and writing of data from the main memory, which will occupy a large amount of memory bandwidth and affect the overall performance of the system, thereby reducing the access to the main memory, thereby reducing the occupation of memory bandwidth.
[0070] As an optional implementation, as in the aforementioned method, according to the flag bit hit after the table item KEY comparison, the table item content is read in the table item content memory, including: when it is determined that the table item to be updated by the software update request and the table item to be queried by the message query request are both target table items, the new table item content is obtained from the register. In other words, when it is determined that the table item to be updated by the software update request is the same as the table item to be queried by the message query request, and both are target table items, since the table item to be updated by the software update request is stored in the register, the table item content can be directly read from the register to obtain the new table item content. This can solve the problem that the software dynamically updates the existing table items, but the message still uses the old table items.
[0071] like Figure 3 As shown, an application example of applying any of the above embodiments is provided:
[0072] Moment 1 in the above figure is a scenario where the software update request and the message query request conflict at the same time. In this case, the message query request takes priority, and at moment 2, a TCAM read operation is performed in response to the message query request to compare the table entry KEY. At the idle time of moment 3, in response to the software update request, the new table entry KEY is written into the TCAM (i.e., the table entry KEY memory). At moment 6, the comparison of the table entry KEY is completed, and according to the hit flag, the MEMORY table entry content is read from the table entry content memory at moment 7. At the idle time of moment 8, the new table entry content in the software update request is written into the MEMORY (i.e., the table entry content memory). At moment 11, the message query result is returned to other module circuits (i.e., the next destination).
[0073] If the software update request and the message query request are operations on the same table entry, the MEMORY table entry content read out at time 7 will be replaced by the new table entry data to be written at time 8, and return will be made at time 11.
[0074] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0076] According to another aspect of an embodiment of the present application, a TCAM table entry query circuit for implementing the above-mentioned TCAM table entry dynamic update method is also provided. Figure 4 is a structural block diagram of an optional TCAM table entry query circuit according to an embodiment of the present application, such as Figure 4 As shown, the circuit may include: a table entry KEY controller 41, a table entry content controller 42, a table entry KEY memory 43 and a table entry content memory 44;
[0077] When the table entry KEY controller 41 obtains the software update request and the message query request at the same time, it reads the content of the table entry KEY memory 43 in response to the message query request and performs table entry KEY comparison;
[0078] When the table entry KEY comparison is completed, the table entry KEY controller 41 writes the new table entry KEY corresponding to the software update request into the table entry KEY storage 43;
[0079] The table entry content controller 42 reads the table entry content from the table entry content memory 44 according to the hit flag bit after comparing the table entry KEY;
[0080] After completing the reading of the entry content, the entry content controller 42 writes the new entry content corresponding to the software update request into the entry content memory 44 .
[0081] It should be noted that the table entry KEY controller 41 in this embodiment can be used to execute the above steps S202 and S204, and the table entry content controller 42 in this embodiment can be used to execute the above steps S206 and S208.
[0082] As an optional implementation, the TCAM table entry query circuit as described above further includes: a register 45;
[0083] The register 45 obtains the new table entry KEY and the new table entry content to be updated by the software update request, and temporarily stores the new table entry KEY and the new table entry content;
[0084] When the table entry KEY comparison is completed, the table entry KEY controller 41 writes the new table entry KEY in the register into the table entry KEY memory 43;
[0085] After completing the reading of the entry content, the entry content controller 42 writes the new entry content in the register into the entry content memory 44 .
[0086] As an optional implementation, such as the aforementioned TCAM table entry query circuit, the table entry content controller 32 is further used for:
[0087] When it is determined that the table entry to be updated by the software update request and the table entry to be queried by the message query request are both target table entries, the content of the new table entry is obtained from the register.
[0088] As an optional implementation, such as the aforementioned TCAM table entry query circuit, the table entry content controller 42 is further used for:
[0089] The message query result obtained by reading the table entry content is sent to the next destination corresponding to the message query request.
[0090] The table entry KEY controller 41, table entry content controller 42, table entry KEY memory 43, table entry content memory 44 and register 45 in the device in this embodiment, in addition to implementing the methods corresponding to the above steps, may also include a module for executing any method in any of the embodiments of the TCAM table entry dynamic update method described above.
[0091] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0092] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned TCAM table entry dynamic update method is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0093] According to another embodiment of the present application, there is also provided an electronic device, including: Figure 5As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0094] Memory 1503, used for storing computer programs;
[0095] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:
[0096] Step S202: when a software update request and a message query request are obtained at the same time, the content of the table entry KEY memory is read in response to the message query request to perform table entry KEY comparison.
[0097] Step S204: When the comparison of the table entry KEY is completed, the new table entry KEY corresponding to the software update request is written into the table entry KEY storage.
[0098] Step S206, reading the table entry content from the table entry content memory according to the hit flag bit after the table entry KEY is compared.
[0099] Step S208: After the entry content is read, the new entry content corresponding to the software update request is written into the entry content storage.
[0100] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0101] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0102] As an example, the memory 1503 may include but is not limited to the module units for implementing the steps S202 to S208. In addition, it may also include but is not limited to other module units for implementing the TCAM table entry dynamic update method, which will not be described in detail in this example.
[0103] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0104] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.
[0105] Optionally, in this embodiment, the storage medium may include but is not limited to: a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0106] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0107] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0108] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0109] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0110] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0111] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0112] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for dynamically updating TCAM entries, characterized in that: include: In the case of simultaneously acquiring a software update request and a message query request, reading the content of the table entry KEY memory in response to the message query request, and performing a table entry KEY comparison; When the comparison of the table entry KEY is completed, writing the new table entry KEY corresponding to the software update request into the table entry KEY storage; Reading the table entry content in the table entry content memory according to the hit flag bit after the table entry KEY is compared; After the entry content is read, the new entry content corresponding to the software update request is written into the entry content memory.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining the new entry KEY and the content of the new entry to be updated by the software update request; Temporarily storing the new entry KEY and the new entry content in a register; The step of writing the new table entry KEY corresponding to the software update request into the table entry KEY memory upon completion of the table entry KEY comparison comprises: writing the new table entry KEY in the register into the table entry KEY memory upon completion of the table entry KEY comparison; After completing the reading of the table entry content, writing the new table entry content corresponding to the software update request into the table entry content memory includes: after completing the reading of the table entry content, writing the new table entry content in the register into the table entry content memory.
3. The method according to claim 2, characterized in that According to the hit flag bit after the comparison of the table entry KEY, the table entry content is read in the table entry content memory, including: When it is determined that the table entry to be updated by the software update request and the table entry to be queried by the message query request are both target table entries, the new table entry content is obtained from the register.
4. The method according to claim 1, characterized in that: The method further comprises: The message query result obtained by reading the table entry content is sent to the next destination corresponding to the message query request.
5. A TCAM table entry query circuit, characterized in that: include: An entry KEY controller, an entry content controller, an entry KEY memory, and an entry content memory; When the table entry KEY controller obtains the software update request and the message query request at the same time, it reads the content of the table entry KEY memory in response to the message query request and performs table entry KEY comparison; The table entry KEY controller writes the new table entry KEY corresponding to the software update request into the table entry KEY memory when the table entry KEY comparison is completed; The table entry content controller reads the table entry content from the table entry content memory according to the hit flag bit after the table entry KEY is compared; After completing the reading of the entry content, the entry content controller writes the new entry content corresponding to the software update request into the entry content memory.
6. The TCAM table entry query circuit according to claim 5, characterized in that: Also includes: register; The register obtains the new table entry KEY and the new table entry content to be updated by the software update request, and temporarily stores the new table entry KEY and the new table entry content; The table entry KEY controller writes the new table entry KEY in the register into the table entry KEY memory when the table entry KEY comparison is completed; After completing the reading of the table entry content, the table entry content controller writes the new table entry content in the register into the table entry content memory.
7. The TCAM table entry query circuit according to claim 6, characterized in that: The table item content controller is also used for: When it is determined that the table entry to be updated by the software update request and the table entry to be queried by the message query request are both target table entries, the new table entry content is obtained from the register.
8. The TCAM table entry query circuit according to claim 5, characterized in that: The table item content controller is also used for: The message query result obtained by reading the table entry content is sent to the next destination corresponding to the message query request.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 4 by running the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.