A flow table management method, a data processing unit and a chip
By combining hardware flow table engine processing layer scanning with firmware proxy processing layer batch deletion, the problem of flow table deletion delay in cloud networks is solved, achieving efficient and rapid aging of flow tables and improving the system's real-time performance and concurrent processing capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN JAGUAR MICROSYSTEMS CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-07-21
AI Technical Summary
In large-scale, high-concurrency cloud network scenarios, existing flow table deletion mechanisms suffer from significant delays, failing to meet the efficiency requirements of business changes, resulting in flow table remnants and abnormal network forwarding.
The hardware flow table engine processing layer directly scans the aging segment of the hardware flow table, extracts and compares the port identifier, and quickly locates the flow table entries to be aged. Combined with the batch deletion interface of the firmware proxy processing layer, efficient and fast aging of flow tables is achieved.
It achieves efficient and rapid aging of flow tables, avoiding the delays caused by software-level lookup and synchronous waiting, and improving the system's real-time performance and concurrent processing capabilities.
Smart Images

Figure CN121907895B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of flow table technology, specifically to a flow table management method, a data processing unit, and a chip. Background Technology
[0002] With the rapid development of cloud computing and artificial intelligence (AI) models, data center networks (DCNs) have become the core infrastructure supporting massive data storage, high-speed computing, and distributed collaboration. In cloud network scenarios, dynamic scheduling and elastic scaling of virtual machines (VMs) and containers have become commonplace, with the number of physical machines, switches, routers, and other nodes within a single data center reaching tens or even hundreds of thousands. Virtual switches, as a key technology for network virtualization in cloud networks, have been deeply integrated into the network virtualization architecture of cloud platforms, including cloud-native environments such as OpenStack and Kubernetes, as well as various public cloud infrastructures. By implementing core functions such as virtual network isolation (VLAN / VxLAN), traffic forwarding, QoS control, and security policies (ACLs), virtual switches serve as a bridge connecting physical and virtual networks, and their performance and reliability directly impact the stability of cloud services.
[0003] The traffic characteristics of cloud networks pose extreme challenges to flow table management components. On the one hand, the number of concurrent sessions is growing explosively: a single data node (such as a physical machine or edge gateway) needs to handle business traffic from thousands of virtual machines simultaneously, easily exceeding one million concurrent sessions. The data frames corresponding to these sessions need to be matched and forwarded through flow tables, and the number of flow table entries also increases accordingly, with the scale of a single node's flow table often reaching hundreds of thousands to millions of entries. On the other hand, the dynamism and burstiness of traffic are significantly enhanced: operations such as elastic scaling of cloud services, virtual machine migration, and failover can lead to frequent changes in network topology and traffic paths, requiring the flow table management system to respond quickly to the addition, modification, and deletion of flow tables.
[0004] Against this backdrop, efficient management of flow tables has become a key pain point for cloud network performance optimization. Taking the batch deletion of flow tables at the port level as an example, when a cloud platform needs to delete all flow tables under a certain port due to business changes (such as tenant cancellation or subnet adjustment), the conventional processing logic is as follows: the software side needs to first traverse the flow table database to filter out the flow table entries associated with the target port, and then send deletion instructions to the underlying network hardware (such as the ASIC chip of the smart network card, the TCAM controller of the switch, or the firmware of the data processing unit DPU) one by one. After receiving the instructions, the underlying hardware needs to search for each hardware table entry and perform the erasure operation. This "software traversal filtering + hardware deletion" mechanism will produce significant latency (seconds) when the flow table scale is large (such as 100,000 flow tables associated with a certain port). This not only affects the efficiency of business changes, but may also lead to flow table residue, resource leakage, and even network forwarding anomalies (such as packet mismatch and packet loss) when the port fluctuates frequently (such as multiple online and offline times in a short period of time).
[0005] Current auxiliary solutions are also difficult to adapt to the high-concurrency scenarios of cloud networks. For example, although the timestamp aging mechanism can achieve automatic deletion of a single flow table, it relies on a preset time-to-live (TTL) and cannot respond to the immediate needs of port-level batch deletion; the mark-delete mode can reduce foreground blocking by adding deletion marks and asynchronous background scanning and cleaning, but its marking and scanning latency (usually hundreds of milliseconds) still cannot meet the requirements of cloud networks for rapid fault self-healing (such as cleaning all associated flow tables within 100ms to avoid loops when a port fails).
[0006] Therefore, in large-scale, high-concurrency cloud network scenarios, how to overcome the performance bottleneck of existing flow table deletion mechanisms and achieve efficient and rapid aging of flow tables has become an urgent technical problem to be solved. Summary of the Invention
[0007] The purpose of this application is to propose a flow table management method, a data processing unit, and a chip to achieve efficient and rapid aging of flow tables.
[0008] To achieve the above objectives, according to a first aspect of this application, a flow table management method is provided, the method comprising:
[0009] When flow table aging is triggered, the flow table management application layer sends a conditional aging message to the firmware proxy processing layer. The firmware proxy processing layer parses the condition aging message to obtain the target port identifier, sends the target port identifier to the hardware flow table engine processing layer, and returns an acknowledgment message to the flow table management application layer. The hardware flow table engine processing layer scans the aging field of all flow table entries in the hardware flow table to extract the port identifier of each flow table entry, and compares the port identifier of each flow table entry with the target port identifier; if the port identifier of any flow table entry is the same as the target port identifier, then the flow table entry is reported to the firmware proxy processing layer. The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer to delete the reported flow table entries in batches, based on the flow table entries reported by the hardware flow table engine processing layer.
[0010] In some embodiments, the firmware proxy processing layer parses the conditional aging message to obtain the target port identifier, and sends the target port identifier to the hardware flow table engine processing layer, including: The firmware proxy processing layer parses the conditional aging message to obtain the aging mode and target port identifier, and sends the aging mode and target port identifier to the hardware flow table engine processing layer. Wherein, when the aging mode is the first mode, the target port is identified by a version number, which is used to uniquely identify the port, and the first mode indicates that the flow table is aged based on the version number; when the aging mode is the second mode, the target port is identified by a version group number, which is used to identify the port group to which the port belongs, and the second mode indicates that the flow table is aged based on the version group number.
[0011] In some embodiments, the aging field of the flow table entry includes a version field and a version group field, wherein the version field is used to store the version number and the version group field is used to store the version group number. The hardware flow table engine processing layer scans the aging segment of all flow table entries to extract the port identifier of each flow table entry, including: When the aging mode is the first mode, the hardware flow table engine processing layer scans the version field of all flow table entries in the hardware flow table to extract the version number of each flow table entry. When the aging mode is the second mode, the hardware flow table engine processing layer scans the version field of all flow table entries in the hardware flow table to extract the version group number of each flow table entry.
[0012] In some embodiments, reporting any flow table entry to the firmware proxy processing layer includes: The hardware flow table engine processing layer records any flow table entry as invalid and reports any flow table entry to the firmware agent processing layer through the hardware aging queue.
[0013] In some embodiments, the method includes: When the flow table management application layer starts, it sends a global aging message to the firmware proxy processing layer. The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer based on the global aging message to delete all flow table entries currently stored in the hardware flow table engine processing layer. After the deletion is completed, it returns confirmation deletion information to the flow table management application layer.
[0014] In some embodiments, the method includes: After receiving the confirmation deletion information, the flow table management application layer sends aging domain segment information to the firmware agent processing layer. The firmware proxy processing layer parses the aging segment information to obtain the length of the aging segment and the offset of the aging segment in the flow table entry; The firmware proxy processing layer's length and offset configure the aging segment scanning function of the hardware flow table engine processing layer.
[0015] In some embodiments, the method includes: The flow table management application layer assigns a port identifier to each port and stores the port identifier of each port in the private data area of each port. When any port receives a data packet, the data packet parsing module parses the data packet, generates a keyword based on the data packet parsing result and the port identifier of the port, and sends the keyword and the port information of the port to the hardware flow table engine processing layer through the firmware proxy processing layer. The hardware flow table engine processing layer scans the hardware flow table for a matching flow table entry based on the keyword. If a matching entry is found, the data packet is processed according to the matching entry. If not, the data packet and the port information of the port are sent to the flow table management application layer through the firmware proxy processing layer to trigger the issuance of a new flow table entry, and the data packet is processed according to the new flow table entry.
[0016] In some embodiments, triggering the issuance of a new flow table entry includes: The flow table management application layer generates new flow table entries based on the port identifier and the packet parsing result, and sends them to the firmware proxy processing layer. The firmware proxy processing layer configures the hardware flow table according to the new flow table entry and adds the new flow table entry to the hardware flow table.
[0017] According to a second aspect of this application, a data processing unit (DPU) is provided, including a flow table management application layer, a firmware proxy processing layer, and a hardware flow table engine processing layer for performing the above-described methods.
[0018] According to a third aspect of this application, a chip is provided, including the data processing unit (DPU) described above.
[0019] The flow table management method, data processing unit, and chip provided in this application have the following beneficial effects: This application directly scans the aging domains of all flow table entries in the hardware flow table through the hardware flow table engine processing layer. It compares the extracted port identifiers with the target port identifiers to quickly locate all flow table entries to be aged. Then, it reports this to the firmware proxy processing layer, which calls the dedicated deletion interface of the hardware flow table engine processing layer to batch delete all flow table entries to be aged. Simultaneously, after sending the target port identifiers to the hardware flow table engine processing layer, the firmware proxy processing layer immediately returns a confirmation message to the flow table management application layer, enabling asynchronous background processing of the aging task. In summary, by combining hardware batch scanning with asynchronous batch deletion, the delays caused by software-layer item-by-item searching and synchronous waiting are avoided, achieving efficient and rapid aging of flow tables.
[0020] Other features and advantages of this application will be set forth in the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings required in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a flow table management method in an embodiment of this application.
[0023] Figure 2 This is a structural diagram of the flow table entries in the embodiments of this application.
[0024] Figure 3 This is a system framework diagram of a data processing unit in an embodiment of this application. Detailed Implementation
[0025] The detailed description of the accompanying drawings is intended to illustrate the present preferred embodiments of this application and is not intended to represent only the forms in which this application can be implemented. It should be understood that the same or equivalent functions may be performed by different embodiments intended to be included within the scope of this application.
[0026] Please see Figure 1 One embodiment of this application provides a flow table management method, including the following steps: Step S10: When the flow table aging is triggered, the flow table management application layer sends a conditional aging message to the firmware proxy processing layer. Specifically, triggering flow table aging includes port deletion / port failure, frequent port online / offline / port oscillation, and service group / port group switching or offline. Port deletion / port invalidation refers to the process of deleting a logical or physical port due to business changes, such as tenant cancellation, subnet adjustment, or other cloud platform business changes, or the release of virtual machines / containers, when the related network port is no longer used, or port failure or active offline. In this case, the port and all its associated flow tables will be aged out. Frequent port online / offline / port oscillation refers to the phenomenon where a port repeatedly goes online and offline (oscillates) in a short period of time. In order to prevent old flow table residues, resource leaks, or forwarding anomalies, the flow tables related to the port will be rapidly aged when the port status changes. Service group / port group switching or offline refers to the process where a group of ports with the same business logic needs to be offline or switched as a whole. This triggers flow table aging at the port group level, aging the flow tables corresponding to all ports in the group at once. The conditional aging message includes at least a target port identifier, which is used to instruct the hardware flow table engine processing layer to perform flow table aging with the target port identifier as a condition.
[0027] Step S20: The firmware proxy processing layer parses the condition aging message to obtain the target port identifier, sends the target port identifier to the hardware flow table engine processing layer, and returns an acknowledgment message to the flow table management application layer. Specifically, the firmware proxy processing layer parses the received conditional aging messages and extracts the target port identifier (such as version number and version group number) used to match the aging conditions. This target port identifier is then configured and sent to the hardware flow table engine processing layer to instruct the hardware side to start the scanning logic and execute the comparison task. During this process, after sending the target port identifier to the hardware, the firmware proxy processing layer immediately returns a confirmation message to the flow table management application layer. This mechanism decouples the control command from the execution process, allowing the flow table management application layer to release control without waiting for the time-consuming hardware scan and batch deletion operations to complete, thereby ensuring the real-time performance of upper-layer services and the concurrent processing capability of the system.
[0028] Step S30: The hardware flow table engine processing layer scans the aging domain of all flow table entries in the hardware flow table to extract the port identifier of each flow table entry, and compares the port identifier of each flow table entry with the target port identifier; if the port identifier of any flow table entry is the same as the target port identifier, then the flow table entry is reported to the firmware proxy processing layer. Specifically, the hardware flow table engine processing layer scans all currently stored flow entries in its hardware flow table based on the configuration information issued by the firmware proxy processing layer. During the scan, the hardware engine extracts the port identifier corresponding to the preset aging domain in each flow table entry and compares the extracted port identifier with the target port identifier issued in step S20 in real time. If the port identifier of any flow table entry matches the target port identifier, the hardware engine determines that the flow table entry meets the aging conditions and reports it to the firmware proxy processing layer, thereby completing the rapid location and filtering of flow table entries to be aged.
[0029] Step S40: The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer to delete the reported flow table entries in batches, based on the flow table entries reported by the hardware flow table engine processing layer. Specifically, the firmware proxy processing layer receives the set of flow table entries reported by the hardware flow table engine processing layer, analyzes and organizes the set of flow table entries, and then calls the dedicated deletion interface provided by the hardware flow table engine processing layer to perform batch deletion operations on the above set of entries, thereby completing the deletion of multiple flow table entries, significantly reducing the interaction overhead of the control layer and the system bus occupation.
[0030] As described in the above embodiments, the method of this embodiment directly scans the aging domain of all flow table entries in the hardware flow table through the hardware flow table engine processing layer. It compares the extracted port identifiers with the target port identifiers to quickly locate all flow table entries to be aged, and then reports this to the firmware proxy processing layer. The firmware proxy processing layer then calls the dedicated deletion interface of the hardware flow table engine processing layer to batch delete all flow table entries to be aged. Simultaneously, after sending the target port identifiers to the hardware flow table engine processing layer, the firmware proxy processing layer immediately returns a confirmation message to the flow table management application layer, realizing asynchronous background processing of the aging task. In summary, the method of this embodiment combines hardware batch scanning with asynchronous batch deletion, avoiding the delays of software-layer item-by-item searching and synchronous waiting, thus achieving efficient and rapid aging of flow tables.
[0031] In some embodiments, the firmware proxy processing layer parses the conditional aging message to obtain the target port identifier, and sends the target port identifier to the hardware flow table engine processing layer, including: The firmware proxy processing layer parses the conditional aging message to obtain the aging mode and target port identifier, and sends the aging mode and target port identifier to the hardware flow table engine processing layer. Wherein, when the aging mode is the first mode, the target port is identified by a version number, which is used to uniquely identify the port, and the first mode indicates that the flow table is aged based on the version number; when the aging mode is the second mode, the target port is identified by a version group number, which is used to identify the port group to which the port belongs, and the second mode indicates that the flow table is aged based on the version group number.
[0032] Specifically, the method in this embodiment supports flow table cleanup at different granularities. When the firmware proxy processing layer parses the conditional aging message, it not only obtains the specific port identification information, but also obtains the aging mode at the same time, and configures these two types of parameters to the hardware flow table engine processing layer to guide the hardware to perform port-level aging or port group-level aging. When the aging mode is the first mode, the target port identifier is specifically the version number. Under this configuration, the version number is used to uniquely identify a single port. The hardware flow table engine processing layer matches based on the version number, aiming to achieve the aging and deletion of all flow table entries under this specific port. When the aging mode is the second mode, the target port identifier is specifically the version group number. Under this configuration, the version group number is used to identify a set of ports belonging to the same business logic. The hardware flow table engine processing layer matches based on the version group number, aiming to achieve batch aging and deletion of flow table entries associated with all ports in the port group. This embodiment distinguishes between aging modes, enabling the system to flexibly respond to different business scenarios such as single port changes or overall port group switching, thereby improving the flexibility of flow table management.
[0033] The port grouping involves grouping ports with the same or highly related business logic into the same group. Business logic may include: ports belonging to the same tenant or the same subnet, ports carrying the same type of business (such as storage, computing, and management networks), and a set of ports working together in the same business link or topology layer.
[0034] In some embodiments, such as Figure 2 As shown, the aging field of the flow table entry includes a version field and a version group field. The version field is used to store the version number, and the version group field is used to store the version group number. The hardware flow table engine processing layer scans the aging segment of all flow table entries to extract the port identifier of each flow table entry, including: When the aging mode is the first mode, the hardware flow table engine processing layer scans the version field of all flow table entries in the hardware flow table to extract the version number of each flow table entry. When the aging mode is the second mode, the hardware flow table engine processing layer scans the version field of all flow table entries in the hardware flow table to extract the version group number of each flow table entry.
[0035] Specifically, each flow table entry has two pre-defined aging fields for storing identification information: a version field for storing the version number of the port to which the flow table entry belongs, and a version group field for storing the version group number of the port to which the flow table entry belongs. This ensures that each flow table entry carries dual identity information of its port and port group. When the hardware flow table engine processing layer performs a full table scan, it does not blindly read all the information, but dynamically selects the target field to scan based on the issued aging mode to improve matching efficiency and accuracy. When the aging mode is indicated as the first mode, the system target is to age all flow tables under a specific port. The hardware flow table engine processing layer only scans and extracts the version number of the version field in the flow table entry. By comparing the extracted version number with the target port identifier (i.e. the target version number), all flow table entries belonging to that specific port can be accurately located. When the aging mode is indicated as the second mode, the system target is to age all flow tables of all ports under a specific service group. The hardware flow table engine processing layer only scans and extracts the version group number of the version group field in the flow table entry. By comparing the extracted version group number with the target port identifier (i.e. the target version group number), all flow table entries belonging to the port group are filtered out at once. This embodiment divides the hardware flow table into version domain segments and version group domain segments, and combines aging mode to control the scanning range of the hardware engine. This enables flexible switching and efficient matching in single-port aging and port group aging scenarios, avoids reading and comparing invalid data, and optimizes the utilization of hardware resources.
[0036] In some embodiments, reporting any flow table entry to the firmware proxy processing layer includes: The hardware flow table engine processing layer records any flow table entry as invalid and reports any flow table entry to the firmware agent processing layer through the hardware aging queue.
[0037] Specifically, once the hardware flow table engine processing layer confirms that the port identifier of a flow table entry matches the target identifier, it immediately marks the status of that flow table entry as invalid. This ensures that the flow table entry will not be hit or forwarded by subsequent incoming data packets before the physical storage space is actually reclaimed. This effectively avoids traffic forwarding anomalies caused by residual entries still being effective within the time window between scanning and discovering the entry and the firmware performing physical deletion. After completing the status marking, the hardware writes the relevant information of the flow table entry into a designated hardware aging queue, thereby notifying the firmware agent processing layer. The hardware aging queue serves as a communication buffer between the high-speed hardware processing layer and the firmware software processing layer, enabling batch information reporting through the queue.
[0038] In some embodiments, the method includes: When the flow table management application layer starts, it sends a global aging message to the firmware proxy processing layer. The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer based on the global aging message to delete all flow table entries currently stored in the hardware flow table engine processing layer. After the deletion is completed, it returns confirmation deletion information to the flow table management application layer.
[0039] Specifically, in this embodiment, global flow table cleanup is performed during the system initialization phase to ensure that the hardware flow table engine is in a defined and clean initial state when the flow table management application layer starts. This is automatically triggered when the flow table management application layer starts. The flow table management application layer sends a global aging message to the firmware proxy processing layer. This global aging message is different from the conditional aging message for a specific port or port group. Its instruction intent is to clear all flow table entries currently stored in the hardware. The firmware proxy processing layer responds to the global aging message by directly calling the deletion interface of the hardware flow table engine processing layer to perform a full flow table cleanup operation to resolve the risk of hardware entry residue. After the hardware flow table engine processing layer completes the physical deletion of all entries, it returns confirmation deletion information to the firmware proxy processing layer, which then returns confirmation deletion information to the flow table management application layer. It should be noted that in actual operation scenarios, if the flow table management application layer crashes or exits abnormally, a large number of old flow table entries may still be retained in the hardware flow table. When the flow table management application layer restarts, without this global cleanup step, these residual old entries may continue to be effective, causing traffic to be forwarded according to expired rules, thereby causing uncontrollable consequences such as routing errors and security policy failures.
[0040] In some embodiments, the method includes: After receiving the confirmation deletion information, the flow table management application layer sends aging domain segment information to the firmware agent processing layer. The firmware proxy processing layer parses the aging segment information to obtain the length of the aging segment and the offset of the aging segment in the flow table entry; The firmware proxy processing layer's length and offset configure the aging segment scanning function of the hardware flow table engine processing layer.
[0041] Specifically, after confirming that the hardware flow table has been cleared, the flow table management application layer sends aging segment information to the firmware proxy processing layer based on the aging segment settings configured by the user through software. This aging segment information defines the segment attributes used for aging judgment in the flow table entry and serves as the basis for data extraction by the hardware flow table engine processing layer. The firmware proxy processing layer parses the aging segment information, extracting the length and offset. The offset indicates the starting position of the aging field in the flow table entry structure, and the length defines the number of bits or bytes occupied by the aging field. Based on the length and offset, a specific segment can be determined. Furthermore, the firmware proxy processing layer writes the parsed offset and length parameters into the corresponding registers or configuration tables of the hardware flow table engine processing layer, completing the static configuration of the scanning rules for subsequent execution of conditional aging tasks.
[0042] For example, an aging segment control register can be set in the hardware flow table engine processing layer. This register includes at least: segment offset, segment length, scan enable bit, and aging mode selection. The firmware agent processing layer drives the hardware flow table engine processing layer to perform flow table aging operations by configuring the parameters of the segment offset, segment length, scan enable bit, and aging mode selection. For example, if the scan enable bit = 1 and the aging mode = 0, the first mode is executed; if the scan enable bit = 1 and the aging mode = 1, the second mode is executed; if the scan enable bit = 0, aging scan is not performed.
[0043] In some embodiments, the method includes: The flow table management application layer assigns a port identifier to each port and stores the port identifier of each port in the private data area of each port. When any port receives a data packet, the data packet parsing module parses the data packet, generates a keyword based on the data packet parsing result and the port identifier of the port, and sends the keyword and the port information of the port to the hardware flow table engine processing layer through the firmware proxy processing layer. The hardware flow table engine processing layer scans the hardware flow table for a matching flow table entry based on the keyword. If a matching entry is found, the data packet is processed according to the matching entry. If not, the data packet and the port information of the port are sent to the flow table management application layer through the firmware proxy processing layer to trigger the issuance of a new flow table entry, and the data packet is processed according to the new flow table entry.
[0044] Specifically, during the initialization phase, the flow table management application layer assigns a port identifier (version number and version group number) to each port. This port identifier is written to the private data area corresponding to each port. The private data area is a dedicated memory space used to maintain port state attributes, ensuring a one-to-one correspondence between the port identifier and the port entity, and enabling fast retrieval. When a port changes, its port identifier may change. In this case, a new port identifier needs to be assigned, the old port identifier is deleted from the corresponding private data area, and the flow table entry containing the old port identifier is aged out. This is done based on either the first or second mode of flow table aging.
[0045] Data packets received at each port are parsed by the data packet parsing module to obtain data packet information. The parsed data packet information and its corresponding port information are sent to the flow table management application layer. The flow table management application layer accesses the private data area of the corresponding port to obtain the port identifier (version number and version group number) based on the port information. Based on the data packet information and the obtained port identifier, a key is generated, which carries the port identifier. The generated key, along with the port information, is passed to the hardware flow table engine processing layer through the firmware proxy processing layer as the basis for table lookup.
[0046] The hardware flow table engine processing layer scans the hardware flow table based on the keyword. If a matching flow table entry is found, it indicates that the traffic has been learned and its affiliation is clear. The hardware flow table engine processing layer directly processes the data packet according to the action instructions (such as forwarding, modifying, or dropping) in the matching flow table entry, achieving line-speed forwarding. If the hardware flow table engine processing layer does not find a matching entry, it means that the data traffic is appearing for the first time or the corresponding flow table is old / does not exist. In this case, the hardware flow table engine processing layer sends the data packet and port information to the flow table management application layer through the firmware proxy processing layer. After receiving the sent information, the flow table management application layer calculates according to the preset strategy algorithm to decide how to process the data packet. It should be noted that the processing method for different types of data packets is user-defined. The flow table management application layer generates a new flow table entry (containing the port identifier of the current port) based on the decision and sends it down to the hardware flow table engine processing layer again. After installing the new entry, the hardware flow table engine processing layer processes the data packet according to the flow table entry, completing the flow table learning process.
[0047] In some embodiments, triggering the issuance of a new flow table entry includes: The flow table management application layer generates new flow table entries based on the port identifier and the packet parsing result, and sends them to the firmware proxy processing layer. The firmware proxy processing layer configures the hardware flow table according to the new flow table entry and adds the new flow table entry to the hardware flow table.
[0048] Specifically, the flow table management application layer logically combines the packet information extracted by the packet parsing module with the port identifier (version number and version group number) to generate a key. It then calculates the corresponding action instruction based on a preset strategy algorithm, ultimately generating a complete flow table entry containing both a matching field and an action field. Each flow table entry describes the mapping relationship between the key and the action (Key→Action). The firmware proxy processing layer, acting as an adaptation layer between the control plane and the hardware plane, receives the logical flow table entries from the flow table management application layer and converts them into a low-level configuration format recognizable by the hardware flow table engine. The firmware proxy processing layer calls the hardware driver's configuration interface to perform a write operation, allocating free entries in the hardware flow table's storage resources and writing the newly constructed flow table entry data. After configuration, the hardware flow table is capable of processing this type of packet.
[0049] like Figure 3 As shown, another embodiment of this application provides a data processing unit (DPU) including a flow table management application layer 1, a firmware proxy processing layer 2, and a hardware flow table engine processing layer 3 for performing the methods described in the above embodiments.
[0050] Specifically, the flow table management application layer 1 runs on the operating system of the DPU's general-purpose processor core. As the brain of the control plane, it is responsible for complex logical operations, global resource management (such as allocating port identifiers), and slow path processing of abnormal packets. It does not directly interact with high-speed data streams but interacts with the firmware through standard interfaces. The firmware agent processing layer 2 is low-level software running on the microcontroller (MCU) or dedicated processing core inside the DPU, usually in a bare-metal or RTOS environment. As an adaptation layer and execution agent, it shields the complexity of the underlying hardware, receives high-level instructions (such as configuring aging scan parameters) issued by the flow table management application layer 1 on the DPU OS side, and translates them into precise read and write operations on hardware registers. At the same time, it is responsible for polling or interrupt handling and reporting hardware state changes to the flow table management application layer 1. The hardware flow table engine processing layer 3 is the internal hardware logic circuit of the DPU, including hardware flow tables, lookup engines, and hardware aging queues. It provides deletion and parameter configuration interfaces for the firmware proxy processing layer 2. As a data plane engine, the hardware flow table engine processing layer 3 provides line-speed packet processing capabilities, performing fast table lookups, matching, and forwarding actions, as well as hardware aging scans and reporting. In addition, the DPU also includes a packet parsing module, which is a hardware parser integrated into the DPU data path. As a packet preprocessing unit, it uses dedicated logic circuits to parse packet headers at high speed, extract packet features, and generate lookup keys by combining port identifiers.
[0051] Another embodiment of this application provides a chip including the data processing unit (DPU) described in the above embodiments.
[0052] Another embodiment of this application provides a network interface card. The network interface card may include the chip described in the above embodiments. The chip may be a DPU chip.
[0053] Another embodiment of this application provides an electronic device. The electronic device may include the network interface card described in the above embodiments or the chip described in the above embodiments. Preferably, the electronic device may be a server in a data center.
[0054] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many updates and modifications will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A flow table management method, characterized in that, The method includes: When flow table aging is triggered, the flow table management application layer sends a conditional aging message to the firmware proxy processing layer. The firmware proxy processing layer parses the conditional aging message to obtain the aging mode and target port identifier, sends the aging mode and target port identifier to the hardware flow table engine processing layer, and returns an acknowledgment message to the flow table management application layer. Specifically, when the aging mode is the first mode, the target port identifier is a version number, which uniquely identifies the port; the first mode indicates that flow table aging is performed based on the version number. When the aging mode is the second mode, the target port identifier is a version group number, which identifies the port group to which the port belongs; the second mode indicates that flow table aging is performed based on the version group number. The hardware flow table engine processing layer scans the aging field of all flow table entries to extract the port identifier of each flow table entry, and compares the port identifier of each flow table entry with the target port identifier. If the port identifier of any flow table entry is the same as the target port identifier, then that flow table entry is reported to the firmware proxy processing layer. The hardware flow table engine processing layer is a hardware logic circuit. The aging field of each flow table entry includes a version field and a version group field. The version field stores the version number, and the version group field stores the version group number. When the aging mode is the first mode, the hardware flow table engine processing layer scans the version field of all flow table entries to extract the version number of each flow table entry. When the aging mode is the second mode, the hardware flow table engine processing layer scans the version field of all flow table entries to extract the version group number of each flow table entry. The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer to delete the reported flow table entries in batches, based on the flow table entries reported by the hardware flow table engine processing layer.
2. The method according to claim 1, characterized in that, The step of reporting any one of the flow table entries to the firmware proxy processing layer includes: The hardware flow table engine processing layer records any flow table entry as invalid and reports any flow table entry to the firmware agent processing layer through the hardware aging queue.
3. The method according to claim 1, characterized in that, The method includes: When the flow table management application layer starts, it sends a global aging message to the firmware proxy processing layer. The firmware proxy processing layer calls the deletion interface of the hardware flow table engine processing layer based on the global aging message to delete all flow table entries currently stored in the hardware flow table engine processing layer. After the deletion is completed, it returns confirmation deletion information to the flow table management application layer.
4. The method according to claim 3, characterized in that, The method includes: After receiving the confirmation deletion information, the flow table management application layer sends aging domain segment information to the firmware agent processing layer. The firmware proxy processing layer parses the aging segment information to obtain the length of the aging segment and the offset of the aging segment in the flow table entry; The firmware proxy processing layer's length and offset configure the aging segment scanning function of the hardware flow table engine processing layer.
5. The method according to claim 1, characterized in that, The method includes: The flow table management application layer assigns a port identifier to each port and stores the port identifier of each port in the private data area of each port. When any port receives a data packet, the data packet parsing module parses the data packet, generates a keyword based on the data packet parsing result and the port identifier of the port, and sends the keyword and the port information of the port to the hardware flow table engine processing layer through the firmware proxy processing layer. The hardware flow table engine processing layer scans the hardware flow table for a matching flow table entry based on the keyword. If a matching entry is found, the data packet is processed according to the matching entry. If not, the data packet and the port information of the port are sent to the flow table management application layer through the firmware proxy processing layer to trigger the issuance of a new flow table entry, and the data packet is processed according to the new flow table entry.
6. The method according to claim 5, characterized in that, The triggering of the issuance of new flow table entries includes: The flow table management application layer generates new flow table entries based on the port identifier and the packet parsing result, and sends them to the firmware proxy processing layer. The firmware proxy processing layer configures the hardware flow table according to the new flow table entry and adds the new flow table entry to the hardware flow table.
7. A data processing unit, characterized in that, It includes a flow table management application layer, a firmware proxy processing layer, and a hardware flow table engine processing layer for performing the method described in any one of claims 1 to 6.
8. A chip, characterized in that, Includes the data processing unit as described in claim 7.