Packet sending table item processing method and device, electronic equipment and storage medium
By setting multiple target storage spaces in the forwarding chip and using control fields to manage the storage and processing of packet table entries, the problem of low resource utilization of packet table entries in OAM packets is solved, and storage space saving and processing efficiency are achieved. promote.
Patent Information
- Application Number
- CN202411614038.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the prior art, when processing OAM packets, the resource utilization rate of the packet table entry is low, resulting in wasted storage space and unable to support large-scale OAM sessions.
By setting multiple target storage spaces in the storage space controlled by the forwarding chip, the packaged table entries are dynamically obtained and stored from the host CPU, and the storage and processing of table entries are managed using the control field to ensure that only the queried table entries occupy the storage space. And immediately process the newly stored entry group after processing one entry group.
It significantly saves the storage space of the forwarding chip, improves the utilization rate of the packetized table entry resources, reduces the number of free table entry waiting to be queried, and ensures an efficient processing process.
Smart Images

Figure CN119149243A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a method, device, electronic device and storage medium for processing a packet sending table item. Background Art
[0002] OAM (Operation, Administration and Maintenance) messages, including BFD (Bidirectional Forwarding Detection), CFD (Connectivity Falut Detection), TWAMP (Two-way Active Measurement Protocol), etc., play an important role in network detection (such as link connectivity detection, delay jitter measurement, packet loss calculation, etc.), and are indispensable functions for high-performance switching, routing and forwarding chips.
[0003] When forwarding OAM messages, the forwarding chip needs to use the packet table. Due to factors such as the area and cost of the forwarding chip, the on-chip storage space of the forwarding chip is very limited. SRAM (Static Random Access Memory) is mostly used on the chip, while DDR (Double Data Rate SDRAM) with larger storage space is mostly used outside the chip for data storage.
[0004] When sending OAM messages in related technologies, taking BFD as an example, the storage space required for each session to store the packet table entry is about 128 bytes. In high-performance routers or switches, the total size of BFD sessions usually reaches thousands or even tens of thousands. The host CPU (Central Processing Unit) cannot support such a large-scale session using software solutions, and will send the packet table entries of all OAM sessions to the on-chip or off-chip storage space of the forwarding chip to implement the storage of the packet table entries.
[0005] However, the solution of the related technology will occupy a large amount of table storage space of the forwarding chip. Since OAM sessions are periodic packets, even if all sessions are configured with a minimum packet transmission interval of 3ms, each packet transmission table entry will only be queried and used once every 3ms. For high-performance switching routing forwarding chips, the utilization rate of packet transmission table resources is relatively low. In actual network operations, such a small 3ms packet transmission interval is usually not configured, but a larger interval, such as 10ms or longer, is selected to avoid OAM sessions being too sensitive to link status, so the utilization rate of packet transmission table resources will be even lower. Summary of the invention
[0006] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for processing a packet sending table entry, so as to save the storage space controlled by the forwarding chip, thereby improving the resource utilization rate of the packet sending table entry. The specific technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for processing a packet sending table item, which is applied to a forwarding chip, wherein a plurality of target storage spaces exist in a storage space controlled by the forwarding chip, and a storage space controlled by a host central processing unit (CPU) stores packet sending table items for forwarding operations, management and maintenance of OAM messages, wherein the packet sending table items are divided into packet sending table item groups, and the serial numbers of the packet sending table items in each packet sending table item group are adjacent in sequence, and the method comprises:
[0008] Obtaining a first packet sending table item group from the host CPU, and storing the current first packet sending table item group into a first storage space in the target storage space;
[0009] Start processing each packet sending table item stored in the current first storage space;
[0010] Determine whether it is necessary to continue processing the next packet sending table item group;
[0011] If it is necessary to continue processing the next packet sending table item group, a new second packet sending table item group is obtained from the host CPU, and the current second packet sending table item group is stored in a second storage space in the target storage space except the current first storage space, wherein the time required for obtaining and storing the current second packet sending table item group is not greater than the time required for processing the packet sending table items in the current first storage space, and the serial number of the first packet sending table item in the current second packet sending table item group is: the remainder of the current first value and the total number of packet sending table items in the host CPU, and the first value is: the sum of the serial number of the last table item in the current first packet sending table item group and 1;
[0012] The current second storage space is used as a new first storage space, and execution is started from the step of starting to process each packet sending table entry stored in the current first storage space.
[0013] In one embodiment of the present application, the acquiring a new second packet sending table entry group from the host CPU and storing the current second packet sending table entry group in a second storage space other than the current first storage space in the target storage space includes:
[0014] After starting to process the first packet sending entry in the current first storage space, initiating a dynamic transfer request to the host CPU;
[0015] A new second packet sending table entry group fed back by the host CPU in response to the dynamic transfer request is obtained, and the current second packet sending table entry group is stored in a second storage space in the target storage space except the current first storage space.
[0016] In one embodiment of the present application, the packet sending entry includes a control field, and the control field includes at least one of the following:
[0017] The first field is used to identify whether the packet sending entry has been stored in the target storage space;
[0018] The second field is used to identify whether a new group of package sending entries needs to be obtained and stored in the target storage space after starting to process the package sending entry;
[0019] The third field is used to identify the target base address when it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space. The target base address is the address of the target storage space to which the new packet sending entry group to be stored in the forwarding chip belongs.
[0020] In one embodiment of the present application, for any packet sending entry, the forwarding chip processes the packet sending entry in the following manner:
[0021] Based on the first field, determining whether the packet sending entry has been stored in the target storage space;
[0022] In the case where the first field indicates that the package sending entry has been stored in the target storage space, based on the second field, determining whether a new package sending entry group needs to be obtained and stored in the target storage space;
[0023] When the second field indicates that a new packet sending table item group needs to be obtained and stored in the target storage space, the new second packet sending table item group is obtained from the host CPU, and based on the third field, the target base address of the new second packet sending table item group is determined, and the new second packet sending table item group is stored in the target storage space corresponding to the target base address.
[0024] In one embodiment of the present application, the sum of the number of entries of the packet sending entries that can be stored in the multiple target storage spaces can be divided evenly by the total number of the packet sending entries in the host CPU.
[0025] In one embodiment of the present application, the number of the target storage spaces is two, and the sizes of the two target storage spaces are equal.
[0026] In a second aspect, an embodiment of the present application provides a packet item processing device, which is applied to a forwarding chip, wherein a plurality of target storage spaces exist in a storage space controlled by the forwarding chip, and a storage space controlled by a host central processing unit (CPU) stores packet items for forwarding operations, management and maintenance of OAM messages, wherein the packet items are divided into packet item groups, and the serial numbers of the packet items in each packet item group are adjacent in sequence, and the device comprises:
[0027] A first acquisition and storage module, used for acquiring a first packet sending table item group from the host CPU, and storing the current first packet sending table item group into a first storage space in the target storage space;
[0028] A first processing module, used to start processing each packet sending table item stored in the current first storage space;
[0029] A first judgment module is used to judge whether it is necessary to continue processing the next packet sending table item group;
[0030] The second acquisition and storage module is used to obtain a new second packet sending item group from the host CPU if it is necessary to continue processing the next packet sending item group, store the current second packet sending item group in a second storage space in the target storage space except the current first storage space, use the current second storage space as the new first storage space, and return to trigger the execution of the first processing module, wherein the time required to obtain and store the current second packet sending item group is not greater than the time required to process the packet sending items in the current first storage space, the serial number of the first packet sending item in the current second packet sending item group is: the remainder of the current first value and the total number of packet sending items in the host CPU, and the first value is: the sum of the serial number of the last item in the current first packet sending item group and 1.
[0031] In one embodiment of the present application, the second acquisition and storage module is specifically used to:
[0032] After starting to process the first packet sending entry in the current first storage space, initiating a dynamic transfer request to the host CPU;
[0033] A new second packet sending table entry group fed back by the host CPU in response to the dynamic transfer request is obtained, and the current second packet sending table entry group is stored in a second storage space in the target storage space except the current first storage space.
[0034] In one embodiment of the present application, the packet sending entry includes a control field, and the control field includes at least one of the following:
[0035] The first field is used to identify whether the packet sending entry has been stored in the target storage space;
[0036] The second field is used to identify whether a new group of package sending entries needs to be obtained and stored in the target storage space after starting to process the package sending entry;
[0037] The third field is used to identify the target base address when it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space. The target base address is the address of the target storage space to which the new packet sending entry group to be stored in the forwarding chip belongs.
[0038] In one embodiment of the present application, for any package delivery entry, the package delivery entry processing device specifically includes:
[0039] A second judgment module, used for judging whether the packet sending entry has been stored in the target storage space based on the first field;
[0040] A third judgment module, configured to judge whether it is necessary to obtain a new group of package sending items and store them in the target storage space based on the second field when the first field indicates that the package sending item has been stored in the target storage space;
[0041] The third acquisition and storage module is used to obtain a new second packet sending item group from the host CPU when the second field indicates that a new packet sending item group needs to be obtained and stored in a target storage space, determine the target base address of the new second packet sending item group based on the third field, and store the new second packet sending item group in a target storage space corresponding to the target base address.
[0042] In one embodiment of the present application, the sum of the number of entries of the packet sending entries that can be stored in the multiple target storage spaces can be divided evenly by the total number of the packet sending entries in the host CPU.
[0043] In one embodiment of the present application, the number of the target storage spaces is two, and the sizes of the two target storage spaces are equal.
[0044] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0045] Memory, used to store computer programs;
[0046] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0048] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the method steps described in the first aspect above.
[0049] Beneficial effects of the embodiments of the present application:
[0050] The embodiment of the present application provides a method for processing a packet sending table item, wherein there are multiple target storage spaces in the storage space controlled by the forwarding chip, and the storage of the packet sending table items from the host CPU is completed only through the target storage space. The method provided by the embodiment of the present application can dynamically store a part of the packet sending table items from the host CPU to the storage space controlled by the forwarding chip. During the processing, only this part of the packet sending table items will occupy the storage space controlled by the forwarding chip, and when processing the packet sending table items in one of the target storage spaces, another group of packet sending table items from the host CPU can be stored in another target storage space at the same time, so that after completing the processing of the packet sending table items in one target storage space, the newly stored packet sending table items can be processed immediately without affecting the processing efficiency of the packet sending table items.
[0051] That is, compared with the methods of the prior art, the method provided in the embodiments of the present application can reduce the number of packet table entries stored in the storage space controlled by the forwarding chip. Therefore, within a fixed time period, the number of idle packet table entries waiting to be queried and used will be reduced, which significantly saves the storage space controlled by the forwarding chip and improves the resource utilization of the packet table entries.
[0052] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0054] Figure 1 A schematic diagram of the contents of a BFD session packet table in the related art;
[0055] Figure 2 An example diagram of the correspondence between BFD session specifications and table entry space required for packet transmission in the related art;
[0056] Figure 3 A schematic diagram of the arrangement of multiple packet sending entries in a storage space controlled by a host central processing unit in the related art;
[0057] Figure 4 A flowchart of a first method for processing a package item provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of the arrangement of the packet sending table items in the first target storage space provided in an embodiment of the present application;
[0059] Figure 6 A flowchart of a second method for processing a package item provided in an embodiment of the present application;
[0060] Figure 7 A schematic diagram of the arrangement of the packet sending table items in the second target storage space provided in an embodiment of the present application;
[0061] Figure 8 A schematic diagram of a processing process of a package item provided in an embodiment of the present application;
[0062] Fig. 9 A schematic diagram of the structure of a packet item processing device provided in an embodiment of the present application;
[0063] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0065] In the related art, when sending OAM messages, taking BFD as an example, see Figure 1, which is a schematic diagram of the contents of the packet table of a BFD session, including packet control information, packet encapsulation information, and outbound interface information. The packet control information includes the session index, packet interval, and packet length; the packet encapsulation information includes Ethernet II frame (Ethernet II), Internet Protocol header (IP header, Internet Protocol header), User Datagram Protocol header (UDP header, User Datagram Protocol header), Bidirectional Forwarding Detection header (BFD header), and Authentication header (Auth header, Authentication header); the outbound interface information includes the outbound interface index (physical port / aggregation port / tunnel port). The space required to store a single packet table entry is 128B. In high-performance routers or switches, the total scale of BFD sessions usually reaches thousands or even tens of thousands, see Figure 2 , is an example of the correspondence between the BFD session specification and the table space required for packet transmission. Assuming that the BFD session specification is 2K, that is, the number of packet transmission items is 2048, namely, packet transmission item 0, packet transmission item 1, packet transmission item 2, ..., packet transmission item 2047. Since the space required to store a single packet transmission item is 128B, the space required to store 2K packet transmission items is: 2048×128B=262144B=256KB; Assuming that the BFD session specification is 1 0K, that is, the number of package items is 10240, namely package item 0, package item 1, package item 2, ..., package item 2047, package item 2048, package item 2049, ..., package item 10238, package item 10239. Since the space required to store a single package item is 128B, the space required to store 10K package items is: 10240×128B=1310720B=1280KB=1.25MB.
[0066] After the OAM session packet table entries are generated, they are initially stored in the storage space controlled by the host CPU. Figure 3, is a schematic diagram of the arrangement of multiple packet sending items in the storage space controlled by the host central processing unit, wherein the total number of packet sending items in the storage space is N, namely, packet sending item 0, packet sending item 1, packet sending item 2, ..., packet sending item N-1, a single packet sending item occupies 128B of storage space, wherein 1, 2, ..., N-1 are the session indexes of the packet sending items, the storage space controlled by the host central processing unit also stores the base address of each packet sending item, namely: packet sending item 0 is the base address, packet sending item 1 is the base address + 128B, packet sending item 2 is the base address + 128B × 2, packet sending item N-1 is the base address + 128B × (N-1), the base address of any packet sending item is: base address + 128B × session index, the base address can also be called base address.
[0067] However, the host CPU cannot support such a large number of sessions using software solutions. In this case, all OAM session packet entries will be sent to the on-chip or off-chip storage space of the forwarding chip to implement the storage of the packet entry. However, this solution will occupy a large amount of table storage space of the forwarding chip, and the utilization rate of the packet entry resources is low.
[0068] In order to save the storage space of the forwarding chip control and thus improve the resource utilization of the packet sending table, see Figure 4 , which is a flow chart of a first method for processing a packet sending table item provided in an embodiment of the present application, and is applied to a forwarding chip. The method includes the following steps S401-S405.
[0069] Step S401: Obtain a first packet sending entry group from the host central processor, and store the current first packet sending entry group into a first storage space in the target storage space.
[0070] There are multiple target storage spaces in the storage space controlled by the forwarding chip. The storage space controlled by the host CPU stores packet sending items for forwarding OAM messages. The packet sending items are divided into packet sending item groups. The serial numbers of the packet sending items in each packet sending item group are adjacent in sequence.
[0071] The above-mentioned target storage space is a part of the storage space controlled by the above-mentioned forwarding chip, which is used to store the packet sending table items for forwarding OAM messages from the storage space controlled by the host CPU. The storage space controlled by the above-mentioned forwarding chip can be the on-chip storage space of the forwarding chip (such as SRAM, etc.) or the off-chip storage space of the forwarding chip (such as DDR, etc.). The size of each target storage space is not limited, as long as the number of target storage spaces is two or more.
[0072] See also Figure 5, which is a schematic diagram of the arrangement of package items in the first target storage space provided in an embodiment of the present application, there are n target storage spaces, namely target storage space 1, target storage space 2, ..., target storage space n, the maximum number of package items that can be stored in each target storage space is M, and the storage space occupied by each package item is 128B. Among them, the packet sending items to be stored in the target storage space 1 are respectively recorded as: packet sending item X, packet sending item X+1, packet sending item X+2, ..., packet sending item X+M-1, the reference addresses of the packet sending items to be stored in the target storage space 1 are respectively: packet sending item X is the reference address 0, packet sending item X+1 is the reference address 0+128B, packet sending item X+2 is the reference address 0+128B×2, packet sending item X+M-1 is the reference address 0+128B×(M-1), and the reference address of any packet sending item to be stored is: reference address 0+128B×session index; the packet sending items to be stored in the target storage space 2 are respectively recorded as: packet sending item X+M , package item X+M+1, package item X+M+2, ..., package item X+2M-1, the base addresses of the package items to be stored in the target storage space 2 are: package item X+M is the base address 1, package item X+M+1 is the base address 1+128B, package item X+M+2 is the base address 1+128B×2, package item X+2M-1 is the base address 1+128B×(M-1), the base address of any package item to be stored is: base address 1+128B×session index; the package items to be stored in the target storage space n are recorded as: package item X+(n-1)M, package item X+(n-1)M +1, packet entry X+(n-1)M+2, ..., packet entry X+nM-1, the base addresses of the packet entries to be stored in the target storage space n are: packet entry X+(n-1)M is the base address (n-1), packet entry X+(n-1)M+1 is the base address (n-1)+128B, packet entry X+(n-1)M+2 is the base address (n-1)+128B×2, packet entry X+nM-1 is the base address (n-1)+128B×(M-1), and the base address of any packet entry to be stored is: base address (n-1)+128B×session index. In actual applications, the number and capacity of the target storage space can be adjusted according to the performance of the forwarding chip in sending OAM messages, the processing performance of the packet entry, etc.
[0073] The space occupied by all entries in the first packet sending entry group must be less than or equal to the capacity of the first storage space.
[0074] Step S402: Start processing each packet sending table entry stored in the current first storage space.
[0075] The forwarding chip processes each packet sending table item stored in the current first storage space, and can determine the processing method of the packet sending table item according to various information contained in the packet sending table item, such as whether the packet needs to be sent, whether the processing needs to be terminated, etc.
[0076] Step S403: Determine whether it is necessary to continue processing the next packet sending entry group.
[0077] In the process of processing the packet sending entries stored in the current first storage space, it is determined whether it is necessary to continue processing the next packet sending entry group, where the next packet sending entry group is a new group of packet sending entries obtained from the host CPU.
[0078] If the judgment result is yes, execute step S404; if the judgment result is no, end the process.
[0079] Step S404: obtaining a new second packet sending entry group from the host central processor, and storing the current second packet sending entry group into a second storage space in the target storage space except the current first storage space.
[0080] Among them, the time required to obtain and store the current second packet sending item group is not greater than the time required to process the packet sending items in the current first storage space, and the serial number of the first packet sending item in the current second packet sending item group is: the remainder of the current first value and the total number of packet sending items in the above-mentioned host CPU, and the above-mentioned first value is: the sum of the serial number of the last item in the current first packet sending item group and 1.
[0081] Since the scheme of the present application is a cyclic processing process, in order to facilitate the forwarding chip to process the packet items, the serial number of the first packet item in the current second packet item group is set to: the remainder of the current first value and the total number of packet items in the above-mentioned host CPU, and the above-mentioned first value is: the sum of the serial number of the last item in the current first packet item group and 1. In an example, the total number of packet items in the above-mentioned host CPU is 1024, and the serial numbers of the packet items in the current first packet item group are 512-1023, that is, the serial number of the last item in the current first packet item group is 1023, then the current first value is: 1023+1=1024, so the remainder of the current first value 1024 and the total number of packet items 1024 in the above-mentioned host CPU is 0, then the serial number of the first packet item in the current second packet item group is set to 0.
[0082] Step S405: Use the current second storage space as a new first storage space.
[0083] Return to the above step S402 and start execution.
[0084] As can be seen from the above, the packet list processing method provided by the embodiment of the present application, there are multiple target storage spaces in the storage space controlled by the forwarding chip, and the storage of the packet list items from the host CPU is completed only through the target storage space. The method provided by the embodiment of the present application can dynamically store a part of the packet list items from the host CPU to the storage space controlled by the forwarding chip. During the processing, only this part of the packet list items will occupy the storage space controlled by the forwarding chip, and when processing the packet list items in one of the target storage spaces, another group of packet list items from the host CPU can be stored in another target storage space at the same time, so that after completing the processing of the packet list items in one target storage space, the newly stored packet list items can be processed immediately without affecting the processing efficiency of the packet list items. That is, compared with the method of the prior art, the method provided by the embodiment of the present application can reduce the number of packet list items stored in the storage space controlled by the forwarding chip, so that within a fixed time period, the number of idle packet list items waiting to be queried and used will be reduced, which significantly saves the storage space controlled by the forwarding chip, thereby improving the resource utilization of the packet list items.
[0085] See also Figure 6 , which is a flow chart of the second method for processing a packet sending table item provided in an embodiment of the present application, the above step S404 can be implemented by the following steps S404A-S404B.
[0086] Step S404A: after starting to process the first packet sending entry in the current first storage space, a dynamic transfer request is initiated to the host central processor.
[0087] The above step S404A indicates that when the forwarding chip processes any packet sending item in the current first storage space, it can initiate a dynamic transfer request to the above host CPU. Since the number of packet sending item groups obtained each time is not necessarily equal, it is sufficient to ensure that the storage of the next packet sending item group is completed during the processing of the packet sending item in the current first storage space.
[0088] In an example, the forwarding chip may be configured to initiate a dynamic transfer request to the host CPU when processing the first packet sending entry in the current first storage space.
[0089] Step S404B: obtaining a new second packet sending entry group fed back by the host CPU in response to the dynamic transfer request, and storing the current second packet sending entry group into a second storage space in the target storage space except the current first storage space.
[0090] The host CPU will feedback a new group of packet sending item groups, namely the new second packet sending item group, in response to the dynamic transfer request. After the forwarding chip obtains the new second packet sending item group, it is necessary to store the current second packet sending item group in the target storage space except the current first storage space.
[0091] As can be seen from the above, the packet item processing method provided in the embodiment of the present application can quickly and accurately obtain a new packet item group by initiating a dynamic transfer request to the host CPU to obtain a new second packet item group after starting to process the first packet item in the current first storage space.
[0092] In one embodiment of the present application, the above-mentioned packet sending table entry includes a control field, and the above-mentioned control field includes at least one of the following:
[0093] The first field is used to identify whether the packet sending entry has been stored in the target storage space;
[0094] The second field is used to identify whether a new group of package sending entries needs to be obtained and stored in the target storage space after starting to process the package sending entry;
[0095] The third field is used to identify the target base address when it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space. The target base address is the address of the target storage space to which the new packet sending entry group to be stored in the forwarding chip belongs.
[0096] The control fields can be set in the reserved free bytes in the packet sending table, and the number of bits occupied by each control field can be 1 bit, 2 bits or even more. In an example, in order to save fields, the number of bits occupied by each control field is 1 bit. For the convenience of description, the first field can be recorded as the bMoveDone (transfer completion) field, the second field can be recorded as the bBeginMove (transfer start) field, and the third field can be recorded as the BaseAddrPos (base address position) field.
[0097] As can be seen from the above, the method for processing the packet sending items provided in the embodiment of the present application can accurately determine the real-time status of each packet sending item by setting a control field in the packet sending item, thereby achieving accurate processing of the packet sending item.
[0098] In one embodiment of the present application, for any packet sending entry, the forwarding chip may process the packet sending entry by following steps A to C.
[0099] Step A: Based on the first field, determine whether the packet sending entry has been stored in the target storage space.
[0100] Specifically, the value of the field at the location of the first field in the storage space controlled by the forwarding chip can be read to determine whether the packet sending entry has been stored in the target storage space. For example, when the number of bits occupied by the first field is 1 bit, the following judgment method can be used to determine whether the packet sending entry has been stored in the target storage space:
[0101] When the first field is 1, it is determined that the packet sending entry has been stored in the target storage space;
[0102] When the first field is 0, it is determined that the packet sending entry is not stored in the target storage space.
[0103] It should be noted that for any packet sending item, the first field is 1 in the host CPU. If the forwarding chip obtains the packet sending item and stores it in the target storage space, the first field of the packet sending item is 1, indicating that the packet sending item has been stored in the target storage space. After the forwarding chip processes the packet sending item, it needs to set the first field to 0. Until the next time the packet sending item needs to be obtained and stored, the first field is always 0. This is to prevent the first field from taking a value of 1 before the next packet sending item is actually not successfully stored in the target storage space, resulting in the forwarding chip judging that the packet sending item has been stored in the target storage space based on the value of 1 in the first field. False processing situation.
[0104] It should be noted that the first field being 1 indicates that the package sending item has been stored in the target storage space, and being 0 indicates that the package sending item has not been stored in the target storage space is only one possible embodiment. In another possible embodiment, the first field being 0 indicates that the package sending item has been stored in the target storage space, and being 1 indicates that the package sending item has not been stored in the target storage space. The specific value of the first field and the meaning corresponding to the value are not limited in this application, as long as the values indicating that the package sending item has been stored in the target storage space and that it has not been stored in the target storage space are different.
[0105] Step B: When the first field indicates that the packet sending entry has been stored in the target storage space, based on the second field, it is determined whether a new packet sending entry group needs to be obtained and stored in the target storage space.
[0106] If the first field indicates that the packet sending item has not been stored in the target storage space, it means that the acquisition and storage of the packet sending item has failed, which is recorded as an error processing. The number of error processing is counted and the processing of the packet sending item is terminated, and the processing of the next packet sending item continues. In addition, the forwarding chip will determine whether the packet sending item needs to forward the OAM message based on the control information in the packet sending item. In the solution provided in the embodiment of the present application, regardless of whether the packet sending item needs to forward the OAM message, as long as the first field indicates that the packet sending item has been stored in the target storage space, it is necessary to determine whether a new packet sending item group needs to be obtained and stored in the target storage space based on the second field.
[0107] Specifically, the value of the field at the location of the second field in the storage space controlled by the forwarding chip can be read to determine whether a new packet sending table item group needs to be obtained and stored in the target storage space. For example, when the number of bits occupied by the second field is 1 bit, it can be determined whether a new packet sending table item group needs to be obtained and stored in the target storage space according to the following judgment method:
[0108] When the second field is 1, it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space;
[0109] When the second field is 0, it is determined that there is no need to obtain a new packet sending entry group and store it in the target storage space.
[0110] In one example, the second field of the first packet sending entry in each packet sending entry group is 1, which means that when the forwarding chip processes the first packet sending entry in the current target storage space, it obtains a new packet sending entry group and stores it in another target storage space.
[0111] It should be noted that the second field being 1 indicates that a new group of package item needs to be obtained and stored in the target storage space, and being 0 indicates that a new group of package item does not need to be obtained and stored in the target storage space is only one possible embodiment. In another possible embodiment, the second field being 0 indicates that a new group of package item needs to be obtained and stored in the target storage space, and being 1 indicates that a new group of package item does not need to be obtained and stored in the target storage space. The specific value of the second field and the meaning corresponding to the value are not limited in this application, as long as the values indicating that a new group of package item needs to be obtained and stored in the target storage space and that a new group of package item does not need to be obtained and stored in the target storage space are different.
[0112] Step C: When the second field indicates that a new packet sending item group needs to be obtained and stored in the target storage space, a new second packet sending item group is obtained from the host CPU, and based on the third field, the target base address of the new second packet sending item group is determined, and the new second packet sending item group is stored in the target storage space corresponding to the target base address.
[0113] Specifically, the value of the field at the location of the third field in the storage space controlled by the forwarding chip can be read to determine the target base address of the new second packet sending table item group. For example, when the number of bits occupied by the third field is 1 bit, and there are two target storage spaces, namely target storage space 1 and target storage space 2, the target base address in target storage space 1 is base address0, and the target base address in target storage space 2 is baseaddress1, the target base address of the new second packet sending table item group can be determined according to the following judgment method, and the new second packet sending table item group can be stored in the target storage space corresponding to the target base address:
[0114] When the third field is 1, the target base address of the new second packet sending table entry group is determined to be baseaddress0, and the new second packet sending table entry group is stored in the target storage space 1;
[0115] When the first field is 0, the target base address of the new second packet sending table entry group is determined to be baseaddress1, and the new second packet sending table entry group is stored in the target storage space 2.
[0116] It should be noted that the third field is 1, indicating that the target base address of the new second package item group is baseaddress0, and the new second package item group is stored in target storage space 1. The third field is 0, indicating that the target base address of the new second package item group is base address1, and the new second package item group is stored in target storage space 2. This is only one possible embodiment. In another possible embodiment, the third field is 0, indicating that the target base address of the new second package item group is base address0, and the new second package item group is stored in target storage space 1. The third field is 1, indicating that the target base address of the new second package item group is base address1, and the new second package item group is stored in target storage space 2. The specific value of the third field and the corresponding meaning of the value are not limited in this application, as long as the values indicating that the new package item group needs to be obtained and stored in the target storage space and the new package item group does not need to be obtained and stored in the target storage space are different.
[0117] From the above, it can be seen that the packet sending item processing method provided in the embodiment of the present application can implement the storage and processing of the packet sending item based on the control field for any packet sending item, and after determining that a packet sending item does not need to be sent, it can immediately continue to process the next packet sending item, thereby improving the processing efficiency of the packet sending item.
[0118] In one embodiment of the present application, the sum of the number of entries of the packet sending table items that can be stored in the above-mentioned multiple target storage spaces can be divided evenly by the total number of the packet sending table items in the above-mentioned host CPU.
[0119] The target storage space is a storage space with no less than two forwarding chips. In the embodiment of the present application, the sum of the number of items of the packet sending table items that can be stored in all target storage spaces is set to be divisible by the total number of the packet sending table items in the host CPU. If the total number of the packet sending table items in the host CPU is N, the sum of the number of items of the packet sending table items that can be stored in all target storage spaces needs to be divisible by N. For example, if the total number of the packet sending table items in the host CPU is 1024, the sum of the number of items of the packet sending table items that can be stored in all target storage spaces can be 512, 256, 128, etc.
[0120] It can be seen from the above that the packet table item processing method provided in the embodiment of the present application can, on the basis of saving the storage space controlled by the forwarding chip, further improve the processing efficiency of the packet table items by setting the sum of the number of packet table items that can be stored in all target storage spaces to be divisible by the total number of packet table items in the above-mentioned host CPU.
[0121] In one embodiment of the present application, the number of the target storage spaces is two, and the sizes of the two target storage spaces are equal.
[0122] See also Figure 7, which is a schematic diagram of the arrangement of the packet sending items in the second target storage space provided in an embodiment of the present application. In the storage space controlled by the forwarding chip, there are two target storage spaces, which are respectively recorded as target storage space 1 and target storage space 2, and the maximum number of packet sending items that can be stored in target storage space 1 and target storage space 2 is M. Among them, the packet sending items to be stored in target storage space 1 are respectively recorded as: packet sending item X, packet sending item X+1, packet sending item X+2, ..., packet sending item X+M-1; the packet sending items to be stored in target storage space 2 are respectively recorded as: packet sending item X+M, packet sending item X+M+1, packet sending item X+M+2, ..., packet sending item X+2M-1. The target storage space 1 and the target storage space 2 can be a large storage space with continuous addresses, which is divided into two small sections from the middle, namely the target storage space 1 and the target storage space 2; or they can be two independent storage spaces, that is, the addresses between the target storage space 1 and the target storage space 2 are not continuous, but the addresses in each target storage space are continuous. In addition, the target base address is also stored in the target storage space, which is used to determine the target storage space to which the new packet sending table entry group belongs after the forwarding chip obtains the new packet sending table entry group. The target base address in the target storage space 1 is the base address 0, and the target base address in the target storage space 2 is the base address 1. The target base addresses of each packet sending item to be stored in the target storage space 1 are: the packet sending item X is the reference address 0, the packet sending item X+1 is the reference address 0+128B, the packet sending item X+2 is the reference address 0+128B×2, the packet sending item X+M-1 is the reference address 0+128B×(M-1), and the target base address of any packet sending item to be stored is: reference address 0+128B×session index; the target base addresses of each packet sending item to be stored in the target storage space 2 are: the packet sending item X+M is the reference address 1, the packet sending item X+M+1 is the reference address 1+128B, the packet sending item X+M+2 is the reference address 1+128B×2, the packet sending item X+2M-1 is the reference address 1+128B×(M-1), and the target base address of any packet sending item to be stored is: reference address 1+128B×session index.
[0123] In the embodiment of the present application, the specific processing flow of the forwarding chip is as follows:
[0124] When the forwarding chip is processing the packet sending table item X in the target storage space 1, the first dynamic transfer request is initiated, and the packet sending table item [(X+M)%N, ((X+M)%N) + M-1] stored in the storage space controlled by the host CPU is stored in the target storage space 2 in an asynchronous manner; when the forwarding chip is processing the M packet sending table items in the target storage space 1, the packet sending table item [(X+M)%N, ((X+M)%N) + M-1] is stored. Similarly, when the forwarding chip is processing the packet sending table item (X+M)%N in the target storage space 2, the second dynamic transfer request is initiated, and the packet sending table item [(X+2M)%N, ((X+2M)%N) + M-1] stored in the storage space controlled by the host CPU is stored in the target storage space 1 in an asynchronous manner; when the chip is processing the M packet sending table items in the target storage space 2, the packet sending table item [(X+2M)%N, ((X+2M)%N) + M-1] is stored. This cycle repeats itself, and the entire process of processing the package items becomes smooth.
[0125] For an example, see Figure 8 , is a schematic diagram of a processing process of a packet sending table item provided in an embodiment of the present application, wherein the specification of the OAM session is N=2K, that is, the number of packet sending table items stored in the storage space controlled by the host central processor is N=2048, and the maximum number of packet sending table items that can be stored in a target storage space is M=512, that is, 2M=1024, that is, the 2048 packet sending table items stored in the storage space controlled by the host central processor are divided into 4 parts of equal number of packet sending table items, and the four parts of packet sending table items are respectively They are: contract item 0, contract item 1, contract item 2, ..., contract item 511 (Part 1); contract item 512, contract item 513, contract item 514, ..., contract item 1023 (Part 2); contract item 1024, contract item 1025, contract item 1026, ..., contract item 1535 (Part 3); contract item 1536, contract item 1537, contract item 1538, ..., contract item 2047 (Part 4). There are two target storage spaces in the storage space controlled by the forwarding chip. The number of packet sending items that can be stored in each target storage space is M=512. The packet sending items to be stored in the two target storage spaces are respectively recorded as packet sending items [X, X+511] and packet sending items [X+512, X+1023]. The initial packet sending items stored in the target storage space of the forwarding chip are the packet sending items [0,511] in the host central processor (Part 1). When the forwarding chip starts the scheduled packet sending, the steps executed are:
[0126] Step (1): When processing the packet entry 0, a dynamic transfer request is initiated to asynchronously store the packet entry [512, 1023] (part 2) stored in the storage space controlled by the host CPU to the packet entry [X+512, X+1023] position in the target storage space;
[0127] Step (2): When processing the packet entry 512, the forwarding chip initiates a dynamic transfer request and asynchronously stores the packet entry [1024, 1535] (part 3) stored in the storage space controlled by the host CPU to the packet entry [X, X+511] position in the target storage space;
[0128] Step (3): When processing the packet entry 1024, the forwarding chip initiates a dynamic transfer request and asynchronously stores the packet entry [1536, 2047] (part 4) stored in the storage space controlled by the host CPU to the packet entry [X+512, X+1023] in the target storage space;
[0129] Step (4): When processing the packet entry 1536, the forwarding chip initiates a dynamic transfer request and asynchronously stores the packet entry [0,511] (part 1) stored in the storage space controlled by the host CPU to the packet entry [X, X+511] position in the target storage space;
[0130] The subsequent forwarding chip executes steps (1), (2), (3), and (4) in a loop, and the entire packet sending entry processing process is streamlined until there is no need to process new packet sending entries.
[0131] As can be seen from the above, the target storage space set in the embodiment of the present application is used to process the packet table items. Since there are two target storage spaces of equal size, it can be ensured that the forwarding chip stores the newly acquired packet table item group in the second target storage space during the process of processing the packet table items in the first target storage space, and after processing the packet table items in the first target storage space, it can immediately process the newly stored packet table items in the second target storage space; similarly, in the process of processing the newly stored packet table items in the second target storage space, another newly acquired packet table item group is stored in the first target storage space, and so on. The solution of the embodiment of the present application can be implemented by only two target storage spaces. Without affecting the processing efficiency of the forwarding chip, it is ensured that the two target storage spaces always store packet table items, and no waste of storage space is caused, thereby saving the storage space controlled by the forwarding chip to the maximum extent.
[0132] Corresponding to the aforementioned packet sending item processing method, the embodiment of the present application further provides a packet sending item processing device, which is applied to a forwarding chip, wherein there are multiple target storage spaces in the storage space controlled by the forwarding chip, and the storage space controlled by the host CPU stores packet sending items for forwarding OAM messages, and the packet sending items are divided into packet sending item groups, and the serial numbers of the packet sending items in each packet sending item group are adjacent in sequence, see Fig. 9 , is a structural diagram of a packet sending entry processing device provided in an embodiment of the present application, including:
[0133] A first acquisition and storage module 901 is used to acquire a first packet sending table item group from the host CPU, and store the current first packet sending table item group into a first storage space in the target storage space;
[0134] A first processing module 902 is used to start processing each packet sending table item stored in the current first storage space;
[0135] The first judgment module 903 is used to judge whether it is necessary to continue processing the next packet sending table entry group;
[0136] The second acquisition and storage module 904 is used to obtain a new second packet sending item group from the host CPU if it is necessary to continue processing the next packet sending item group, store the current second packet sending item group in a second storage space in the target storage space except the current first storage space, use the current second storage space as the new first storage space, and return to trigger the execution of the first processing module 902, wherein the time required to obtain and store the current second packet sending item group is not greater than the time required to process the packet sending items in the current first storage space, the serial number of the first packet sending item in the current second packet sending item group is: the remainder of the current first value and the total number of packet sending items in the host CPU, and the first value is: the sum of the serial number of the last item in the current first packet sending item group and 1.
[0137] As can be seen from the above, in the packet item processing device provided by the embodiment of the present application, there are multiple target storage spaces in the storage space controlled by the forwarding chip, and the storage of the packet items from the host CPU is completed only through the target storage space. The device provided by the embodiment of the present application can dynamically move a part of the packet items from the host CPU to the storage space controlled by the forwarding chip. During the processing, only this part of the packet items will occupy the storage space controlled by the forwarding chip, and when processing the packet items in one of the target storage spaces, another group of packet items from the host CPU can be stored in another target storage space at the same time, so that after completing the processing of the packet items in one target storage space, the newly stored packet items can be processed immediately without affecting the processing efficiency of the packet items. That is, the device provided by the embodiment of the present application can reduce the number of packet items stored in the storage space controlled by the forwarding chip, so that within a fixed time period, the number of idle packet items waiting to be queried and used will be reduced, which significantly saves the storage space controlled by the forwarding chip, thereby improving the resource utilization of the packet items.
[0138] In one embodiment of the present application, the second acquisition and storage module 904 is specifically used to:
[0139] After starting to process the first packet sending entry in the current first storage space, initiating a dynamic transfer request to the host CPU;
[0140] A new second packet sending table entry group fed back by the host CPU in response to the dynamic transfer request is obtained, and the current second packet sending table entry group is stored in a second storage space in the target storage space except the current first storage space.
[0141] From the above, it can be seen that the packet item processing device provided in the embodiment of the present application can quickly and accurately obtain a new packet item group by initiating a dynamic transfer request to the host CPU to obtain a new second packet item group after starting to process the first packet item in the current first storage space.
[0142] In one embodiment of the present application, the packet sending entry includes a control field, and the control field includes at least one of the following:
[0143] The first field is used to identify whether the packet sending entry has been stored in the target storage space;
[0144] The second field is used to identify whether a new group of package sending entries needs to be obtained and stored in the target storage space after starting to process the package sending entry;
[0145] The third field is used to identify the target base address when it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space. The target base address is the address of the target storage space to which the new packet sending entry group to be stored in the forwarding chip belongs.
[0146] It can be seen from the above that the packet sending item processing device provided in the embodiment of the present application can accurately determine the real-time status of each packet sending item by setting a control field in the packet sending item, thereby achieving accurate processing of the packet sending item.
[0147] In one embodiment of the present application, for any package delivery entry, the package delivery entry processing device specifically includes:
[0148] A second judgment module, used for judging whether the packet sending entry has been stored in the target storage space based on the first field;
[0149] A third judgment module, configured to judge whether it is necessary to obtain a new group of package sending items and store them in the target storage space based on the second field when the first field indicates that the package sending item has been stored in the target storage space;
[0150] The third acquisition and storage module is used to obtain a new second packet sending item group from the host CPU when the second field indicates that a new packet sending item group needs to be obtained and stored in a target storage space, determine the target base address of the new second packet sending item group based on the third field, and store the new second packet sending item group in a target storage space corresponding to the target base address.
[0151] From the above, it can be seen that the packet sending item processing device provided in the embodiment of the present application can implement the storage and processing of the packet sending item based on the control field for any packet sending item, and after determining that a packet sending item does not need to be sent, it can immediately continue to process the next packet sending item, thereby improving the processing efficiency of the packet sending item.
[0152] In one embodiment of the present application, the sum of the number of entries of the packet sending entries that can be stored in the multiple target storage spaces can be divided evenly by the total number of the packet sending entries in the host CPU.
[0153] It can be seen from the above that the packet table processing device provided in the embodiment of the present application can, on the basis of saving the storage space controlled by the forwarding chip, further improve the processing efficiency of the packet table items by setting the sum of the number of packet table items that can be stored in all target storage spaces to be divisible by the total number of packet table items in the above-mentioned host CPU.
[0154] In one embodiment of the present application, the number of the target storage spaces is two, and the sizes of the two target storage spaces are equal.
[0155] As can be seen from the above, the packet table item processing device provided in the embodiment of the present application has two target storage spaces of equal size, which can ensure that the forwarding chip stores the newly acquired packet table item group in the second target storage space during the process of processing the packet table items in the first target storage space, and after processing the packet table items in the first target storage space, it can immediately process the newly stored packet table items in the second target storage space; similarly, in the process of processing the newly stored packet table items in the second target storage space, the newly acquired packet table item group is stored in the first target storage space again, and so on. The solution of the embodiment of the present application can be implemented by only two target storage spaces. Without affecting the processing efficiency of the forwarding chip, it is ensured that the two target storage spaces always store packet table items, and no waste of storage space is caused, thereby saving the storage space controlled by the forwarding chip to the maximum extent.
[0156] The present application also provides an electronic device, such as Fig.10 As shown, it includes a processor 1001 , a communication interface 1002 , a memory 1003 and a communication bus 1004 , wherein the processor 1001 , the communication interface 1002 , and the memory 1003 communicate with each other via the communication bus 1004 .
[0157] Memory 1003, used for storing computer programs;
[0158] The processor 1001 is used to implement the above-mentioned method for processing the packet sending table item when executing the program stored in the memory 1003.
[0159] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0160] The communication interface is used for communication between the above electronic device and other devices.
[0161] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0162] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0163] In another embodiment provided by the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for processing packet sending entries are implemented.
[0164] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the methods for processing a packet sending entry in the above embodiments.
[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can 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 the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, 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 computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0166] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0167] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0168] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for processing a package item, characterized in that: Applied to a forwarding chip, a storage space controlled by the forwarding chip has multiple target storage spaces, a storage space controlled by a host central processing unit (CPU) stores packet sending items for forwarding operations, management and maintenance of OAM messages, the packet sending items are divided into packet sending item groups, and the serial numbers of the packet sending items in each packet sending item group are adjacent in sequence, the method includes: Obtaining a first packet sending table item group from the host CPU, and storing the current first packet sending table item group into a first storage space in the target storage space; Start processing each packet sending table item stored in the current first storage space; Determine whether it is necessary to continue processing the next packet sending table item group; If it is necessary to continue processing the next packet sending table item group, a new second packet sending table item group is obtained from the host CPU, and the current second packet sending table item group is stored in a second storage space in the target storage space except the current first storage space, wherein the time required for obtaining and storing the current second packet sending table item group is not greater than the time required for processing the packet sending table items in the current first storage space, and the serial number of the first packet sending table item in the current second packet sending table item group is: the remainder of the current first value and the total number of packet sending table items in the host CPU, and the first value is: the sum of the serial number of the last table item in the current first packet sending table item group and 1; The current second storage space is used as a new first storage space, and execution is started from the step of starting to process each packet sending table entry stored in the current first storage space.
2. The method according to claim 1, characterized in that The acquiring a new second packet sending table item group from the host CPU and storing the current second packet sending table item group in a second storage space other than the current first storage space in the target storage space includes: After starting to process the first packet sending entry in the current first storage space, initiating a dynamic transfer request to the host CPU; A new second packet sending table entry group fed back by the host CPU in response to the dynamic transfer request is obtained, and the current second packet sending table entry group is stored in a second storage space in the target storage space except the current first storage space.
3. The method according to claim 1, characterized in that The packet sending entry includes a control field, and the control field includes at least one of the following: The first field is used to identify whether the packet sending entry has been stored in the target storage space; The second field is used to identify whether a new group of package sending entries needs to be obtained and stored in the target storage space after starting to process the package sending entry; The third field is used to identify the target base address when it is determined that a new packet sending entry group needs to be obtained and stored in the target storage space. The target base address is the address of the target storage space to which the new packet sending entry group to be stored in the forwarding chip belongs.
4. The method according to claim 3, characterized in that For any packet sending entry, the forwarding chip processes the packet sending entry in the following manner: Based on the first field, determining whether the packet sending entry has been stored in the target storage space; In the case where the first field indicates that the package sending entry has been stored in the target storage space, based on the second field, determining whether a new package sending entry group needs to be obtained and stored in the target storage space; When the second field indicates that a new packet sending table item group needs to be obtained and stored in the target storage space, the new second packet sending table item group is obtained from the host CPU, and based on the third field, the target base address of the new second packet sending table item group is determined, and the new second packet sending table item group is stored in the target storage space corresponding to the target base address.
5. The method according to any one of claims 1 to 4, characterized in that The sum of the number of entries of the packet sending table items that can be stored in the multiple target storage spaces can be divided evenly by the total number of the packet sending table items in the host CPU.
6. The method according to any one of claims 1 to 4, characterized in that The number of the target storage spaces is two, and the sizes of the two target storage spaces are equal.
7. A package item processing device, characterized in that: Applied to a forwarding chip, a storage space controlled by the forwarding chip has multiple target storage spaces, a storage space controlled by a host central processing unit (CPU) stores a packet sending table item for forwarding operation, management and maintenance of OAM messages, the packet sending table item is divided into a packet sending table item group, and the serial numbers of the packet sending table items in each packet sending table item group are adjacent in sequence, and the device includes: A first acquisition and storage module, used for acquiring a first packet sending table item group from the host CPU, and storing the current first packet sending table item group into a first storage space in the target storage space; A first processing module, used to start processing each packet sending table item stored in the current first storage space; A first judgment module is used to judge whether it is necessary to continue processing the next packet sending table item group; The second acquisition and storage module is used to obtain a new second packet sending item group from the host CPU if it is necessary to continue processing the next packet sending item group, store the current second packet sending item group in a second storage space in the target storage space except the current first storage space, use the current second storage space as the new first storage space, and return to trigger the execution of the first processing module, wherein the time required to obtain and store the current second packet sending item group is not greater than the time required to process the packet sending items in the current first storage space, the serial number of the first packet sending item in the current second packet sending item group is: the remainder of the current first value and the total number of packet sending items in the host CPU, and the first value is: the sum of the serial number of the last item in the current first packet sending item group and 1.
8. The device according to claim 7, characterized in that The second acquisition and storage module is specifically used for: After starting to process the first packet sending entry in the current first storage space, initiating a dynamic transfer request to the host CPU; A new second packet sending table entry group fed back by the host CPU in response to the dynamic transfer request is obtained, and the current second packet sending table entry group is stored in a second storage space in the target storage space except the current first storage space.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data storage method and device
CN104410897A
Task triggering method and device, computer equipment and storage medium
CN114416324A
LZ4 coding compression device
CN114442954A
Business process processing method and device, equipment and storage medium
CN114579101A
Forwarding table storage method and device, forwarding table search method and device, electronic equipment and storage medium
CN116361280A
