Flow table offloading system, device and cluster
By allowing multiple physical functions to share the hash table of the same specification, the problem that the hash table specifications and stream counts in the prior art cannot be dynamically adjusted, and efficient use of hash tables and system flexibility is achieved.
Patent Information
- Application Number
- CN202411688392.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-11-25
AI Technical Summary
In the prior art, the number of flows of physical functions and the specifications of subhash tables need to be allocated and planned in advance, and cannot adapt to changes in system requirements.
By providing a flow table offload system that allows multiple physical functions to share a hash table of the same specification, the hash bucket can be dynamically allocated according to needs, improving the efficiency of the hash table usage.
It realizes efficient use of hash tables, can adapt to changes in the number of streams of different physical functions, and improves system flexibility and resource utilization.
Smart Images

Figure CN119172338B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communications, and in particular to a flow table unloading system, device, and cluster. Background Art
[0002] In order to facilitate clearing the contents of a hash bucket in a hash table used by a physical function (PF), the hash table is usually divided into regions. Figure 1 As shown, when there are 4 PFs (for example, the first PF, the second PF, the third PF, and the fourth PF), the hash table is divided into 4 sub-hash tables, for example, the first sub-hash table, the second sub-hash table, the third sub-hash table, and the fourth sub-hash table. The addresses in each sub-hash table are independently addressed and do not affect each other. Among them, the first PF uses the first sub-hash table, the second PF uses the second sub-hash table, the third PF uses the third sub-hash table, and the fourth PF uses the fourth sub-hash table. The depth of the first sub-hash table is N1, the depth of the second sub-hash table is N2, the depth of the third sub-hash table is N3, and the depth of the fourth sub-hash table is N4. Then, N1+N2+N3+N4=N, N is the total depth of the hash table. The first sub-hash table includes the first table item to the N1th table item, the second sub-hash table includes the first table item to the N2th table item, the third sub-hash table includes the first table item to the N3th table item, and the fourth sub-hash table includes the first table item to the N4th table item. If it is necessary to clear all the contents in the hash bucket used by the first PF, the hash buckets in the first entry to the N1th entry included in the first sub-hash table may be cleared in sequence.
[0003] However, hash operation is a compression operation. Therefore, multiple different input values may get the same hash value after being operated by the hash algorithm, resulting in "hash collision". In order to control the hash collision rate within a certain range, the number of hash buckets in each sub-hash table must be greater than the number of entries in the flow table of the physical function. Generally, the ratio of the number of hash buckets (slots) to the number of flow table entries (Flow ID) is not less than 1.5.
[0004] Taking the first PF as an example, if the number of flows assigned to the first PF is K1, the number of hash buckets in the first sub-hash table is at least 1.5 Therefore, in the prior art, the number of flows of each physical function and the specifications of the sub-hash table need to be allocated and planned in advance, and the number of flows of each PF is fixed, which cannot adapt to changes in system requirements. For example, due to changes in business requirements, the number of flows of the first PF is increased from K1 to K1+Y. Summary of the invention
[0005] The present application provides a flow table unloading system, device and cluster, which can enable hash tables used by multiple physical functions to share the same specifications, thereby improving the efficiency of hash table usage.
[0006] In a first aspect, a flow table unloading system is provided, including:
[0007] A network card, which is used to provide hardware resources for network communication, including multiple physical functions and multiple virtual functions, wherein the physical function is used to manage the virtual function;
[0008] A processor, configured to communicate with the network card and unload the hash table and the result table into a cache of the network card;
[0009] A network card cache, used to store a hash table and a result table, wherein the hash table includes a plurality of table entries, each table entry includes a plurality of hash buckets, any hash bucket in the hash table can be provided for use by any one of the plurality of physical functions, and the hash table is uniformly addressed;
[0010] The network card is also used to query the hash table and the result table in the network card cache, and forward the data message according to the hash table and the result table.
[0011] In some possible designs, the hash bucket can store a correspondence between a hash value and a flow identifier, and the hash bucket further includes a physical function identifier, and the physical function identifier is used to indicate a physical function occupying the hash bucket;
[0012] The network card cache is used to delete the correspondence between the hash value and the flow identifier in the hash bucket whose physical function identifier in the hash table is the first physical function identifier, wherein the first physical function identifier is used to indicate that the physical function occupying the hash bucket is the first physical function, and the first physical function belongs to the multiple physical functions.
[0013] In some possible designs, the hash bucket can store the correspondence between the hash value and the flow identifier, different physical functions use different flow identifier segments, and the flow identifier segment includes multiple flow identifiers.
[0014] The network card cache is used to delete the correspondence between the hash value in the hash bucket of the flow identifier belonging to the first flow identifier segment and the flow identifier, wherein the first flow identifier segment is used to indicate that the physical function using the flow identifier segment is the first physical function, and the first physical function belongs to the multiple physical functions.
[0015] In some possible designs, a mapping table is stored in the network card cache, and the mapping table is used to store the correspondence between the physical function and the flow identification segment.
[0016] The network card cache is used to determine the flow identifier segment to which the first flow identifier belongs according to the first flow identifier in the first hash bucket, determine the first flow identifier segment used by the first physical function using the first flow identifier according to the flow identifier segment to which the first flow identifier belongs and the mapping table, delete the correspondence between the hash value and the flow identifier in the first hash bucket, and the first hash bucket belongs to multiple hash buckets in the hash table.
[0017] In some possible designs, the mapping table includes multiple flow identification groups, there is a one-to-one correspondence between the multiple flow identification groups and the multiple physical functions, the flow identification group includes multiple identification bits, there is a one-to-one correspondence between the multiple identification bits and the multiple flow identification segments, when the value of the first identification bit in the first flow identification group is a first value, it indicates that the flow identification segment corresponding to the first identification bit is used by the physical function corresponding to the first flow identification group, when the value of the first identification bit in the first flow identification group is a second value, it indicates that the flow identification segment corresponding to the first identification bit is not used by the physical function corresponding to the first flow identification group, and the first flow identification group belongs to the multiple flow identification groups.
[0018] In some possible designs, the number of the first flow identification segments is multiple.
[0019] In some possible designs, the multiple physical functions share the size of the hash table.
[0020] In some possible designs, a first hash bucket in a first table entry is used by a first physical function, a second hash bucket in the first table entry is used by a second physical function, the first table entry belongs to the multiple table entries, and the first hash bucket and the second hash bucket are adjacent hash buckets in the first table entry.
[0021] In a second aspect, a computing device is provided, including a flow table unloading system and a storage unit, wherein the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of the first aspects.
[0022] In a third aspect, a computing device cluster is provided, including a flow table unloading system and a storage unit, wherein the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of the first aspects.
[0023] In the above solution, different physical functions can share the same hash table specifications. When one of the physical functions does not need to use so many hash buckets, these hash buckets can be provided to other physical functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0025] Figure 1 It is a structural diagram of a hash table provided by the prior art;
[0026] Figure 2 It is a structural schematic diagram of a flow table unloading system provided by this application;
[0027] Figure 3 It is a schematic diagram of the structure of a hash table provided by this application;
[0028] Figure 4 It is a structural schematic diagram of a computing device provided by this application. DETAILED DESCRIPTION
[0029] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention. The terms used in the implementation mode of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0030] See also Figure 2 , Figure 2 Schematic diagram of a flow table unloading system provided by this application. Figure 2 As shown, the flow table unloading system of the present application includes a processor 11, a network card cache 12 and a network card 13.
[0031] The processor 11 is used to communicate with the network card, run the virtual switch and the data plane development kit. The virtual switch is a switch virtualized based on the hardware resources of the processor, the network card and the memory. The data plane development kit is used to assist the virtual switch to improve the performance of the virtual switch. The processor 11 is a computing core and a control core, which can handle complex situations. The processor 11 can be a very large-scale integrated circuit. An operating system and other software programs are installed in the processor 11, so that the processor 11 can access the memory and various PCIE devices. The processor 11 can quickly access the memory through the on-chip bus. The processor 11 may include one or more processor cores. In one implementation, the processor 11 may be a multi-core chip, that is, a chip containing multiple processing cores. In another implementation, the processor 11 may include one or more processor cores. It can be a chip with one processing core. The processor 11 unloads the flow table to the network card cache 12.
[0032] The network card cache 12 can use a ternary content addressable memory (TCAM), a dynamic random access memory (DRAM), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), and a data processing unit (DPU). The network card cache 12 can also be other random access memories, such as static random access memory (SRAM). This embodiment does not limit the number and type of the network card cache 12. In addition, the network card cache 12 can be configured to have a power protection function. The power protection function means that when the system loses power and then powers on again, the data stored in the memory will not be lost. The network card cache 12 is usually used to store flow tables, etc. The flow table includes a hash table and a result table. Among them, the hash table is used to quickly find and match flow information, and the result table usually stores results or actions related to flow processing. When a matching flow entry is found in the hash table, the corresponding processing result is obtained from the result table and executed.
[0033] The hash table includes multiple entries, and each entry includes multiple hash buckets. Figure 3As shown, the hash table may include a first table item, a second table item, ..., and an Nth table item, where N is an integer greater than 1. Among them, the first table item includes a first hash bucket, a second hash bucket, a third hash bucket, a fourth hash bucket, and a fifth hash bucket; the second table item includes a first hash bucket, a second hash bucket, a third hash bucket, a fourth hash bucket, and a fifth hash bucket; ...; the Nth table item includes a first hash bucket, a second hash bucket, a third hash bucket, a fourth hash bucket, and a fifth hash bucket. In the above example, the number of hash buckets included in each table item is five as an example for explanation. In actual applications, each table item may include more or fewer hash buckets, and the number of hash buckets included in different table items may be exactly the same, completely different, or partially the same, which is not specifically limited here. The hash bucket can store the correspondence between the hash value and the flow identifier. Each hash bucket may include: a valid bit, a hash value, and a flow identifier. The valid bit may be 1 bit wide, which is used to indicate whether the data in the hash bucket is valid. When adding a flow table, if the hash bucket is available, the valid bit is set to 1, and when the flow table is deleted, the valid bit of the corresponding hash bucket is cleared. The hash value is used for hash matching comparison, and its bit width is determined by the depth of the hash table. The flow identifier represents the index of the flow table. When the hash value matches, the flow identifier is used as the address to read the detailed matching items, and the information carried by the message header of the data message is accurately matched with the matching items. If the comparison results are the same, the corresponding action item in the result table is searched, and the action is executed according to the corresponding action item in the search result table. The bit width of the flow identifier is determined by the number of data flows.
[0034] In order to locate and access these hash buckets conveniently and quickly, the hash buckets in the hash table are uniformly addressed, that is, continuous and regular addresses are assigned to these hash buckets. For example, if the hash table has 10 hash buckets, these buckets may be numbered from 0 to 9, or regular addresses may be assigned according to certain specific rules. Therefore, when the hash function calculates that an element should be stored in a certain hash bucket, the corresponding hash bucket position can be quickly found according to this unified addressing method, thereby improving the efficiency of hash table operations.
[0035] The hash table is shared by multiple physical functions. That is, any hash bucket in the hash table can be used by any of the multiple physical functions. Figure 3Taking the above example as an example, the first hash bucket in the first table item in the hash table can be used by the first PF, the second PF, the third PF, and the fourth PF. Other hash buckets in the hash table can also be used by the first PF, the second PF, the third PF, and the fourth PF. However, the hash buckets are used on a "first come, first served" basis. A hash bucket can only be used by one PF at a time. Therefore, once the hash bucket is used by a PF, other PFs are not allowed to use the hash bucket until the hash bucket is cleared and released. Continue with Figure 3 Taking the example shown as an example, the first hash bucket in the first table entry is used by the first physical function, the second hash bucket in the first table entry is used by the second physical function, the third hash bucket in the first table entry is used by the first physical function, the fourth hash bucket in the first table entry is used by the fourth physical function, the fifth hash bucket in the first table entry is used by the third physical function, and so on.
[0036] The network card 13 is used to query the flow table in the network card cache and provide hardware resources for network communication. Because it has a Media Access Control Address (MAC) address, it belongs between Layer 1 and Layer 2 of the Open System Interconnection (OSI) model. It allows users to connect to each other through cables or wirelessly. Each network card has a unique 48-bit serial number called a MAC address, which is written in a read-only memory on the card. Here, the network card can be a Field Programmable Gate Array (FPGA) network card or an Application Specific Integrated Circuit (ASIC) network card, etc. The network card 13 is hardware virtualized through Single Root I / O Virtualization (SR-IOV). SR-IOV allows a physical high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) device (such as network card 13) to be presented as multiple independent virtual devices, each of which can be directly allocated to a virtual machine for use. SR-IOV usually includes physical functions (PF) and virtual functions (VF). PF is used to manage VF, while VF can be directly allocated to virtual machines, and each PF is independent of each other.
[0037] When you need to delete the contents of a hash bucket in a hash table used by a physical function (PF), you can use the following two methods:
[0038] In the first way, the hash bucket in the hash table also includes a physical function identifier, which is used to indicate the physical function occupying the hash bucket. For example, when the physical function identifier in the first hash bucket in the first table item of the hash table is 00, it means that the first hash bucket in the first table item is used by the first physical function; when the physical function identifier in the first hash bucket in the first table item of the hash table is 01, it means that the first hash bucket in the first table item is used by the second physical function; when the physical function identifier in the first hash bucket in the first table item of the hash table is 10, it means that the first hash bucket in the first table item is used by the third physical function; when the physical function identifier in the first hash bucket in the first table item of the hash table is 11, it means that the first hash bucket in the first table item is used by the fourth physical function. The same is true for other hash buckets in the hash table.
[0039] When it is necessary to delete the content in the hash bucket in the hash table used by the first physical function, the network card cache traverses the hash buckets in the entire hash table and deletes the correspondence between the hash value and the flow identifier in the hash bucket whose physical function identifier in the hash table is the first physical function identifier. The first physical function identifier is used to indicate that the physical function occupying the hash bucket is the first physical function, and the first physical function belongs to multiple physical functions.
[0040] In the second method, different physical functions use different flow identification segments. For example, the first PF uses a flow identification segment of 0 to 1023, the second PF uses a flow identification segment of 1024 to 2047, the third PF uses a flow identification segment of 2048 to 3071, and the fourth PF uses a flow identification segment of 3072 to 4095. Each flow identification segment includes multiple flow identifications. Here, the flow identification segment of 0 to 1023 includes 1024 flow identifications, the flow identification segment of 1024 to 2047 includes 1024 flow identifications, the flow identification segment of 2048 to 3071 includes 1024 flow identifications, and the flow identification segment of 3072 to 4095 includes 1024 flow identifications. Alternatively, the first PF uses the flow identification segment of 2048 to 3071, the second PF uses the flow identification segment of 1024 to 2047, the third PF uses the flow identification segment of 3072 to 4095, and the fourth PF uses the flow identification segment of 0 to 1023. Alternatively, the first PF uses the flow identification segment of 0 to 1023 and the flow identification of 2048 to 3071, the second PF uses the flow identification segment of 1024 to 2047, and the third PF uses the flow identification segment of 3072 to 4095.
[0041] When the content in the hash bucket in the hash table used by the first physical function needs to be deleted, the network card cache deletes the correspondence between the hash value in the hash bucket of the flow identifier belonging to the first flow identifier segment and the flow identifier. The first flow identifier segment is used to indicate that the physical function using the flow identifier segment is the first physical function.
[0042] Optionally, a mapping table is provided in the network card cache, and the mapping table includes multiple flow identification groups. There is a one-to-one correspondence between the multiple flow identification groups and the multiple physical functions. For example, each PF may correspond to a flow identification group. For example, the first PF corresponds to the first flow identification group, the second PF corresponds to the second flow identification group, the third PF corresponds to the third flow identification group, and the fourth PF corresponds to the fourth flow identification group. Each flow identification group includes multiple identification bits, and there is a one-to-one correspondence between the multiple identification bits and the multiple flow identification segments. For example,
[0043] The first flow identification group includes the first identification bit to the fourth identification bit, wherein the first identification bit of the first flow identification group corresponds to the flow identification segment of 0~1023, the second identification bit of the first flow identification group corresponds to the flow identification segment of 1024~2047, the third identification bit of the first flow identification group corresponds to the flow identification segment of 2048~3071, and the fourth identification bit of the first flow identification group corresponds to the flow identification segment of 3072~4095.
[0044] The second flow identification group includes the first identification bit to the fourth identification bit, wherein the first identification bit of the second flow identification group corresponds to the flow identification segment of 0~1023, the second identification bit of the second flow identification group corresponds to the flow identification segment of 1024~2047, the third identification bit of the second flow identification group corresponds to the flow identification segment of 2048~3071, and the fourth identification bit of the second flow identification group corresponds to the flow identification segment of 3072~4095.
[0045] The third flow identification group includes the first identification bit to the fourth identification bit, wherein the first identification bit of the third flow identification group corresponds to the flow identification segment of 0~1023, the second identification bit of the third flow identification group corresponds to the flow identification segment of 1024~2047, the third identification bit of the third flow identification group corresponds to the flow identification segment of 2048~3071, and the fourth identification bit of the third flow identification group corresponds to the flow identification segment of 3072~4095.
[0046] The fourth flow identification group includes the first identification bit to the fourth identification bit, wherein the first identification bit of the fourth flow identification group corresponds to the flow identification segment of 0~1023, the second identification bit of the fourth flow identification group corresponds to the flow identification segment of 1024~2047, the third identification bit of the fourth flow identification group corresponds to the flow identification segment of 2048~3071, and the fourth identification bit of the fourth flow identification group corresponds to the flow identification segment of 3072~4095.
[0047] When the value of the first identification bit in the first flow identification group is the first value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is used by the first physical function corresponding to the first flow identification group. When the value of the first identification bit in the first flow identification group is the second value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is not used by the first physical function corresponding to the first flow identification group.
[0048] When the value of the second identification bit in the first flow identification group is the first value, it indicates that the flow identification segment 1024~2047 corresponding to the second identification bit is used by the first physical function corresponding to the first flow identification group. When the value of the second identification bit in the first flow identification group is the second value, it indicates that the flow identification segment 1024~2047 corresponding to the second identification bit is not used by the first physical function corresponding to the first flow identification group.
[0049] When the value of the third identification bit in the first flow identification group is the first value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is used by the first physical function corresponding to the first flow identification group. When the value of the third identification bit in the first flow identification group is the second value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is not used by the first physical function corresponding to the first flow identification group.
[0050] When the value of the fourth identification bit in the first flow identification group is the first value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is used by the first physical function corresponding to the first flow identification group. When the value of the fourth identification bit in the first flow identification group is the second value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is not used by the first physical function corresponding to the first flow identification group.
[0051] When the value of the first identification bit in the second flow identification group is the first value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is used by the second physical function corresponding to the second flow identification group. When the value of the first identification bit in the second flow identification group is the second value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is not used by the second physical function corresponding to the second flow identification group.
[0052] When the value of the second identification bit in the second flow identification group is the first value, it indicates that the flow identification segment 1024~2047 corresponding to the second identification bit is used by the second physical function corresponding to the second flow identification group. When the value of the second identification bit in the second flow identification group is the second value, it indicates that the flow identification segment 1024~2047 corresponding to the second identification bit is not used by the second physical function corresponding to the second flow identification group.
[0053] When the value of the third identification bit in the second flow identification group is the first value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is used by the second physical function corresponding to the second flow identification group. When the value of the third identification bit in the second flow identification group is the second value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is not used by the second physical function corresponding to the second flow identification group.
[0054] When the value of the fourth identification bit in the second flow identification group is the first value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is used by the second physical function corresponding to the second flow identification group. When the value of the fourth identification bit in the second flow identification group is the second value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is not used by the second physical function corresponding to the second flow identification group.
[0055] When the value of the first identification bit in the third flow identification group is the first value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is used by the third physical function corresponding to the third flow identification group. When the value of the first identification bit in the third flow identification group is the second value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is not used by the third physical function corresponding to the third flow identification group.
[0056] When the value of the second identification bit in the third flow identification group is the first value, it indicates that the flow identification segment of 1024~2047 corresponding to the second identification bit is used by the third physical function corresponding to the third flow identification group. When the value of the second identification bit in the third flow identification group is the second value, it indicates that the flow identification segment of 1024~2047 corresponding to the second identification bit is not used by the third physical function corresponding to the third flow identification group.
[0057] When the value of the third identification bit in the third flow identification group is the first value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is used by the third physical function corresponding to the third flow identification group. When the value of the third identification bit in the third flow identification group is the second value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is not used by the third physical function corresponding to the third flow identification group.
[0058] When the value of the fourth identification bit in the third flow identification group is the first value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is used by the third physical function corresponding to the third flow identification group. When the value of the fourth identification bit in the third flow identification group is the second value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is not used by the third physical function corresponding to the third flow identification group.
[0059] When the value of the first identification bit in the fourth flow identification group is the first value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is used by the fourth physical function corresponding to the fourth flow identification group. When the value of the first identification bit in the fourth flow identification group is the second value, it indicates that the flow identification segment of 0~1023 corresponding to the first identification bit is not used by the fourth physical function corresponding to the fourth flow identification group.
[0060] When the value of the second identification bit in the fourth flow identification group is the first value, it indicates that the flow identification segment of 1024~2047 corresponding to the second identification bit is used by the fourth physical function corresponding to the fourth flow identification group. When the value of the second identification bit in the fourth flow identification group is the second value, it indicates that the flow identification segment of 1024~2047 corresponding to the second identification bit is not used by the fourth physical function corresponding to the fourth flow identification group.
[0061] When the value of the third identification bit in the fourth flow identification group is the first value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is used by the fourth physical function corresponding to the fourth flow identification group. When the value of the third identification bit in the fourth flow identification group is the second value, it indicates that the flow identification segment 2048~3071 corresponding to the third identification bit is not used by the fourth physical function corresponding to the fourth flow identification group.
[0062] When the value of the fourth identification bit in the fourth flow identification group is the first value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is used by the fourth physical function corresponding to the fourth flow identification group. When the value of the fourth identification bit in the fourth flow identification group is the second value, it indicates that the flow identification segment 3072~4095 corresponding to the fourth identification bit is not used by the fourth physical function corresponding to the fourth flow identification group.
[0063] Therefore, when the first PF uses the flow identification segment of 0~1023, the second PF uses the flow identification segment of 1024~2047, the third PF uses the flow identification segment of 2048~3071, and the fourth PF uses the flow identification segment of 3072~4095, the first flow identification group is 1000, the second flow identification group is 0100, the third flow identification group is 0010, and the fourth flow identification group is 0001.
[0064] When it is necessary to delete the content in the hash bucket in the hash table used by the first physical function, the network card cache determines the flow identification segment to which the first flow identification belongs according to the first flow identification in the first hash bucket, determines the first flow identification segment used by the first physical function using the first flow identification according to the flow identification segment to which the first flow identification belongs and the mapping table, and deletes the correspondence between the hash value and the flow identification in the first hash bucket. For example, assuming that the first flow identification in the first hash bucket is 5, then, according to the upper 4 bits of the first flow identification, it can be determined that the first flow identification belongs to the flow identification segment of 0~1023, and then according to the first flow identification group of 1000, the second flow identification group of 0100, the third flow identification group of 0010, and the fourth flow identification group of 0001 in the mapping table, it can be determined that the flow identification segment of 0~1023 is allocated to the first PF for use, and therefore, it is necessary to delete the content in the first hash bucket. For another example, the second flow identifier in the second hash bucket is 1027. Then, according to the upper 4 bits of the second flow identifier, it can be determined that the second flow identifier belongs to the flow identifier segment of 1024~2047. According to the first flow identifier group of 1000, the second flow identifier group of 0100, the third flow identifier group of 0010, and the fourth flow identifier group of 0001 in the mapping table, it can be determined that the flow identifier segment of 1024~2047 is allocated to the second PF for use. Therefore, there is no need to delete the content in the second hash bucket. By traversing the hash buckets in the entire hash table in the above manner, the content in the hash bucket in the hash table corresponding to the first physical function can be deleted.
[0065] See also Figure 4 , Figure 4 4 is a schematic diagram of a computing device provided by the present application. The computing device 400 includes: one or more processing units 410 , a communication interface 420 and a storage unit 430 .
[0066] The processing unit 410, the communication interface 420 and the storage unit 430 are interconnected via a bus 440. Optionally, the computing device 400 may also include an input / output interface 450, which is connected to an input / output device for receiving parameters set by a user, etc. The computing device 400 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 processing unit 410 can also be used to implement some or all of the operation 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 400 can refer to the specific details in the above-mentioned embodiment, such as the processing unit 410 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 the embodiment of the present application, the computing device 400 can be used to implement some or all of the functions of one or more components in the above-mentioned device embodiment, and the communication interface 420 can be specifically used for the communication functions necessary to implement the functions of these devices and components, and the processing unit 410 can be specifically used for the processing functions necessary to implement the functions of these devices and components, etc.
[0067] Figure 4 The computing device 400 may include one or more processing units 410, and the multiple processing units 410 may provide processing capabilities in a coordinated manner in a parallel connection manner, a serial connection manner, a serial-parallel connection manner, or any connection manner, or the multiple processing units 410 may constitute a processor sequence or a processor array, or the multiple processing units 410 may be divided into a main processor and an auxiliary processor, or the multiple processing units 410 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 4 The computing device 400 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 400 may include Figure 4 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0068] The processing unit 410 may have a variety of specific implementation forms. For example, the processing unit 410 may include a processor (central processing unit, CPU), a graphic processing unit (graphic processing unit, GPU), a neural-network processing unit (neural-network processing unit, NPU), a tensor processing unit (tensor processing unit, TPU) or a data processing unit (data processing unit, DPU) and other combinations thereof, which are not specifically limited in the embodiments of the present application. The processing unit 410 may also be a single-core processor or a multi-core processor. The processing unit 410 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a generic array logic (generic array logic, GAL) or any combination thereof. The processing unit 410 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (digital signal processor, DSP), etc. The communication interface 420 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.
[0069] The storage unit 430 may be a non-volatile memory, such as a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The storage unit 430 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 random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous connection dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). The storage unit 430 may also be used to store program codes and data, so that the processing unit 410 can call the program codes stored in the storage unit 430 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 4 Show more or fewer components, or have different component configurations.
[0070] The bus 440 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 440 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 440 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 4 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.
[0071] The present application also provides 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 embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0072] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one network site, computer, server or data center to another network site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or it can be a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape, etc.), an optical medium (e.g., a DVD, etc.), or a semiconductor medium (e.g., a solid-state hard disk), etc. In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
Claims
1. A flow table unloading system, characterized in that: include: A network card, which is used to provide hardware resources for network communication, including multiple physical functions and multiple virtual functions, wherein the physical function is used to manage the virtual function; A processor, configured to communicate with the network card and unload the hash table and the result table into a cache of the network card; A network card cache, used to store a hash table and a result table, wherein the hash table includes multiple table entries, each table entry includes multiple hash buckets, any hash bucket in the hash table can be provided for use by any one of the multiple physical functions, the hash table is uniformly addressed, the hash bucket can store the correspondence between the hash value and the flow identifier, the hash bucket also includes a physical function identifier, the physical function identifier is used to indicate the physical function occupying the hash bucket, or different physical functions use different flow identifier segments; The network card is also used to query the hash table and the result table in the network card cache, and forward the data message according to the hash table and the result table.
2. The system according to claim 1, characterized in that The network card cache is used to delete the correspondence between the hash value and the flow identifier in the hash bucket whose physical function identifier in the hash table is the first physical function identifier, wherein the first physical function identifier is used to indicate that the physical function occupying the hash bucket is the first physical function, and the first physical function belongs to the multiple physical functions.
3. The system according to claim 1, characterized in that The flow identification segment includes a plurality of flow identifications, The network card cache is used to delete the correspondence between the hash value in the hash bucket of the flow identifier belonging to the first flow identifier segment and the flow identifier, wherein the first flow identifier segment is used to indicate that the physical function using the flow identifier segment is the first physical function, and the first physical function belongs to the multiple physical functions.
4. The system according to claim 3, characterized in that The network card cache stores a mapping table, which is used to store the correspondence between the physical function and the flow identification segment. The network card cache is used to determine the flow identifier segment to which the first flow identifier belongs according to the first flow identifier in the first hash bucket, determine the first flow identifier segment used by the first physical function using the first flow identifier according to the flow identifier segment to which the first flow identifier belongs and the mapping table, delete the correspondence between the hash value and the flow identifier in the first hash bucket, and the first hash bucket belongs to multiple hash buckets in the hash table.
5. The system according to claim 4, characterized in that The mapping table includes multiple flow identification groups, and there is a one-to-one correspondence between the multiple flow identification groups and the multiple physical functions. The flow identification group includes multiple identification bits, and there is a one-to-one correspondence between the multiple identification bits and multiple flow identification segments. When the value of the first identification bit in the first flow identification group is a first value, it indicates that the flow identification segment corresponding to the first identification bit is used by the physical function corresponding to the first flow identification group; when the value of the first identification bit in the first flow identification group is a second value, it indicates that the flow identification segment corresponding to the first identification bit is not used by the physical function corresponding to the first flow identification group, and the first flow identification group belongs to the multiple flow identification groups.
6. The system according to any one of claims 3 to 5, characterized in that: The number of the first flow identification segments is multiple.
7. The system according to any one of claims 1 to 5, characterized in that: The plurality of physical functions share a size of the hash table.
8. The system according to claim 1, characterized in that A first hash bucket in a first table entry is used by a first physical function, a second hash bucket in the first table entry is used by a second physical function, the first table entry belongs to the multiple table entries, and the first hash bucket and the second hash bucket are adjacent hash buckets in the first table entry.
9. A computing device, characterized in that It comprises a flow table unloading system and a storage unit, the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of claims 1-8.
10. A computing device cluster, characterized in that: It comprises a flow table unloading system and a storage unit, the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of claims 1-8.
Citation Information
Patent Citations
Flow table unloading system, method and equipment and storage medium
CN116886605A
High-speed serial computer expansion bus equipment identification method and device and related equipment
CN117472838A
Flow table unloading method for multi-source access, computer equipment and medium
CN118573637A