Processing unit and method for updating processing unit

By establishing a second service execution unit and table entry in a pipeline-based network processor, the problem of service suspension during the processing unit update process is solved, and updates without service interruption are achieved, thereby improving user experience and update efficiency.

CN120658701APending Publication Date: 2025-09-16HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410297501.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In a pipelined network processor, pausing during a processing unit update will affect the connected processing units, causing the network processor to be temporarily unavailable during the update process, thus reducing user experience.

Method used

By establishing a second service execution unit and a corresponding second table entry, it is possible to avoid suspending the service during the update process. The matching processor and the action processor are used to obtain context information, create a programmable second service execution unit and table entry, and maintain service continuity.

Benefits of technology

Updating the processing unit without affecting business improves user experience, reduces the impact on business, and improves update efficiency and storage resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658701A_ABST
    Figure CN120658701A_ABST
Patent Text Reader

Abstract

The invention provides a processing unit which is applied to the field of communication. The processing unit comprises a matching processor and an action processor. Before the service execution unit is updated, the processing unit is used for obtaining third context information according to the first context information and the first action type executed by the first service execution unit. The action processor is further configured to create a second business execution unit. And after the service execution unit is updated, the matching processor is used for obtaining second context information, and obtaining a second memory physical address according to the second context information. The second memory physical address corresponds to the second table item. The action processor is further used for obtaining a second action type according to the identifier in the second table item. And the action processor is used for executing a second action type according to the second context information and the second service execution unit to obtain fourth context information. In the application, by establishing the second service execution unit and the corresponding second table item, the service does not need to be paused in the updating process, so that the user experience 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 communications, and in particular to a processing unit and a method for updating the processing unit. Background Art

[0002] A network processor (NP) is a core chip used to perform tasks such as packet forwarding and table entry processing. For example, packet data optical transmission equipment includes a NP. NPs are composed of multiple processor cores. These cores include processing elements (PEs) and co-processors (COPs). NPs generally have two architectures. One is a run-to-complete (RTC) architecture, in which each PE performs similar tasks. The entire processing of a packet is assigned to a single PE, leveraging multiple PEs in parallel to improve processing performance. The other is a pipeline architecture, similar to an industrial production line. Packet forwarding is divided into multiple steps, with each PE handling only one step. Multiple PEs are then serially connected to complete packet forwarding. In a pipeline architecture, updating a processing unit requires stopping the PE from receiving packets. After a delay, when the PE is depleted, the old full instructions in the instruction memory are replaced with the new full instructions, completing the processing unit update.

[0003] However, the suspension of one processing unit will affect the serial processing units, causing the network processor to temporarily stop processing during the update process, thereby reducing the user experience. Summary of the Invention

[0004] The present application provides a processing unit and a method for updating the processing unit. By establishing a second service execution unit and a corresponding second table entry, there is no need to suspend the service during the update process, thereby improving the user experience.

[0005] In a first aspect, the present application provides a processing unit for use in a network processor employing a pipeline architecture. The processing unit includes a matching processor and an action processor. Before updating a service execution unit, the matching processor is used to obtain first context information and obtain a first memory physical address based on the first context information. The first memory physical address corresponds to a first table entry. The action processor is used to obtain a first action type based on an identifier in the first table entry. The first action type points to the first service execution unit. The action processor is used to execute the first action type based on the first context information and the first service execution unit to obtain third context information. The action processor is also used to create a second service execution unit. The second service execution unit is a programmable execution unit. After updating the service execution unit, the matching processor is also used to obtain second context information and obtain a second memory physical address based on the second context information. The second memory physical address corresponds to a second table entry. The action processor is also used to obtain a second action type based on the identifier in the second table entry. The second action type points to the second service execution unit. The action processor is also used to execute a second action type based on the second context information and the second service execution unit to obtain fourth context information.

[0006] In an optional manner of the first aspect, the matching processor is configured to obtain a first memory physical address based on first context information, including: the matching processor is configured to obtain a first service index based on the first context information and a first encryption method, and obtain the first memory physical address based on the first service index and a first address translation table, wherein the first address translation table includes a mapping relationship between the service index and the memory physical address. The action processor is configured to obtain a first action type based on an identifier in a first table entry, including: the action processor is configured to search a first action mapping table based on the identifier in the first table entry to obtain the first action type.

[0007] In an optional manner of the first aspect, the matching processor is used to obtain the second memory physical address based on the second context information, including: the matching processor is used to obtain the second business index based on the second context information and the first encryption method, and obtain the second memory physical address based on the second business index and the first address translation table. The action processor is used to obtain the second action type based on the identifier in the second table item, including: the action processor is used to search the second action mapping table based on the identifier in the second table item to obtain the second action type. In the present application, by establishing the second action mapping table, it is beneficial to improve the efficiency of updating the business execution unit, thereby reducing the impact on the business.

[0008] In an optional embodiment of the first aspect, the matching processor is configured to obtain the second memory physical address based on the second context information, including: the matching processor is configured to obtain a second service index based on the second context information and the first encryption method, and obtain the second memory physical address based on the second service index and a second address translation table. In the present application, establishing the second address translation table is beneficial for improving the efficiency of updating the service execution unit, thereby reducing the impact on the service.

[0009] In an optional embodiment of the first aspect, the matching processor is configured to obtain the second memory physical address based on the second context information, including: the matching processor is configured to obtain the second service index based on the second context information and the second encryption method, and obtain the second memory physical address based on the second service index and the second address translation table. When updating the service execution unit, the encryption method may also need to be updated. Updating the encryption method is beneficial for improving compatibility with new service execution units.

[0010] In an optional manner of the first aspect, the first service execution unit is a programmable execution unit. The action processor is further configured to reclaim storage space of the first service execution unit. By reclaiming storage space of the first service execution unit, storage resources can be saved.

[0011] In an optional manner of the first aspect, the matching processor is further configured to reclaim the instruction space of the first encryption method, the storage space of the first address translation table, and the storage space of the first entry. By reclaiming the above storage space, storage resources can be saved.

[0012] In an optional manner of the first aspect, the action processor is further configured to transmit fourth context information to another processing unit, where the fourth context information includes a synchronization instruction, the synchronization instruction being configured to instruct the other processing unit to replace the service execution unit. Carrying the synchronization instruction in the fourth context facilitates synchronous updating of the service execution unit by multiple processing units, thereby improving service processing reliability.

[0013] A second aspect of the present application provides a network processor. The network processor includes another processing unit and the processing unit described in the first aspect or any one of the first aspects. The processing unit is configured to transmit fourth context information and second context information to the other processing unit. The other processing unit is configured to process the fourth context information and the second context information.

[0014] A third aspect of the present application provides a communication device. The communication device includes a transceiver and the network processor described in the second aspect. The transceiver is configured to receive a first data packet. The first data packet includes second context information. The network processor is configured to process the second context information.

[0015] A fourth aspect of the present application provides a communication system, comprising a transmitting device, a receiving device, another communication device, and the communication device described in the third aspect. The transmitting device is configured to send a first data packet to the receiving device via the communication device and the other communication device. The first data packet includes second context information; the communication device is configured to process the second context information to obtain a second data packet, and then send the second data packet to the other communication device. The other communication device is configured to process the second data packet to obtain a first data packet, and then send the first data packet to the receiving device.

[0016] The fifth aspect of the present application provides a method for updating a processing unit. The method for updating a processing unit is applied to a processing unit, a network processor or a communication device. The following describes the method for updating a processing unit by taking the method for updating a processing unit as an example. The method for updating a processing unit includes the following steps: the processing unit obtains first context information, obtains a first memory physical address according to the first context information, and the first memory physical address corresponds to a first table entry; the processing unit obtains a first action type according to an identifier in the first table entry, and the first action type points to a first business execution unit; the processing unit executes the first action type according to the first context information and the first business execution unit, and obtains third context information; the processing unit creates a second business execution unit, and the second business execution unit is a programmable execution unit; the processing unit obtains second context information, obtains a second memory physical address according to the second context information, and the second memory physical address corresponds to a second table entry; the processing unit obtains a second action type according to the identifier in the second table entry, and the second action type points to the second business execution unit, and executes the second action type according to the second context information and the second business execution unit, and obtains fourth context information.

[0017] In an optional manner of the fifth aspect, the processing unit obtaining the first memory physical address based on the first context information includes: the processing unit obtaining a first service index based on the first context information and the first encryption method, and obtaining the first memory physical address based on the first service index and a first address translation table, wherein the first address translation table includes a mapping relationship between the service index and the memory physical address. The processing unit obtaining the first action type based on the identifier in the first table entry includes: the processing unit searching the first action mapping table based on the identifier in the first table entry to obtain the first action type.

[0018] In an optional manner of the fifth aspect, the processing unit obtaining the second memory physical address based on the second context information includes: the processing unit obtaining a second service index based on the second context information and the first encryption method, and obtaining the second memory physical address based on the second service index and the first address translation table. The processing unit obtaining the second action type based on the identifier in the second table entry includes: the processing unit searching a second action mapping table based on the identifier in the second table entry to obtain the second action type.

[0019] In an optional manner of the fifth aspect, the processing unit obtains the second memory physical address according to the second context information, including: the processing unit obtains the second business index according to the second context information and the first encryption method, and obtains the second memory physical address according to the second business index and the second address conversion table.

[0020] In an optional manner of the fifth aspect, the processing unit obtains the second memory physical address according to the second context information, including: the processing unit obtains the second business index according to the second context information and the second encryption method, and obtains the second memory physical address according to the second business index and the second address conversion table.

[0021] In an optional manner of the fifth aspect, the first service execution unit is a programmable execution unit, and the method for updating the processing unit further includes the following steps: the processing unit reclaims the storage space of the first service execution unit.

[0022] In an optional embodiment of the fifth aspect, the method further includes: the method for updating the processing unit further includes the following steps: the processing unit transmits fourth context information to another processing unit. The fourth context information includes a synchronization instruction. The synchronization instruction is used to instruct the other processing unit to replace the service execution unit.

[0023] A sixth aspect of the present application provides a chip, which includes a processing circuit configured to execute the method described in the fifth aspect or any optional embodiment of the fifth aspect.

[0024] In a seventh aspect, the present application provides a computer-readable storage medium storing instructions. When the instructions are executed by a computer, the method described in the aforementioned fifth aspect or any optional method of the fifth aspect is implemented.

[0025] In an eighth aspect, the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer, the computer executes the method described in the fifth aspect or any optional embodiment of the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of the structure of the processing unit provided in an embodiment of the present application;

[0027] Figure 2 A first structural diagram of a communication device provided in an embodiment of the present application;

[0028] Figure 3 A second structural diagram of a communication device provided in an embodiment of the present application;

[0029] Figure 4A third structural diagram of the communication device provided in an embodiment of the present application;

[0030] Figure 5 A fourth structural diagram of a communication device provided in an embodiment of the present application;

[0031] Figure 6 A schematic diagram of the structure of a network processor provided in an embodiment of the present application;

[0032] Figure 7 A fifth structural diagram of a communication device provided in an embodiment of the present application;

[0033] Figure 8 A sixth structural diagram of a communication device provided in an embodiment of the present application;

[0034] Figure 9 A schematic diagram of the structure of a communication system provided in an embodiment of the present application;

[0035] Figure 10 A first flow chart of a method for updating a processing unit provided in an embodiment of the present application;

[0036] Figure 11 This is a second flowchart of the method for updating a processing unit provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The present application provides a processing unit and a method for updating a processing unit. By establishing a second table entry corresponding to a second service execution unit, it is possible to avoid suspending the service during the update process, thereby improving the user experience. It should be understood that the terms "first", "second", etc. used in this application are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. In addition, for the sake of simplicity and clarity, reference numbers and / or letters are repeated in multiple figures of this application. Repetition does not indicate a strict limiting relationship between various embodiments and / or configurations.

[0038] In the communications field, network processors are core chips used to perform tasks such as packet forwarding and table entry processing. Network processors are composed of multiple processor cores. Network processors generally employ either a parallel processing architecture or a pipeline architecture. In a pipeline architecture, to update a processing unit, the processing unit to be updated must stop receiving packets. After a delay waiting for the processing unit to be drained, the old full instructions in the instruction memory are replaced with new full instructions, completing the update of the processing unit. However, pausing one processing unit can affect the connected processing units, requiring the network processor to temporarily shut down during the update process, which can reduce the user experience.

[0039] To this end, the present application provides a processing unit for use in a network processor employing a pipeline architecture. The processing unit may also be referred to as a match-action (MA) processing unit, a network processing unit (NPU), or a network processing core. Figure 1 This is a schematic diagram of the structure of the processing unit provided in the embodiment of the present application. Figure 1 As shown, the processing unit 100 includes a matching processor 101 and an action processor 102. The matching processor 101 can also be called a matching processing unit. The action processor 102 can also be called an action processing unit. The action processor 102 can be used to execute an action type according to the business execution unit. For example, the instruction space of the instruction memory (IMEM) stores program instructions, and the action processor 102 executes the action type by executing the program instructions. The processing unit 100 provided in the embodiment of the present application can be used to update the business execution unit without suspending the business. The following describes the process of processing the business before the processing unit 100 updates the business execution unit, the update process of the processing unit 100, and the process of processing the business after the processing unit 100 updates the business execution unit.

[0040] Before updating the service execution unit, the matching processor 101 is used to obtain the first context information. For example, the matching processor 101 is used to obtain the first context information in the first data packet. The first data packet can also be called the first service message. The matching processor 101 is used to obtain the first memory physical address based on the first context information. The first memory physical address corresponds to the first table entry. The action processor 102 is used to obtain the first action type based on the identifier in the first table entry. For example, the first action type is to modify the message content or to perform statistics on a specific message. The first action type points to the first service execution unit. The first service execution unit can be a programmable program instruction or a dynamically reconfigurable functional circuit combination or a fully functional hardened circuit. The action processor 102 is used to execute the first action type based on the first context information and the first service execution unit to obtain third context information.

[0041] During the update process, the action processor 102 is used to create a second service execution unit. The second service execution unit is a programmable execution unit. For example, the second service execution unit is a program instruction stored in the instruction space of IMEM. For another example, the second service execution unit is a dynamically reconfigurable functional circuit combination. When the software is running, the interconnection relationship of the functional circuits can be dynamically configured and modified to realize a new function by combining multiple functional circuits. The interconnection parameter configuration is stored in the register / RAM. The processing unit 100 is also used to create a second table entry. It should be understood that the processing unit 100 can be used to update the service execution unit without suspending the service. Therefore, the processing unit 100 can be used to create a second service execution unit and a second table entry in the process of processing the first context information.

[0042] After updating the service execution unit, the matching processor 101 is configured to obtain second context information. For example, the matching processor 101 is configured to obtain the second context information from the second data packet. The matching processor 101 is configured to obtain a second memory physical address based on the second context information. The second memory physical address corresponds to a second table entry. The action processor 102 is configured to obtain a second action type based on the identifier in the second table entry. The second action type points to the second service execution unit. The action processor 102 is further configured to execute the second action type based on the second context information and the second service execution unit to obtain fourth context information.

[0043] In this embodiment of the present application, the second table entry corresponds to the second action type, which points to the second service execution unit. Therefore, the second service execution unit corresponds to the second table entry. By creating the second service execution unit and the corresponding second table entry, there is no need to suspend the service during the update process, thereby improving the user experience.

[0044] Figure 2 This is a first structural diagram of a communication device provided in an embodiment of the present application. Figure 2 As shown, the communication device includes a processing unit and a pooled physical memory 204. The pooled physical memory 204 stores a first table entry and a second table entry. The processing unit includes a matching processor 101 and an action processor 102. The matching processor 101 includes a first encryption unit 201. The first encryption unit 201 is also called a first key unit or a first key unit. The first encryption unit 201 stores one or more service indexes. The action processor 102 includes a first service execution unit 202 and a second service execution unit 203.

[0045] Before updating the service execution unit, the matching processor 101 is configured to obtain first context information and send the first context information to the first encryption unit 201. The first encryption unit 201 is configured to obtain a first service index based on the first context information. That is, the matching processor 101 is configured to obtain the first service index based on the first context information and the first encryption method. The matching processor 101 is configured to search the first address translation table using the first service index to obtain a first memory physical address. The first address translation table includes one or more memory physical addresses. The matching processor 101 is configured to obtain a first table entry from the pooled physical memory 204 using the first memory physical address. The first table entry includes one or more entries. The action processor 102 is configured to search the first action mapping table using the processing unit identifier in the first table entry as an index to obtain a first action type. The first action mapping table stores a mapping relationship between identifiers and action types. The processing unit identifier can be an MA identifier. The first action type points to the first service execution unit 202. The action processor 102 is configured to execute the first action type based on the first context information and the first service execution unit 202 to obtain third context information.

[0046] After updating the service execution unit, the matching processor 101 is configured to obtain second context information and send the second context information to the first encryption unit 201. The first encryption unit 201 is configured to obtain a second service index based on the second context information. That is, the matching processor 101 is configured to obtain the second service index based on the second context information and the first encryption method. The second service index may be the same as or different from the first service index.

[0047] The matching processor 101 is used to search the first address translation table using the second service index to obtain the second memory physical address. The matching processor 101 is used to obtain the second table entry in the pooled physical memory 204 using the second memory physical address. The second table entry includes one or more entries. The action processor 102 is used to search the first action mapping table using the identifier of the processing unit in the second table entry as an index to obtain a second action type. The second action type and the first action type may be the same or different. The second action type points to the second service execution unit 203. The action processor 102 is used to execute the second action type based on the second context information and the second service execution unit 203 to obtain fourth context information.

[0048] Figure 3 A second structural diagram of the communication device provided in an embodiment of the present application. Figure 3 Communication equipment and Figure 2 The communication equipment in is similar. The difference is Figure 3The action processor 102 includes a first action mapping table and a second action mapping table. The action processor 102 is configured to search the second action mapping table using the identifier of the processing unit in the second table item as an index to obtain a second action type.

[0049] exist Figure 3 In the example of , the action processor 102 configures a second action mapping table, and replaces the first action mapping table with the second action mapping table. Similarly, the matching processor 101 may also configure a second address translation table. Figure 4 This is a third structural diagram of the communication device provided in an embodiment of the present application. Figure 4 Communication equipment and Figure 2 The communication equipment in is similar. The difference is Figure 4 The matching processor 101 includes a first address translation table and a second address translation table. The matching processor 101 is configured to search the second address translation table using a second service index to obtain a second memory physical address.

[0050] In actual applications, when the service execution unit is updated, the encryption method may also need to be updated. Figure 5 This is a fourth structural diagram of the communication device provided in an embodiment of the present application. Figure 5 Communication equipment and Figure 4 The communication equipment in is similar. The difference is Figure 5 The matching processor 101 includes a first encryption unit 201 and a second encryption unit 501. The matching processor 101 is configured to obtain second context information and send the second context information to the second encryption unit 501. The second encryption unit 501 is configured to obtain a second service index based on the second context information, that is, the matching processor 101 is configured to obtain the second service index based on the second context information and the second encryption method.

[0051] It should be understood that Figures 2 to 5 These are just a few structural examples of the network processor provided in the embodiments of this application. In practical applications, those skilled in the art can make adaptive modifications to the structure of the network processor according to their needs. Figure 4 and Figure 5 In the example, action processor 102 includes a first action mapping table and a second action mapping table. For another example, those skilled in the art may configure pooled physical memory 204 within matching processor 101. In this case, the network processor includes matching processor 101 and action processor 102, and matching processor 101 includes pooled physical memory 204.

[0052] As can be seen from the previous description, the first service execution unit can be a programmable program instruction. In this case, the first service execution unit can also be referred to as a programmable execution unit. After updating the service execution unit, the action processor 102 can also be used to reclaim the storage space of the first service execution unit. Similarly, the matching processor 101 can also be used to reclaim the instruction space of the first encryption method, the storage space of the first address translation table, and the storage space of the first table entry.

[0053] According to the above description, the network processor of the pipeline architecture includes multiple processing units connected in series. The above example is described by taking the first-level processing unit among the multiple processing units as an example. It should be understood that the method of updating other processing units is similar to the method of updating the first-level processing unit. Therefore, with regard to the content of updating other processing units, reference can be made to the content of updating the first-level processing unit mentioned above. It should be understood that in the example of updating the first-level processing unit, before updating the business execution unit, the first-level processing unit is used to process the first context information; after updating the business execution unit, the first-level processing unit is used to process the second context information. When it is necessary to update other processing units among the multiple processing units, before updating the business execution unit, the other processing units are used to process the context information (e.g., the third context information) and the first context information output by the previous level processing unit; after updating the business execution unit, the other processing units are used to process the context information (e.g., the fourth context information) and the second context information output by the previous level processing unit.

[0054] In practical applications, to ensure that multiple processing units connected in series synchronously update their service execution units, a processing unit is further configured to send a synchronization instruction to the next-level processing unit after updating the service execution unit. For example, the action processor 102 is further configured to transmit fourth context information to another processing unit, where the fourth context information includes a synchronization instruction. The synchronization instruction is used to instruct the other processing unit to replace the service execution unit.

[0055] Figure 6 This is a schematic diagram of the structure of the network processor provided in the embodiment of the present application. Figure 6 As shown, the network processor 600 includes another processing unit 601 and the processing unit 100. For the description of the processing unit 100, reference can be made to the aforementioned Figures 1 to 5Description of any figure. The processing unit 100 is configured to output fourth context information based on the second context information. The processing unit 100 is configured to transmit the fourth context information and the second context information to another processing unit 601. The other processing unit 601 is configured to process the fourth context information and the second context information. For the description of the processing of the fourth context information and the second context information by the other processing unit 601, reference can be made to the description of the processing of the second context information by the aforementioned processing unit 100. The following describes an example application scenario of a network processor. For example, the second context information is context information in a service message of a home or enterprise dedicated line user. Figure 6 The network processor in the multi-service fine-grain optical transport network (MS-FgOTN) device is a network processor. The network processor is set on the Ethernet over OTN (EoO) board. The service message passes through the EoO board and the network processor to complete the second / third layer switching processing. For example, the network processor is used to map the service message to the optical service unit (OSU) pipe. Specifically, the service message is processed by the network processor and carried as the OSU payload on the OSU frame. For example, the network processor is used to decapsulate the service message from the OSU frame and send it to the gateway device after the second / third layer switching processing of the EoO board.

[0056] Figure 7 This is a fifth structural diagram of the communication device provided in the embodiment of the present application. Figure 7 As shown, the communication device includes a network processor 700, a bus 704 and an entry memory. The network processor 700 includes a plurality of processing units connected in series. Figure 7 In the example of FIG, the communication device includes three processing units, namely processing unit 701, processing unit 702 and processing unit 703. The multiple processing units are connected to the table entry memory via bus 704. The table entry memory can be a pooled physical memory. Bus 704 can be a crossbar switch matrix. Any of the multiple processing units can serve as the aforementioned Figures 1 to 5 Therefore, the description of the plurality of processing units can refer to the aforementioned Figures 1 to 5 A description of any graph.

[0057] Figure 8 This is the sixth structural diagram of the communication device provided in the embodiment of the present application. Figure 8As shown, the communication device 800 includes a transceiver 801 and a network processor 802. The transceiver 801 can be an optical transceiver or a wireless radio frequency device. The transceiver 801 is used to receive a first data packet. The first data packet includes second context information. The network processor 802 includes multiple processing units connected in series. The multiple processing units are used to process the second context information. The network processor 802 can refer to the aforementioned Figure 6 Description of network processor 600 in FIG.

[0058] Figure 9 This is a schematic diagram of the structure of the communication system provided in the embodiment of the present application. Figure 9 As shown, communication system 900 includes a transmitting device 901, a receiving device 903, another communication device 902, and a communication device 904. Transmitting device 901 and receiving device 903 are client terminal devices, such as personal hosts, mobile phones, wireless terminals, tablets, servers, or gateway devices. Another communication device 902 and communication device 904 can be devices located in a network such as a wavelength division transmission network, a bearer Ethernet, an optical transport network, a fine-grained optical transport network, or a multi-service fine-grained optical transport network. For example, another communication device 902 and communication device 904 are optical transport network (OTN) devices, routers, or optical line terminals (OLTs). Transmitting device 901 is configured to send a first data packet to receiving device 903 via communication device 904 and another communication device 902. The first data packet includes second context information; communication device 904 is configured to process the second context information to obtain a second data packet and send the second data packet to another communication device 902. Another communication device 902 is used to process the second data packet to obtain the first data packet, and send the first data packet to the receiving device 903. The description of the communication device 904 and the other communication device 902 is similar to the above description of the communication device, the network processor in the communication device, or the processing unit in the network processor. Therefore, the description of the communication device 904 and the other communication device 902 can refer to the above description of the communication device. Figures 1 to 8 A description of any graph.

[0059] Figure 10 This is a first flow chart of a method for updating a processing unit provided in an embodiment of the present application. The method for updating a processing unit can be applied to a processing unit, a network processor, or a communication device. The following describes the method for updating a processing unit by taking the method for updating a processing unit as an example. Figure 10 As shown, the method for updating a processing unit includes the following steps.

[0060] In step 1001, the processing unit obtains first context information, and obtains a first memory physical address according to the first context information, where the first memory physical address corresponds to a first table entry.

[0061] The processing unit obtains first context information. For example, the processing unit obtains the first context information in a first data packet. The processing unit obtains a first service index based on the first context information, that is, the processing unit obtains the first service index based on the first context information and a first encryption method. The processing unit searches a first address translation table using the first service index to obtain a first memory physical address. The first address translation table includes one or more memory physical addresses. The first memory physical address corresponds to a first table entry. The first table entry includes one or more entries.

[0062] In step 1002, the processing unit obtains a first action type according to an identifier in a first table entry.

[0063] The processing unit searches the first action mapping table using the processing unit identifier in the first table entry as an index to obtain a first action type. The first action mapping table stores a mapping relationship between identifiers and action types. The processing unit identifier may be an MA identifier. The first action type points to the first service execution unit.

[0064] In step 1003 , the processing unit executes the first action type according to the first context information and the first service execution unit to obtain third context information.

[0065] In step 1004 , the processing unit creates a second service execution unit and a second table entry, where the second service execution unit is a programmable execution unit.

[0066] The processing unit creates a second service execution unit. The second service execution unit is a programmable execution unit. For example, the second service execution unit is a program instruction stored in the instruction space of IMEM. For another example, the second service execution unit is a dynamically reconfigurable functional circuit combination. The processing unit creates a second table entry. It should be understood that the processing unit can be used to update the service execution unit without suspending the service. Therefore, the processing unit can create the second service execution unit and the second table entry in the process of processing the first context information, that is, there is no strictly defined timing relationship between step 1004 and steps 1001 to 1003.

[0067] In step 1005 , the processing unit obtains second context information, and obtains a second memory physical address according to the second context information, where the second memory physical address corresponds to a second table entry.

[0068] The processing unit obtains second context information. The processing unit obtains a second service index based on the second context information, i.e., the processing unit obtains the second service index based on the second context information and the first encryption method. The processing unit searches the first address translation table using the second service index to obtain a second memory physical address. The second memory physical address corresponds to a second table entry. The second table entry includes one or more entries.

[0069] In step 1006, the processing unit obtains the second action type according to the identifier in the second table entry.

[0070] The processing unit searches the first action mapping table using the identifier of the processing unit in the second entry as an index to obtain a second action type. The second action type points to the second service execution unit. The processing unit executes the second action type based on the second context information and the second service execution unit to obtain fourth context information.

[0071] In step 1007 , the processing unit executes the second action type according to the second context information and the second service execution unit to obtain fourth context information.

[0072] It should be understood that Figure 10 The description of the method for updating the processing unit in Figures 1 to 10 There are similarities in the description of the communication device, the network processor in the communication device, or the processing unit in the network processor in any of the figures. Figure 10 The description of the method for updating the processing unit in Figures 1 to 9 Description of any of the figures. For example, the processing unit obtaining the second memory physical address based on the second context information includes: the processing unit obtaining a second service index based on the second context information and the first encryption method, and obtaining the second memory physical address based on the second service index and the second address translation table. For another example, the first service execution unit is a programmable execution unit, and the method for updating the processing unit further includes the following steps: the processing unit reclaims the storage space of the first service execution unit.

[0073] The foregoing Figures 2 to 5 Several examples of communication devices are provided in Figure 4 Taking the communication device in FIG. 1 as an example, the method for updating the processing unit is described. Figure 11 This is a second flow chart of a method for updating a processing unit provided in an embodiment of the present application. The method for updating a processing unit can be applied to a communication device or a network processor in a communication device. The following describes the method for updating a processing unit by taking the method for updating a processing unit applied to a communication device as an example. Figure 11 As shown, the method for updating a processing unit includes the following steps.

[0074] In step 1101, the communication device sets the table reading of each processing unit to read the original address translation table, and sets the table entry loading and instruction loading to be incomplete.

[0075] The original address translation table refers to the first address translation table. The table reading setting is used to control the matching processor to search the first address translation table or the second address translation table based on the service index. The second address translation table is also called the new address translation table. Table entry loading refers to whether the second table entry has been loaded. The first table entry is also called the original table entry, and the second table entry is also called the new table entry. Instruction loading refers to whether the new service execution unit has been loaded. The first service execution unit is also called the original service execution unit, and the second service execution unit is also called the new service execution unit.

[0076] In step 1102, the data packets of the communication device continue to flow, and the original process is followed according to the above settings.

[0077] Without suspending the data packet flow, the original process is followed according to the setting of step 1101, for example Figure 4 The process of the communication device processing the first context information.

[0078] In step 1103, each processing unit of the communication device loads a new table entry, a new service execution unit, and a new address translation table, refreshes the memory address in the new address translation table to point to the new table entry, and refreshes the action mapping table to point to the new service execution unit.

[0079] Each processing unit in the communication device loads the new table entry. The communication device adds the new table entry to unused or reserved physical memory space. The content of the table entry can be a dynamic data structure that can be flexibly assembled. The action instruction address in the table entry is the program instruction entry of the second service execution unit. Each processing unit in the communication device loads the new service execution unit and the new address translation table. The communication device refreshes the memory address in the new address translation table to point to the new table entry and refreshes the first action mapping table to point to the new service execution unit.

[0080] In step 1104, the communication device sets the table entry loading and instruction loading of each processing unit to be completed, and sets the table reading of the first-level processing unit to read the new address translation table.

[0081] In step 1105, the data packets of the communication device are continuously sent, and the first-level processing unit queries the meter reading settings, switches the service to a new process, and passes it to the subsequent processing unit through a synchronization instruction.

[0082] After step 1104, the communication device reads the new address translation table. Therefore, after receiving the second context information, the communication device will process the service according to the new process, for example Figure 4The communication device processes the second context information. The communication device processes the second context information to obtain fourth context information. The processing unit is further configured to send a synchronization instruction to a next-level processing unit. For example, the fourth context information carries the synchronization instruction. The next-level processing unit, based on the synchronization instruction, sets the table read to read the new address translation table, thereby switching the service to the new process.

[0083] In step 1106, the communication device recycles the original table entry, the original service execution unit, and the original address translation table.

[0084] The above is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the protection scope of the present application.

Claims

1. A processing unit, characterized in that: Includes matching processors and action processors, where: The matching processor is configured to obtain first context information, and obtain a first memory physical address according to the first context information, where the first memory physical address corresponds to a first table entry; The action processor is configured to obtain a first action type according to the identifier in the first table entry, and execute the first action type according to the first context information and the first service execution unit to obtain third context information; The action processor is further configured to create a second service execution unit, wherein the second service execution unit is a programmable execution unit; The matching processor is further configured to obtain second context information, and obtain a second memory physical address according to the second context information, where the second memory physical address corresponds to a second table entry; The action processor is further configured to obtain a second action type according to the identifier in the second table entry, execute the second action type according to the second context information and the second service execution unit, and obtain fourth context information.

2. The processing unit according to claim 1, characterized in that The matching processor is configured to obtain a first memory physical address according to the first context information, comprising: the matching processor is configured to obtain a first service index according to the first context information and a first encryption method, and obtain the first memory physical address according to the first service index and a first address translation table, wherein the first address translation table includes a mapping relationship between the service index and the memory physical address; The action processor is configured to obtain the first action type according to the identifier in the first table entry, including: the action processor is configured to search a first action mapping table according to the identifier in the first table entry to obtain the first action type.

3. The processing unit according to claim 2, characterized in that The matching processor is configured to obtain a second memory physical address according to the second context information, comprising: the matching processor is configured to obtain a second service index according to the second context information and the first encryption method, and obtain the second memory physical address according to the second service index and the first address translation table; The action processor is configured to obtain the second action type according to the identifier in the second table entry, including: the action processor is configured to search a second action mapping table according to the identifier in the second table entry to obtain the second action type.

4. The processing unit according to claim 2, characterized in that The matching processor is used to obtain the second memory physical address according to the second context information, including: the matching processor is used to obtain a second business index according to the second context information and the first encryption method, and obtain the second memory physical address according to the second business index and the second address conversion table.

5. The processing unit according to claim 2, characterized in that The matching processor is used to obtain the second memory physical address according to the second context information, including: the matching processor is used to obtain a second business index according to the second context information and a second encryption method, and obtain the second memory physical address according to the second business index and a second address translation table.

6. The processing unit according to any one of claims 1 to 5, characterized in that The first service execution unit is a programmable execution unit; The action processor is further configured to reclaim the storage space of the first service execution unit.

7. The processing unit according to any one of claims 1 to 6, characterized in that The action processor is further configured to transmit the fourth context information to another processing unit, where the fourth context information includes a synchronization instruction, and the synchronization instruction is configured to instruct the other processing unit to replace the service execution unit.

8. A network processor, characterized in that: comprising another processing unit and the processing unit of any one of claims 1 to 7, wherein: The processing unit is configured to transmit fourth context information and second context information to the other processing unit; The another processing unit is configured to process the fourth context information and the second context information.

9. A communication device, characterized in that: The transceiver and the network processor of claim 8, wherein: The transceiver is configured to receive a first data packet, wherein the first data packet includes second context information; The network processor is configured to process the second context information.

10. A communication system, characterized in that: The device comprises a transmitting end device, a receiving end device, another communication device, and the communication device according to claim 9, wherein: The transmitting end device is configured to send a first data packet to the receiving end device through the communication device and the other communication device, where the first data packet includes second context information; The communication device is configured to process the second context information to obtain a second data packet, and send the second data packet to the other communication device; The other communication device is used to process the second data packet to obtain the first data packet, and send the first data packet to the receiving device.

11. A method for updating a processing unit, characterized in that: include: Obtaining first context information, and obtaining a first memory physical address according to the first context information, where the first memory physical address corresponds to a first table entry; Obtaining a first action type according to the identifier in the first table entry; Executing the first action type according to the first context information and the first service execution unit to obtain third context information; Creating a second service execution unit, where the second service execution unit is a programmable execution unit; Acquire second context information, and obtain a second memory physical address according to the second context information, where the second memory physical address corresponds to a second table entry; Obtaining a second action type according to the identifier in the second table item; The second action type is executed according to the second context information and the second service execution unit to obtain fourth context information.

12. The method for updating a processing unit according to claim 11, wherein: Obtaining the first memory physical address according to the first context information includes: obtaining a first service index according to the first context information and a first encryption method, and obtaining the first memory physical address according to the first service index and a first address translation table, wherein the first address translation table includes a mapping relationship between the service index and the memory physical address; Obtaining the first action type according to the identifier in the first table entry includes: searching a first action mapping table according to the identifier in the first table entry to obtain the first action type.

13. The method for updating a processing unit according to claim 12, wherein: Obtaining the second memory physical address according to the second context information includes: obtaining a second service index according to the second context information and the first encryption method, and obtaining the second memory physical address according to the second service index and the first address translation table; Obtaining the second action type according to the identifier in the second table entry includes: searching a second action mapping table according to the identifier in the second table entry to obtain the second action type.

14. The method for updating a processing unit according to claim 12, wherein: Obtaining the second memory physical address according to the second context information includes: obtaining a second service index according to the second context information and the first encryption method, and obtaining the second memory physical address according to the second service index and a second address translation table.

15. The method for updating a processing unit according to claim 12, wherein: Obtaining the second memory physical address according to the second context information includes: obtaining a second service index according to the second context information and a second encryption method, and obtaining the second memory physical address according to the second service index and a second address translation table.

16. The method for updating a processing unit according to any one of claims 11 to 15, characterized in that: The first service execution unit is a programmable execution unit, and the method further includes: The storage space of the first service execution unit is reclaimed.

17. The method for updating a processing unit according to any one of claims 11 to 16, characterized in that: The method further comprises: The fourth context information is transmitted to another processing unit, where the fourth context information includes a synchronization instruction, and the synchronization instruction is used to instruct the other processing unit to replace the service execution unit.