Flow table deployment method, computer equipment and medium

By adopting a hybrid deployment method of hardware memory and host memory in stream table deployment, combining global addressing and host cache management, the problem of insufficient hardware memory storage caused by the increase in the scale of the stream table is solved, and the stream table forwarding performance and search speed are improved.

CN119211120BActive Publication Date: 2025-04-08ZHUHAI XINGYUN ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411691433.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-08
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

In the prior art, as the scale of the flow table increases, the storage space of hardware memory is insufficient and competing with other processing tasks for limited storage resources, resulting in poor overall system performance.

Method used

A hybrid deployment method based on hardware memory and host memory is adopted to offload the stream table. By globally addressing the stream table index of hardware memory and host memory, the stream table is preferred to offload the stream table to hardware memory, and then offload it to host memory when the hardware memory is full, and flow table entries are managed in the host cache to improve the search speed.

Benefits of technology

Through hybrid deployment methods, we make full use of the storage resources of hardware memory, improve flow table forwarding performance, avoid the problem of insufficient hardware memory storage space, and use host cache to improve flow table search speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211120B_ABST
    Figure CN119211120B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology and provides a flow table deployment method, computer equipment and medium. The flow table deployment method uses three different types of storage resources, namely hardware memory, host memory and host cache, to select a suitable flow table deployment mode according to the flow table specifications, which helps to make full use of the storage resources of the hardware memory and improve the flow table forwarding performance; by globally addressing the flow table indexes of the host memory and the hardware memory respectively, the flow table can be preferentially unloaded to the hardware memory, and then unloaded to the host memory when the entries in the hardware memory are full of specifications; a corresponding flow table entry addition mechanism is designed to maintain the highest priority of the hardware memory and realize timely update of the flow table entries in the host cache.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a flow table deployment method, computer equipment and medium. Background Art

[0002] In cloud computing networks, big data centers and other application scenarios, data forwarding services are carried out through dedicated forwarding chips to meet the increasing demand for data traffic. In the prior art, flow table deployment solutions based on hardware acceleration offloading technology generally directly offload flow tables to hardware memory, such as random access memory (RAM) on the hardware or similar external cache. However, as the scale of flow tables increases, such as flow tables in the millions and flow tables in the tens of millions, the storage space of the hardware memory may be insufficient, and it will also compete with other processing tasks for limited storage resources, which is not conducive to improving the overall system performance. On the other hand, the host server generally has abundant storage resources, but the access speed and forwarding performance are not as good as the local storage resources on the hardware.

[0003] To this end, the present application provides a flow table deployment method, computer equipment and medium, and provides a hybrid deployment method based on hardware memory and host memory to unload the flow table, which not only improves the flow table specifications but also improves the data forwarding performance. Summary of the invention

[0004] In the first aspect, the present application provides a flow table deployment method. The flow table deployment method includes: when the flow table specification of the flow table to be deployed is not greater than a first preset threshold, unloading the flow table to be deployed to the hardware memory of the data forwarding hardware; when the flow table specification of the flow table to be deployed is greater than the first preset threshold, unloading the flow table to be deployed in a hybrid deployment manner, wherein the hybrid deployment manner is based on the hardware memory and the host memory of the host machine, the data forwarding hardware is connected to the host machine and is used to carry the data forwarding service of the host machine, and the hybrid deployment manner includes globally addressing the flow table index of the hardware memory and the flow table index of the host memory together to obtain a global addressing result, and then Afterwards, based on the global addressing result, the flow table to be deployed is preferentially unloaded to the hardware memory, and when there is no free index in the hardware memory, it is unloaded to the host memory, wherein the hybrid deployment method also includes, in response to unloading the first flow table item of the flow table to be deployed to the host memory, judging whether there is a free index in the host cache associated with the host memory of the host machine, when there is a free index in the host cache, adding the first flow table item to the flow table index of the host cache, when there is no free index in the host cache, replacing the oldest flow table item in the flow table index of the host cache with the first flow table item.

[0005] Through the first aspect of the present application, three different types of storage resources are utilized, namely hardware memory, host memory, and host cache, to realize selecting a suitable flow table deployment mode according to the flow table specifications, which helps to make full use of the storage resources of the hardware memory and improve the flow table forwarding performance; by globally addressing the flow table indexes of the host memory and the hardware memory respectively, the flow table can be unloaded to the hardware memory first, and then unloaded to the host memory when the entries in the hardware memory are full of specifications; a corresponding flow table item addition mechanism is designed to maintain the highest priority of the hardware memory and realize timely updating of the flow table items in the host cache.

[0006] In a possible implementation of the first aspect of the present application, a data specification of the host memory is larger than a data specification of the hardware memory, an access speed of the host memory is lower than an access speed of the hardware memory, a data specification of the host cache is smaller than a data specification of the hardware memory, and an access speed of the host cache is higher than an access speed of the hardware memory.

[0007] In a possible implementation of the first aspect of the present application, the hybrid deployment method also includes, in response to deleting a second flow table entry deployed on the hardware memory, moving the latest flow table entry in the flow table index of the host cache from the host cache to the hardware memory, and deleting the moved flow table entry from the host cache and the host memory.

[0008] In a possible implementation manner of the first aspect of the present application, the hybrid deployment method further includes, in response to deleting the third flow table entry deployed on the host cache, deleting the third flow table entry from the host memory.

[0009] In a possible implementation of the first aspect of the present application, the oldest flow table entry in the flow table index of the host cache and the latest flow table entry in the flow table index of the host cache are both determined based on the time field of each flow table entry in the flow table index of the host cache, and the time field indicates the time when the flow table entry is created and the time when the flow table entry is hit.

[0010] In a possible implementation of the first aspect of the present application, the hybrid deployment method also includes: preferentially looking up a table in the hardware memory, and if the table lookup in the hardware memory hits, ending the table lookup, and if the table lookup in the hardware memory does not hit, looking up the table in the host cache, and then, if the table lookup in the host cache hits, updating the hit time of the flow table entry in the flow table index of the host cache.

[0011] In a possible implementation of the first aspect of the present application, if a table lookup in the host cache does not hit, a table lookup is performed in the host memory; if a table lookup in the host memory hits, the oldest flow table entry in the flow table index of the host cache is replaced with the flow table entry that is hit in the flow table index of the host memory; if a table lookup in the host memory does not hit, a table lookup failure is fed back.

[0012] In a possible implementation manner of the first aspect of the present application, the hardware memory is a high bandwidth memory.

[0013] In a possible implementation manner of the first aspect of the present application, the flow table index of the hardware memory and the flow table index of the host memory are both hash table indexes.

[0014] In a possible implementation manner of the first aspect of the present application, the flow table to be deployed is a native flow table of a virtual network switch, and the virtual network switch uses a data plane development tool set to implement flow table unloading based on the data forwarding hardware.

[0015] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.

[0016] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flow chart of a flow table deployment method provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a flow table unloading provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0023] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0024] Figure 1 A flow chart of a flow table deployment method provided in an embodiment of the present application. Figure 1 As shown, the flow table deployment method includes the following steps.

[0025] Step S101: when the flow table specification of the flow table to be deployed is not greater than a first preset threshold, the flow table to be deployed is unloaded to the hardware memory of the data forwarding hardware.

[0026] Step S103: When the flow table specification of the flow table to be deployed is greater than the first preset threshold, the flow table to be deployed is uninstalled according to a hybrid deployment method, wherein the hybrid deployment method is based on the hardware memory and the host memory of the host machine, and the data forwarding hardware is connected to the host machine and is used to carry the data forwarding service of the host machine.

[0027] Specifically, the hybrid deployment method includes globally addressing the flow table index of the hardware memory and the flow table index of the host memory together to obtain a global addressing result, and then, based on the global addressing result, preferentially unloading the flow table to be deployed to the hardware memory, and unloading to the host memory when there is no free index in the hardware memory. The hybrid deployment method also includes, in response to unloading the first flow table entry of the flow table to be deployed to the host memory, determining whether there is a free index in the host cache associated with the host memory of the host machine, adding the first flow table entry to the flow table index of the host cache when there is a free index in the host cache, and replacing the oldest flow table entry in the flow table index of the host cache with the first flow table entry when there is no free index in the host cache.

[0028] Figure 1The flow table deployment method shown can be applied to application scenarios such as cloud computing networks and big data centers. Data forwarding hardware is specialized hardware used to carry data forwarding services, such as forwarding chips, data processing units (DPUs) that simulate network cards, or network interface cards (NICs). The hardware memory on the data forwarding hardware is a local storage resource relative to the data forwarding hardware, so the speed of data copying and interaction with other components of the data forwarding hardware, such as processing circuits, is faster. Therefore, by directly offloading the flow table to the hardware memory of the data forwarding hardware, the hardware acceleration offloading technology can be used to improve the overall data forwarding performance. Considering that the hardware memory on the data forwarding hardware can only provide limited storage resources, such as the random access memory (RAM) on the data forwarding hardware, or the double data rate synchronous dynamic random access memory (DDR SDRAM) externally connected to the data forwarding hardware, the hardware memory on the data forwarding hardware is often used to support other services besides flow table offloading. Compared with the hardware memory of the data forwarding hardware, the host memory of the host machine generally has more abundant storage resources, and the upper limit of the storage resources that the host machine can control can also be increased by connecting to the external memory of the host machine. The data forwarding hardware is connected to the host machine and is used to carry the data forwarding service of the host machine. Therefore, if the data forwarding hardware wants to use the host memory of the host machine to perform flow table unloading and support data forwarding services, the access speed will be slower than accessing local storage resources, that is, the hardware memory on the data forwarding hardware.

[0029] See also Figure 1In step S101, when the flow table specification of the flow table to be deployed is not greater than the first preset threshold, the flow table to be deployed is unloaded to the hardware memory of the data forwarding hardware. In step S103, when the flow table specification of the flow table to be deployed is greater than the first preset threshold, the flow table to be deployed is unloaded in a hybrid deployment manner. The hybrid deployment manner is based on the hardware memory and the host memory of the host machine. The data forwarding hardware is connected to the host machine and is used to carry the data forwarding service of the host machine. In this way, a corresponding flow table unloading mechanism is designed. If the flow table specification does not exceed the first preset threshold (for example, 100,000 flow table items), it is unloaded to the hardware memory. If the flow table specification exceeds the first preset threshold, the flow table to be deployed is unloaded in a hybrid deployment manner, that is, the host memory and hardware memory are mixed for flow table unloading. Furthermore, the hybrid deployment method includes globally addressing the flow table index of the hardware memory and the flow table index of the host memory together to obtain a global addressing result, and then, based on the global addressing result, preferentially unloading the flow table to be deployed to the hardware memory, and when there is no free index in the hardware memory, unloading to the host memory. In this way, by globally addressing the flow table indexes of the host memory and the hardware memory respectively, the flow table can be preferentially unloaded to the hardware memory, and then unloaded to the host memory when the entries in the hardware memory are full.

[0030] Continue reading Figure 1, further, the hybrid deployment method also includes, in response to unloading the first flow table item of the flow table to be deployed to the host memory, judging whether there is a free index in the host cache associated with the host memory of the host machine, adding the first flow table item to the flow table index of the host cache when there is a free index in the host cache, and replacing the oldest flow table item in the flow table index of the host cache with the first flow table item when there is no free index in the host cache. In this way, a corresponding flow table item addition mechanism is designed. In some embodiments, the flow table index is managed and maintained in the data format of a hash table, and the hash table of the host memory, the hash table of the hardware memory, and the hash table of the host cache are managed by the software on the host side. First, it is checked whether the hash table of the hardware memory is free. If so, it is written to the hardware memory. If not, it is then checked whether the hash table of the host memory is free. If the hash table of the host memory is not free, it means that the hard transfer has failed, that is, there is no free space in the unloaded flow table, and soft transfer is required. If the hash table in the host memory is free, write it to the host memory, and then check whether the hash table in the host cache is free. If so, write it to the host cache. If not, replace the oldest flow table item in the host cache. In some examples, the flow table items in the host cache use a time field or a time value to record the creation time and update time of the flow table item. Therefore, the flow table item with the smallest time value means the earliest creation time or the earliest update time. Therefore, when there is a new flow table item to be added, it is added to the hardware memory first, and writing to the hardware memory will not trigger changes to the host cache. If there is no free time in the hardware memory, try to write to the host memory, and, in the case of successful writing to the host memory, that is, in response to unloading the first flow table item of the flow table to be deployed to the host memory, write to the host cache or replace the oldest flow table item in the host cache, thereby maintaining the highest priority of the hardware memory and achieving timely update of the flow table items in the host cache. It should be understood that the change to the host cache is triggered by an operation of writing to the host memory, that is, in response to unloading the first flow table entry of the flow table to be deployed to the host memory, the first flow table entry is added to the flow table index of the host cache or the oldest flow table entry in the flow table index of the host cache is replaced with the first flow table entry (when there is no free index in the host cache).

[0031] Continue reading Figure 1Here, three types of memory are involved, each with different characteristics, namely: (1) host memory, which has large specifications and the slowest access speed, such as hard disk; (2) host cache associated with host memory, which has the smallest specifications and the fastest access speed, such as the first-level cache and second-level cache deployed near the hard disk on the server. Cache-level storage resources are generally used to process instructions from the host's operating system and central processing unit, such as taking on instruction issuance and parsing tasks. Here, the host cache can also be a cache-level storage resource provided separately to improve the flow table search speed; (3) hardware memory of data forwarding hardware, such as RAM on the hardware, or high-bandwidth memory such as DDR and high-bandwidth memory (HBM). The specifications of hardware memory are smaller than host memory and larger than host cache, and the access speed is faster than host memory and slower than host cache. Therefore, the specifications and access speed of hardware memory are both in the middle and can be used as a reference standard for the design of flow table offloading solutions. In this way, the arrangement from large to small in terms of specifications is host memory-hardware memory-host cache, and the arrangement from fast to slow in terms of access speed is host cache-hardware memory-host memory. For example, the host memory supports the unloading of 900,000 flow tables, the host cache only supports the unloading of 10,000 flow tables, and the hardware memory supports the unloading of 100,000 flow tables. In this way, using the first preset threshold, the first flow table deployment mode can be selected, that is, the flow table to be deployed can be unloaded to the hardware memory of the data forwarding hardware, or the second flow table deployment mode can be selected, that is, the flow table to be deployed can be unloaded in a mixed deployment manner. For example, if the specification of the unloaded flow table is not large, such as 80,000 or 100,000, then the first mode is selected, that is, the flow table to be deployed is unloaded to the hardware memory of the data forwarding hardware. If the specification of the unloaded flow table is large, such as 1 million, then the second mode is selected, that is, the flow table to be deployed can be unloaded in a mixed deployment manner. In this way, a more suitable flow table deployment mode can be selected according to the flow table specifications, the storage resources of the hardware memory can be fully utilized, and the flow table forwarding performance can be improved. If the second mode, that is, the mixed deployment mode, is selected, it means mixing the hardware memory and the host memory of the host machine. Considering that the host memory is slower than the hardware memory in access speed, the above-mentioned host cache is introduced to improve the flow table search speed. The data structure of the flow table entry in the host cache may include an index value to construct the flow table index of the host cache, and may also include a time value or a time field for recording the flow table entry generation time, the flow table entry update time, etc. In this way, when the flow table entry in the host cache is generated, the creation time is recorded in the time field, and if the flow table entry is hit later, the latest hit time is also updated to the time field.In this way, when writing to the host memory is successful, that is, in response to unloading the first flow table item of the flow table to be deployed to the host memory, writing to the host cache or replacing the oldest flow table item in the host cache, thereby maintaining the highest priority of the hardware memory and realizing timely updating of the flow table items in the host cache, that is, ensuring that each time the host cache replaces the oldest flow table item or the flow table item with the smallest creation time or the latest hit time recorded in the time field (that is, the earliest).

[0032] In conclusion, Figure 1 The flow table deployment method shown utilizes three different types of storage resources, namely hardware memory, host memory, and host cache, to select an appropriate flow table deployment mode according to the flow table specifications, which helps to make full use of the storage resources of the hardware memory and improve the flow table forwarding performance; by globally addressing the flow table indexes of the host memory and the hardware memory respectively, the flow table can be unloaded to the hardware memory first, and then unloaded to the host memory when the entries in the hardware memory are full of specifications; a corresponding flow table entry addition mechanism is designed to maintain the highest priority of the hardware memory and realize timely updating of the flow table entries in the host cache.

[0033] Figure 2 A schematic diagram of a flow table unloading provided in an embodiment of the present application. Figure 2 As shown, the host machine 201 has a host memory 211 and a host cache 213, and the data forwarding hardware 203 has a hardware memory 221. Figure 2 , used for Figure 2The flow table deployment method for flow table unloading includes: when the flow table specification of the flow table to be deployed is not greater than the first preset threshold, unloading the flow table to be deployed to the hardware memory 221 of the data forwarding hardware 203; when the flow table specification of the flow table to be deployed is greater than the first preset threshold, unloading the flow table to be deployed in a hybrid deployment manner. Wherein, the hybrid deployment manner is based on the hardware memory 221 and the host memory 211 of the host machine 201, and the data forwarding hardware 203 is connected to the host machine 201 and is used to carry the data forwarding service of the host machine 201. The hybrid deployment manner includes globally addressing the flow table index of the hardware memory 221 and the flow table index of the host memory 211 together to obtain a global addressing result, and then, based on the global addressing result, preferentially unloading the flow table to be deployed to the hardware memory 221, and when there is no free index in the hardware memory 221, unloading to the host memory 211. Among them, the hybrid deployment method also includes, in response to unloading the first flow table item of the flow table to be deployed to the host memory 211, determining whether there is a free index in the host cache 213 associated with the host memory 211 of the host machine 201; when there is a free index in the host cache 213, adding the first flow table item to the flow table index of the host cache 213; when there is no free index in the host cache 213, replacing the oldest flow table item in the flow table index of the host cache 213 with the first flow table item. In this way, by utilizing three different types of storage resources, namely hardware memory 221, host memory 211 and host cache 213, it is possible to select a suitable flow table deployment mode according to the flow table specifications, which helps to make full use of the storage resources of the hardware memory 221 and improve the flow table forwarding performance; by globally addressing the flow table indexes of the host memory 211 and the hardware memory 221 respectively, the flow table can be unloaded to the hardware memory 221 first, and then unloaded to the host memory 211 when the entries in the hardware memory 221 are full of specifications; a corresponding flow table entry addition mechanism is designed to maintain the highest priority of the hardware memory 221 and realize timely updating of the flow table entries in the host cache 213.

[0034] See also Figure 1 and Figure 2In a possible implementation, the data specification of the host memory is greater than the data specification of the hardware memory, the access speed of the host memory is lower than the access speed of the hardware memory, the data specification of the host cache is smaller than the data specification of the hardware memory, and the access speed of the host cache is higher than the access speed of the hardware memory. The specifications of the hardware memory are smaller than the host memory and larger than the host cache, and the access speed is faster than the host memory and slower than the host cache. Therefore, the specifications and access speed of the hardware memory are both in the middle and can be used as a reference standard for the design of flow table unloading solutions. In this way, the arrangement from large to small in terms of specifications is host memory-hardware memory-host cache, and the arrangement from fast to slow in terms of access speed is host cache-hardware memory-host memory. For example, the host memory supports the unloading of 900,000 flow tables, the host cache only supports the unloading of 10,000 flow tables, and the hardware memory supports the unloading of 100,000 flow tables. In this way, a more appropriate flow table deployment mode can be selected according to the flow table specifications, and the storage resources of the hardware memory can be fully utilized to improve the flow table forwarding performance; and by introducing the host cache to provide three different types of storage resources, namely hardware memory, host memory and host cache, it helps to improve the flow table lookup speed.

[0035] In a possible implementation, the hybrid deployment method further includes, in response to deleting the second flow table entry deployed on the hardware memory, moving the latest flow table entry in the flow table index of the host cache from the host cache to the hardware memory, and deleting the moved flow table entry from the host cache and the host memory. In this way, a corresponding flow table entry deletion mechanism is designed. If the deleted flow table entry is located in the hardware memory, the flow table entry that meets the preset requirements in the host cache is moved to the hardware memory, so that the entries in the hardware memory are always fully utilized, that is, each time a flow table entry in the hardware memory is deleted, a flow table entry that meets the preset requirements is moved from the host cache to the host cache. The flow table entry in the host cache has a specific data structure, which includes a time field that records the generation time of the flow table entry, which is used to record the creation time of the flow table entry, and the hit time of hitting and updating the flow table entry is also recorded in the time field. Therefore, the time field of each flow table entry in the host cache records the time from when the flow table entry was created or the last time it was updated. By comparing the time fields of all flow table items in the host cache, the flow table item with the largest time field (here, the largest time field means the latest) can be determined, or the latest flow table item is the flow table item that has passed the shortest time since it was created or updated. Therefore, each time a flow table item in the hardware memory is deleted, the latest flow table item, that is, the flow table item with the largest time field (meaning the shortest time from now) can be moved from the host cache to the hardware memory. Further, in combination with the above-mentioned flow table item addition mechanism and the flow table item deletion mechanism here, it can be seen that when the host memory is successfully written, the host cache is written or the oldest flow table item in the host cache is replaced, so that the highest priority of the hardware memory is maintained, and the flow table items in the host cache are updated in time. Therefore, the change to the host cache is triggered by the operation of writing to the host memory, that is, in response to unloading the first flow table item of the flow table to be deployed to the host memory, the first flow table item is added to the flow table index of the host cache or the oldest flow table item in the flow table index of the host cache is replaced with the first flow table item (when there is no free index in the host cache). Correspondingly, each time a flow table entry in the hardware memory is deleted, a change to the host cache will also be triggered, that is, in response to deleting the second flow table entry deployed on the hardware memory, the latest flow table entry in the flow table index of the host cache is moved from the host cache to the hardware memory. In this way, through the flow table deletion mechanism, if the flow table entry located in the hardware memory is deleted, the latest flow table entry is moved from the host cache to the hardware memory, which takes advantage of the fast access speed of the hardware memory, helps to keep the entries in the hardware memory fully utilized, and improves the flow table forwarding performance.

[0036] In some embodiments, the hybrid deployment method further includes, in response to deleting the third flow table entry deployed on the host cache, deleting the third flow table entry from the host memory. In this way, if the deleted flow table entry is located in the host cache, because the record in the host cache is based on the host memory, the flow table entry in the host memory must also be deleted. This helps to maintain synchronization and consistency in records and improve the overall performance of the system.

[0037] In a possible implementation, the oldest flow table item in the flow table index of the host cache and the latest flow table item in the flow table index of the host cache are determined based on the time field of each flow table item in the flow table index of the host cache, and the time field indicates the time when the flow table item is created and the time when the flow table item is hit. In this way, the flow table item in the host cache has a specific data structure, which includes a time field that records the generation time of the flow table item, which is used to record the creation time of the flow table item, and the hit time of hitting and updating the flow table item is also recorded in the time field. Therefore, the time field of each flow table item in the host cache records the time from when the flow table item was created or last updated. By comparing the time fields of all flow table items in the host cache, the flow table item with the largest time field (here, the largest time field means the latest) can be determined, or the latest flow table item is the flow table item with the shortest time from when it was created or updated to now, and the flow table item with the smallest time field (here the smallest time field means the oldest) can also be determined. When deleting a flow entry, if the deleted flow entry is in the hardware memory, the flow entry in the hardware memory is deleted first, and then the newest flow entry in the host cache, that is, the flow entry with the largest time field, is moved to the hardware memory, and the moved flow entry is deleted from the host cache and the host memory. Conversely, when adding a flow entry or searching for a flow entry, if the relevant flow entry is in the host memory, the oldest flow entry in the host cache, that is, the flow entry with the smallest time field, is replaced. Such a design of the time field of the flow entry helps to improve the overall flow forwarding performance.

[0038] In some embodiments, the hybrid deployment method also includes, first looking up the table in the hardware memory, if the table in the hardware memory hits, then ending the table lookup, and, if the table in the hardware memory does not hit, then looking up the table in the host cache, and then, if the table in the host cache hits, then updating the hit time of the flow table entry of the flow table entry hit in the flow table index of the host cache. In this way, a corresponding flow table lookup mechanism is designed. The table is first looked up in the hardware memory, and if it does not hit, then the table is looked up in the host cache, and after the hit, the time field of the flow table entry hit in the host cache is updated, that is, the hit time of hitting and updating the flow table entry is also recorded in the corresponding time field, and the software is notified to update the relevant records in the hash table of the host cache managed by the software, so that the above-mentioned flow table entry adding mechanism can be adapted.

[0039] In some embodiments, if the table lookup in the host cache does not hit, the table is looked up in the host memory. If the table lookup in the host memory hits, the oldest flow table entry in the flow table index of the host cache is replaced with the flow table entry hit in the flow table index of the host memory. If the table lookup in the host memory does not hit, feedback is given that the table lookup failed. In this way, if the host cache is not hit, the table is looked up in the host memory. If it still does not hit, soft transfer is performed. After the soft transfer, flow table entries may be added, and the unloading of new flow tables may also be triggered. If the host cache is hit, the oldest flow table entry in the flow table index of the host cache is replaced with the flow table entry hit in the flow table index of the host memory, and the software is notified to update the relevant records in the hash table of the host cache managed by the software, so that the above-mentioned flow table entry addition mechanism can be adapted. In this way, considering the slow access speed of the host memory, a host cache with a faster access speed is introduced, such as a cache-level resource for processing processor instructions, so that the newly created or hit flow table items can be stored through the host cache, and the table is first looked up in the host cache. If the table is hit, there is no need to look up the table in the slower host memory. If the table is not hit in the host cache, the table is looked up in the host memory. In this case, if the table is hit in the host memory, the oldest flow table item in the flow table index of the host cache is replaced with the flow table item hit in the flow table index of the host memory. In this way, the flow table items in the host cache can be updated in a timely manner, which helps to improve the flow table forwarding performance.

[0040] In summary, in combination with the above-mentioned flow entry addition mechanism, flow entry deletion mechanism and flow table lookup mechanism here, through the collaboration of these three mechanisms, and the use of three different types of storage resources, namely hardware memory, host memory and host cache, it is realized to select the appropriate flow table deployment mode according to the flow table specifications, which helps to make full use of the storage resources of the hardware memory and improve the flow table forwarding performance. In addition, based on the flow entry addition mechanism, the change to the host cache is triggered by the operation of writing to the host memory, that is, in response to unloading the first flow table entry of the flow table to be deployed to the host memory, the first flow table entry is added to the flow table index of the host cache or the oldest flow table entry in the flow table index of the host cache is replaced with the first flow table entry (when there is no free index in the host cache). Based on the flow entry deletion mechanism, each deletion of the flow table entry in the hardware memory will also trigger the change to the host cache, that is, in response to deleting the second flow table entry deployed on the hardware memory, the latest flow table entry in the flow table index of the host cache is moved from the host cache to the hardware memory. Based on the flow table lookup mechanism, the table is looked up in the hardware memory first. If the table lookup in the hardware memory does not hit, the table is looked up in the host cache. Then, if the table lookup in the host cache hits, the flow table item hit time of the flow table item hit in the flow table index of the host cache is updated, and if the table lookup in the host cache does not hit, the table is looked up in the host memory. If the table lookup in the host memory hits, the oldest flow table item in the flow table index of the host cache is replaced with the flow table item hit in the flow table index of the host memory. In this way, by using the flow table item addition mechanism and the flow table item deletion mechanism, it is achieved to use the hardware memory as much as possible to improve the flow table forwarding performance, and it is achieved to update the host cache in time to store the latest created or hit flow table items. In terms of table lookup, if the flow table item in the hardware memory is hit, it will not trigger the change of the host cache. If the flow table item in the host memory or the host cache is hit, it will trigger the change of the host cache. First check whether the flow table entry in the host cache is hit. If it is hit, the time field of the hit flow table entry is updated. If it does not hit the host cache but hits the flow table entry in the host memory, the hit flow table entry in the host memory replaces the oldest flow table entry in the host cache. If the host cache change is triggered, it must be synchronized to the hash table of the host cache managed by the software. Because the hardware memory is searched first, the search efficiency is improved.Moreover, through the above-mentioned flow entry addition mechanism, flow entry deletion mechanism and flow table lookup mechanism, the collaboration of these three mechanisms ensures that the flow entry in the host cache is the latest created or the most recently hit flow entry, which increases the probability of hitting in the host cache, especially for data packets with larger data specifications, which may be cut into multiple copies, and then each copy hits the same flow entry, so that it can continuously hit in the hardware memory or host cache, and the time field of the flow entry in the host cache can be continuously updated. Furthermore, through the mixed use mechanism of hardware memory and host memory, the overall search efficiency is improved, which helps to overcome the shortcomings of the limited specifications of the host cache itself. For example, the host memory supports the unloading of 900,000 flow tables, the host cache only supports the unloading of 10,000 flow tables, and the hardware memory supports the unloading of 100,000 flow tables, which effectively overcomes the shortcomings of the limited specifications of the host cache.

[0041] In a possible implementation, the hardware memory is a high bandwidth memory, so that various types of memories can be adapted.

[0042] In a possible implementation, the flow table index in the hardware memory and the flow table index in the host memory are both hash table indexes, so that the hash algorithm and flow table lookup are implemented.

[0043] In a possible implementation, the flow table to be deployed is a native flow table of a virtual network switch, and the virtual network switch uses a data plane development tool set (Data Plane Development Kit, DPDK) to implement flow table unloading based on the data forwarding hardware. In this way, it can be applied to application scenarios such as cloud computing networks and big data centers, and can be adapted to various virtualization technologies and products.

[0044] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned device embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these devices and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these devices and components.

[0045] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0046] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0047] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.

[0048] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0049] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.

[0050] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0051] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments 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. 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, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.

[0052] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0053] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A flow table deployment method, characterized in that: The flow table deployment method includes: When the flow table specification of the flow table to be deployed is not greater than a first preset threshold, unloading the flow table to be deployed to a hardware memory of the data forwarding hardware; When the flow table specification of the flow table to be deployed is greater than the first preset threshold, the flow table to be deployed is unloaded in a hybrid deployment manner, wherein the hybrid deployment manner is based on the hardware memory and the host memory of the host machine, and the data forwarding hardware is connected to the host machine and is used to carry the data forwarding service of the host machine, The hybrid deployment method includes globally addressing the flow table index of the hardware memory and the flow table index of the host memory together to obtain a global addressing result, and then, based on the global addressing result, preferentially unloading the to-be-deployed flow table to the hardware memory, and unloading to the host memory when there is no free index in the hardware memory, Among them, the hybrid deployment method also includes, in response to unloading the first flow table entry of the flow table to be deployed to the host memory, determining whether there is a free index in the host cache associated with the host memory of the host machine, when there is a free index in the host cache, adding the first flow table entry to the flow table index of the host cache, when there is no free index in the host cache, replacing the oldest flow table entry in the flow table index of the host cache with the first flow table entry.

2. The flow table deployment method according to claim 1, characterized in that: The data specification of the host memory is greater than the data specification of the hardware memory, the access speed of the host memory is lower than the access speed of the hardware memory, the data specification of the host cache is smaller than the data specification of the hardware memory, and the access speed of the host cache is higher than the access speed of the hardware memory.

3. The flow table deployment method according to claim 1, characterized in that: The hybrid deployment method also includes, in response to deleting a second flow table entry deployed on the hardware memory, moving the latest flow table entry in the flow table index of the host cache from the host cache to the hardware memory, and deleting the moved flow table entry from the host cache and the host memory.

4. The flow table deployment method according to claim 3, characterized in that: The hybrid deployment method further includes, in response to deleting the third flow table entry deployed on the host cache, deleting the third flow table entry from the host memory.

5. The flow table deployment method according to claim 1, characterized in that: The oldest flow table entry in the flow table index of the host cache and the latest flow table entry in the flow table index of the host cache are both determined based on the time field of each flow table entry in the flow table index of the host cache, and the time field indicates the time when the flow table entry is created and the time when the flow table entry is hit.

6. The flow table deployment method according to claim 3, characterized in that: The hybrid deployment method also includes, preferentially looking up a table in the hardware memory, and if the table lookup in the hardware memory hits, ending the table lookup, and, if the table lookup in the hardware memory does not hit, looking up a table in the host cache, and then, if the table lookup in the host cache hits, updating the hit time of the flow table entry in the flow table index of the host cache.

7. The flow table deployment method according to claim 6, characterized in that: If the table lookup in the host cache does not hit the target, the table is looked up in the host memory. If the table lookup in the host memory hits the target, the oldest flow table entry in the flow table index of the host cache is replaced with the flow table entry that is hit in the flow table index of the host memory. If the table lookup in the host memory does not hit the target, a table lookup failure is fed back.

8. The flow table deployment method according to claim 1, characterized in that: The hardware memory is a high bandwidth memory.

9. The flow table deployment method according to claim 1, characterized in that: The flow table index of the hardware memory and the flow table index of the host memory are both hash table indexes.

10. The flow table deployment method according to claim 1, characterized in that: The flow table to be deployed is a native flow table of a virtual network switch, and the virtual network switch uses a data plane development tool set to implement flow table unloading based on the data forwarding hardware.

11. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 10 when executing the computer program.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Flow table hardware unloading method, equipment and medium

    CN115150328A

  • Flow table semi-unloading method, equipment and medium

    CN115941598A