An intelligent network card offloading method, device, equipment, medium and product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-08-07
AI Technical Summary
然而,现有方案基于会话流(五元组)实现卸载,对于无状态的业务场景,需要额外创建无状态会话来维护卸载表,增加了主机内存占用,同时由于会话数量一般为千万级,远大于一般网卡支持的百万级卸载表项,存在卸载表项过多导致卸载失败从而降低转发性能的问题
[0015]相对于现有技术,本申请提供的一种智能网卡卸载方法、装置、设备、介质及产品的有益效果在于:通过在智能网卡接收到业务报文时,根据所述业务报文中的目标节点地址信息在预设的节点流表中进行匹配,若匹配成功则根据所述节点流表中对应的动作项对所述业务报文进行处理并发送至目标用户节点,若匹配失败则通过慢路径转发所述业务报文,能够实现基于节点流的网卡卸载,通过使用节点流表替代传统的基于会话的表项,使主机侧避免了维护无状态会话的内存开销,同时可以大大减少表项数量,使得更多流量通过网卡直接转发,从而提升转发性能。
Smart Images

Figure CN122534010A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus, device, medium and product for intelligent network interface card (NIC) offloading based on node flow. Background Technology
[0002] Offloading technology is a method that reduces software processing overhead and improves network performance by offloading functions or modules used in network traffic forwarding from software computation or processing to hardware processing through smart network interface cards (NICs) or dedicated hardware. Existing offloading solutions typically employ an architecture of OVS (Open vSwitch) + DPDK (Data Plane Development Kit). When the NIC receives a packet, it matches it against the hardware flow table; if a match is found, the packet is forwarded directly; otherwise, it is sent to OVS. However, existing solutions implement offloading based on session flows (five-tuples). For stateless service scenarios, additional stateless sessions need to be created to maintain the offloading table, increasing host memory usage. Furthermore, since the number of sessions is typically in the tens of millions, far exceeding the millions of offloading table entries supported by typical NICs, there is a problem of excessive offloading entries leading to offloading failures and reduced forwarding performance. Summary of the Invention
[0003] To address the above technical issues, this application provides a smart NIC offloading method, apparatus, device, medium, and product, applicable to stateless service scenarios. By offloading based on node flow, it can avoid the memory overhead of maintaining stateless sessions and reduce the number of offloading table entries, thereby improving forwarding performance.
[0004] This application provides a method for unloading a smart network interface card (NIC), including: When a service message is received, a match is performed in a preset node flow table based on the target node address information in the service message; the node flow table includes matching items for several nodes and their corresponding action items; If a match is successful, the service message is processed according to the corresponding action item in the node flow table and sent to the target user node; If a match fails, the service message is forwarded via a slow path.
[0005] As an improvement to the above scheme, the step of matching the target node address information in the service message against a preset node flow table includes: Extract the target node address information corresponding to the target user node from the service message. The target node address information includes the Virtual Extensible Local Area Network (VXLAN) tunnel endpoint address, VXLAN network identifier, and node address information. The VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information are matched in a preset node flow table.
[0006] As an improvement to the above scheme, when the service packet is a packet received from the source node, the matching based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information in a preset node flow table includes: Based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful. Based on the node flow table, it is determined whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current compute node. If so, the service packet is sent to the target user node in the current compute node after processing. Otherwise, the service packet is sent to other compute nodes through the switch after processing.
[0007] As an improvement to the above scheme, when the service packet is a packet received from the switch, the matching based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information in a preset node flow table includes: Based on the node flow table, determine whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current computing node; If not, the service message is discarded; If so, then based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful, and the service message is sent to the target user node in the current computing node after processing.
[0008] As an improvement to the above scheme, the creation time of each entry in the node flow table is the creation time of the user node corresponding to that entry, and the deletion time of each entry in the node flow table is the deletion time of the user node corresponding to that entry.
[0009] As an improvement to the above solution, the method further includes: When a new user node is created, in response to receiving a VXLAN format node flow packet from the virtual switch of the new user node, the node flow packet is parsed to obtain the VXLAN tunnel endpoint address, VXLAN network identifier, node address information and packet forwarding rules of the new user node. Using the VXLAN tunnel endpoint address, VXLAN network identifier, and node address information of the new user node as matching items, and the packet forwarding rule corresponding to the new user node as the action item, a new entry is generated and updated in the node flow table.
[0010] As an improvement to the above solution, the method further includes: During hot migration of a user node, in response to receiving a first message with a migration flag and containing the matching item and action item corresponding to the user node, the user node is determined to be in a migration state, wherein the action item in the first message is empty; according to the first message, the entry corresponding to the user node in the node flow table is marked as unavailable, so that the traffic corresponding to the user node is forwarded through the slow path. In response to receiving a second message with a migration flag and containing the matching item and action item corresponding to the user node, it is determined that the user node migration is complete, wherein the action item in the second message is the packet forwarding rule corresponding to the user node; according to the second message, the VXLAN tunnel endpoint address corresponding to the user node in the node flow table is updated to the VXLAN tunnel endpoint address of the compute node where the user node is located after migration, and the unavailable state of the corresponding entry in the node flow table is removed.
[0011] This application also provides a smart network interface card (NIC) offloading device, comprising: The entry matching module is used to match the target node address information in the service message with a preset node flow table when a service message is received; the node flow table includes matching entries for several nodes and their corresponding action entries. The message forwarding module is used to process the service message according to the corresponding action item in the node flow table and send it to the target user node if the match is successful; if the match fails, the service message is forwarded through the slow path.
[0012] This application also provides a computer device, including a processor and a memory, wherein the memory stores a computer program and the computer program is configured to be executed by the processor, wherein the processor executes the computer program to implement the smart network card offloading method described in any of the above claims.
[0013] This application also provides a computer-readable storage medium storing a computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the smart network card offloading method described above.
[0014] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the smart network card offloading method described in any of the above claims.
[0015] Compared with existing technologies, the beneficial effects of the smart NIC offloading method, apparatus, device, medium, and product provided in this application are as follows: When the smart NIC receives a service packet, it matches the target node address information in the service packet against a preset node flow table. If the match is successful, the service packet is processed according to the corresponding action item in the node flow table and sent to the target user node. If the match fails, the service packet is forwarded through a slow path. This enables NIC offloading based on node flow. By using a node flow table instead of the traditional session-based table entries, the host side avoids the memory overhead of maintaining stateless sessions. At the same time, it can greatly reduce the number of table entries, allowing more traffic to be forwarded directly through the NIC, thereby improving forwarding performance. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a smart network card unloading method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a user service traffic processing flow provided in an embodiment of this application; Figure 3 This is a schematic diagram of a node flow message format provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a smart network card offloading device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0018] Please see Figure 1 , Figure 1This is a flowchart illustrating a smart network interface card (NIC) uninstallation method provided in an embodiment of this application. The smart NIC uninstallation method includes: S1: When a service message is received, a match is performed in a preset node flow table based on the target node address information in the service message; the node flow table includes matching items for several nodes and their corresponding action items; S2: If the match is successful, the service message is processed according to the corresponding action item in the node flow table and sent to the target user node; S3: If the match fails, the service message is forwarded via the slow path.
[0019] Specifically, in response to the problem that session-based offloading in stateless service scenarios can lead to additional memory usage and offloading failure due to excessive table entries, this application embodiment uses node flow to replace the traditional session-based offloading flow. When the smart network card receives a service packet, it obtains the target node address information by parsing the service packet, and then matches it in the node flow table based on the target node address information.
[0020] The node flow table includes several node flow offload entries. The OVS virtual switch, by issuing node flow offload entries to smart network interface cards (NICs), can utilize the hardware capabilities of the smart NICs to modify and forward packets. Each entry in the node flow table consists of a matching entry and its corresponding action entry; one user node corresponds to one entry.
[0021] The process uses user node information as the key (matching item) for node flows and the corresponding packet forwarding rules as the actions (actions) for those flows. User nodes can be virtual machines, bare metal devices, or containers. Packet forwarding rules include, but are not limited to, VXLAN (Virtual eXtensible Local Area Network) encapsulation / decapsulation, QoS (Quality of Service) rate limiting, and NAT (Network Address Translation) rules.
[0022] Based on the target node address information carried in the service message, if the entry is successfully matched in the node flow table, the operation of the action item in that entry is executed to process the service message accordingly, and then the processed service message is sent to the target user node.
[0023] If the target node address information for the service packet is not matched in the node flow table, the service packet offloading fails, and it is forwarded via the slow path through the virtual switch. Slow path forwarding is a packet processing mechanism in network devices that does not forward packets through hardware, but rather processes and forwards packets through software.
[0024] Furthermore, during slow path forwarding, the virtual switch attempts to learn the node flow information of the service packet. If the learning is successful, it generates corresponding packet forwarding rules, forms new entries, and updates the node flow table of the smart NIC. Specifically, when the virtual switch learns successfully, it assembles node flow packets based on the learned packet information, generates node flow packets with learning tags and containing matching items and action items corresponding to the user nodes, and sends them to the smart NIC so that the smart NIC can update the node flow table with the new entries based on the node flow packets.
[0025] It should be noted that the entries in the node flow table learned through the slow path of the virtual switch are only sent to the smart network card of the current host (i.e., the current compute node) and not to other hosts. In addition, the entries are set with an aging time, such as 120 seconds, so as to clean up invalid entries in time and ensure the utilization of hardware resources.
[0026] This application embodiment utilizes the hardware capabilities of smart network interface cards (NICs) to perform node-flow-based smart NIC offloading, which can improve service forwarding bandwidth and reduce service CPU usage on the host side. By using node flows instead of traditional session-based offloading flows, the host side avoids the memory overhead of maintaining stateless sessions. At the same time, using node flow tables can greatly reduce the number of offloading table entries, allowing more traffic to be forwarded directly through the NIC, thereby improving forwarding performance.
[0027] As one optional embodiment, the matching in a preset node flow table based on the target node address information in the service message includes: Extract the target node address information corresponding to the target user node from the service message. The target node address information includes the Virtual Extensible Local Area Network (VXLAN) tunnel endpoint address, VXLAN network identifier, and node address information. The VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information are matched in a preset node flow table.
[0028] Specifically, this embodiment adopts the OVS+DPDK technical architecture and uses an Overlay networking scheme to achieve user isolation through VXLAN technology. Based on this, the smart network interface card (NIC) utilizes node flow tables for packet matching and forwarding. In this embodiment, the node flow table specifically uses the VTEP (VXLAN Tunnel Endpoint) address and VNI (VXLAN Network Identifier) of the host / compute node where the user node resides as matching items with the node address information, such as the user node's IP address.
[0029] Upon receiving a service packet (a VXLAN packet), the smart network interface card (NIC) first parses the packet to obtain the VTEP address, VNI, and node address information of the target node. Then, the NIC searches for a matching entry in the node flow table based on the VTEP address, VNI, and node address information. If a match is found, the NIC determines that a match is successful and processes and forwards the service packet according to the packet forwarding rules in the corresponding action item.
[0030] As one optional embodiment, when the service packet is a packet received from the source node, the matching in a preset node flow table based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information includes: Based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful. Based on the node flow table, it is determined whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current compute node. If so, the service packet is sent to the target user node in the current compute node after processing. Otherwise, the service packet is sent to other compute nodes through the switch after processing.
[0031] Specifically, a host is a computing node, and the host contains a smart network interface card (NIC). The smart NIC can execute the smart NIC offloading method of this application embodiment. For traffic from the same host, the smart NIC receives service packets from the source node, parses the service packets, and obtains the VTEP address, VNI, and target node address information in the service packets. Then, using the VNI and target node address information of the service packets as matching items, a matching query is performed in the node flow table. If no matching item is found, the matching is determined to be unsuccessful, and the service packet is forwarded through the slow path via a virtual switch. If a matching item is successfully found, the node flow table is queried again based on the VTEP address to determine whether the VTEP address is the same as the VTEP address of the current host. If they are the same, it means that the service packet is traffic from the same node. After processing the service packet according to the action item corresponding to the matching item, the packet is sent to the corresponding target user node. If the VTEP address in the service packet is different from the VTEP address of the current host, it means that the service packet is not traffic from the same node. For cross-host traffic, the smart network card also processes the service packet according to the action item corresponding to the matching item, and then sends the service packet through the switch, i.e. the physical network, to other computing nodes.
[0032] In a specific example, please refer to Figure 2 The user nodes are distributed across three compute nodes in two Points of Delivery (PODs). POD 1 includes two compute nodes, Host 1 and Host 2, while POD 2 includes Host 3. Host 1 includes User Node 1 and User Node 2, Host 2 includes User Node 3, and Host 3 includes User Node 4. In this example, User Node 1 is the source node, and User Nodes 2, 3, and 4 are the target user nodes.
[0033] User node 1 sends a service packet. HOST 1's smart network interface card (NIC) receives the data packet and parses it to obtain the VTEP address, VNI, and DIP (Destination IP) from the packet. It matches the VNI and DIP against the node flow table of the smart NIC. If no match is found, OVS performs slow path forwarding and updates the node flow table. If a match is found, it further matches the VTEP address against the node flow table to determine if the VTEP address in the service packet matches the local VTEP address. If so, the current traffic is within the same host, and the corresponding action in the node flow table is executed before sending the packet to the target user node (user node 2). Otherwise, the current traffic is across hosts, and the corresponding action in the node flow table is executed before sending the packet across the physical network to the target node.
[0034] As one optional embodiment, when the service packet is a packet received from a switch, the matching process in a preset node flow table based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information includes: Based on the node flow table, determine whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current computing node; If not, the service message is discarded; If so, then based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful, and the service message is sent to the target user node in the current computing node after processing.
[0035] Specifically, service packets are transmitted to various compute nodes via the physical network, including compute nodes on the same POD node and compute nodes on different POD nodes. In the physical network, service packets are sent from the switch to the smart network interface card (NIC) of the compute node. Upon receiving the data packet, the smart NIC parses it to obtain the VTEP address, VNI, and destination node address information corresponding to the service packet. Then, it first matches the VTEP address against the node flow table to determine if the VTEP address of the service packet is the same as the VTEP address of the current host. If they are different, it indicates abnormal traffic and the packet is discarded. If they are the same, it continues to match the VNI and destination node address information against the node flow table. If the match fails, the packet is forwarded via a slow path through the virtual switch. If the match succeeds, the service packet is processed according to the action item corresponding to the matching item and then sent to the corresponding target user node.
[0036] In a specific example, please refer to Figure 2 In the HOST 2 and HOST 3 sections, the smart network interface card (NIC) receives service packets originating from user node 1 on the physical link. After parsing the service packets, it obtains the VTEP address, VNI, and DIP from the service packets and performs VTEP address matching based on the node flow table. If the VTEP address of the service packet is different from the VTEP address of the current host, the service packet is discarded as abnormal traffic. If the VTEP address of the service packet is the same as the VTEP address of the current host, a matching query is performed in the node flow table based on the VNI and DIP in the service packet. If the match is successful, the corresponding action is executed on the service packet according to the node flow table, and the processed service packet is sent to the target user node, i.e., user node 3 or user node 4. If the match fails, the service packet is sent to the virtual switch for slow path forwarding, and the node flow table is updated according to the slow path learning results.
[0037] As one optional embodiment, the creation time of each entry in the node flow table is the creation time of the user node corresponding to that entry, and the deletion time of each entry in the node flow table is the deletion time of the user node corresponding to that entry.
[0038] Specifically, unlike existing technologies that create offload entries based on the first packet and delete them based on session aging, the creation time of offload entries in the node flow table of this application embodiment is the creation time of the user node, and the deletion time is the deletion time of the user node. Each entry in the node flow table corresponds to a user node. When a user node is created, the corresponding offload entry is constructed and updated in the node flow table of the smart network interface card of each computing node, so that the smart network interface card can perform corresponding action operations to process and forward the packets when it receives traffic packets destined for that user node.
[0039] This application embodiment generates a node flow table when the user creates a node, so that the user's first packet can hit the unload table entry of the node flow table and be forwarded directly, eliminating the problem of large latency of the first packet and greatly reducing the memory overhead of stateless sessions in stateless business scenarios.
[0040] As one optional embodiment, the method further includes: When a new user node is created, in response to receiving a VXLAN format node flow packet from the virtual switch of the new user node, the node flow packet is parsed to obtain the VXLAN tunnel endpoint address, VXLAN network identifier, node address information and packet forwarding rules of the new user node. Using the VXLAN tunnel endpoint address, VXLAN network identifier, and node address information of the new user node as matching items, and the packet forwarding rule corresponding to the new user node as the action item, a new entry is generated and updated in the node flow table.
[0041] Specifically, when a new user node is created, its OVS encapsulates the user node's VTEP address, VNI, and target node address into a VXLAN packet, obtaining a node flow packet. This node flow packet is then sent sequentially to the smart NICs of all hosts within the current POD. Upon receiving the node flow packet, the smart NIC parses it, generating corresponding matching items and action items (key + action) based on the parsing results. This forms a new offload table entry and updates the node flow table. The matching item includes the VTEP address, VNI, and target node address information, while the action item represents the packet forwarding rule corresponding to the user node, such as decapsulation rules, rate limiting rules, and address translation rules. Furthermore, when a new compute node (i.e., host) is added within the current POD, the management system instructs the OVS of this compute node to send the aforementioned node flow packet to the smart NIC of the newly added compute node to generate the corresponding node flow table.
[0042] In this embodiment of the application, since the number of user nodes in a single POD is generally in the hundreds of thousands, which is much smaller than the capacity of the smart NIC offload table entries in the millions, it can be guaranteed that the node flow offload table entries of all user nodes in the POD can be successfully sent, thus improving reliability.
[0043] Furthermore, for cross-POD traffic, slow path learning needs to be performed through a virtual switch to obtain the corresponding node flow table entries, which are then sent to the smart NIC.
[0044] In a specific example, such as Figure 3 As shown, the node flow message specifically includes an outer Ethernet header (ETH), an outer IP header, an outer UDP header, a VXLAN header, and an inner message. The outer message (i.e., the VXLAN HEADER) uses the standard VXLAN message format to achieve overlay networking. The inner message includes the destination MAC address, the source MAC address, the message type, and the payload. The destination MAC address uses a special address "03:03:03:03:03:03" with a length of 6 bytes; the source MAC address is the MAC address of the source user node, with a length of 6 bytes; the message type is the IANA (Internet Assigned Numbers Authority) reserved type "0xFFFF", with a length of 2 bytes; the payload contains a key and an action, with a length range of 12-512 bytes. The key section specifically includes: VTEP address, DIP (Destination Address), VNI, and packet tag field F, with a total length of 12 bytes. The VTEP address occupies 4 bytes, the DIP occupies 4 bytes, the VNI occupies 3 bytes, and the VNI is followed by the 1-byte packet tag field F. The packet tag field includes a 1-bit learning tag L, a 1-bit hot migration tag M, and the rest are reserved fields. The action section has a length of 0-1488 bytes and uses TLV format to store the corresponding action items. When the action length is 0, it represents deleting the corresponding node's flow table entry.
[0045] In this embodiment, node flow packets are generated and broadcast within the POD when the user creates a node to update the node flow table of each smart network card. This allows the user's first packet to hit the offload entry in the node flow table and be forwarded directly. This eliminates the problem of large latency in the first packet in common first packet offload flow creation schemes where the first packet is not offloaded and needs to be sent to OVS for slow path forwarding and a new offload entry to be generated.
[0046] As one optional embodiment, the method further includes: During hot migration of a user node, in response to receiving a first message with a migration flag and containing the matching item and action item corresponding to the user node, the user node is determined to be in a migration state, wherein the action item in the first message is empty; according to the first message, the entry corresponding to the user node in the node flow table is marked as unavailable, so that the traffic corresponding to the user node is forwarded through the slow path. In response to receiving a second message with a migration flag and containing the matching item and action item corresponding to the user node, it is determined that the user node migration is complete, wherein the action item in the second message is the packet forwarding rule corresponding to the user node; according to the second message, the VXLAN tunnel endpoint address corresponding to the user node in the node flow table is updated to the VXLAN tunnel endpoint address of the compute node where the user node is located after migration, and the unavailable state of the corresponding entry in the node flow table is removed.
[0047] Specifically, hot migration refers to migrating a user node from one host to another without shutting it down, ensuring uninterrupted service during the migration process. In a user node hot migration scenario, the management system instructs the OVS of the original host containing the user node to be migrated to send a node flow packet with an empty action and a migration flag M in the packet's marking field F to the smart network interface cards (NICs) of all user node hosts. When the smart NIC receives this first packet with an empty action and a migration flag M in the packet's marking field F, it parses the packet to obtain the matching key and action. Based on the matching key, it queries the node flow table. When a corresponding entry is found, the entry is marked as unavailable, and the traffic corresponding to that user node is upcalled to the slow path. Simultaneously, OVS stops learning the flow of that node.
[0048] Once the user node migration is complete, OVS sends a node flow packet (the second packet) containing an action and a migration flag M in the packet tag field F to the smart network interface cards (NICs) of all host locations of the user nodes. Upon receiving the second packet containing the action and migration flag M, the smart NIC parses it to obtain the matching key and action. Based on the DIP and VNI values, it determines whether the user node is a migrated user node. If so, it updates the VTEP address in the corresponding entry of the node flow table to the VTEP address of the host to which the node is migrating, removes the unavailable status of the entry, and updates the action field of the entry, thus completing the node flow table update under hot migration.
[0049] This application embodiment can efficiently achieve node hot migration through a specific table update process. Traditional solutions require rebuilding a massive number of session tables after migration, which is time-consuming and prone to interruption. However, this application adopts a smart NIC offloading solution based on node flow, which only requires updating the node mapping, greatly improving efficiency.
[0050] Compared to existing technologies, this application uses node flow tables instead of traditional session-based entries, significantly reducing the size of entries for the same traffic scenarios. This allows more traffic to be forwarded directly through the network interface card (NIC), avoiding the problem of a large number of upcalls due to offloading failures, which affects forwarding performance. Specifically, the number of entries in the node flow table within a POD is only related to the number of user nodes within the POD. For a typical host supporting tens of millions of sessions, a NIC with one million entries would only be able to offload 10% of the traffic using traditional methods. 90% of the traffic would have to take a slow path because offloading entries cannot be created, thus impacting performance. However, the method in this application uses node flow tables. Since the number of user nodes within a single POD is typically in the hundreds of thousands, the NIC's entry rules can cover the offloading of all traffic within the POD, avoiding the performance degradation problem caused by offloading failures in traditional session-granular offloading schemes.
[0051] Furthermore, this application embodiment supports active slow path learning, and cross-POD traffic and public network traffic can also be offloaded via node flow, enabling more traffic to be forwarded through offloading and thus improving forwarding performance. This application embodiment generates node flow packets and broadcasts them within the POD when a user creates a node. The user's first packet can hit the node flow table and be directly forwarded, eliminating the problem of high latency in the first packet creation offloading flow scheme, where the first packet does not go through offloading but needs to be sent to OVS for a slow path and table entry generation. For stateless service scenarios, this application embodiment avoids the memory overhead of creating stateless sessions to manage offloading table entries, as required by traditional session-based offloading schemes, thus improving offloading efficiency and forwarding performance.
[0052] Accordingly, this application also provides a smart network card unloading device, which can implement all the processes of the smart network card unloading method in the above embodiments.
[0053] Please see Figure 4 , Figure 4 This is a schematic diagram of a smart network interface card (NIC) offloading device provided in an embodiment of this application. The smart NIC offloading device includes: The table entry matching module 401 is used to match the target node address information in the service message in a preset node flow table when a service message is received; the node flow table includes matching entries for several nodes and their corresponding action entries. The message forwarding module 402 is used to process the service message according to the corresponding action item in the node flow table and send it to the target user node if the match is successful; if the match fails, the service message is forwarded through the slow path.
[0054] Preferably, the step of matching the target node address information in the service message within a preset node flow table includes: Extract the target node address information corresponding to the target user node from the service message. The target node address information includes the Virtual Extensible Local Area Network (VXLAN) tunnel endpoint address, VXLAN network identifier, and node address information. The VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information are matched in a preset node flow table.
[0055] Preferably, when the service packet is a packet received from the source node, the matching in a preset node flow table based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information includes: Based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful. Based on the node flow table, it is determined whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current compute node. If so, the service packet is sent to the target user node in the current compute node after processing. Otherwise, the service packet is sent to other compute nodes through the switch after processing.
[0056] Preferably, when the service packet is a packet received from a switch, the matching in a preset node flow table based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information includes: Based on the node flow table, determine whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current computing node; If not, the service message is discarded; If so, then based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful, and the service message is sent to the target user node in the current computing node after processing.
[0057] Preferably, the creation time of each entry in the node flow table is the creation time of the user node corresponding to that entry, and the deletion time of each entry in the node flow table is the deletion time of the user node corresponding to that entry.
[0058] Preferably, the smart network card offloading device is further used for: When a new user node is created, in response to receiving a VXLAN format node flow packet from the virtual switch of the new user node, the node flow packet is parsed to obtain the VXLAN tunnel endpoint address, VXLAN network identifier, node address information and packet forwarding rules of the new user node. Using the VXLAN tunnel endpoint address, VXLAN network identifier, and node address information of the new user node as matching items, and the packet forwarding rule corresponding to the new user node as the action item, a new entry is generated and updated in the node flow table.
[0059] Preferably, the smart network card offloading device is further used for: During hot migration of a user node, in response to receiving a first message with a migration flag and containing the matching item and action item corresponding to the user node, the user node is determined to be in a migration state, wherein the action item in the first message is empty; according to the first message, the entry corresponding to the user node in the node flow table is marked as unavailable, so that the traffic corresponding to the user node is forwarded through the slow path. In response to receiving a second message with a migration flag and containing the matching item and action item corresponding to the user node, it is determined that the user node migration is complete, wherein the action item in the second message is the packet forwarding rule corresponding to the user node; according to the second message, the VXLAN tunnel endpoint address corresponding to the user node in the node flow table is updated to the VXLAN tunnel endpoint address of the compute node where the user node is located after migration, and the unavailable state of the corresponding entry in the node flow table is removed.
[0060] In specific implementation, the working principle, control process and technical effects of the smart network card unloading device provided in this application embodiment are the same as those of the smart network card unloading method in the above embodiments, and will not be repeated here.
[0061] See Figure 5 , Figure 5This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device includes a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program, it implements the steps in the above-described smart network card offloading method embodiment. Alternatively, when the processor 501 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.
[0062] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 502 and executed by the processor 501 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.
[0063] The computer device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will understand that the schematic diagram is merely an example of a computer device and does not constitute a limitation on the computer device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0064] The processor 501 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 501 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and lines.
[0065] The memory 502 can be used to store the computer programs and / or modules. The processor 501 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 502 and calling the data stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0066] Wherein, if the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 501, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms.
[0067] This application also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the smart network card offloading method described in any of the above embodiments.
[0068] This application also provides a computer program product, including a computer program / instruction, which, when executed by the computer program / instruction processor, implements the smart network card offloading method described in any of the above embodiments.
[0069] The methods in this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in this application are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, core network equipment, or other programmable devices.
[0070] The computer program or instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions may be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; or an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0071] The computer programs / instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards those instructions to computer-readable storage media within the respective computing / processing device.
[0072] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages and conventional procedural programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, or it may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0073] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0074] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0075] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0076] Each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0077] This application provides a method, apparatus, device, medium, and product for intelligent network interface card (NIC) offloading. Its advantages are as follows: when the intelligent NIC receives a service packet, it matches the target node address information in the service packet against a preset node flow table. If the match is successful, the service packet is processed according to the corresponding action item in the node flow table and sent to the target user node. If the match fails, the service packet is forwarded via a slow path. This enables NIC offloading based on node flow, using a node flow table instead of traditional session-based entries. This avoids the memory overhead of maintaining stateless sessions on the host side and significantly reduces the number of entries, allowing more traffic to be forwarded directly through the NIC, thereby improving forwarding performance.
[0078] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A method for unloading a smart network interface card (NIC), characterized in that, include: When a service message is received, a match is performed in a preset node flow table based on the target node address information in the service message; the node flow table includes matching items for several nodes and their corresponding action items; If a match is successful, the service message is processed according to the corresponding action item in the node flow table and sent to the target user node; If a match fails, the service message is forwarded via a slow path.
2. The smart network card unloading method as described in claim 1, characterized in that, The step of matching the target node address information in the service message against a preset node flow table includes: Extract the target node address information corresponding to the target user node from the service message. The target node address information includes the Virtual Extensible Local Area Network (VXLAN) tunnel endpoint address, VXLAN network identifier, and node address information. The VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information are matched in a preset node flow table.
3. The smart network card unloading method as described in claim 2, characterized in that, When the service message is a message received from the source node, the matching process based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information in a preset node flow table includes: Based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful. Based on the node flow table, it is determined whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current compute node. If so, the service packet is sent to the target user node in the current compute node after processing. Otherwise, the service packet is sent to other compute nodes through the switch after processing.
4. The smart network card unloading method as described in claim 2, characterized in that, When the service packet is a packet received from the switch, the matching process based on the VXLAN tunnel endpoint address, the VXLAN network identifier, and the node address information in a preset node flow table includes: Based on the node flow table, determine whether the VXLAN tunnel endpoint address of the service packet is the same as the VXLAN tunnel endpoint address of the current computing node; If not, the service message is discarded; If so, then based on the VXLAN network identifier and the node address information, a matching item is queried in the node flow table; If no match is found, the match is considered to have failed. If a match is found, the match is considered successful, and the service message is sent to the target user node in the current computing node after processing.
5. The method for unloading a smart network card as described in claim 1, characterized in that, The creation time of each entry in the node flow table is the creation time of the user node corresponding to that entry, and the deletion time of each entry in the node flow table is the deletion time of the user node corresponding to that entry.
6. The method for unloading a smart network card as described in claim 1, characterized in that, The method further includes: When a new user node is created, in response to receiving a VXLAN format node flow packet from the virtual switch of the new user node, the node flow packet is parsed to obtain the VXLAN tunnel endpoint address, VXLAN network identifier, node address information and packet forwarding rules of the new user node. Using the VXLAN tunnel endpoint address, VXLAN network identifier, and node address information of the new user node as matching items, and the packet forwarding rule corresponding to the new user node as the action item, a new entry is generated and updated in the node flow table.
7. The method for unloading a smart network card as described in claim 1, characterized in that, The method further includes: During hot migration of a user node, in response to receiving a first message with a migration flag and containing the matching item and action item corresponding to the user node, the user node is determined to be in a migration state, wherein the action item in the first message is empty; according to the first message, the entry corresponding to the user node in the node flow table is marked as unavailable, so that the traffic corresponding to the user node is forwarded through the slow path. In response to receiving a second message with a migration flag and containing the matching item and action item corresponding to the user node, it is determined that the user node migration is complete, wherein the action item in the second message is the packet forwarding rule corresponding to the user node; according to the second message, the VXLAN tunnel endpoint address corresponding to the user node in the node flow table is updated to the VXLAN tunnel endpoint address of the compute node where the user node is located after migration, and the unavailable state of the corresponding entry in the node flow table is removed.
8. A smart network card offloading device, characterized in that, include: The entry matching module is used to match the target node address information in the service message with a preset node flow table when a service message is received; the node flow table includes matching entries for several nodes and their corresponding action entries. The message forwarding module is used to process the service message according to the corresponding action item in the node flow table and send it to the target user node if the match is successful; if the match fails, the service message is forwarded through the slow path.
9. A computer device, characterized in that, The device includes a processor and a memory, the memory storing a computer program configured to be executed by the processor, wherein the processor, when executing the computer program, implements the smart network interface card offloading method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the smart network card offloading method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the smart network card unloading method as described in any one of claims 1 to 7.