Address allocation method, address management controller, network card chip and network card device

CN122679129APending Publication Date: 2026-09-01WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611105039.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

[0004]然而,在多次为网络端分配空闲地址后,存在各bank中剩余空闲地址的数量差异较大的问题

Benefits of technology

[0032]The aforementioned address allocation method, address management controller, network interface card (NIC) chip, and NIC device complete network-side address allocation by selecting the address block with the most remaining free addresses from two address groups. After each address allocation, the remaining address quantity of the corresponding address block is updated. The address group set is iteratively updated in conjunction with address block shifting operations. The address filtering and allocation process is executed cyclically until the remaining address quantity of all address blocks tends to be consistent. This effectively balances the address resource consumption rate of each address block in the address pool, solving the problem of excessive differences in the remaining address quantity of each address block and uneven address resource utilization after long-term operation of the traditional dual-group address allocation method. It significantly improves the overall resource utilization rate of the NIC chip address pool, while avoiding problems such as concurrent application conflicts and address allocation failures caused by address resource idleness and local address exhaustion, ensuring the stability and continuity of address application and allocation on the network transceiver side.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122679129A_ABST
    Figure CN122679129A_ABST
Patent Text Reader

Abstract

This application relates to an address allocation method, an address management controller, a network interface card (NIC) chip, and a NIC device. The method includes: selecting address blocks from an address pool's address group set to obtain a first and second address block; allocating a first free address from the first address block and a second free address from the second address block to the network; updating the remaining address counts of the first and second address blocks, and performing operations on each address block in the address group set to obtain a new address group set; returning to the previous step to select address blocks from the new address group set to obtain a next selected first and second address block, so as to allocate the next selected first and second free addresses to the network, until the remaining address counts of each address block in the address pool are consistent. This method can reduce the difference in the number of remaining free addresses in each address block after multiple allocations of free addresses to the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network interface card (NIC) chip address management technology, and in particular to an address allocation method, an address management controller, a NIC chip, and a NIC device. Background Technology

[0002] In business scenarios involving network packet address requests, it is necessary to allocate addresses to network endpoints, which include network receivers and network senders.

[0003] In related technologies, to improve address resource utilization and avoid address conflicts caused by concurrent requests from multiple devices, the system typically divides the overall address pool into multiple address banks. The system's address allocation rule is as follows: divide the multiple banks into two groups, select the bank with the most remaining free addresses from each group, select one free address from each of the two selected banks, and allocate them to the network receiver and the network transmitter.

[0004] However, after allocating free addresses to the network multiple times, there is a problem that the number of remaining free addresses varies greatly among different banks. Summary of the Invention

[0005] Therefore, it is necessary to provide an address allocation method, address management controller, network interface card (NIC) chip, and NIC device that can reduce the difference in the number of remaining free addresses in each bank after allocating free addresses to the network end multiple times, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides an address allocation method, including:

[0007] The current selection operation is performed on the address blocks in the address group set of the address pool to obtain the first address block and the second address block selected in the current selection; the first address block is the address block with the most remaining addresses in the first address group in the address group set, and the second address block is the address block with the most remaining addresses in the second address group in the address group set;

[0008] Assign the first free address in the first address block and the second free address in the second address block to the network end;

[0009] Update the number of remaining addresses in the first and second address blocks, and perform a shift operation on each address block in the address group set to obtain a new address group set;

[0010] Return to the previous step of selecting address blocks from the new address group set to obtain the first and second address blocks to be selected next, so as to allocate the new first free address from the first address block and the new second free address from the second address block to the network end, until it is determined that the number of remaining addresses in each address block in the address pool is consistent.

[0011] In one embodiment, determining that the number of remaining addresses in each address block of the address pool is consistent includes:

[0012] After the most recent update of the number of remaining addresses in the first address block and the new second address block to be selected, if the first number of remaining addresses in each address block in the new address group set is consistent, obtain the second number of remaining addresses in each address block in other address group sets in the address pool.

[0013] If the first quantity and the second quantity are the same, it is determined that the number of remaining addresses in each address block in the address pool is the same.

[0014] In one embodiment, the method further includes:

[0015] If the first quantity and the second quantity are inconsistent, shift operations are performed on each address block of each address group set in the address pool to obtain each new address group set;

[0016] If the number of remaining addresses in each address block is consistent across all new address groups, then the number of remaining addresses in each address block in the address pool is determined to be consistent.

[0017] In one embodiment, the next selection operation is performed on the address blocks in the new address group set to obtain the first and second address blocks to be selected next, including:

[0018] Based on the number of remaining addresses in the first address group of the new address group set, and / or the first cumulative number of times the first address block selected in the previous selection has been selected, the next selection operation is performed on the address blocks in the first address group to obtain the first address block to be selected in the next selection.

[0019] Based on the number of remaining addresses in the second address group of the new address group set, and / or the second cumulative number of times the currently selected second address block has been selected, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block.

[0020] In one embodiment, based on the first cumulative number of times the first address block has been selected in the current selection, a next selection operation is performed on the address blocks in the first address group to obtain the next selected first address block, including:

[0021] If the first cumulative count equals the preset count, the first address block to be selected next is determined from the first other address blocks in the new address group set; wherein, the first other address blocks include address blocks in the first address group corresponding to the current selection operation other than the first address block selected in the current selection operation;

[0022] Based on the second cumulative number of times the second address block has been selected in the current selection, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block, including:

[0023] If the second cumulative count equals the preset count, the next selected second address block is determined from the second other address blocks in the new address group set; wherein, the second other address blocks include address blocks in the second address group corresponding to the current selection operation other than the current selected second address block.

[0024] In one embodiment, updating the number of remaining addresses in the first and second address blocks includes:

[0025] Subtract a preset value from the number of remaining addresses in the first address block to update the number of remaining addresses in the first address block;

[0026] Subtract a preset value from the number of remaining addresses in the second address block to update the number of remaining addresses in the second address block.

[0027] In one embodiment, the above-described shift operation on each address block in the address group set includes:

[0028] Move each address block in the address group set by a preset number of bits; the preset number of bits is not an integer multiple of the number of address blocks in the address group.

[0029] In a second aspect, this application also provides an address management controller, which includes programmable logic circuitry and / or program instructions that, when the address management controller is running, implement the steps of the method described in any one of the first aspects above.

[0030] Thirdly, this application also provides a network interface card (NIC) chip, which includes the address management controller as described in the second aspect above.

[0031] Fourthly, this application also provides a network interface card (NIC) device, which includes the NIC chip described in the third aspect above.

[0032] The aforementioned address allocation method, address management controller, network interface card (NIC) chip, and NIC device complete network-side address allocation by selecting the address block with the most remaining free addresses from two address groups. After each address allocation, the remaining address quantity of the corresponding address block is updated. The address group set is iteratively updated in conjunction with address block shifting operations. The address filtering and allocation process is executed cyclically until the remaining address quantity of all address blocks tends to be consistent. This effectively balances the address resource consumption rate of each address block in the address pool, solving the problem of excessive differences in the remaining address quantity of each address block and uneven address resource utilization after long-term operation of the traditional dual-group address allocation method. It significantly improves the overall resource utilization rate of the NIC chip address pool, while avoiding problems such as concurrent application conflicts and address allocation failures caused by address resource idleness and local address exhaustion, ensuring the stability and continuity of address application and allocation on the network transceiver side. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a diagram illustrating the application environment of an address allocation method in one embodiment;

[0035] Figure 2 This is one of the flowcharts illustrating an address allocation method in one embodiment;

[0036] Figure 3 This is one of the shift diagrams of each address block in the address group set in one embodiment;

[0037] Figure 4 This is a second flowchart illustrating the address allocation method in one embodiment;

[0038] Figure 5 This is the second schematic diagram of the shifting of each address block in the address group set in one embodiment;

[0039] Figure 6 This is the third flowchart illustrating the address allocation method in one embodiment;

[0040] Figure 7 This is a schematic diagram illustrating the shifting of individual address blocks in the address pool in one embodiment;

[0041] Figure 8 This is the fourth flowchart illustrating the address allocation method in one embodiment;

[0042] Figure 9This is the fifth flowchart of an address allocation method in one embodiment. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0044] In business scenarios involving network packet address requests, it is necessary to allocate addresses to network endpoints, which include network receivers and network senders.

[0045] In related technologies, to improve address resource utilization and avoid address conflicts caused by concurrent requests from multiple devices, the system typically divides the overall address pool into multiple address banks. The system's address allocation rule is as follows: divide the multiple banks into two groups, select the bank with the most remaining free addresses from each group, select one free address from each of the two selected banks, and allocate them to the network receiver and the network transmitter.

[0046] However, after allocating free addresses to the network multiple times, there is a significant difference in the number of remaining free addresses in each bank, leading to extreme imbalance between banks and severely impacting network bandwidth. Therefore, this application provides an address allocation method to solve the aforementioned problem.

[0047] The address allocation method provided in this application embodiment can be applied to, for example, Figure 1 The network interface card (NIC) chip 01 shown includes an address management controller 10. The address management controller 10 is used to manage a large number of addresses stored in the address pool. For example, the address management controller 10 can divide the large number of stored addresses into multiple address blocks (banks). Each bank stores an equal or unequal number of addresses for use by the network end.

[0048] Having described the application environment of the address allocation method provided in the embodiments of this application above, the specific implementation methods of the address allocation method provided in this embodiment will be described below.

[0049] In one exemplary embodiment, such as Figure 2 As shown, an address allocation method is provided, which is applied to... Figure 1 Taking address management control 10 as an example, the explanation includes:

[0050] S201. Perform the current selection operation on the address blocks in the address group set of the address pool to obtain the first address block and the second address block selected in the current selection; the first address block is the address block with the most remaining addresses in the first address group in the address group set, and the second address block is the address block with the most remaining addresses in the second address group in the address group set.

[0051] The address pool refers to the cache pool that stores all addresses in the network card chip. The address pool can include multiple address group sets. Each address group set includes two address groups, and each address group can include multiple address blocks. For example, assuming there are M address blocks in the address pool, these M address blocks are divided into n address group sets. Each address group set includes n address blocks, and the n address blocks are evenly distributed among the two address groups.

[0052] Optionally, for any one of the n address group sets, the current selection can be made from the first address group in the address group set to obtain the first address block with the most remaining addresses in the first address group, and the current selection can be made from the second address group in the address group set to obtain the second address block with the most remaining addresses in the second address group.

[0053] S202. Assign the first free address in the first address block and the second free address in the second address block to the network end.

[0054] In this embodiment, after obtaining the first address block and the second address block, a free address can be randomly selected from the first address block as the first free address, or the free address ranked first in the first address block can be selected as the first free address. Similarly, a free address can be randomly selected from the second address block as the second free address, or the free address ranked first in the second address block can be selected as the second free address. It should be noted that the method of selecting a free address from the address block is not limited to the methods provided in this embodiment, and may also include other methods of selecting a free address from multiple free addresses. This embodiment does not limit this method.

[0055] S203. Update the number of remaining addresses in the first address block and the second address block, and perform a shift operation on each address block in the address group set to obtain a new address group set.

[0056] In this embodiment, after allocating the first free address in the first address block to the network end, the number of remaining addresses in the first address block can be updated. For example, the number of remaining addresses in the first address block can be reduced by 1, or other values ​​can be reduced.

[0057] Optionally, after allocating the second free address in the second address block to the network end, the number of remaining addresses in the second address block can be updated, for example, by subtracting the value 1 from the number of remaining addresses in the second address block, or by subtracting other values ​​from the number of remaining addresses in the second address block.

[0058] Furthermore, after updating the remaining address counts of the first and second address blocks, a shift operation can be performed on each address block in the address group set to obtain a new address group set; for example, shifting each address block in the address group set one position to the left or right yields the new address group set, see [link to relevant documentation]. Figure 3 The address set includes a first address set and a second address set. The first address set includes four address blocks: Bank0, Bank1, Bank2, and Bank3. The second address set includes four address blocks: Bank4, Bank5, Bank6, and Bank7. After updating the number of remaining addresses in the first and second address blocks, each address block in the address set is shifted one bit to the left to obtain a new address set. The new address set includes a new first address set and a new second address set. The new first address set includes four address blocks: Bank1, Bank2, Bank3, and Bank4. The new second address set includes four address blocks: Bank5, Bank6, Bank7, and Bank0.

[0059] S204. Return to the step of performing the next selection operation on the address blocks in the new address group set to obtain the first and second address blocks to be selected next, so as to allocate the new first free address in the first address block and the new second free address in the second address block to the network end, until it is determined that the number of remaining addresses in each address block in the address pool is consistent.

[0060] In this embodiment, after performing the shift operation on each address block in the address group set to obtain a new address group set, the next selection can be made from the first address group in the new address group set to obtain the first address block with the most remaining addresses in the first address group in the new address group set, and the next selection can be made from the second address group in the new address group set to obtain the second address block with the most remaining addresses in the second address group in the new address group set. A new first free address in the first address block selected next time and a new second free address in the second address block selected next time are allocated to the network end. The number of remaining addresses in the first address block and the second address block is updated, and the shift operation on each address block in the address group set is performed again to obtain a new address group set, until it is determined that the number of remaining addresses in each address block in the address pool is consistent.

[0061] Optionally, it can be determined that the number of remaining addresses in each address block in the address pool is consistent. This can be either that the number of remaining addresses in each address block in the address pool is equal, or that the difference between the number of remaining addresses in each address block in the address pool is less than a preset difference.

[0062] Optionally, after determining that the number of remaining addresses in each address block in the address pool is consistent, it is also necessary to select address blocks from the address group set of the address pool. For example, randomly select an address block from multiple address blocks in the first address group in the address group set as the first address block, and randomly select an address block from multiple address blocks in the second address group in the address group set as the second address block. Then, return to the step of allocating the first free address in the first address block and the second free address in the second address block to the network end, until there are no remaining addresses in each address block in the address pool.

[0063] In this embodiment, the network address allocation is completed by selecting the address block with the most remaining free addresses from the two address groups respectively. After each address allocation, the remaining address quantity of the corresponding address block is updated. The address group set is iteratively updated in conjunction with the address block shift operation. The address filtering and allocation process is executed cyclically until the remaining address quantity of all address blocks tends to be consistent. This can effectively balance the address resource consumption rate of each address block in the address pool. It solves the problem of excessive difference in the remaining address quantity of each address block and uneven address resource utilization after long-term operation of the traditional dual-group address allocation method. It significantly improves the overall resource utilization of the network card chip address pool. At the same time, it avoids problems such as concurrent application conflicts and address allocation failures caused by address resource idleness and local address exhaustion, and ensures the stability and continuity of address application allocation on the network transceiver side.

[0064] In one embodiment, in the above Figure 2 Based on the illustrated embodiment, the specific method for ensuring that the number of remaining addresses in each address block of the address pool is consistent can also be described above. See [link to relevant documentation]. Figure 4 The aforementioned S204 includes:

[0065] S301. After the most recent update of the number of remaining addresses in the first address block and the new second address block to be selected, if the first number of remaining addresses in each address block in the new address group set is consistent, obtain the second number of remaining addresses in each address block in other address group sets in the address pool.

[0066] In this embodiment, in S203 above, the number of remaining addresses in the next selected first address block and second address block is updated, and a shift operation is performed on each address block in the address group set to obtain a new address group set. Then, the next selection operation is performed on the address blocks in the new address group set to obtain the next selected first address block and second address block. The third free address in the next selected first address block and the fourth free address in the next selected second address block are allocated to the network end. Then, the number of remaining addresses in the next selected first address block and second address block is updated again, and a shift operation is performed on each address block in the new address group set to obtain a new address group set again. ... After the most recent allocation of the next selected first free address and the new second free address to the network end, and after the most recent update of the number of remaining addresses in the next selected first address block and the new second address block, the first number of remaining addresses in each address block in the new address group set is determined. If the first number of remaining addresses in each address block in the new address group set is consistent, the second number of remaining addresses in each address block in other address group sets in the address pool is obtained.

[0067] For example, see Figure 5After the first shift of the address set to obtain a new address set, we get a new first address set and a new second address set. The new first address set includes four address blocks: Bank1, Bank2, Bank3, and Bank4. The new second address set includes four address blocks: Bank5, Bank6, Bank7, and Bank0. Then, we select Bank4 from the four address blocks in the new first address set, which has the most remaining addresses. We select Bank6 from the four address blocks in the new second address set, which has the most remaining addresses (the second address set has two banks with the most remaining addresses, Bank6 and Bank7; either bank can be chosen arbitrarily, or Bank6 can be chosen since Bank7 was already chosen last time). Finally, we select an empty address from Bank4 and Bank6 respectively. Idle addresses are allocated to the network side. Then, the number of remaining addresses in Bank4 and Bank6 is updated. A second shift operation is then performed on each address block in the new address group set to obtain a new first address group and a new second address group. The new first address group includes four address blocks: Bank2, Bank3, Bank4, and Bank5. The new second address group includes four address blocks: Bank6, Bank7, Bank0, and Bank1. Then, Bank5 with the most remaining addresses is selected from the four address blocks in the new first address group, and Bank7 with the most remaining addresses is selected from the four address blocks in the new second address group, and so on. The above steps are repeated until the number of remaining addresses in each address block in the new address group set is consistent after the most recent update of the number of remaining addresses in the next selected first and second address blocks.

[0068] S302. If the first quantity and the second quantity are the same, determine that the number of remaining addresses in each address block in the address pool is the same.

[0069] In this embodiment, if the first number of remaining addresses in each address block in the new address group set is the same as the second number of remaining addresses in each address block in other address group sets, then the number of remaining addresses in each address block in the signature address pool is the same.

[0070] In this embodiment, a hierarchical progressive verification method is used to first check the number of remaining addresses in each address block within the same address group. Only when the balance within a group is achieved is the balance compared with other address groups. This eliminates the need to traverse all address blocks for a full comparison, significantly reducing the amount of data comparison and computational power consumption. It can quickly and accurately determine whether the remaining addresses of all address blocks in the entire address pool are equal, facilitating timely monitoring of the address resource balance status, supporting efficient address allocation and scheduling, and reducing the waste of address resources due to idleness or exhaustion.

[0071] In one exemplary embodiment, in the above Figure 4 Based on the illustrated embodiments, see also Figure 6 The above methods also include:

[0072] S303. If the first quantity and the second quantity are inconsistent, perform a shift operation on each address block of each address group set in the address pool to obtain each new address group set.

[0073] In this embodiment, if the first number of remaining addresses in each address block in the new address group set is inconsistent with the second number of remaining addresses in each address block in other address group sets, a shift operation can be performed on each address block in each address group set in the address pool to obtain each new address group set.

[0074] See Figure 7 Suppose the address pool contains two new address group sets: the new address group set and the other address group set. When the remaining address counts of the 8 address blocks (Bank0, Bank1, Bank2, Bank3, Bank4, Bank5, Bank6, and Bank7) in the new address group set are all n, and the remaining address counts of the 8 address blocks (Bank8, Bank9, Bank10, Bank11, Bank12, Bank13, Bank14, and Bank15) in the other address group set are all m (m ≠ n), then the address blocks in the address pool can be shifted as a whole to obtain the new address group set, which includes 8 address blocks, namely Bank1, Bank2, Bank3, Bank4, Bank5, Bank6, Bank7, and Bank8, and the other address group set, which also includes 8 address blocks, namely Bank9, Bank10, Bank11, Bank12, Bank13, Bank14, Bank15, and Bank0.

[0075] At this point, since the number of remaining addresses in each address block in the new address group set is different, we can return to step S201 until the first number of remaining addresses in each address block in the new address group set is consistent, and the second number of remaining addresses in each address block in other address group sets is consistent. If the first number and the second number are inconsistent, we can perform shift operations on each address block in each address group set in the address pool again to obtain each new address group set again.

[0076] S304. If the number of remaining addresses in each address block in each new address group set is consistent, determine that the number of remaining addresses in each address block in the address pool is consistent.

[0077] In this embodiment, if the number of remaining addresses in each address block in each of the above-mentioned new address group sets is consistent, it is determined that the number of remaining addresses in each address block in the address pool is consistent.

[0078] In this embodiment, when the number of remaining addresses in different address groups is mismatched, the address resources are rearranged by performing a shift operation on all address blocks in the address pool, and then the remaining addresses in the new address group are checked to see if they are equal. This quickly completes the address resource balancing and reorganization, which can efficiently smooth out the difference in the number of remaining addresses in each address block, evenly distribute address resources, avoid the waste of some address blocks having their addresses exhausted and some idle resources, improve the overall resource utilization of the address pool, and at the same time, the shift and reorganization logic is simple and can complete the address balancing scheduling in a lightweight manner.

[0079] In one exemplary embodiment, in the above Figure 2 Based on the illustrated embodiment, a further selection operation can be performed on the address blocks in the new address group set to obtain the first and second address blocks to be selected next. See the detailed implementation description below. Figure 8 The aforementioned S204 includes:

[0080] S401. Based on the number of remaining addresses in the first address group of the new address group set, and / or the first cumulative number of times the currently selected first address block has been selected, perform the next selection operation on the address blocks in the first address group to obtain the next selected first address block.

[0081] In this embodiment, the address blocks in the first address group can be selected again based on the number of remaining addresses in the first address group of the new address group set, to obtain the first address block to be selected next. For example, please refer to [link to previous document]. Figure 3 Bank4, which has the most remaining addresses, is selected from the new first address group.

[0082] Optionally, the next selection of address blocks in the first address group can be performed based on the first cumulative number of times the first address block has been selected in the current selection, thus obtaining the first address block for the next selection; for example, please see [link to relevant documentation]. Figure 3 If Bank3 has already been selected from the first address group in the current iteration, when selecting a Bank from the new first address group in the next iteration, any Bank can be selected from Bank1, Bank2, and Bank4.

[0083] Optionally, the next selection operation can be performed on the address blocks in the first address group based on the number of remaining addresses in the first address group of the new address group set and the first cumulative number of times the currently selected first address block has been selected, to obtain the next selected first address block; for example, please continue to see Figure 3After Bank3 has been selected from the first address group in the previous step, when selecting Bank from the new first address group in the next step, Bank4, which has the largest number of remaining addresses in the first address group, can be selected.

[0084] S402. Based on the number of remaining addresses in the address blocks of the second address group of the new address group set, and / or the second cumulative number of times the currently selected second address block has been selected, perform the next selection operation on the address blocks in the second address group to obtain the next selected second address block.

[0085] In this embodiment, the address blocks in the second address group can be selected again based on the number of remaining addresses in the second address group of the new address group set, to obtain the next selected second address block. For example, please refer to [link to previous document]. Figure 3 Select Bank6 or Bank7 from the new second address group, which has the most remaining addresses.

[0086] Optionally, the next selection of address blocks in the second address group can be performed based on the second cumulative number of times the second address block has been selected in the current selection, thus obtaining the next selected second address block; for example, please continue to see Figure 3 After Bank7 has been selected from the second address group in the previous iteration, when selecting a Bank from the new second address group in the next iteration, any Bank can be selected from Bank5, Bank7, and Bank0.

[0087] Optionally, the next selection operation can be performed on the address blocks in the second address group based on the number of remaining addresses in the second address group of the new address group set, and the second cumulative number of times the currently selected second address block has been selected, to obtain the next selected second address block; for example, please continue to see Figure 3 After Bank7 has been selected from the second address group in the previous iteration, when selecting a Bank from the new second address group in the next iteration, Bank6, which has the most remaining addresses in the second address group and was not selected in the previous iteration, can be selected.

[0088] In this embodiment, the selection of address blocks is based on a comprehensive judgment that considers both the remaining number of addresses and the cumulative number of historical selections. This approach balances the balance of address resource reserves with the fairness of the frequency of calls to each address block. It can prioritize the selection of blocks with sufficient remaining addresses to avoid premature resource depletion, while also preventing some address blocks from being frequently retrieved and others from being idle for a long time. This enables two sets of address blocks to be independently and in a balanced and orderly polling and allocation manner, thereby improving the overall utilization rate and allocation fairness of address resources.

[0089] In an exemplary embodiment, a method is also provided for performing a next selection operation on address blocks in a first address group based on a first cumulative number of times the currently selected first address block has been selected, to obtain the next selected first address block, including:

[0090] If the first cumulative count equals the preset count, the first address block to be selected next is determined from the first other address blocks in the new address group set; wherein, the first other address blocks include address blocks in the first address group corresponding to the current selection operation other than the first address block selected in the current selection operation.

[0091] In an exemplary embodiment, a method is also provided for performing a next selection operation on address blocks in a second address group based on a second cumulative number of times the currently selected second address block has been selected, to obtain the next selected second address block, including:

[0092] If the second cumulative count equals the preset count, the next selected second address block is determined from the second other address blocks in the new address group set; wherein, the second other address blocks include address blocks in the second address group corresponding to the current selection operation other than the current selected second address block.

[0093] In this embodiment, by setting a selection threshold for each address block, when the cumulative selection count of a certain address block reaches a preset value, the system automatically switches to other address blocks in the same group for resource selection. This effectively avoids the problem of rapid resource exhaustion and load imbalance caused by repeated calls to a single address block. The rotation rules are controlled independently in two groups to ensure that the call frequency of each address block in each group is uniform, thereby achieving balanced distribution of address resource load, extending the overall address pool lifespan, and improving the fairness and stability of address scheduling.

[0094] In one exemplary embodiment, in the above Figure 2 Based on the illustrated embodiment, the process of updating the number of remaining addresses in the first and second address blocks can also be described, see [link to relevant documentation]. Figure 9 The aforementioned S203 includes:

[0095] S501. Subtract a preset value from the number of remaining addresses in the first address block to update the number of remaining addresses in the first address block.

[0096] S502. Subtract a preset value from the number of remaining addresses in the second address block to update the number of remaining addresses in the second address block.

[0097] In this embodiment, the number of remaining addresses in the first address block can be subtracted by a preset value to update the number of remaining addresses in the first address block, and the number of remaining addresses in the second address block can be subtracted by a preset value to update the number of remaining addresses in the second address block; for example, the number of remaining addresses in the first address block can be subtracted by the value 1 to update the number of remaining addresses in the first address block, and the number of remaining addresses in the second address block can be subtracted by the value 1 to update the number of remaining addresses in the second address block.

[0098] In this embodiment, after each address allocation, a fixed preset value is deducted from the remaining address count of the two types of address blocks to complete the data synchronization update. This can standardize and uniformly maintain the remaining address statistics of each address block, ensuring that the remaining address count of the two groups of address blocks is accurate in real time and consistent in caliber. This provides reliable data support for subsequent address balance verification and address block rotation selection, and avoids resource scheduling imbalance caused by statistical value deviation.

[0099] In one exemplary embodiment, in the above Figure 2 Based on the illustrated embodiment, the process of shifting each address block in the address group set can be described in detail. S203 above includes:

[0100] Move each address block in the address group set by a preset number of bits; the preset number of bits is not an integer multiple of the number of address blocks in the address group.

[0101] For example, please continue to see Figure 3 The first address group and the second address group each contain four address blocks. During shifting, each address block can be shifted to the left or right by one, two, three, five, six, seven, ..., and so on, except for integer multiples of the number of address blocks in the address group.

[0102] In this embodiment, when shifting address blocks, a preset number of bits not equal to an integer multiple of the total number of address blocks is selected for offset. This avoids the situation where the address block arrangement is repeated with the original order and the resource distribution remains unchanged after shifting. It fully disrupts the original address block order and breaks up the original uneven distribution of the remaining addresses in each block. This provides a regular and non-repeating new address group for subsequent address balance verification and resource equalization, effectively improving the problem of uneven address resource allocation and enhancing the address pool balance scheduling effect.

[0103] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0104] In one exemplary embodiment, an address management controller is provided, including programmable logic circuitry and / or program instructions, which, when the address management controller is running, perform the following steps:

[0105] The current selection operation is performed on the address blocks in the address group set of the address pool to obtain the first address block and the second address block selected in the current selection; the first address block is the address block with the most remaining addresses in the first address group in the address group set, and the second address block is the address block with the most remaining addresses in the second address group in the address group set;

[0106] Assign the first free address in the first address block and the second free address in the second address block to the network end;

[0107] Update the number of remaining addresses in the first and second address blocks, and perform a shift operation on each address block in the address group set to obtain a new address group set;

[0108] Return to the previous step of selecting address blocks from the new address group set to obtain the first and second address blocks to be selected next, so as to allocate the new first free address from the first address block and the new second free address from the second address block to the network end, until it is determined that the number of remaining addresses in each address block in the address pool is consistent.

[0109] In one embodiment, the address management controller performs the following steps at runtime:

[0110] After the most recent update of the number of remaining addresses in the first address block and the new second address block to be selected, if the first number of remaining addresses in each address block in the new address group set is consistent, obtain the second number of remaining addresses in each address block in other address group sets in the address pool.

[0111] If the first quantity and the second quantity are the same, it is determined that the number of remaining addresses in each address block in the address pool is the same.

[0112] In one embodiment, the address management controller performs the following steps at runtime:

[0113] If the first quantity and the second quantity are inconsistent, shift operations are performed on each address block of each address group set in the address pool to obtain each new address group set;

[0114] If the number of remaining addresses in each address block is consistent across all new address groups, then the number of remaining addresses in each address block in the address pool is determined to be consistent.

[0115] In one embodiment, the address management controller performs the following steps at runtime:

[0116] Based on the number of remaining addresses in the first address group of the new address group set, and / or the first cumulative number of times the first address block selected in the previous selection has been selected, the next selection operation is performed on the address blocks in the first address group to obtain the first address block to be selected in the next selection.

[0117] Based on the number of remaining addresses in the second address group of the new address group set, and / or the second cumulative number of times the currently selected second address block has been selected, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block.

[0118] In one embodiment, the address management controller performs the following steps at runtime:

[0119] If the first cumulative count equals the preset count, the first address block to be selected next is determined from the first other address blocks in the new address group set; wherein, the first other address blocks include address blocks in the first address group corresponding to the current selection operation other than the first address block selected in the current selection operation;

[0120] Based on the second cumulative number of times the second address block has been selected in the current selection, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block, including:

[0121] If the second cumulative count equals the preset count, the next selected second address block is determined from the second other address blocks in the new address group set; wherein, the second other address blocks include address blocks in the second address group corresponding to the current selection operation other than the current selected second address block.

[0122] In one embodiment, the address management controller performs the following steps at runtime:

[0123] Subtract a preset value from the number of remaining addresses in the first address block to update the number of remaining addresses in the first address block;

[0124] Subtract a preset value from the number of remaining addresses in the second address block to update the number of remaining addresses in the second address block.

[0125] In one embodiment, the address management controller performs the following steps at runtime:

[0126] Move each address block in the address group set by a preset number of bits; the preset number of bits is not an integer multiple of the number of address blocks in the address group.

[0127] In one embodiment, a network interface card (NIC) chip is provided, including an address management controller as described in the above embodiments.

[0128] In one embodiment, a network interface card (NIC) device is provided, including the NIC chip as described in the above embodiments.

[0129] In the above embodiments, each functional module in the network card chip can be implemented entirely or partially through hardware circuits, firmware, or a combination of hardware and firmware.

[0130] Specifically, when implemented through hardware circuits, each functional module can utilize hardware logic devices such as Application-Specific Integrated Circuits (ASICs) and Field-Programmable Gate Arrays (FPGAs) to implement corresponding message feature extraction, hash operations, lookup matching, and action execution processing logic. When implemented using firmware, the firmware configures logic according to the corresponding application scenario and business requirements. This configuration logic can be stored in the network interface card chip's memory in the form of microcode or firmware programs, and executed by the chip's internal processor or logic operation unit, thereby generating all or part of the processes or functions according to the embodiments of this application, such as key-value concatenation and fusion matching.

[0131] Those skilled in the art will understand that the technical solution of this application is essentially an improvement on the internal hardware resource scheduling and packet data flow mechanism of network switching equipment. The technical solution of this application, or the part that contributes to the prior art, can be embodied through the hardware logic circuit design in the network interface card (NIC) chip, or it can be implemented by loading and executing firmware instructions in the NIC chip. These firmware instructions can be stored in on-chip storage media such as read-only memory (ROM), static random access memory (SRAM), and time content addressable memory (TCAM) inside the NIC chip, so that when the NIC chip processes packets, it can implement the packet processing method steps of any of the above embodiments of this application, thereby significantly saving on-chip storage resources and reducing chip costs while maintaining processing capabilities.

[0132] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0133] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An address allocation method, characterized in that, The method includes: The current selection operation is performed on the address blocks in the address group set of the address pool to obtain the first address block and the second address block selected in the current selection; the first address block is the address block with the most remaining addresses in the first address group in the address group set, and the second address block is the address block with the most remaining addresses in the second address group in the address group set; Assign the first free address in the first address block and the second free address in the second address block to the network end; Update the number of remaining addresses in the first address block and the second address block, and perform a shift operation on each address block in the address group set to obtain a new address group set; Return to the step of performing the next selection operation on the address blocks in the new address group set to obtain the next selected first address block and second address block, so as to allocate the new first free address in the next selected first address block and the new second free address in the second address block to the network end, until it is determined that the number of remaining addresses in each address block in the address pool is consistent.

2. The method according to claim 1, characterized in that, Determining that the number of remaining addresses in each address block of the address pool is consistent includes: If, after the most recent update of the number of remaining addresses in the first and second address blocks to be selected next time, the first number of remaining addresses in each address block in the new address group set is consistent, then the second number of remaining addresses in each address block in other address group sets in the address pool is obtained. If the first quantity and the second quantity are the same, it is determined that the number of remaining addresses in each address block in the address pool is the same.

3. The method according to claim 2, characterized in that, The method further includes: If the first quantity and the second quantity are inconsistent, a shift operation is performed on each address block of each address group set in the address pool to obtain each new address group set; If the number of remaining addresses in each address block in each of the new address group sets is consistent, then the number of remaining addresses in each address block in the address pool is determined to be consistent.

4. The method according to any one of claims 1-3, characterized in that, The next selection operation is performed on the address blocks in the new address group set to obtain the first and second address blocks to be selected next, including: Based on the number of remaining addresses in the first address group of the new address group set, and / or the first cumulative number of times the currently selected first address block has been selected, the next selection operation is performed on the address blocks in the first address group to obtain the next selected first address block; Based on the number of remaining addresses in the second address group of the new address group set, and / or the second cumulative number of times the currently selected second address block has been selected, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block.

5. The method according to claim 4, characterized in that, Based on the first cumulative number of times the first address block has been selected in the current selection, the next selection operation is performed on the address blocks in the first address group to obtain the next selected first address block, including: If the first cumulative number of times equals the preset number of times, the first address block to be selected next is determined from the first other address blocks in the new address group set; wherein, the first other address blocks include address blocks in the first address group corresponding to the current selection operation other than the first address block selected in the current selection operation; Based on the second cumulative number of times the second address block has been selected in the current selection, the next selection operation is performed on the address blocks in the second address group to obtain the next selected second address block, including: If the second cumulative number of times equals the preset number of times, the next selected second address block is determined from the second other address blocks in the new address group set; wherein, the second other address blocks include address blocks in the second address group corresponding to the current selection operation other than the current selected second address block.

6. The method according to any one of claims 1-3, characterized in that, The update of the number of remaining addresses in the first address block and the second address block includes: Subtract a preset value from the number of remaining addresses in the first address block to update the number of remaining addresses in the first address block; The number of remaining addresses in the second address block is subtracted from the preset value to update the number of remaining addresses in the second address block.

7. The method according to any one of claims 1-3, characterized in that, The shifting operation on each address block in the address group set includes: Move each address block in the address group set by a preset number of bits; the preset number of bits is not equal to an integer multiple of the number of address blocks in the address group.

8. An address management controller, characterized in that, The address management controller includes programmable logic circuitry and / or program instructions that, when the address management controller is running, implement the steps of the method according to any one of claims 1 to 7.

9. A network interface card (NIC) chip, characterized in that, The network interface card chip includes the address management controller as described in claim 8.

10. A network interface card (NIC) device, characterized in that, The network interface card (NIC) device includes the NIC chip as described in claim 9.