A method and device for upgrading microcode

By dividing the main and backup instruction spaces in the online card forwarding chip, loading the microcode version upgrade information in the backup instruction space, the business forwarding interruption caused by the upgrade of the microcode version in the existing technology is solved, and the business forwarding efficiency is improved.

CN112199100BActive Publication Date: 2025-02-25ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910611232.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-08
Publication Date
2025-02-25
Estimated Expiration
2039-07-08

AI Technical Summary

Technical Problem

When upgrading the microcode version in the existing technology, it is necessary to delete the original microcode version information and load the upgrade information, resulting in interruption of business forwarding and affecting efficiency.

Method used

By pre-dividing the main command space and backup command space in the online card forwarding chip, the microcode version upgrade information is loaded in the backup command space, and switched from the main command space to the backup command space to avoid interruption.

Benefits of technology

It realizes the avoidance of service forwarding interruption during the microcode version upgrade process, and improves the efficiency of service forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112199100B_ABST
    Figure CN112199100B_ABST
Patent Text Reader

Abstract

This article discloses a microcode upgrade method and device, including: a line card forwarding chip receives microcode version upgrade information from a line card control chip; loads microcode version upgrade information in a backup instruction space; switches from a main instruction space to a backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the instruction space used for loading microcode version information in the line card forwarding chip. The present application can load microcode version upgrade information in the backup instruction space and forward services in the main instruction space, thereby realizing the synchronization of loading microcode version upgrade information and normal service forwarding, thereby improving the forwarding efficiency of services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and more particularly to a method and device for upgrading a microcode. Background Art

[0002] The upgrade of line card microcode includes two aspects: one is the upgrade of microcode version, and the other is the recalculation and distribution of forwarding table entries corresponding to the microcode version. Both of these aspects involve the line card forwarding chip and the line card control chip.

[0003] In the related art, when upgrading the microcode version, the line card control chip obtains the microcode version upgrade information, and then sends the microcode version upgrade information to the line card forwarding chip, which loads the microcode version upgrade information into its own instruction space.

[0004] However, this method deletes the original microcode version information and then loads the microcode version upgrade information. Since reloading the information takes time, service forwarding will be interrupted. Summary of the invention

[0005] The embodiment of the present invention provides a microcode upgrade method, which can avoid service forwarding interruption caused by loading microcode version upgrade information and improve service forwarding efficiency.

[0006] An embodiment of the present invention provides a microcode upgrade method, comprising:

[0007] The line card forwarding chip receives microcode version upgrade information from the line card control chip;

[0008] The line card forwarding chip loads the microcode version upgrade information in the standby instruction space;

[0009] The line card forwarding chip switches from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the instruction space of the line card forwarding chip for loading microcode version information.

[0010] An embodiment of the present invention provides a microcode upgrade method, comprising:

[0011] The line card control chip obtains microcode version upgrade information;

[0012] The line card control chip sends the microcode version upgrade information to the line card forwarding chip, so that the line card forwarding chip loads the microcode version upgrade information in the backup instruction space and switches from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the line card forwarding chip's instruction space for loading microcode version information.

[0013] An embodiment of the present invention further provides a line card, including:

[0014] Line card control chip and line card forwarding chip;

[0015] The line card control chip is used to obtain microcode version upgrade information and send the microcode version upgrade information to the line card forwarding chip;

[0016] The line card forwarding chip is used to receive microcode version upgrade information from the line card control chip; load the microcode version upgrade information in the backup instruction space; switch from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the line card forwarding chip's instruction space for loading microcode version information.

[0017] Since the microcode version upgrade information is loaded in the standby instruction space, the microcode version in the main instruction space can perform business forwarding normally, thereby avoiding business forwarding interruption caused by loading the microcode version upgrade information and improving business forwarding efficiency.

[0018] Other features and advantages of the embodiments of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purposes and other advantages of the embodiments of the present invention can be achieved and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide a further understanding of the technical solutions of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solutions of the embodiments of the present invention and do not constitute a limitation on the technical solutions of the embodiments of the present invention.

[0020] Figure 1 A schematic diagram of a flow chart of a microcode upgrade method provided by an embodiment of the present invention;

[0021] Figure 2 A schematic flow chart of another microcode upgrade method provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of the structure of a line card forwarding chip provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of a line card control chip provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of a line card provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of the structure of a storage space for storing forwarding table entries in a line card forwarding chip provided by an embodiment of the present invention;

[0026] Figure 7 A schematic diagram of the structure of a storage space for storing forwarding table entries in another line card forwarding chip provided in an embodiment of the present invention;

[0027] Figure 8 A schematic diagram of the structure of a storage space for storing forwarding table entries in another line card forwarding chip provided in an embodiment of the present invention;

[0028] Fig. 9 A schematic diagram of the structure of a storage space for storing forwarding table entries in another line card forwarding chip provided in an embodiment of the present invention;

[0029] Fig.10 A schematic diagram of a structure for performing entry compatibility using reserved fields is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0031] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.

[0032] The embodiment of the present invention provides a method for upgrading a microcode, such as Figure 1 As shown, including:

[0033] Step 101: The line card forwarding chip receives microcode version upgrade information from the line card control chip.

[0034] Step 102: The line card forwarding chip loads microcode version upgrade information in the standby instruction space.

[0035] Step 103: The line card forwarding chip switches from the primary instruction space to the backup instruction space.

[0036] The main instruction space and the backup instruction space are obtained by pre-dividing the instruction space in the line card forwarding chip for loading microcode version information.

[0037] In an exemplary embodiment, there will be a momentary service interruption when switching instruction spaces, but the interruption time is very short compared to the time required to reload the microcode version upgrade information.

[0038] In an exemplary embodiment, the line card forwarding chip divides its instruction space for loading microcode version information into halves to obtain a main instruction space and a backup instruction space of the same size.

[0039] In an exemplary embodiment, after the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes:

[0040] First, the line card forwarding chip receives the target forwarding table entry from the line card control chip.

[0041] The target forwarding table entry is a forwarding table entry obtained by calculation and having entry content different from that of an existing forwarding table entry.

[0042] Secondly, the line card forwarding chip stores the target forwarding table entry.

[0043] In an exemplary embodiment, the related technology is often that the line card control chip recalculates all forwarding table items, and then sends all calculated forwarding table items to the line card forwarding chip, and the line card forwarding chip performs a complete refresh (i.e., the recalculated forwarding table items replace all existing forwarding table items). However, in most cases, only a few forwarding table items have changed, so refreshing all forwarding table items will cause a waste of resources and cause business interruption during the refresh process. In contrast, the microcode upgrade method provided in the embodiment of the present invention only saves the forwarding table items whose table items have changed, and then when the microcode version information is loaded, only the saved forwarding table items can be refreshed instead of refreshing all forwarding table items, thereby greatly shortening the refresh time of the forwarding table items.

[0044] In an exemplary embodiment, the forwarding table entries recalculated by the line card control chip correspond one-to-one to the existing forwarding objects.

[0045] In an exemplary instance, since the line card forwarding chip receives and stores the target forwarding table entry with changed content from the line card control chip, and does not delete the existing forwarding table entry corresponding to the target forwarding table entry, business forwarding can be performed before switching to the upgraded microcode version, and business forwarding can also be performed after switching to the upgraded microcode version.

[0046] In an exemplary embodiment, after the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes:

[0047] First, the line card forwarding chip receives the compatible forwarding table entries and the incompatible forwarding table entries from the line card control chip.

[0048] Among them, the forwarding table items that have been processed for compatibility are forwarding table items that are obtained by compatibility processing from existing forwarding table items and are compatible with the calculated forwarding table items when the table item content of the calculated forwarding table items is different from that of existing forwarding table items, and the forwarding table items that cannot be compatible are forwarding table items that are obtained by compatibility processing from existing forwarding table items and are different from those of existing forwarding table items, and cannot be compatible with the calculated forwarding table items after compatibility processing from existing forwarding table items.

[0049] In an exemplary instance, the first identification information can be used to identify the forwarding table items that have been processed for compatibility, and the second identification information can be used to identify the forwarding table items that are not compatible, so that the line card forwarding chip can know which are the forwarding table items that have been processed for compatibility and need to be covered, and which are the forwarding table items that are not compatible and need to be stored, wherein the first identification information is used to identify the forwarding table items that are compatible with the corresponding existing forwarding table items, and the second identification information is used to identify the forwarding table items that are not compatible with the corresponding existing forwarding table items.

[0050] Then, the line card forwarding chip overwrites the corresponding existing forwarding table entry with the compatible processed forwarding table entry in the first forwarding table entry storage space for storing the existing forwarding table entry.

[0051] Finally, the forwarding chip stores the incompatible forwarding table entry in the second forwarding table entry storage space used for storing forwarding table entries that are incompatible with the existing forwarding table entries.

[0052] The first forwarding table entry storage space and the second forwarding table entry storage space are obtained by dividing the storage space of the forwarding chip for storing forwarding table entries according to a preset space ratio.

[0053] In an exemplary embodiment, the preset space ratio includes: the preset space ratio includes: the space ratio of the first forwarding table entry storage space to the second forwarding table entry storage space is 9:1.

[0054] The microcode upgrade method provided by the embodiment of the present invention, since the microcode version upgrade information is loaded in the backup instruction space of the line card forwarding unit, the microcode version in the main instruction space can perform business forwarding normally, thereby avoiding business forwarding interruption caused by loading the microcode version upgrade information and improving the business forwarding efficiency.

[0055] The embodiment of the present invention provides a method for upgrading a microcode, such as Figure 2 As shown, including:

[0056] Step 201: The line card control chip obtains microcode version upgrade information.

[0057] Step 202: The line card control chip sends the microcode version upgrade information to the line card forwarding chip, so that the line card forwarding chip loads the microcode version upgrade information in the backup instruction space and switches from the main instruction space to the backup instruction space.

[0058] The main instruction space and the backup instruction space are obtained by pre-dividing the instruction space in the line card forwarding chip for loading microcode version information.

[0059] In an exemplary embodiment, after the line card control chip obtains the microcode upgrade information, the process further includes:

[0060] First, the line card control chip obtains the service configuration data and calculates the forwarding table entries according to the service configuration data.

[0061] In an exemplary embodiment, after obtaining microcode upgrade information, the line card control chip must send the obtained microcode upgrade information to the line card forwarding chip, and must re-acquire service configuration data and recalculate forwarding table entries according to the service configuration data.

[0062] Then, the line card control chip obtains several target forwarding table entries in the calculated forwarding table entries whose table contents are different from the corresponding existing forwarding table entries.

[0063] In an exemplary embodiment, when there are forwarding table entries with the same content as the corresponding existing forwarding table entries among all calculated forwarding table entries, the line card control chip obtains several target forwarding table entries with different content from the corresponding existing forwarding table entries among the calculated forwarding table entries.

[0064] In an exemplary instance, when there is no forwarding table entry among all calculated forwarding table entries whose content is the same as the corresponding existing forwarding table entry (i.e., the contents of all existing forwarding table entries have changed), the line card control chip will send all calculated forwarding table entries to the line card forwarding chip so that the line card forwarding chip can refresh all the forwarding table entries.

[0065] Finally, the line card control chip sends the target forwarding table entry to the line card forwarding chip.

[0066] In an exemplary embodiment, after the line card control chip obtains the microcode upgrade information, the process further includes:

[0067] First, the line card control chip obtains service configuration data and calculates forwarding table entries according to the service configuration data; the line card control chip obtains several target forwarding table entries whose contents are different from the corresponding existing forwarding table entries in the calculated forwarding table entries.

[0068] Secondly, the line card control chip obtains, from the plurality of target forwarding table entries, forwarding table entries to be processed for compatibility that can be compatible with the corresponding existing forwarding table entries that have undergone compatibility processing, and forwarding table entries that cannot be compatible.

[0069] In an exemplary embodiment, the forwarding table entry to be processed compatibly is a forwarding table entry in the target forwarding table that can be made compatible with the corresponding existing forwarding table entry after the compatibility processing (referring to the forwarding table entry to be processed compatibly).

[0070] In an exemplary embodiment, the incompatible forwarding table entry refers to a forwarding table entry that cannot be processed for compatibility by existing table entries to obtain a forwarding table entry that is compatible with the forwarding table entry.

[0071] Then, the line card control chip performs compatibility processing on the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly, so as to obtain the forwarding table entry after the compatibility processing.

[0072] In an exemplary instance, the obtained translation table entry that has been processed for compatibility is obtained by performing compatibility processing on the existing translation table entry corresponding to the translation table entry to be processed for compatibility based on the translation table entry to be processed for compatibility. Therefore, the obtained translation table entry that has been processed for compatibility is compatible with both the translation table entry to be processed for compatibility and the existing translation table entry corresponding to the translation table entry to be processed for compatibility.

[0073] Finally, the line card control chip sends the forwarding table entries that have been processed for compatibility and the forwarding table entries that cannot be made compatible to the line card forwarding chip.

[0074] In an exemplary embodiment, the line card control chip performs compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly, including:

[0075] The line card control chip performs compatibility processing on the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of the reserved field.

[0076] Alternatively, the line card control chip performs compatibility processing on the forwarded entry corresponding to the forwarding entry to be processed compatibly according to the forwarding entry to be processed compatibly by means of other compatible coding methods except the reserved field.

[0077] In an exemplary embodiment, the line card control chip performs compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of a reserved field, including:

[0078] First, the line card control chip obtains different fields between the forwarding table entry to be processed compatible and each row of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatible.

[0079] Then, the line card control chip adds a reserved field after each row of fields of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly.

[0080] Finally, the line card control chip fills the reserved fields of the corresponding rows with the obtained different fields between each row.

[0081] In an exemplary embodiment, other compatible encoding methods except reserved fields include: Type Length Value (TLV) encoding, codec framework Google Protobuf, JavaScript Object Notation (JSON), and Extensible Markup Language (XML).

[0082] The microcode upgrade method provided by the embodiment of the present invention, since the microcode version upgrade information is loaded in the backup instruction space of the line card forwarding unit, the microcode version in the main instruction space can perform business forwarding normally, thereby avoiding business forwarding interruption caused by loading the microcode version upgrade information and improving the business forwarding efficiency.

[0083] The embodiment of the present invention also provides a line card forwarding chip, such as Figure 3 As shown, the line card forwarding chip 3 includes:

[0084] The receiving module 31 is used to receive microcode version upgrade information from the line card control chip.

[0085] The first processing module 32 is used to load the microcode version upgrade information into the standby instruction space.

[0086] The first processing module 32 is further used to switch from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the instruction space used for loading microcode version information in the line card forwarding chip.

[0087] In an exemplary embodiment, the receiving module 31 is further configured to receive a target forwarding table entry from a line card control chip; wherein the target forwarding table entry is a forwarding table entry obtained by calculation and having entry content different from that of an existing forwarding table entry.

[0088] The first processing module 32 is further configured to store the target forwarding table entry.

[0089] In an exemplary instance, the receiving module 31 is also used to receive forwarding table items that have been processed for compatibility and forwarding table items that cannot be compatible from the line card control chip; wherein, the forwarding table items that have been processed for compatibility are forwarding table items that are obtained by compatibility processing from existing forwarding table items when the table content of the calculated forwarding table items is different from that of existing forwarding table items, and are compatible with the calculated forwarding table items; and the forwarding table items that cannot be compatible are forwarding table items that are obtained by compatibility processing from existing forwarding table items when the table content is different from that of existing forwarding table items and cannot be compatible with the calculated forwarding table items after compatibility processing from existing forwarding table items.

[0090] The first processing module 32 is also used to overwrite the corresponding existing forwarding table items with the forwarding table items that have been processed for compatibility in the first forwarding table item storage space used to store the existing forwarding table items; and to store the incompatible forwarding table items in the second forwarding table item storage space used to store the forwarding table items that are incompatible with the existing forwarding table items; wherein the first forwarding table item storage space and the second forwarding table item storage space are obtained by dividing the storage space of the forwarding chip itself for storing forwarding table items according to a preset space ratio.

[0091] In an exemplary embodiment, the preset space ratio includes: the preset space ratio includes: the space ratio of the first forwarding table entry storage space to the second forwarding table entry storage space is 9:1.

[0092] The line card forwarding chip provided by the embodiment of the present invention, since the microcode version upgrade information is loaded in the backup instruction space of the line card forwarding unit, the microcode version in the main instruction space can normally forward services, thereby avoiding service forwarding interruption caused by loading the microcode version upgrade information and improving the service forwarding efficiency.

[0093] In practical applications, the receiving module 31 and the first processing module 32 are both implemented by a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA) in a line card forwarding chip.

[0094] The embodiment of the present invention also provides a line card control chip, such as Figure 4 As shown, the line card control chip 4 includes:

[0095] The second processing module 41 is used to obtain microcode version upgrade information;

[0096] The sending module 42 is used to send the microcode version upgrade information to the line card forwarding chip, so that the line card forwarding chip loads the microcode version upgrade information in the backup instruction space and switches from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the line card forwarding chip's instruction space for loading microcode version information.

[0097] In an exemplary embodiment, the second processing module 41 is further used to obtain service configuration data, and calculate forwarding table entries according to the service configuration data; and obtain several target forwarding table entries whose table contents in the calculated forwarding table entries are different from the corresponding existing forwarding table entries.

[0098] The sending module 42 is further configured to send the target forwarding table entry to the line card forwarding chip.

[0099] In an exemplary instance, the second processing module 41 is also used to obtain business configuration data and calculate routing table items based on the business configuration data; obtain several target routing table items whose contents are different from the corresponding existing routing table items in the calculated routing table items; obtain the routing table items to be processed for compatibility that can be compatible with the corresponding existing routing table items that have undergone compatibility processing, and the routing table items that cannot be compatible from the several target routing table items; perform compatibility processing on the existing routing table items corresponding to the routing table items to be processed for compatibility according to the routing table items to be processed for compatibility, and obtain the routing table items that have undergone compatibility processing.

[0100] The sending module 42 is further used to send the forwarding table entries that have been processed for compatibility and the forwarding table entries that cannot be made compatible to the line card forwarding chip.

[0101] In an exemplary embodiment, the second processing module 41 is specifically configured to perform compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of a reserved field.

[0102] In an exemplary embodiment, the second processing module 41 is specifically configured to perform compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of other compatible coding methods except the reserved field.

[0103] In an exemplary embodiment, the second processing module 41 is specifically used for:

[0104] The different fields between the forwarding table entry to be processed compatibly and each row of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly are obtained.

[0105] A reserved field is added after each row of fields of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly.

[0106] The different fields between each obtained row are filled in the reserved fields of the corresponding row.

[0107] In an exemplary embodiment, other compatible encoding methods except the reserved field include: TLV encoding, Google Protobuf, JSON and XML.

[0108] The line card control chip provided by the embodiment of the present invention, since the microcode version upgrade information is loaded in the backup instruction space of the line card forwarding unit, the microcode version in the main instruction space can normally forward services, thereby avoiding service forwarding interruption caused by loading the microcode version upgrade information and improving the service forwarding efficiency.

[0109] In practical applications, the second processing module 41 and the sending module 42 are both implemented by a CPU, an MPU, a DSP or an FPGA in a line card control chip.

[0110] The embodiment of the present invention further provides a line card, such as Figure 5 As shown, it includes: line card control chip and line card forwarding chip. Among them, the line card control chip and the line card forwarding chip can be reset independently, that is, the reset of the line card control chip will not affect the normal forwarding of service messages by the line card forwarding chip. The line card control chip is responsible for generating forwarding table entries according to the service configuration data issued by the main control board and sending them to the line card forwarding chip. The line card forwarding chip forwards service messages according to the forwarding table entries. The specific process is as follows:

[0111] First, the main control board uploads the microcode version upgrade information to its own version library; the main control board sends an upgrade reset command to the line card control chip.

[0112] Secondly, after the line card control chip receives the upgrade reset command, it backs up the current service configuration data; the line card control chip triggers a reset, obtains the microcode version upgrade information from the main control board after powering on again, and sends it to the line card forwarding chip for operation; the line card control chip obtains the service configuration data from the backup and recalculates the forwarding table items.

[0113] In an exemplary embodiment, the line card control chip identifies the specific situation of the forwarding table item through the version number, so that the line card forwarding chip can determine how to handle the forwarding table item according to the different version numbers. For example, the line card forwarding chip determines that the microcode version is incompatible through the different identifications of the large version number, and the loading of the upgraded microcode version requires refreshing all forwarding table items; determines that the forwarding table item is incompatible through the different identifications of the medium version number, and stores the forwarding table item in the reserved forwarding table item storage space (corresponding to the second forwarding table item storage space in the above embodiment); determines that the forwarding table item is compatible through the different identifications of the small version number, and the recalculated forwarding table item data can overwrite the current forwarding table item data.

[0114] In an exemplary embodiment, it is assumed that the structure of the storage space used to store the forwarding table entries before the upgrade is as follows: Figure 6 Shown, the existing forwarding table item is stored in the first forwarding table item storage space, and at this moment, the second forwarding table item storage space is empty. When carrying out the first time microcode upgrade, suppose that the forwarding table item C, forwarding table item E and forwarding table item F that recalculate have changed, wherein the forwarding table item C that recalculates (belonging to the forwarding table item to be compatible with in the above-described embodiment) can obtain compatible forwarding table item C (version number is V1.1.2) (belonging to the forwarding table item through compatible with in the above-described embodiment) through compatibility treatment by existing forwarding table item C (version number is V1.1.1), the forwarding table item E that recalculates (belonging to the forwarding table item to be compatible with in the above-described embodiment) can obtain compatible forwarding table item E (version number is V1.1.1) through compatibility treatment by existing forwarding table item E (version number is V1.1.2) V1.1.2) (belongs to the forwarding table item that has been processed for compatibility in the above embodiment), the recalculated forwarding table item F (version number is V1.2.1) cannot be compatible (belongs to the incompatible forwarding table item in the above embodiment), so the line card forwarding chip overwrites the existing forwarding table item C (version number is V1.1.1) with the forwarding table item C (version number is V1.1.2) in the first forwarding table item storage space, overwrites the existing forwarding table item E (version number is V1.1.1) with the forwarding table item E (version number is V1.1.2), and stores the forwarding table item F (version number is V1.2.1) in the second forwarding table item storage space. The structure of the storage space is as follows: Figure 7 When the second microcode upgrade is performed, it is assumed that the recalculated forwarding table item B, forwarding table item C, and forwarding table item E have changed, wherein the recalculated forwarding table item B (belonging to the forwarding table item to be processed for compatibility in the above embodiment) can be processed for compatibility by the existing forwarding table item B (version number is V1.1.1) to obtain a compatible forwarding table item B (version number is V1.1.2) (belonging to the forwarding table item processed for compatibility in the above embodiment), and the recalculated forwarding table item C (belonging to the forwarding table item to be processed for compatibility in the above embodiment) can be processed for compatibility by the existing forwarding table item C (version number is V1.1.2) to obtain a compatible forwarding table item C (version number is V1.1.2). V1.1.3) (belongs to the forwarding table item that has been processed for compatibility in the above embodiment), the recalculated forwarding table item E (version number is V1.2.1) cannot be compatible (belongs to the incompatible forwarding table item in the above embodiment), so the line card forwarding chip overwrites the existing forwarding table item B (version number is V1.1.1) with the forwarding table item B (version number is V1.1.2) in the first forwarding table item storage space, overwrites the existing forwarding table item C (version number is V1.1.2) with the forwarding table item C (version number is V1.1.3), and stores the forwarding table item E (version number is V1.2.1) in the second forwarding table item storage space. The structure of the storage space is as follows: Figure 8When the third microcode upgrade is performed, assuming that the recalculated forwarding table entries are different from the existing forwarding table entries, the major version numbers of all forwarding table entries are changed, and the line card forwarding chips are completely refreshed. The structure of the storage space is as follows Fig. 9 Therefore, the corresponding relationship between the processing method of the forwarding table entry and different version numbers can be shown in the following table 1:

[0115]

[0116] Table 1

[0117] In an exemplary embodiment, each time the microcode is upgraded, the line card forwarding chip switches the main and standby instruction spaces. Figure 6 Upgrade to Figure 7 , the line card forwarding chip switches from the main instruction space to the backup instruction space, and the microcode Figure 7 Upgrade to Figure 8 , the line card forwarding chip switches from the backup instruction space to the main instruction space, and the microcode Figure 8 Upgrade to Fig. 9 , the line card forwarding chip switches from the main instruction space to the backup instruction space.

[0118] In an exemplary instance, the compatibility of the forwarding table entries can be achieved by reserving fields, and the generated compatible forwarding table entries need to meet the following requirements: the field cannot be deleted and can only be discarded; the new field can only be added at the end and the field cannot be inserted in the middle; if the field needs to be expanded or modified (for example, BYTE is changed to INT), it needs to be added to the end in the same way as the new field, but the value of the original field needs to be retained (for use in the old version).

[0119] In an exemplary embodiment, a schematic diagram of performing table entry compatibility in a reserved field manner is shown in FIG. Fig.10 Assume that the table entry has only one row of fields, and the reserved field is 64 bits. Take the different version numbers of this row of fields as an example. Assume that it contains V1.1.1, V 1.1.2, V1.1.3, and V1.2.1. Fig.10 As shown, V1.1.2 modifies field B (expands 1 byte) and V1.1.3 adds field Z.

[0120] Then, the line card control chip selects the corresponding forwarding table entry delivery method according to the three version numbers (large, medium and small), and delivers the recalculated forwarding table entry to the line card forwarding chip.

[0121] Finally, the line card forwarding chip receives the forwarding table entry and processes the forwarding table entry; loads the microcode version upgrade information into the standby instruction space; and switches the current main instruction space to the standby instruction space.

[0122] The embodiment of the present invention further provides a line card, comprising: a line card control chip and a line card forwarding chip, wherein the line card control chip is used to obtain microcode version upgrade information and send the microcode version upgrade information to the line card forwarding chip.

[0123] The line card forwarding chip is used to receive microcode version upgrade information from the line card control chip; load the microcode version upgrade information in the backup instruction space; switch from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the line card forwarding chip's instruction space for loading microcode version information.

[0124] In an exemplary instance, the line card control chip is also used to obtain service configuration data and calculate forwarding table entries based on the service configuration data; obtain several target forwarding table entries whose table contents are different from the corresponding existing forwarding table entries in the calculated forwarding table entries; and send the target forwarding table entries to the line card forwarding chip.

[0125] The line card forwarding chip is also used to receive a target forwarding table entry from the line card control chip; wherein the target forwarding table entry is a forwarding table entry obtained by calculation and whose table content is different from that of an existing forwarding table entry; and store the target forwarding table entry.

[0126] In an exemplary instance, the line card control chip is also used to obtain business configuration data and calculate routing table items based on the business configuration data; obtain several target routing table items whose table item contents are different from the corresponding existing routing table items in the calculated routing table items; obtain, from the several target routing table items, routing table items to be processed for compatibility that can be compatible with the corresponding existing routing table items that have undergone compatibility processing, and routing table items that cannot be compatible; perform compatibility processing on the existing routing table items corresponding to the routing table items to be processed for compatibility according to the routing table items to be processed for compatibility, to obtain routing table items that have undergone compatibility processing; and send the routing table items that have undergone compatibility processing and the routing table items that cannot be compatible to the line card forwarding chip.

[0127] The line card forwarding chip is also used to receive compatible forwarding table items and incompatible forwarding table items from the line card control chip; to overwrite corresponding existing forwarding table items with compatible forwarding table items in a first forwarding table item storage space used to store existing forwarding table items; and to store incompatible forwarding table items in a second forwarding table item storage space used to store forwarding table items incompatible with existing forwarding table items; wherein the first forwarding table item storage space and the second forwarding table item storage space are obtained by dividing the forwarding chip's own storage space for storing forwarding table items according to a preset space ratio.

[0128] In an exemplary embodiment, the preset space ratio includes: the space ratio of the first forwarding table entry storage space to the second forwarding table entry storage space is 9:1.

[0129] In an exemplary embodiment, the line card control chip is specifically used to perform compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of a reserved field.

[0130] In an exemplary embodiment, the line card control chip is specifically configured to perform compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of other compatible coding except the reserved field.

[0131] In an exemplary instance, the line card control chip is specifically used to obtain different fields between each row of the forwarding table items to be processed compatibly and the existing forwarding table items corresponding to the forwarding table items to be processed compatibly; add a reserved field after each row of fields of the existing forwarding table items corresponding to the forwarding table items to be processed compatibly; and fill the reserved fields of the corresponding rows with the different fields between each row obtained.

[0132] In an exemplary embodiment, other compatible encoding methods except the reserved field include: TLV encoding, Google Protobuf, JSON and XML.

[0133] Although the implementation methods disclosed in the embodiments of the present invention are as above, the contents described are only implementation methods adopted to facilitate understanding of the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Any technician in the field to which the embodiments of the present invention belong may make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in the embodiments of the present invention, but the scope of patent protection of the embodiments of the present invention shall still be subject to the scope defined in the attached claims.

Claims

1. A method for upgrading a microcode, comprising: The line card forwarding chip receives microcode version upgrade information from the line card control chip; The line card forwarding chip loads the microcode version upgrade information in the standby instruction space; The line card forwarding chip switches from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the instruction space used for loading microcode version information in the line card forwarding chip itself; After the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes: The line card forwarding chip receives a forwarding table entry that has been processed for compatibility from the line card control chip; wherein the forwarding table entry that has been processed for compatibility is a forwarding table entry that is compatible with the forwarding table entry that has been calculated and is obtained after the compatibility processing of the existing forwarding table entry when the table content of the forwarding table entry that has been calculated is different from that of the existing forwarding table entry; The line card forwarding chip overwrites the corresponding existing forwarding table entry with the compatible-processed forwarding table entry in a first forwarding table entry storage space for storing existing forwarding table entries.

2. The upgrading method according to claim 1, characterized in that: After the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes: The line card forwarding chip receives a target forwarding table entry from the line card control chip; wherein the target forwarding table entry is a forwarding table entry obtained by calculation and having a table entry content different from an existing forwarding table entry; The line card forwarding chip stores the target forwarding entry.

3. The upgrading method according to claim 1, characterized in that: After the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes: The line card forwarding chip receives an incompatible forwarding table entry from the line card control chip; wherein the incompatible forwarding table entry is a forwarding table entry whose table content is different from an existing forwarding table entry and cannot be calculated to be compatible with the existing forwarding table entry after compatibility processing; The forwarding chip stores the incompatible forwarding table entries in a second forwarding table entry storage space used to store forwarding table entries that are incompatible with the existing forwarding table entries; wherein the first forwarding table entry storage space and the second forwarding table entry storage space are obtained by dividing the forwarding chip's own storage space for storing forwarding table entries according to a preset space ratio.

4. The upgrading method according to claim 3, characterized in that: The preset space ratio includes: a space ratio of the first forwarding table entry storage space to the second forwarding table entry storage space is 9:

1.

5. A method for upgrading a microcode, comprising: The line card control chip obtains microcode version upgrade information; The line card control chip sends the microcode version upgrade information to the line card forwarding chip, so that the line card forwarding chip loads the microcode version upgrade information in the backup instruction space and switches from the main instruction space to the backup instruction space; wherein the main instruction space and the backup instruction space are obtained by pre-dividing the instruction space used for loading microcode version information in the line card forwarding chip; After the line card control chip obtains the version upgrade information, the method further includes: The line card control chip acquires service configuration data and calculates forwarding table entries according to the service configuration data; The line card control chip acquires a plurality of target forwarding table entries whose table contents in the calculated forwarding table entries are different from the corresponding existing forwarding table entries; The line card control chip obtains, from a plurality of target forwarding table entries, forwarding table entries to be processed for compatibility that are compatible with corresponding existing forwarding table entries that have undergone compatibility processing; The line card control chip performs compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly, so as to obtain a forwarding table entry that has undergone compatibility processing; The line card control chip sends the forwarding table entry that has undergone compatibility processing to the line card forwarding chip.

6. The upgrading method according to claim 5, characterized in that: After the line card control chip obtains the version upgrade information, the method further includes: The line card control chip obtains incompatible forwarding table entries from a plurality of target forwarding table entries; The line card control chip sends the incompatible forwarding table entries to the line card forwarding chip.

7. The upgrading method according to claim 5, characterized in that: The line card control chip performs compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly, including: The line card control chip performs compatibility processing on the existing forwarding table entry corresponding to the forwarding table entry to be processed compatible according to the forwarding table entry to be processed compatible by means of a reserved field; or, The line card control chip performs compatibility processing on an existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly according to the forwarding table entry to be processed compatibly by means of other compatible coding methods except the reserved field.

8. The upgrading method according to claim 7, characterized in that: The line card control chip performs compatibility processing on the existing forwarding table entry corresponding to the forwarding table entry to be processed compatible by means of a reserved field, including: The line card control chip acquires different fields between the forwarding table entry to be processed compatible and each row of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatible; The line card control chip adds the reserved field after each row field of the existing forwarding table entry corresponding to the forwarding table entry to be processed compatibly; The line card control chip fills the reserved field of the corresponding row with the obtained different fields between each row.

9. The upgrading method according to claim 7, characterized in that: The other compatible encoding methods except the reserved fields include: type-length-value TLV encoding, encoding and decoding framework Google Protobuf, interpreted scripting language object notation JSON and extensible markup language XML.

10. A line card, characterized in that: include: Line card control chip and line card forwarding chip; The line card control chip is used to obtain microcode version upgrade information and send the microcode version upgrade information to the line card forwarding chip; The line card forwarding chip is used to receive microcode version upgrade information from the line card control chip; load the microcode version upgrade information in the standby instruction space; switch from the main instruction space to the standby instruction space; wherein the main instruction space and the standby instruction space are obtained by pre-dividing the instruction space used for loading microcode version information in the line card forwarding chip; After the line card forwarding chip receives the microcode version upgrade information from the line card control chip, the method further includes: The line card forwarding chip receives the forwarding table entry that has been processed for compatibility from the line card control chip; The forwarding table entry that has undergone compatibility processing is a forwarding table entry that is compatible with the forwarding table entry that has been calculated and is obtained by the existing forwarding table entry after compatibility processing when the table content of the forwarding table entry that has been calculated is different from that of the existing forwarding table entry; The line card forwarding chip overwrites the corresponding existing forwarding table entry with the compatible-processed forwarding table entry in a first forwarding table entry storage space for storing existing forwarding table entries.

Citation Information

Patent Citations

  • Microcode switching method and microcode switching device

    CN101729428A