CN113419978A - Communication equipment, table item updating method and storage medium - Google Patents

Communication equipment, table item updating method and storage medium Download PDF

Info

Publication number
CN113419978A
CN113419978A CN202110699119.2A CN202110699119A CN113419978A CN 113419978 A CN113419978 A CN 113419978A CN 202110699119 A CN202110699119 A CN 202110699119A CN 113419978 A CN113419978 A CN 113419978A
Authority
CN
China
Prior art keywords
target
message
memory address
forwarding
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110699119.2A
Other languages
Chinese (zh)
Inventor
张树坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202110699119.2A priority Critical patent/CN113419978A/en
Publication of CN113419978A publication Critical patent/CN113419978A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1605Handling requests for interconnection or transfer for access to memory bus based on arbitration
    • G06F13/161Handling requests for interconnection or transfer for access to memory bus based on arbitration with latency improvement
    • G06F13/1636Handling requests for interconnection or transfer for access to memory bus based on arbitration with latency improvement using refresh

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the application provides communication equipment, an item updating method and a storage medium. In the application, a processor in the communication device sends a message for table item refreshing to a forwarding chip in the communication device, a transceiver module in the forwarding chip receives the message and then transmits the message for table item refreshing to a table refreshing module in the forwarding chip, and the table refreshing module performs an updating operation on a corresponding forwarding table item according to the message, so that the forwarding table item in a memory of the forwarding chip is updated by the forwarding chip.

Description

Communication equipment, table item updating method and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communication device, a table entry updating method, and a storage medium.
Background
In the communication device based on the network forwarding chip, the updating rate of the forwarding table entry is very critical, and the delay of the table entry taking effect, the on-line rate of the user, the response speed of the protection switching, and the like are often determined. Taking the protection switching as an example, in order to "fool" the user's vision and hearing so as to achieve the user's imperceptibility, the protection switching needs to be completed within 50 milliseconds.
In the prior art, in the process of updating the forwarding table entry, the CPU directly updates the forwarding table entry in the memory of the forwarding chip through a PCIE (Peripheral Component Interconnect Express, high speed serial computer extended bus standard) interface. However, the above method may result in a higher update delay of the forwarding table entry in the forwarding chip.
Disclosure of Invention
An object of the embodiments of the present application is to provide a communication device, a table entry updating method, and a storage medium, so as to reduce an update delay of a forwarding table entry in a forwarding chip. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a communication device, including:
the system comprises a processor and at least one forwarding chip, wherein each forwarding chip comprises a table refreshing module and a transceiver module, and a plurality of forwarding table entries are stored in each forwarding chip;
the processor is configured to generate a message carrying a target forwarding table entry when the target forwarding table entry on the target forwarding chip needs to be updated, and send the message to a transceiver module in the target forwarding chip, where the message also carries table entry update indication information, attribute information of the target forwarding table entry, and an update operation type;
the receiving and sending module is used for sending the message to a table refreshing module in the target forwarding chip according to the table updating indication information in the message after receiving the message;
the table-flushing module is configured to determine, after receiving the message, a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and perform, on the basis of the target memory address, a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message.
In a possible implementation manner, the attribute information includes a table number, a table type, and a Key of the target forwarding table entry;
the table refreshing module is specifically configured to calculate the table number and the Key according to a calculation manner of calculating a memory address corresponding to the table type, so as to obtain a target memory address corresponding to the target forwarding table entry.
In a possible implementation, the update operation type is a new addition operation;
the table-flushing module is specifically configured to write the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module is specifically configured to replace a forwarding table entry stored in the target memory address with the target forwarding table entry in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module is specifically configured to delete the target forwarding table entry in the message stored in the target memory address.
In a possible implementation manner, the table-flushing module is further configured to add a mutual exclusion lock to the target memory address before the target update operation is performed; and releasing the mutual exclusion lock of the target memory address after the target updating operation is executed.
In a second aspect, an embodiment of the present application provides a method for updating forwarding entries in forwarding chips, which is applied to a communication device, where the communication device includes a processor and at least one forwarding chip, each forwarding chip includes a table flushing module and a transceiver module, and multiple forwarding entries are stored in each forwarding chip, and the method includes:
when a target forwarding table entry on a target forwarding chip needs to be updated, the processor generates a message carrying the target forwarding table entry and sends the message to a transceiver module in the target forwarding chip, wherein the message also carries table entry updating indication information, attribute information of the target forwarding table entry and an updating operation type;
after receiving the message, a transceiver module in the target forwarding chip updates the indication information according to the table entry in the message and sends the message to a table refreshing module in the target forwarding chip;
after receiving the message, the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and executes a target updating operation corresponding to the updating operation type in the message on the target forwarding table entry in the message based on the target memory address.
In a possible implementation manner, the attribute information includes a table number, a table type, and a Key of the target forwarding table entry;
the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and specifically includes:
and the table refreshing module in the target forwarding chip calculates the table number and the Key according to the calculation mode of calculating the memory address corresponding to the table type to obtain the target memory address corresponding to the target forwarding table item.
In a possible implementation, the update operation type is a new addition operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip writes the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip replaces forwarding table entries stored in the target memory address with the target forwarding table entries in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
and deleting the target forwarding table entry in the message stored in the target memory address by a table refreshing module in the target forwarding chip.
In a possible implementation manner, before the table flushing module in the target forwarding chip executes, based on the target memory address, a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message, the method further includes:
a table-refreshing module in the target forwarding chip adds a mutual exclusion lock to the target memory address;
after the table-flushing module in the target forwarding chip executes the target updating operation corresponding to the updating operation type in the message on the target forwarding table entry in the message based on the target memory address, the method further includes;
and the table-refreshing module in the target forwarding chip relieves the mutual exclusion lock of the target memory address.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements an entry updating method described in any of the present application.
The embodiment of the application has the following beneficial effects:
the communication equipment provided by the embodiment of the application comprises a processor and at least one forwarding chip, wherein each forwarding chip comprises a table refreshing module and a receiving and sending module, and a plurality of forwarding table entries are stored in each forwarding chip; the processor is used for generating a message carrying a target forwarding table item when the target forwarding table item on the target forwarding chip needs to be updated, and sending the message to a transceiver module in the target forwarding chip, wherein the message also carries table item updating indication information, attribute information of the target forwarding table item and an updating operation type; the receiving and sending module is used for updating the indication information according to the table entry in the message after receiving the message and sending the message to a table refreshing module in the target forwarding chip; and the table refreshing module is used for determining a target memory address corresponding to a target forwarding table item in the message according to the attribute information in the message after receiving the message, and executing target updating operation corresponding to the updating operation type in the message on the target forwarding table item in the message based on the target memory address. In the process, the processor sends the message for table item refreshing to the forwarding chip, the transceiver module in the forwarding chip transmits the message for table item refreshing to the table refreshing module in the forwarding chip after receiving the message, and the table refreshing module performs updating operation on the forwarding table item according to the message, so that the forwarding table item in the memory of the forwarding chip is updated by using the forwarding chip. Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic diagram of a communication device according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a communication device updating a forwarding table entry according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a refresh module updating a forwarding table entry according to an embodiment of the present application;
fig. 4 is a schematic diagram of an entry updating method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the description herein are intended to be within the scope of the present disclosure.
In order to reduce the update delay of the forwarding table entry in the forwarding chip, an embodiment of the present application provides a communication device, which is shown in fig. 1 and includes:
the system comprises a processor 11 and at least one forwarding chip 12, wherein each forwarding chip 12 comprises a table refreshing module 121 and a transceiver module 122, and a plurality of forwarding table entries are stored in each forwarding chip;
the processor 11 is configured to generate a message carrying a target forwarding table entry when the target forwarding table entry on the target forwarding chip needs to be updated, and send the message to a transceiver module in the target forwarding chip, where the message also carries table entry update indication information, attribute information of the target forwarding table entry, and an update operation type;
the transceiver module 122 is configured to, after receiving the packet, send the packet to a table-flushing module in the target forwarding chip according to the table entry update indication information in the packet;
the table flushing module 121 is configured to, after receiving the message, determine a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and execute a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address.
The target forwarding table entry is a forwarding table entry needing to be updated. The processor calculates to obtain a target forwarding table according to the requirement of table updating, and carries the target forwarding table in a message for sending, wherein the message can also comprise table updating indication information, attribute information of the target forwarding table and an updating operation type besides the target forwarding table. Here, the update operation type may be a new addition operation, a modification operation, or a deletion operation, and both the new addition operation and the modification operation may be regarded as a write operation. In one example, the attribute information may include a table number, a table type, and a Key (Key) of the target forwarding table entry; in the case that the update operation type is a new addition operation, the attribute information may further include an entry size and the like. In one example, the processor may send the message to the transceiver module in the target forwarding chip through an interface different from the other interface other than the PCIE interface.
When a receiving and sending module in the forwarding chip receives a message and the message includes the table item updating indication information, the receiving and sending module transmits the message to a table refreshing module in the forwarding chip where the receiving and sending module is located. The table refreshing module determines a target memory address and a target updating operation corresponding to the target forwarding table item according to the attribute information and the updating operation type of the target forwarding table item in the message, and executes the target updating operation on the target forwarding table item based on the target memory address.
In one example, as shown in fig. 2, the update of the forwarding table entry is realized by a table-flushing module in the forwarding chip, where CPU represents a processor, NP represents a network processor, PP represents a message processor, and NP and PP are specific types of the forwarding chip. The table-refreshing module may be a software module based on hardware resources of the forwarding chip, or an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other Programmable logic device may be added to the forwarding chip to implement the table-refreshing module; in one example, the table-flushing module may be implemented based on an IP core (intellectual property core).
In the embodiment of the application, the processor sends the message for table entry refreshing to the forwarding chip, the transceiver module in the forwarding chip receives the message and then transmits the message for table entry refreshing to the table refreshing module in the forwarding chip, and the table refreshing module performs updating operation on the corresponding forwarding table entry according to the message, so that the forwarding table entry in the memory of the forwarding chip is updated by the forwarding chip.
In a possible implementation manner, the attribute information includes a table number, a table type, and a Key of the target forwarding table entry; the table refreshing module is specifically configured to calculate the table number and the Key according to a calculation manner of calculating a memory address corresponding to the table type, so as to obtain a target memory address corresponding to the target forwarding table entry; and the table refreshing module is further configured to determine a target updating operation according to the target forwarding table entry in the message and the updating operation type.
In one example, the table-flushing module may use the table number as a base memory address and the Key as an offset address, and sum the two to obtain the target memory address.
In an example, as shown in fig. 3, after the table-flushing module obtains a message, the table-flushing module analyzes the message, so as to obtain attribute information and an update operation type; the table refreshing module calculates a target memory address corresponding to the table item to be updated according to the table number, the table type and the Key of the table item to be updated in the attribute information, and determines target updating operation according to the updating operation type; and then the table refreshing module executes target updating operation on the table entry to be updated based on the target memory address.
In a possible implementation, the update operation type is a new addition operation;
the table-flushing module is specifically configured to write the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module is specifically configured to replace a forwarding table entry stored in the target memory address with the target forwarding table entry in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module is specifically configured to delete the target forwarding table entry in the message stored in the target memory address.
In order to prevent an error caused by the operation of the forwarding table by another thread in the updating process of the forwarding table, in a possible implementation manner, the table flushing module is further configured to add a mutual exclusion lock to the target memory address before the target updating operation is performed; and releasing the mutual exclusion lock of the target memory address after the target updating operation is executed.
In a possible implementation manner, for the case of deleting a forwarding entry, the table-flushing module is specifically configured to add a mutual exclusion lock to the target memory address when the update operation type is a delete operation; deleting the target forwarding table entry in the message stored in the target memory address; releasing the target memory address; and releasing the mutual exclusion lock of the target memory address.
And the table refreshing module adds a mutual exclusion lock to the target memory address, then executes the target updating operation aiming at the target memory address after the mutual exclusion lock is added, and then removes the mutual exclusion lock of the target memory address. In one example, the table-flushing module adds a mutual exclusion lock to a target memory address, and the target memory address after the mutual exclusion lock is added only allows the table-flushing module to perform read-write operation, but does not allow other threads to perform read-write operation. The table refreshing module executes target updating operation aiming at the target memory address, and after the target updating operation is executed, the table refreshing module releases the mutual exclusion lock of the target memory address.
In the embodiment of the application, the table-flushing module adds the mutual exclusion lock to the target memory address, so that the error caused by reading and writing the target memory address by other threads can be reduced. The mutual exclusion lock of the target memory address does not influence the reading and writing of the data of other memory addresses. And under the condition that a plurality of forwarding table entries need to be updated in the forwarding chip, a mutual exclusion lock can be added respectively for the memory address corresponding to each forwarding table entry, and the plurality of forwarding table entries can be updated simultaneously in a parallel execution mode, so that the update delay of the forwarding table entries is further shortened.
The following takes the newly added forwarding table entry as an example to illustrate:
1. when a target forwarding table entry on a target forwarding chip needs to be updated, a processor generates a message carrying the target forwarding table entry and sends the message to a transceiver module in the target forwarding chip, wherein the message carries table entry update indication information, attribute information of the target forwarding table entry and an update operation type.
The processor does not directly operate the memory of the forwarding chip, and does not need to perform additional data consistency protection such as locking.
2. And the receiving and sending module in the target forwarding chip analyzes the message, identifies whether the message has the table item updating indication information, and if the message has the table item updating indication information, transmits the message to the table refreshing module in the forwarding chip where the message is located.
3. The table-refreshing module analyzes the received message, and acquires attribute information, a target forwarding table entry and an updating operation type, wherein the attribute information comprises a table number, a table type, a table entry size, a Key and the like.
4. And the table refreshing module calculates the target memory address required to be refreshed according to the table number, the table type and the Key.
5. And locking the target memory address to be refreshed by the table refreshing module.
The parallel refreshing of other table entries in other addresses is not influenced by the process, and the table concurrent refreshing performance is improved.
6. And the table refreshing module applies for the memory block for the target forwarding table entry according to the size of the table entry and writes the target forwarding table entry into the applied memory address.
7. And the table refreshing module unlocks the refreshed memory address.
8. The flush table module returns a message to the processor indicating that the update is complete.
In the process of updating the forwarding table entry by the target forwarding chip, the processor can process other tasks without waiting. The process of deleting and modifying forwarding entries is similar, except that the actions are different.
In the prior art, for the situation that the CPU manages multiple forwarding entries of multiple forwarding chips simultaneously, when the forwarding entries to be updated are located in different forwarding chips, the CPU needs to map the memory addresses of the forwarding chips, which may cause a high delay.
When a plurality of target forwarding table entries in a plurality of target forwarding chips need to be updated, the processor generates a message carrying the target forwarding table entry for each target forwarding table entry, and sends the message to a transceiver module in the target forwarding chip where the target forwarding table entry is located. The processor can send corresponding messages to each target forwarding chip in parallel; aiming at each target forwarding chip, after a message is received, corresponding table item updating operation is executed according to the received message, the operations among the forwarding chips are not affected mutually and can be executed in parallel, and therefore the updating delay of the forwarding table items can be greatly shortened.
In the embodiment of the application, a table-flushing module is added in the forwarding chip, so that updating of a plurality of forwarding table entries can be executed in parallel, the processor is only responsible for encapsulating the table entries into messages and sending the messages to the forwarding chip, and is not responsible for real operations of adding, deleting and modifying, the table-flushing module calculates the memory address to be refreshed according to the messages, only the memory address to be operated needs to be locked, other table entries of other addresses are not influenced, and the concurrent operations can be guaranteed not to be blocked; when the forwarding table entry is operated, the transceiver module in the forwarding chip is responsible for primary analysis, the table-flushing module is responsible for deep analysis, and the table-flushing module calculates the memory address and executes corresponding operation according to the analyzed update operation type, table number, table type, Key, target forwarding table entry and the like, so that the update delay of the forwarding table entry in the forwarding chip is shortened.
An embodiment of the present application further provides a table entry updating method, which is applied to a communication device, where the communication device includes a processor and at least one forwarding chip, each forwarding chip includes a table updating module and a transceiver module, and each forwarding chip stores multiple forwarding table entries, referring to fig. 4, where the method includes:
s101, when a target forwarding table entry on a target forwarding chip needs to be updated, the processor generates a message carrying the target forwarding table entry and sends the message to a transceiver module in the target forwarding chip, wherein the message also carries table entry updating indication information, attribute information of the target forwarding table entry and an updating operation type;
s102, after receiving the message, the transceiver module in the target forwarding chip sends the message to a table refreshing module in the target forwarding chip according to the table updating indication information in the message;
s103, after receiving the message, the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and performs a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address.
In a possible implementation manner, the attribute information includes a table number, a table type, and a Key of the target forwarding table entry;
the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and specifically includes:
and the table refreshing module in the target forwarding chip calculates the table number and the Key according to the calculation mode of calculating the memory address corresponding to the table type to obtain the target memory address corresponding to the target forwarding table item.
In a possible implementation, the update operation type is a new addition operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip writes the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip replaces forwarding table entries stored in the target memory address with the target forwarding table entries in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
and deleting the target forwarding table entry in the message stored in the target memory address by a table refreshing module in the target forwarding chip.
In a possible implementation manner, before the table flushing module in the target forwarding chip executes, based on the target memory address, a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message, the method further includes:
a table-refreshing module in the target forwarding chip adds a mutual exclusion lock to the target memory address;
after the table-flushing module in the target forwarding chip executes the target updating operation corresponding to the updating operation type in the message on the target forwarding table entry in the message based on the target memory address, the method further includes;
and the table-refreshing module in the target forwarding chip relieves the mutual exclusion lock of the target memory address.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method for updating a forwarding table entry in a forwarding chip in any of the present application is implemented.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for updating forwarding table entries in a forwarding chip described in any of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the method, the computer program product and the storage medium, since they are substantially similar to the embodiments of the communication device, the description is relatively simple, and in relation to the description, reference may be made to part of the description of the embodiments of the communication device.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (9)

1. A communication device, comprising:
the system comprises a processor and at least one forwarding chip, wherein each forwarding chip comprises a table refreshing module and a transceiver module, and a plurality of forwarding table entries are stored in each forwarding chip;
the processor is configured to generate a message carrying a target forwarding table entry when the target forwarding table entry on the target forwarding chip needs to be updated, and send the message to a transceiver module in the target forwarding chip, where the message also carries table entry update indication information, attribute information of the target forwarding table entry, and an update operation type;
the receiving and sending module is used for sending the message to a table refreshing module in the target forwarding chip according to the table updating indication information in the message after receiving the message;
the table-flushing module is configured to determine, after receiving the message, a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and perform, on the basis of the target memory address, a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message.
2. The communications device of claim 1, wherein the attribute information includes a table number, a table type, and a Key of the target forwarding table entry;
the table refreshing module is specifically configured to calculate the table number and the Key according to a calculation manner of calculating a memory address corresponding to the table type, so as to obtain a target memory address corresponding to the target forwarding table entry.
3. The communication device of claim 2, wherein the update operation type is a new addition operation;
the table-flushing module is specifically configured to write the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module is specifically configured to replace a forwarding table entry stored in the target memory address with the target forwarding table entry in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module is specifically configured to delete the target forwarding table entry in the message stored in the target memory address.
4. The communication device according to claim 1, wherein the table-flushing module is further configured to add a mutex lock to the target memory address before the target update operation is performed; and releasing the mutual exclusion lock of the target memory address after the target updating operation is executed.
5. An entry updating method is applied to a communication device, the communication device includes a processor and at least one forwarding chip, each forwarding chip includes a table-flushing module and a transceiver module, and each forwarding chip stores a plurality of forwarding entries, the method includes:
when a target forwarding table entry on a target forwarding chip needs to be updated, the processor generates a message carrying the target forwarding table entry and sends the message to a transceiver module in the target forwarding chip, wherein the message also carries table entry updating indication information, attribute information of the target forwarding table entry and an updating operation type;
after receiving the message, a transceiver module in the target forwarding chip updates the indication information according to the table entry in the message and sends the message to a table refreshing module in the target forwarding chip;
after receiving the message, the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and executes a target updating operation corresponding to the updating operation type in the message on the target forwarding table entry in the message based on the target memory address.
6. The method of claim 5, wherein the attribute information comprises a table number, a table type, and a Key of the target forwarding table entry;
the table-flushing module in the target forwarding chip determines a target memory address corresponding to the target forwarding table entry in the message according to the attribute information in the message, and specifically includes:
and the table refreshing module in the target forwarding chip calculates the table number and the Key according to the calculation mode of calculating the memory address corresponding to the table type to obtain the target memory address corresponding to the target forwarding table item.
7. The method of claim 5, wherein the update operation type is a new add operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip writes the target forwarding table entry in the message into the target memory address; alternatively, the first and second electrodes may be,
the updating operation type is a modifying operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
a table-flushing module in the target forwarding chip replaces forwarding table entries stored in the target memory address with the target forwarding table entries in the message; alternatively, the first and second electrodes may be,
the updating operation type is deleting operation;
the table flushing module in the target forwarding chip executes a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, and specifically includes:
and deleting the target forwarding table entry in the message stored in the target memory address by a table refreshing module in the target forwarding chip.
8. The method of claim 7, wherein before the table flushing module in the target forwarding chip performs a target update operation corresponding to the update operation type in the message on the target forwarding table entry in the message based on the target memory address, the method further comprises:
a table-refreshing module in the target forwarding chip adds a mutual exclusion lock to the target memory address;
after the table-flushing module in the target forwarding chip executes the target updating operation corresponding to the updating operation type in the message on the target forwarding table entry in the message based on the target memory address, the method further includes;
and the table-refreshing module in the target forwarding chip relieves the mutual exclusion lock of the target memory address.
9. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any of the claims 5-8.
CN202110699119.2A 2021-06-23 2021-06-23 Communication equipment, table item updating method and storage medium Pending CN113419978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110699119.2A CN113419978A (en) 2021-06-23 2021-06-23 Communication equipment, table item updating method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110699119.2A CN113419978A (en) 2021-06-23 2021-06-23 Communication equipment, table item updating method and storage medium

Publications (1)

Publication Number Publication Date
CN113419978A true CN113419978A (en) 2021-09-21

Family

ID=77716352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110699119.2A Pending CN113419978A (en) 2021-06-23 2021-06-23 Communication equipment, table item updating method and storage medium

Country Status (1)

Country Link
CN (1) CN113419978A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103209130A (en) * 2013-04-22 2013-07-17 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) address table entries and forwarding chips
CN104346285A (en) * 2013-08-06 2015-02-11 华为技术有限公司 Memory access processing method, device and system
CN111026324A (en) * 2018-10-09 2020-04-17 华为技术有限公司 Updating method and device of forwarding table entry

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103209130A (en) * 2013-04-22 2013-07-17 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) address table entries and forwarding chips
CN104346285A (en) * 2013-08-06 2015-02-11 华为技术有限公司 Memory access processing method, device and system
CN111026324A (en) * 2018-10-09 2020-04-17 华为技术有限公司 Updating method and device of forwarding table entry

Similar Documents

Publication Publication Date Title
CN108897628B (en) Method and device for realizing distributed lock and electronic equipment
CN108228646B (en) Method and electronic device for accessing data
JP6325001B2 (en) Method and system using recursive event listeners in nodes of hierarchical data structures
CN109213604B (en) Data source management method and device
US10592312B2 (en) Message oriented middleware with integrated rules engine
CN108614976A (en) Authority configuring method, device and storage medium
US9514176B2 (en) Database update notification method
CN104423982A (en) Request processing method and device
US20220222068A1 (en) Data structures for managing configuration versions of cloud-based applications
CN111694992A (en) Data processing method and device
CN106156050B (en) Data processing method and device
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN113419978A (en) Communication equipment, table item updating method and storage medium
CN112115521A (en) Data access method and device
CN113742050B (en) Method, device, computing equipment and storage medium for operating data object
US10678453B2 (en) Method and device for checking false sharing in data block deletion using a mapping pointer and weight bits
CN112783954B (en) Data access method, device and server
CN105072047A (en) Message transmitting and processing method
CN107305582B (en) Metadata processing method and device
CN114020764B (en) Processing method and system for high-performance data clone copy
CN117194298B (en) Control method, device, equipment and storage medium
CN115865839B (en) ACL management method, ACL management device, communication equipment and storage medium
US11799768B1 (en) Lightweight reactive workflows through internal event generation and matching
US9251101B2 (en) Bitmap locking using a nodal lock
CN110838333B (en) Hash table repairing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210921