Deployment method and device for hardware link aggregation, chip, network card and equipment
By activating the representative port device in the network interface card aggregation group, the problem of hardware link aggregation relying on the host kernel network driver is solved, enabling the user-space driver to directly take over without enabling single root input/output virtualization, thus improving link performance.
Patent Information
- Application Number
- CN202511906569.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-12-17
AI Technical Summary
In existing technologies, hardware link aggregation offloading relies on the host kernel's network driver, making it impossible for user-mode drivers to directly take over physical functional devices without enabling single root input/output virtualization.
Create a link aggregation group in the network interface card aggregation group, activate the representative port device and set it to the unloaded state, allowing user-mode drivers to control it in the form of virtual function input/output, and directly carry service traffic.
This enables user-mode drivers to directly take over physical functional devices without enabling single root input/output virtualization, improving link bandwidth and reliability, and achieving load balancing.
Smart Images

Figure CN121334040A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of chip technology, and in particular to a deployment method, apparatus, chip, network interface card and device for hardware link aggregation. Background Technology
[0002] In chip technology, a Link Aggregation Group (LAG) bundles multiple physical network interfaces into a single logical interface, thereby increasing link bandwidth, improving link reliability, and achieving load balancing.
[0003] In related technologies, hardware LAG offloading is achieved by offloading the kernel's Network Interface Bonding (BOND) configuration to the network card hardware side through a private kernel network driver on the host side. When implementing hardware LAG offloading, the network card hardware relies on the host kernel's network protocol stack to process protocol packets. This is done by configuring two or more Physical Function (PF) devices into a BOND group in the kernel, and then offloading the private kernel-mode network driver to the firmware side of the network card hardware.
[0004] However, when implementing hardware LAG offloading using the above method, the PF device needs to be taken over by the kernel's network driver. To allow user-space process service data to pass directly through the kernel protocol stack and network card, the kernel network driver can be exited first, and then user-space takeover can be achieved through Virtual Function I / O (VFIO). This requires enabling Single Root I / O Virtualization (SRIOV) on one of the PF devices in the BOND group, creating a Virtual Function (VF) device, and then allowing the user-space driver to take over the VF device via VFIO. Therefore, hardware LAG offloading in related technologies cannot allow the user-space driver to directly take over the PF device without enabling Single Root I / O Virtualization. Summary of the Invention
[0005] Based on this, it is necessary to provide a deployment method, device, chip, equipment, network interface card, storage medium, and program product that enables user-mode drivers to directly take over physical functional devices for hardware link aggregation without enabling single root input / output virtualization, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a deployment method for hardware link aggregation, applied to a host device, including:
[0007] In response to a network interface card (NIC) aggregation configuration request, a NIC aggregation group is created, wherein the NIC aggregation group includes at least one physical functional device;
[0008] If the unloading conditions of the network interface card (NIC) aggregation group are met, a creation message for the link aggregation group corresponding to the NIC aggregation group is sent to the NIC device.
[0009] The unloading conditions for the network interface card (NIC) aggregation group include that at least one physical functional device has the membership capability of the link aggregation group; the link aggregation group creation message is used to instruct the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state; the representative port device is used for the host device's user-mode driver to control it in a virtual function input / output manner.
[0010] In one embodiment, the creation message of the link aggregation group includes member link information of the link aggregation group, which is used to modify the correspondence between physical ports and the link aggregation group in the receive port table of the network interface card device.
[0011] In one embodiment, after sending the link aggregation creation message corresponding to the network interface card (NIC) aggregation group to the NIC device, the method further includes:
[0012] If the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, then the LACP protocol message sent by the network interface card (NIC) device is received. The LACP protocol message is used to negotiate the active members of the NIC aggregation group.
[0013] Update the status of the negotiated active members to the active link status of the link aggregation group;
[0014] The information of the activated member is sent to the network interface card device, and the information of the activated member is used to set the register corresponding to the link aggregation group.
[0015] In one embodiment, after sending the link aggregation creation message corresponding to the network interface card (NIC) aggregation group to the NIC device, the method further includes:
[0016] In response to a network interface card (NIC) aggregation deletion request, a deletion message for the link aggregation group corresponding to the NIC aggregation group is sent to the NIC device.
[0017] The link aggregation group deletion message is used to instruct the network interface card (NIC) device to delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the NIC aggregation group.
[0018] In one embodiment, the method further includes:
[0019] During the port startup phase of the representative port device, a request to obtain the attributes of the representative port device is sent to the network interface card device.
[0020] Receive the attribute information of the representative port device sent by the network interface card device;
[0021] Based on the attribute information of the representative port device, the network interface card (NIC) device is sent with instructions on setting the routing entries for the representative port device.
[0022] In one embodiment, before creating the network interface card aggregation group in response to the network interface card aggregation configuration request, the method further includes:
[0023] When the network interface card (NIC) device is detected to be powered on, the physical functional devices configured in the NIC device are detected and the identification information of the detected physical functional devices is obtained.
[0024] Based on the identification information of the detected physical functional devices, determine the type of the detected physical functional devices;
[0025] If the type of the detected physical functional device is not a representative port device of a link aggregation group, load the kernel network driver of the detected physical functional device.
[0026] In one embodiment, loading the kernel network driver of the detected physical functional device includes:
[0027] Send a request to the network interface card (NIC) device to obtain the capability information of the detected physical functional device;
[0028] Receive the hardware capability information of the detected physical functional device sent by the network interface card device;
[0029] Based on the hardware capability information, the kernel network driver of the detected physical function device is initialized to obtain the setting information of the physical function device. The setting information is used to instruct the setting of the transmit / receive queue and the routing table of the detected physical function device.
[0030] Send the configuration information of the detected physical function device to the network card device.
[0031] Secondly, this application provides a hardware link aggregation deployment method applied to network interface card (NIC) devices, including:
[0032] If the unloading conditions of the network interface card (NIC) aggregation group are met, a creation message of the link aggregation group corresponding to the NIC aggregation group is received from the host device. The NIC aggregation group includes at least one physical function device. The unloading conditions of the NIC aggregation group include that the at least one physical function device has the membership capability of the link aggregation group.
[0033] In response to the creation message of the link aggregation group, the representative port device mapped by the link aggregation group is activated and the link aggregation group is set to an unloaded state. The representative port device is used for the user-mode driver of the host device to control it in the form of virtual function input / output.
[0034] In one embodiment, the creation message of the link aggregation group includes member link information of the link aggregation group; the method further includes:
[0035] Based on the member link information of the link aggregation group, modify the correspondence between the physical port and the link aggregation group in the receive port table of the network interface card device.
[0036] In one embodiment, after receiving the link aggregation group creation message corresponding to the network interface card aggregation group sent by the host device, the method further includes:
[0037] If the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, then create the redirection table corresponding to the link aggregation group;
[0038] According to the redirection table corresponding to the link aggregation group, an LACP protocol message is sent to the host device. The LACP protocol message is used to negotiate the active members of the network interface card aggregation group.
[0039] Receive the information of the activated member sent by the host device;
[0040] Based on the information of the activated members, set the register corresponding to the link aggregation group.
[0041] In one embodiment, the method further includes:
[0042] Receive the deletion message of the link aggregation group sent by the host device;
[0043] In response to the deletion message of the link aggregation group, delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the network interface card aggregation group.
[0044] In one embodiment, the method further includes:
[0045] During the port startup phase of the representative port device, a request to obtain the attributes of the representative port device sent by the host device is received.
[0046] Send the attribute information of the representative port device to the host device;
[0047] Receive the setting instruction information of the diversion entry of the representative port device corresponding to the attribute information sent by the host device;
[0048] In response to the setting instruction information, the routing rules for the representative port device in the receiving and transmitting directions are set in the routing entry of the representative port device.
[0049] In one embodiment, the method further includes:
[0050] Receive a request from the host device to obtain capability information of the detected physical functional device, wherein the type of the detected physical functional device is not the representative port device of the link aggregation group;
[0051] Send the hardware capability information of the detected physical functional device to the host device. The hardware capability information is used to generate the setting information of the physical functional device during the initialization of the kernel network driver of the detected physical functional device.
[0052] Receive the setting information of the detected physical functional devices sent by the host device;
[0053] Based on the setting information of the physical functional devices, set the transmit / receive queue and diversion table of the detected physical functional devices.
[0054] In one embodiment, the method further includes:
[0055] In response to the setup request of the representative port device, the physical function entry of the representative port device of the link aggregation group is added to the device data of the stored file;
[0056] After detecting that the network card device has started, read the device data from the storage file;
[0057] Based on the device data, the forwarding domain and physical connection status of the representative port device are associated with the link aggregation group.
[0058] Thirdly, this application provides a hardware link aggregation deployment apparatus, applied to a host device, comprising:
[0059] The first processing module is used to respond to a network interface card (NIC) aggregation configuration request and create a NIC aggregation group, wherein the NIC aggregation group includes at least one physical functional device.
[0060] The first sending module is used to send a creation message of the link aggregation group corresponding to the network interface card (NIC) aggregation group to the NIC device when the unloading conditions of the NIC aggregation group are met.
[0061] The unloading conditions for the network interface card (NIC) aggregation group include that at least one physical functional device has the membership capability of the link aggregation group; the link aggregation group creation message is used to instruct the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state; the representative port device is used for the host device's user-mode driver to control it in a virtual function input / output manner.
[0062] In one embodiment, the creation message of the link aggregation group includes member link information of the link aggregation group, which is used to modify the correspondence between physical ports and the link aggregation group in the receive port table of the network interface card device.
[0063] In one embodiment, the device further includes:
[0064] The first receiving module is configured to receive an LACP protocol message sent by the network interface card device if the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode. The LACP protocol message is used to negotiate the active members of the network interface card aggregation group.
[0065] The first processing module is further configured to update the status of the negotiated active member to the active link status of the link aggregation group;
[0066] The first sending module is further configured to send the information of the activated member to the network card device, wherein the information of the activated member is used to set the register corresponding to the link aggregation group.
[0067] In one embodiment, the first sending module is further configured to send a deletion message of the link aggregation group corresponding to the network interface card aggregation group to the network interface card device in response to the network interface card aggregation deletion request;
[0068] The link aggregation group deletion message is used to instruct the network interface card (NIC) device to delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the NIC aggregation group.
[0069] In one embodiment, the first sending module is further configured to send an attribute acquisition request for the representative port device to the network interface card device during the port startup phase of the representative port device; and send setting indication information for the traffic redirection entry of the representative port device to the network interface card device according to the attribute information of the representative port device.
[0070] The first receiving module is further configured to receive attribute information of the representative port device sent by the network card device;
[0071] In one embodiment, the first processing module is further configured to, when the network interface card (NIC) device is detected to be starting up, detect the physical function devices configured in the NIC device and obtain the identification information of the detected physical function devices; determine the type of the detected physical function devices based on the identification information of the detected physical function devices; and load the kernel network driver of the detected physical function devices if the type of the detected physical function devices is not a representative port device of a link aggregation group.
[0072] In one embodiment, the first sending module is further configured to send a request to the network interface card (NIC) device to obtain the capability information of the detected physical function device; and to send the setting information of the detected physical function device to the NIC device.
[0073] The first receiving module is further configured to receive the hardware capability information of the detected physical function device sent by the network card device;
[0074] The first processing module is further configured to initialize the kernel network driver of the detected physical function device according to the hardware capability information, and obtain the setting information of the physical function device. The setting information is used to instruct the setting of the transmit / receive queue and the routing table of the detected physical function device.
[0075] Fourthly, this application also provides a hardware link aggregation deployment apparatus, applied to a network interface card (NIC) device, comprising:
[0076] The second receiving module is used to receive a creation message of a link aggregation group corresponding to the network interface card aggregation group sent by the host device when the unloading conditions of the network interface card aggregation group are met. The network interface card aggregation group includes at least one physical function device, and the unloading conditions of the network interface card aggregation group include that the at least one physical function device has the membership capability of the link aggregation group.
[0077] The second processing module is used to respond to the creation message of the link aggregation group, activate the representative port device mapped by the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for the user-mode driver of the host device to control it in the form of virtual function input / output.
[0078] In one embodiment, the creation message of the link aggregation group includes member link information of the link aggregation group; the second processing module is further configured to modify the correspondence between physical ports and the link aggregation group in the receive port table of the network interface card device according to the member link information of the link aggregation group.
[0079] In one embodiment, the second processing module is further configured to: if the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, create a redirection table corresponding to the link aggregation group; and set the register corresponding to the link aggregation group according to the information of the activated member.
[0080] The device further includes a second sending module, used to send an LACP protocol message to the host device according to the redirection table corresponding to the link aggregation group, wherein the LACP protocol message is used to negotiate the active members of the network interface card aggregation group;
[0081] The second receiving module is further configured to receive information about the activated member sent by the host device.
[0082] In one embodiment, the second receiving module is further configured to receive the deletion message of the link aggregation group sent by the host device;
[0083] The second processing module is further configured to, in response to the deletion message of the link aggregation group, delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the network interface card aggregation group.
[0084] In one embodiment, the second receiving module is further configured to receive, during the port startup phase of the representative port device, a request from the host device to obtain the attribute of the representative port device; and to receive setting indication information for the referral entry of the representative port device corresponding to the attribute information sent by the host device.
[0085] The second sending module is further configured to send the attribute information of the representative port device to the host device;
[0086] The second processing module is further configured to, in response to the setting instruction information, set the routing rules of the representative port device in the receiving and transmitting directions in the routing entry of the representative port device.
[0087] In one embodiment, the second receiving module is further configured to receive a request from the host device to obtain capability information of a detected physical functional device, wherein the type of the detected physical functional device is not a representative port device of a link aggregation group; and to receive setting information of the detected physical functional device from the host device.
[0088] The second sending module is further configured to send the hardware capability information of the detected physical function device to the host device, wherein the hardware capability information is used to generate the setting information of the physical function device by initializing the kernel network driver of the detected physical function device;
[0089] The second processing module is further configured to set the transmit / receive queue and diversion table of the detected physical functional device according to the setting information of the physical functional device.
[0090] In one embodiment, the second processing module is further configured to, in response to the setting request of the representative port device, add a physical function entry of the representative port device of the link aggregation group to the device data in the storage file; after detecting that the network card device is started, read the device data in the storage file; and associate the forwarding domain and physical connection status of the representative port device with the link aggregation group according to the device data.
[0091] Fifthly, this application also provides a CPU chip, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0092] Sixthly, this application also provides a DPU chip, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0093] In a seventh aspect, this application also provides a computer device, including a processor and the DPU chip described in the sixth aspect above, wherein the chip is used to schedule messages to the processor or to process them on its own, and the processor is used to process messages scheduled by the chip.
[0094] Eighthly, this application also provides a network interface card, including the chip and interface described in the sixth aspect, wherein the chip communicates externally through the interface.
[0095] Ninthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first or second aspect above.
[0096] In a tenth aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first or second aspect.
[0097] The aforementioned hardware link aggregation deployment method, apparatus, chip, device, network interface card, storage medium, and program product, in response to a network interface card (NIC) aggregation configuration request, creates a NIC aggregation group, which includes at least one physical functional device. When the unloading conditions of the NIC aggregation group are met, a link aggregation group creation message corresponding to the NIC aggregation group is sent to the NIC device. The unloading conditions of the NIC aggregation group include at least one physical functional device possessing the membership capability of the link aggregation group. The link aggregation group creation message instructs the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for control by the user-mode driver of the host device in a virtual function input / output manner. In this embodiment, when all physical functional devices in the created NIC aggregation group possess the membership capability of the link aggregation group, a link aggregation group creation message is sent to the NIC device, thereby activating the representative port device mapped to the link aggregation group. The representative port device is then used for control by the user-mode driver in a virtual function input / output manner, directly carrying service traffic on the aggregated link group of the NIC device. Since it is not necessary to enable single root input / output virtualization for a physical functional device in the network interface card aggregation group, it is possible for the user-space driver to directly take over the physical functional device without enabling single root input / output virtualization. Attached Figure Description
[0098] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0099] Figure 1 An application environment diagram for a hardware link aggregation deployment method provided in an embodiment of this application;
[0100] Figure 2 A schematic diagram illustrating the principle of a hardware link aggregation deployment method provided in an embodiment of this application;
[0101] Figure 3 Signaling interaction diagram of a hardware link aggregation deployment method provided in an embodiment of this application;
[0102] Figure 4 Signaling interaction diagram of another hardware link aggregation deployment method provided in the embodiments of this application;
[0103] Figure 5 Signaling interaction diagram for another hardware link aggregation deployment method provided in the embodiments of this application;
[0104] Figure 6 A structural block diagram of a hardware link aggregation deployment device provided in an embodiment of this application;
[0105] Figure 7 A structural block diagram of another hardware link aggregation deployment device provided in the embodiments of this application;
[0106] Figure 8 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0107] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0108] The relevant technologies will be explained below.
[0109] In chip technology, a Link Aggregation Group (LAG) bundles multiple physical network interfaces into a single logical interface, thereby increasing link bandwidth, improving link reliability, and achieving load balancing.
[0110] LAG (Link Aggregator) technology allows multiple physical network interfaces to be bundled into a single entity. When one of these physical links fails, traffic automatically switches to other functioning links within the LAG, ensuring service continuity. Furthermore, during data transmission, LAG uses a pre-defined traffic allocation algorithm to distribute traffic across its member links, maximizing bandwidth utilization.
[0111] In related technologies, hardware LAG offloading is achieved by offloading the kernel's Network Interface Bonding (BOND) configuration to the network card hardware side through a private kernel network driver on the host side. Currently, in addition to offloading the complex network protocol stack, network card hardware relies on the host kernel's network protocol stack to process protocol packets when implementing hardware LAG offloading. This is done by configuring two or more Physical Function (PF) devices into a BOND group in the kernel, and then offloading the BOND group to the firmware side of the network card hardware through a private kernel-mode network driver.
[0112] The network interface card (NIC) hardware may include intelligent network or data processing unit (DPU).
[0113] However, when the hardware LAG is unloaded in the above way, the PF device needs to be taken over by the kernel network driver. In order for the business data of the user-mode process to pass through the kernel protocol stack and network card directly, the kernel network driver can be exited first, and then the user-mode takeover can be performed through Virtual Function I / O (VFIO).
[0114] It should be understood that Virtual Function I / O (VFIO) plays a crucial role in direct memory access (DMA). Through Input / Output Memory Management Unit (IOMMU) mapping, VFIO can map the physical memory address of a device for Direct Memory Access (DMA) to user space. This enables user-space programs to autonomously control data transfer and allows them to register interrupt handlers, implementing device driver functionality in user space. VFIO enables device passthrough, allowing user-space drivers to directly interact with the network interface card (NIC) hardware, successfully bypassing parts of the kernel protocol stack's processing flow and significantly improving data transfer efficiency and flexibility.
[0115] In scenarios where user-space traffic is carried on a hardware LAG, since the PF device is already taken over by the host-side kernel network driver as a member of the BOND group, it is necessary to enable Single Root I / O Virtualization (SRIOV) on one of the PF devices that is a member of the BOND group, creating a Virtual Function (VF) device, and then allowing the user-space driver to take over the VF device via VFIO. Therefore, the hardware LAG offloading in related technologies cannot allow the user-space driver to directly take over the PF device without enabling SRIOV.
[0116] To address the aforementioned technical problems, embodiments of this application provide a deployment method, apparatus, chip, device, network interface card, storage medium, and program product for hardware link aggregation. When all physical functional devices in the created network interface card (NIC) aggregation group possess the capabilities of a link aggregation group, the host device sends a link aggregation group creation message to the NIC device, thereby activating the representative port device mapped to the link aggregation group. The representative port device is then controlled by the user-space driver using virtual function input / output (VIO), directly carrying service traffic on the aggregated link group of the NIC device. Since it is not necessary to enable single-root input / output virtualization for any physical functional device in the NIC aggregation group, it is possible for the user-space driver to directly take over the physical functional devices without enabling single-root input / output virtualization.
[0117] The hardware link aggregation deployment method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the user inputs a network interface card (NIC) aggregation configuration request to host device 101. In response, host device 101 creates a NIC aggregation group, which includes at least one physical functional device. Subsequently, if the unloading conditions of the NIC aggregation group are met, host device 101 sends a link aggregation group creation message corresponding to the NIC aggregation group to NIC device 102. The unloading conditions for the NIC aggregation group include that at least one physical functional device possesses the membership capability of the link aggregation group. In response to the link aggregation group creation message, NIC device 102 activates the representative port device mapped to the link aggregation group and sets the link aggregation group to an unloaded state. The representative port device is used by the host device's user-mode driver to control it via virtual function input / output.
[0118] The host device 101 and the network card device 102 can be two devices that interact with each other, or they can both be integrated into the DPU. This application embodiment does not limit this.
[0119] Figure 2 This is a schematic diagram illustrating the principle of a hardware link aggregation deployment method provided in an embodiment of this application, as shown below. Figure 2 On the host device side, the user-mode process maps the PF device to a representative device (LAG0 REPPF2) of a link aggregation group (LAG0). After the NIC aggregation group (BOND0) in the core of the host device is unloaded to the firmware of the NIC device, the representative port device (LAG0 REP PF2) mapped to the link aggregation group (LAG0) is activated. The representative port device (LAG0 REP PF2) is then controlled by the host device's user-mode driver using virtual function input / output to enable the transmission of service traffic on the link aggregation group, thereby increasing link bandwidth, improving link reliability, and achieving load balancing.
[0120] In one exemplary embodiment, such as Figure 3 As shown, a deployment method for hardware link aggregation is provided, which can be applied to... Figure 1 Taking the host device and network card device as examples, the deployment method of this hardware link aggregation includes S201 to S203.
[0121] S201. The host device responds to the network interface card (NIC) aggregation configuration request and creates a NIC aggregation group.
[0122] In some embodiments, the above-mentioned NIC aggregation configuration request is used to instruct the host device to create a NIC aggregation group (BOND) in the kernel configuration. The NIC aggregation configuration request may instruct the configuration of the aggregation mode of the NIC aggregation group, the identification information of the NIC aggregation group, the member ports of the NIC aggregation group, etc.
[0123] The network interface card (NIC) aggregation group includes at least one physical function (PF) device.
[0124] For example, a user can create a network interface card (NIC) aggregation group with the identifier BOND0 by sending a NIC aggregation configuration request to the host device. Subsequently, two PF devices, PF0 and PF1, are added as master members to BOND0. Finally, the aggregation mode of BOND0 is set to Link Aggregation Control Protocol (LACP) mode (i.e., mode 4).
[0125] S202. When the conditions for unloading the network interface card (NIC) aggregation group are met, the host device sends a creation message for the link aggregation group corresponding to the NIC aggregation group to the NIC device.
[0126] In this step, after the host device creates the NIC aggregation group, it can determine whether the NIC aggregation group's unloading conditions are met. If the NIC aggregation group's unloading conditions are not met, the deployment of the hardware link aggregation is terminated. If the NIC aggregation group's unloading conditions are met, a link aggregation group creation message corresponding to the NIC aggregation group is sent to the NIC device.
[0127] It should be understood that the embodiments of this application do not impose restrictions on the unloading conditions of the network interface card (NIC) aggregation group. In some embodiments, the unloading conditions of the NIC aggregation group include at least one physical functional device having the capability to join the link aggregation group. That is, when all physical functional devices in the same NIC aggregation group have the capability to join the link aggregation group, the host device can send a link aggregation group creation message to the NIC device to deploy the hardware link aggregation group.
[0128] Among them, all physical functional devices have the capability to be members of the link aggregation group. That is, the network interface card devices associated with the physical functional devices have the ability to execute link aggregation logic directly at the hardware level without relying on the host and kernel protocol stack.
[0129] For example, the creation message of the link aggregation group mentioned above can be generated by converting the information of the network interface card aggregation group and the member information in the network interface card aggregation group.
[0130] S203. In response to the link aggregation group creation message, the network interface card (NIC) device activates the representative port device mapped to the link aggregation group and sets the link aggregation group to an unloaded state.
[0131] In this step, when the network interface card (NIC) device receives the link aggregation group creation message, it can respond to the link aggregation group creation message by activating the representative port device mapped to the link aggregation group and setting the link aggregation group to an unloaded state.
[0132] The aforementioned representative port device can be a pre-configured physical function device, which is the representative port (REP) of a corresponding set of link aggregation groups, and is a PF device of the Peripheral Component Interconnect Express (PCIe) type.
[0133] It should be understood that since the representative port device is mapped as the representative device of the link aggregation group, the network interface card (NIC) device responds to the link aggregation group creation message and activates the representative port device mapped to the link aggregation group. The representative port device can then be controlled by the host device's user-space driver in a VFIO manner, directly carrying service traffic on the NIC device's aggregated link group. It is no longer necessary to enable SRIOV for a physical function device in the NIC aggregation group. This allows the user-space driver to directly take over the physical function device without enabling SRIOV, and can increase link bandwidth, improve link reliability, and achieve load balancing.
[0134] In some embodiments, the link aggregation group creation message includes member link information for the link aggregation group. Accordingly, after receiving the link aggregation group creation message, the network interface card (NIC) device can modify the mapping between physical ports and link aggregation groups in its received port table.
[0135] The member link information of this link aggregation group is used to modify the mapping between physical ports and link aggregation groups in the receive port table of the network interface card (NIC) device. The physical port can be a receive (RX) port.
[0136] For example, the member link information of a link aggregation group (BOND0) can indicate the corresponding receive (RX) port, such as physical port 0 and physical port 1. Subsequently, in the RX port table, the network interface card device's firmware will map physical port 0 and physical port 1 to the BOND0 suggested correspondence.
[0137] In some embodiments, after sending a link aggregation creation message corresponding to the NIC aggregation group to the NIC device, if the aggregation mode of the link aggregation group is LACP mode, the NIC device can create a redirection table corresponding to the link aggregation group. Subsequently, the NIC device sends an LACP protocol message to the host device. The LACP protocol message is used to negotiate the active members of the NIC aggregation group. Finally, the host device updates the status of the negotiated active members to the active link status of the link aggregation group and sends the active member information to the NIC device. The active member information is used to set the registers corresponding to the link aggregation group.
[0138] In LACP mode, multiple physical links between two devices (e.g., a host and a switch) can be dynamically negotiated and bound into a logical aggregate link.
[0139] For example, in the preset mode numbering, LACP mode can be mapped to mode 4. When the network interface card (NIC) device detects that the aggregation mode in the created NIC aggregation group is mode 4, the NIC device's firmware can create a redirection table corresponding to the link aggregation group, ensuring that the host device's kernel network protocol stack can receive LACP protocol messages. By exchanging LACP protocol messages, the negotiation of active members of the NIC aggregation group can be completed.
[0140] For example, after the BOND group negotiation is completed and the member is activated, the host device's kernel network can update the status of the activated member to the active link (physical port) status of the link aggregation group, and send the activated member information to the network interface card (NIC) device to inform the NIC device of the active member status. After receiving the activated member information, the NIC device can set a series of link aggregation group-related registers to establish the relationship between the link aggregation group and the activated member (physical port), so that the link aggregation group on the NIC device side is in an active state.
[0141] In some embodiments, in response to a NIC aggregation deletion request, the host device may also send a link aggregation group deletion message to the NIC device. Subsequently, in response to the link aggregation group deletion message, the NIC device deletes the setting information in the register corresponding to the link aggregation group and the redirection entry in the redirection table for at least one physical functional device in the NIC aggregation group.
[0142] For example, a user can send a network interface card (NIC) aggregation deletion request to the host device to instruct the tracking device to delete the kernel NIC aggregation group (BOND0). The host device then converts the NIC aggregation deletion request into a deletion message for the corresponding link aggregation group (LAG0) and sends the LAG0 deletion message to the NIC device. Upon receiving the LAG0 deletion message, the NIC device's firmware can delete the configuration messages in the relevant LAG0 registers and remove the routing entries for PF0 and PF1 protocol packets in the routing table of BOND0, thus causing all packets sent to LAG0 to be discarded by the NIC device.
[0143] The hardware link aggregation deployment method provided in this application embodiment responds to a network interface card (NIC) aggregation configuration request by creating a NIC aggregation group, which includes at least one physical functional device (PMP). When the unloading conditions of the NIC aggregation group are met, a link aggregation group creation message corresponding to the NIC aggregation group is sent to the NIC device. The unloading conditions of the NIC aggregation group include at least one PMP having the capability to be a member of the link aggregation group. The link aggregation group creation message instructs the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for control by the user-mode driver of the host device in a virtual function input / output (VMI) manner. In this application embodiment, when all physical functional devices in the created NIC aggregation group have the capability to be a member of the link aggregation group, a link aggregation group creation message is sent to the NIC device, thereby activating the representative port device mapped to the link aggregation group. The representative port device is then used by the user-mode driver to control the link aggregation group in a VMI manner, directly carrying service traffic on the aggregated link group of the NIC device. Since it is not necessary to enable single root input / output virtualization for a physical functional device in the network interface card aggregation group, it is possible for the user-space driver to directly take over the physical functional device without enabling single root input / output virtualization.
[0144] In this application, because the user-space driver directly takes over the physical functional device without enabling single root I / O virtualization, the maintenance cost is lower. Users can take over the representative port device via VFIO without enabling single root I / O virtualization, allowing user-space process traffic to be forwarded directly on the LAG link of the network interface card device without going through the kernel protocol stack, thus providing flexibility in user deployment.
[0145] The following section explains the firmware routing process after the host device controls the representative port device. Figure 4 The signaling interaction diagram for another hardware link aggregation deployment method provided in the embodiments of this application is as follows: Figure 4 As shown, the deployment method for this hardware link aggregation includes S301 to S307.
[0146] S301. The host device responds to the network interface card (NIC) aggregation configuration request and creates a NIC aggregation group.
[0147] S302. When the conditions for unloading the network interface card (NIC) aggregation group are met, the host device sends a creation message for the link aggregation group corresponding to the NIC aggregation group to the NIC device.
[0148] S303. In response to the link aggregation group creation message, the network interface card (NIC) device activates the representative port device mapped to the link aggregation group and sets the link aggregation group to an unloaded state.
[0149] S304. During the port startup phase of the representative port device, the host device sends an attribute acquisition request for the representative port device to the network interface card device.
[0150] S305. The network interface card (NIC) device sends attribute information representing the port device to the host device.
[0151] The aforementioned attribute acquisition request is used to request the attribute information of the representative port device. This attribute information reflects the hardware capabilities of the representative port device, including indication information on whether the port corresponding to the representative port device is a LAG representative port and the forwarding domain information of the representative port device.
[0152] For example, the forwarding domain information of the representative port device can be the identification information of the LAG mapped to the representative port device, and the forwarding domain information of other physical function devices that are not representative port devices can be the physical port identifier (Physical PortID).
[0153] Correspondingly, after the host device's user-space network driver takes over the representative port device in the VFIO manner, during the startup phase of the representative port device, it can send a request to the network interface card (NIC) device to obtain the attribute information of the representative port device. In this way, it can receive the attribute information of the representative port device sent by the NIC device to the host device, thereby determining whether the attribute information is the representative port of LAG and the forwarding domain of the representative port device.
[0154] S306. The host device sends the configuration instruction information for the redirection entry of the representative port device to the network card device based on the attribute information of the representative port device.
[0155] For example, after the user-mode network driver of the host device is loaded, it can determine that the representative port device is the representative port of LAG based on the attribute information of the representative port device, and after determining the forwarding domain of the representative port device, it can send the setting instruction information of the routing entry of the representative port device to the network card device, thereby setting the routing entry of the representative port device based on the forwarding domain of the representative port device.
[0156] The aforementioned traffic redirection entries may include multiple traffic redirection rule information for the representative port device to perform condition matching and processing of traffic.
[0157] S307. In response to the setting instruction information, the network card device sets the routing rules for the representative port device in the receiving and transmitting directions in the routing entry of the representative port device.
[0158] The traffic acquisition rules include rules for matching traffic based on conditions, as well as rules for processing traffic.
[0159] It should be understood that since the firmware of the network interface card (NIC) device determines that the forwarding domain of the representative port device is the LAG domain, the firmware of the NIC device traverses all member links in the LAG and sets the forwarding rules of the representative port device in the receiving direction (RX) and transmitting direction (TX) based on the setting indication information in the forwarding entry of the representative port device, so as to ensure that the forwarding rules are effective in the range of multiple member links in the LAG group associated with the representative port device.
[0160] For example, since a corresponding identifier is pre-assigned to the physical port of the physical function device corresponding to each LAG and bound to the identifier of the LAG, the firmware of the network card device receives the setting instruction information of the redirection entry and can set the redirection rules in the receiving and sending directions, so that the service data entering from any physical port can be correctly identified and forwarded to the representative port device of the corresponding LAG.
[0161] It should be noted that after the traffic redirection rules are set up, the LACP packets received by the physical port are still sent to the physical function device of the host device's kernel and processed by the kernel network protocol stack.
[0162] In some embodiments, the network interface card (NIC) forwarding chip can also be configured with a default routing rule for the corresponding representative port device in the transmission direction (TX). This default routing rule is effective within the LAG forwarding domain, and the destination port is not LAG.
[0163] In other embodiments, when the host device's user-mode driver exits control of the delegate port device, the host device can send a notification message to the network interface card (NIC) device's firmware to instruct the NIC device's firmware to delete redirection entries and / or redirection rules in both the receive and transmit directions. At this time, the delegate port device will no longer receive any packets in the receive direction, and all packets sent in the transmit direction will be discarded by the NIC device.
[0164] It should be noted that steps S304 to S307 can be performed after or before steps S301 to S303; this application embodiment does not impose any restrictions on this. In some embodiments, the host device's user space can first control the representative port device and set traffic redirection rules using VFIO. At this time, traffic or packets cannot be transmitted temporarily, and the user can use the Internet Protocol Link (IP Link) command to configure the network interface card aggregation group, offloading the hardware LAG to the fixed network interface card device.
[0165] The configuration of the representative port device is explained below. Figure 5 The signaling interaction diagram for another hardware link aggregation deployment method provided in the embodiments of this application is as follows: Figure 5 As shown, the deployment method for this hardware link aggregation includes S401 to S413.
[0166] S401. In response to the configuration request of the representative port device, the network interface card device adds the physical function entry of the representative port device of the link aggregation group to the device data in the stored file.
[0167] In this application, the physical function entry of the representative port device of the link aggregation group can be added to the device data of the storage file by sending a configuration request for the representative port device to the network card device, so as to configure the representative port device mapped by the link aggregation group.
[0168] The aforementioned storage file can be a Non-Volatile Memory (NVM) configuration file.
[0169] For example, by setting a representative port device, the device data in the NVM configuration file can be configured, the physical function entry of the representative port device in the link aggregation group can be added, and a physical function device in a PCIe can be defined as the representative port of a hardware LAG.
[0170] For example, a new PF entry can be added to the NVM configuration file as the physical function entry for the representative port device of the link aggregation group. In this PF entry, the identifier of the representative port device is 2, the corresponding LAG identifier is 0, and the LAG representative port device indication message (lag rep flag) is set to 1.
[0171] In some embodiments, the physical function entry of the representative port device of the link aggregation group also includes specific parameter settings, such as specifying the mapping relationship parameters between the physical function device and the LAG. That is, the physical function entry can include not only the identification information of the physical function device and the relevant parameters of the LAG, but also the mapping relationship parameters between the physical function device and the LAG.
[0172] The identification information of physical functional devices can include the device ID, manufacturer identification code ID, etc., which can accurately identify the representative port device. The relevant parameters of the LAG can include LAG ID, member link list, etc., which can describe in detail the composition and characteristics of the hardware LAG.
[0173] The mapping parameters between physical function devices and LAGs are used to bind representative port devices to their corresponding LAGs one-to-one through specific syntax and rules. This allows the connection between representative port devices and LAGs to be established quickly and accurately based on the physical function entry during operation.
[0174] S402. After detecting that the network card device has started, the network card device reads the device data from the storage file.
[0175] For example, after detecting startup, the network interface card (NIC) device can first scan the NVM configuration file in a preset location on the storage medium. Subsequently, the NIC device reads and analyzes each parameter in the NVM configuration file line by line according to specific file parsing rules to obtain device data.
[0176] S403. The network interface card (NIC) device associates the forwarding domain and physical connection status of the representative port device with the link aggregation group based on the device data.
[0177] For example, the configurations of all physical function devices supported by the network interface card (NIC) are stored in the device data of the NVM configuration file. Accordingly, during the initialization process after startup, the NIC device firmware can load the configuration data of all physical function devices from the device data to associate the forwarding domain and physical connection state of the representative port device with the link aggregation group.
[0178] For example, for a physical functional device representing a port device, the forwarding domain can be set to the corresponding LAG domain, and the member links included in the LAG domain are determined by the LAG's own configuration. Correspondingly, the physical connection state of the representative port device is then associated with the LAG. After the physical connection state of the representative port device is associated with the LAG, the network interface card (NIC) firmware will only change the physical connection state of the representative port device from connected to disconnected after all member links of the LAG are disconnected, and will notify the host device's user space via an event.
[0179] For example, for a physical function device that is not a representative port device, the forwarding domain can be set to a certain physical link. Correspondingly, the physical connection status of the physical function device that is not a representative port device can be consistent with the status of the corresponding physical link.
[0180] S404. When the host device detects that the network interface card (NIC) device is started, it probes the physical function devices configured in the NIC device and obtains the identification information of the detected physical function devices.
[0181] In some embodiments, when a host device detects that a network interface card (NIC) device is started, it can determine the physical functional devices configured in the NIC device through a prob mechanism.
[0182] The prob mechanism allows the host device to scan and discover, match drivers, allocate resources, and activate hardware for the physical functional devices in the network interface card (NIC). This enables the kernel in the host device to fully control the NIC and determine the physical functional devices configured in the NIC.
[0183] S405. The host device determines the type of the detected physical functional device based on the identification information of the detected physical functional device.
[0184] The types of physical functional devices mentioned above can include types of representative port devices and types of non-representative port devices.
[0185] For example, the host device can distinguish whether a physical functional device is a type representing a port device or a type not representing a port device based on the identification information of the physical functional device. The identification information of the type representing a port device can be set with special flag bits.
[0186] S406. If the type of the detected physical functional device is not the representative port device of the link aggregation group, the host device loads the kernel network driver of the detected physical functional device.
[0187] In some embodiments, if the detected physical function device is a representative port device of a link aggregation group, the host device does not load the kernel network driver for the detected physical function device by default. If the detected physical function device is not a representative port device of a link aggregation group, the host device loads the kernel network driver for the detected physical function device. In this way, the number of physical function devices and the number of physical ports seen by the user in the kernel through IP link show information are consistent.
[0188] It should be understood that this application embodiment does not limit how the kernel network driver of the detected physical functional device is loaded. In some embodiments, the host device may send a request to the network interface card (NIC) device to obtain the capability information of the detected physical functional device. The NIC device then sends the hardware capability information of the detected physical functional device to the host device. Based on the hardware capability information, the host device initializes the kernel network driver of the detected physical functional device to obtain the configuration information of the physical functional device. Finally, the host device sends the configuration information of the detected physical functional device to the NIC device, and the NIC device sets the transmit / receive queue and routing table of the detected physical functional device based on the configuration information.
[0189] The aforementioned hardware capability information may include the forwarding domain information of physical function devices, the offloading capability information of the physical function devices of the PF, and the LAG identifier information to which the physical function devices belong.
[0190] For example, based on the forwarding domain information of the physical function device (PFM), the offloading capability information of the PFM's hardware PFM, and the LAG identifier information to which the PFM belongs, the host device initializes the kernel network driver of the detected PFM and determines the PFM's configuration information. Then, it sends the PFM's configuration information to the network interface card (NIC) to set the transmit / receive queues and routing tables of the detected PFM.
[0191] This includes the configuration information of the physical function devices, namely the configuration information of the send / receive queues and the devices in the traffic redirection table. For example, by configuring the send / receive queues and traffic redirection entries in the traffic redirection table, the traffic forwarding of the physical function devices is made to correspond one-to-one with their corresponding physical links. At this time, the physical function devices (e.g., PF0 and PF1) can send and receive packets normally, and the link connection status follows their corresponding physical links (e.g., physical port 0 and physical port 1) one-to-one.
[0192] S407. The host device responds to the network interface card (NIC) aggregation configuration request and creates a NIC aggregation group.
[0193] S408. When the conditions for unloading the network interface card (NIC) aggregation group are met, the host device sends a creation message for the link aggregation group corresponding to the NIC aggregation group to the NIC device.
[0194] S409. In response to the link aggregation group creation message, the network interface card (NIC) device activates the representative port device mapped to the link aggregation group and sets the link aggregation group to an unloaded state.
[0195] S410. During the port startup phase of the representative port device, the host device sends an attribute acquisition request for the representative port device to the network interface card device.
[0196] S411. The network interface card (NIC) device sends attribute information representing the port device to the host device.
[0197] S412. The host device sends the configuration instruction information for the routing entry of the representative port device to the network card device based on the attribute information of the representative port device.
[0198] S413. In response to the setting instruction information, the network interface card (NIC) device sets the routing rules for the representative port device in the receiving and transmitting directions in the routing entry of the representative port device.
[0199] In this application, since the association between the representative port device and LAG can be determined by loading the NVM configuration file, the forwarding domain of the representative port device is fixed regardless of whether the LAG is successfully unloaded. Therefore, there is no sequential order between the kernel BOND configuration and the user-space network driver control of the representative port. Similarly, if the user wants to delete the BOND, it is not necessary to first release the control of the representative port device in the user-space network driver. The firmware of the network card device can still correctly release the relevant forwarding resources without causing resource residue. Since users do not need to change their existing configuration habits, the network driver does not load the representative port device, and the number of kernel-space physical function devices queried by the user remains consistent with the number of physical network ports. Accordingly, if the representative port device is not needed, it can also be left unloaded, and the kernel's PF and SRIOV functions will not be affected in any way.
[0200] The hardware link aggregation deployment method provided in this application embodiment responds to a network interface card (NIC) aggregation configuration request by creating a NIC aggregation group, which includes at least one physical functional device (PMP). When the unloading conditions of the NIC aggregation group are met, a link aggregation group creation message corresponding to the NIC aggregation group is sent to the NIC device. The unloading conditions of the NIC aggregation group include that at least one PMP has the capability to be a member of the link aggregation group. The link aggregation group creation message instructs the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for control by the user-mode driver of the host device in a virtual function input / output (VMI) manner. In this application embodiment, when all the PMPs in the created NIC aggregation group have the capability to be a member of the link aggregation group, a link aggregation group creation message is sent to the NIC device, thereby activating the representative port device mapped to the link aggregation group. The representative port device is then used by the user-mode driver to control the link aggregation group in a VMI manner, directly carrying service traffic on the aggregated link group of the NIC device. Since it is not necessary to enable single root input / output virtualization for a physical functional device in the network interface card aggregation group, it is possible for the user-space driver to directly take over the physical functional device without enabling single root input / output virtualization.
[0201] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0202] Based on the same inventive concept, this application also provides a hardware link aggregation deployment apparatus for implementing the above-described deployment method for hardware link aggregation on the host device side. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more hardware link aggregation deployment apparatus embodiments provided below can be found in the limitations of the host device side hardware link aggregation deployment method described above, and will not be repeated here.
[0203] In one exemplary embodiment, such as Figure 6 As shown, a hardware link aggregation deployment device 500 is provided, including: a first processing module 501, a first sending module 502, and a first receiving module 503, wherein:
[0204] The first processing module 501 is used to create a network interface card (NIC) aggregation group in response to a NIC aggregation configuration request. The NIC aggregation group includes at least one physical functional device.
[0205] The first sending module 502 is used to send a creation message of the link aggregation group corresponding to the network interface card (NIC) aggregation group to the NIC device when the unloading conditions of the NIC aggregation group are met.
[0206] The unloading conditions for a network interface card (NIC) aggregation group include at least one physical functional device having the capability to be a member of the link aggregation group; the link aggregation group creation message is used to instruct the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state; the representative port device is used for the host device's user-mode driver to control it in the form of virtual function input / output.
[0207] In some embodiments, the link aggregation group creation message includes member link information of the link aggregation group, which is used to modify the correspondence between physical ports and link aggregation groups in the receive port table of the network interface card device.
[0208] In some embodiments, the hardware link aggregation deployment apparatus 500 further includes:
[0209] The first receiving module 503 is used to receive LACP protocol messages sent by the network interface card device if the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode. The LACP protocol messages are used to negotiate the active members of the network interface card aggregation group.
[0210] The first processing module 501 is also used to update the status of the negotiated active member to the active link status of the link aggregation group.
[0211] The first sending module 502 is also used to send activation member information to the network card device, and the activation member information is used to set the register corresponding to the link aggregation group.
[0212] In some embodiments, the first sending module 502 is further configured to send a deletion message of the link aggregation group corresponding to the network interface card (NIC) aggregation group to the NIC device in response to the NIC aggregation deletion request.
[0213] The link aggregation group deletion message is used to instruct the network interface card (NIC) device to delete the setting information in the register corresponding to the link aggregation group and the redirection entry in the redirection table of at least one physical functional device in the NIC aggregation group.
[0214] In some embodiments, the first sending module 502 is further configured to send an attribute acquisition request for the representative port device to the network interface card device during the port startup phase of the representative port device; and send setting instruction information for the traffic entry of the representative port device to the network interface card device according to the attribute information of the representative port device.
[0215] The first receiving module 503 is also used to receive attribute information of the representative port device sent by the network card device.
[0216] In some embodiments, the first processing module 501 is further configured to, when the network interface card device is detected to start, detect the physical function devices configured in the network interface card device and obtain the identification information of the detected physical function devices; determine the type of the detected physical function devices based on the identification information of the detected physical function devices; and load the kernel network driver of the detected physical function devices if the type of the detected physical function devices is not the representative port device of the link aggregation group.
[0217] In some embodiments, the first sending module 502 is further configured to send a request to the network interface card (NIC) device to obtain capability information of the detected physical functional device; and to send the NIC device to the configuration information of the detected physical functional device.
[0218] The first receiving module 503 is also used to receive hardware capability information of the detected physical functional devices sent by the network card device.
[0219] The first processing module 501 is also used to initialize the kernel network driver of the detected physical function device according to the hardware capability information, and obtain the setting information of the physical function device. The setting information is used to instruct the setting of the transmit and receive queues and flow tables of the detected physical function device.
[0220] Each module in the aforementioned hardware link aggregation deployment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0221] Based on the same inventive concept, this application also provides a hardware link aggregation deployment apparatus for implementing the above-described deployment method for hardware link aggregation on the network interface card (NIC) device side. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations of one or more hardware link aggregation deployment apparatus embodiments provided below can be found in the limitations of the hardware link aggregation deployment method on the NIC device side described above, and will not be repeated here.
[0222] In one exemplary embodiment, such as Figure 7 As shown, a hardware link aggregation deployment device 600 is provided, including: a second receiving module 601, a second processing module 602, and a second sending module 603, wherein:
[0223] The second receiving module 601 is used to receive a creation message of a link aggregation group corresponding to a network interface card (NIC) aggregation group sent by a host device when the unloading conditions of the NIC aggregation group are met. The NIC aggregation group includes at least one physical functional device, and the unloading conditions of the NIC aggregation group include that at least one physical functional device has the membership capability of the link aggregation group.
[0224] The second processing module 602 is used to respond to the creation message of the link aggregation group, activate the representative port device mapped by the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for the host device's user-mode driver to control it in the form of virtual function input / output.
[0225] In one embodiment, the link aggregation group creation message includes member link information of the link aggregation group; the second processing module is further configured to modify the correspondence between physical ports and link aggregation groups in the receive port table of the network interface card device according to the member link information of the link aggregation group.
[0226] In one embodiment, the second processing module 602 is further configured to: if the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, create a redirection table corresponding to the link aggregation group; and set the register corresponding to the link aggregation group according to the information of the activated members.
[0227] The hardware link aggregation deployment device 600 also includes a second sending module 603, which is used to send LACP protocol messages to the host device according to the redirection table corresponding to the link aggregation group. The LACP protocol messages are used to negotiate the active members of the network card aggregation group.
[0228] The second receiving module 601 is also used to receive information about activated members sent by the host device.
[0229] In one embodiment, the second receiving module 601 is further configured to receive a deletion message of the link aggregation group sent by the host device.
[0230] The second processing module 602 is also used to, in response to the deletion message of the link aggregation group, delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the network interface card aggregation group.
[0231] In one embodiment, the second receiving module 601 is further configured to receive a request from the host device to obtain the attributes of the representative port device during the port startup phase of the representative port device; and to receive setting indication information of the referral entry of the representative port device corresponding to the attribute information sent by the host device.
[0232] The second sending module 603 is also used to send attribute information representing the port device to the host device.
[0233] The second processing module 602 is also configured to, in response to the setting instruction information, set the routing rules for the representative port device in the receiving and transmitting directions in the routing entry of the representative port device.
[0234] In one embodiment, the second receiving module 601 is further configured to receive a request from the host device to obtain capability information of the detected physical functional device, wherein the type of the detected physical functional device is not a representative port device of the link aggregation group; and to receive setting information of the detected physical functional device from the host device.
[0235] The second sending module 603 is also used to send the hardware capability information of the detected physical functional device to the host device. The hardware capability information is used to generate the setting information of the physical functional device by initializing the kernel network driver of the detected physical functional device.
[0236] The second processing module 602 is also used to set the transmit / receive queue and diversion table of the detected physical functional devices according to the setting information of the physical functional devices.
[0237] In one embodiment, the second processing module 602 is further configured to, in response to a configuration request of the representative port device, add a physical function entry of the representative port device of the link aggregation group to the device data in the storage file; read the device data in the storage file after detecting that the network interface card device has started; and associate the forwarding domain and physical connection status of the representative port device with the link aggregation group according to the device data.
[0238] Each module in the aforementioned hardware link aggregation deployment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0239] In one embodiment, a computer device is provided, comprising a central processing unit (CPU chip) and a network interface card (NIC). The NIC includes a data processing unit (DPU) chip. The CPU chip of the computer device can implement a hardware link aggregation deployment method on the host device side, and the DPU chip can implement a hardware link aggregation deployment method on the NIC device side. The internal structure diagram of the computer device can be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface (network interface card) is connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a chip reset method.
[0240] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0241] In one exemplary embodiment, a CPU chip is provided. The CPU chip includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described deployment method for hardware link aggregation on the host device side.
[0242] In one exemplary embodiment, a DPU chip is provided. The DPU chip includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described deployment method for hardware link aggregation on the network interface card device side.
[0243] In one exemplary embodiment, a Network Interface Card (NIC) is provided. The NIC includes a DPU chip as described in the foregoing embodiments and multiple interfaces (e.g., PCI / PCIE interfaces, USB interfaces, etc.), through which the DPU chip communicates externally.
[0244] In one exemplary embodiment, a computer device is provided. The computer device includes a processor and a DPU chip or network interface card as described in the foregoing embodiments. The DPU chip is used to schedule packets to a central processing unit or to process the packets itself, and the processor is used to process the packets scheduled by the chip.
[0245] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the above-described deployment method for hardware link aggregation on the host device side or the deployment method for hardware link aggregation on the network interface card device side.
[0246] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described deployment method for hardware link aggregation on the host device side or the deployment method for hardware link aggregation on the network interface card (NIC) device side.
[0247] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0248] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0249] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A deployment method for hardware link aggregation, characterized in that, Applied to a host device, the method includes: In response to a network interface card (NIC) aggregation configuration request, a NIC aggregation group is created, wherein the NIC aggregation group includes at least one physical functional device; If the unloading conditions of the network interface card (NIC) aggregation group are met, a creation message for the link aggregation group corresponding to the NIC aggregation group is sent to the NIC device. The unloading conditions for the network interface card (NIC) aggregation group include that at least one physical functional device has the membership capability of the link aggregation group; the link aggregation group creation message is used to instruct the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state; the representative port device is used for the host device's user-mode driver to control it in a virtual function input / output manner.
2. The method according to claim 1, characterized in that, The creation message of the link aggregation group includes the member link information of the link aggregation group. The member link information of the link aggregation group is used to modify the correspondence between physical ports and the link aggregation group in the receive port table of the network interface card device.
3. The method according to claim 1, characterized in that, After sending the link aggregation creation message corresponding to the network interface card (NIC) aggregation group to the NIC device, the method further includes: If the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, then the LACP protocol message sent by the network interface card (NIC) device is received. The LACP protocol message is used to negotiate the active members of the NIC aggregation group. Update the status of the negotiated active members to the active link status of the link aggregation group; The information of the activated member is sent to the network interface card device, and the information of the activated member is used to set the register corresponding to the link aggregation group.
4. The method according to claim 3, characterized in that, After sending the link aggregation creation message corresponding to the network interface card (NIC) aggregation group to the NIC device, the method further includes: In response to a network interface card (NIC) aggregation deletion request, a deletion message for the link aggregation group corresponding to the NIC aggregation group is sent to the NIC device. The link aggregation group deletion message is used to instruct the network interface card (NIC) device to delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the NIC aggregation group.
5. The method according to claim 1, characterized in that, The method further includes: During the port startup phase of the representative port device, a request to obtain the attributes of the representative port device is sent to the network interface card device. Receive the attribute information of the representative port device sent by the network interface card device; Based on the attribute information of the representative port device, the network interface card (NIC) device is sent with instructions on setting the routing entries for the representative port device.
6. The method according to any one of claims 1-5, characterized in that, Before creating a network interface card (NIC) aggregation group in response to a NIC aggregation configuration request, the method further includes: When the network interface card (NIC) device is detected to be powered on, the physical functional devices configured in the NIC device are detected and the identification information of the detected physical functional devices is obtained. Based on the identification information of the detected physical functional devices, determine the type of the detected physical functional devices; If the type of the detected physical functional device is not a representative port device of a link aggregation group, load the kernel network driver of the detected physical functional device.
7. The method according to claim 6, characterized in that, The loading of the kernel network driver for the detected physical functional device includes: Send a request to the network interface card (NIC) device to obtain the capability information of the detected physical functional device; Receive the hardware capability information of the detected physical functional device sent by the network interface card device; Based on the hardware capability information, the kernel network driver of the detected physical function device is initialized to obtain the setting information of the physical function device. The setting information is used to instruct the setting of the transmit / receive queue and the routing table of the detected physical function device. Send the configuration information of the detected physical function device to the network card device.
8. A deployment method for hardware link aggregation, characterized in that, Applied to network interface card (NIC) devices, the method includes: If the unloading conditions of the network interface card (NIC) aggregation group are met, the host device sends a creation message for the link aggregation group corresponding to the NIC aggregation group. The NIC aggregation group includes at least one physical function device. The unloading conditions of the NIC aggregation group include that the at least one physical function device has the membership capability of the link aggregation group. In response to the creation message of the link aggregation group, the representative port device mapped by the link aggregation group is activated and the link aggregation group is set to an unloaded state. The representative port device is used for the user-mode driver of the host device to control it in the form of virtual function input / output.
9. The method according to claim 8, characterized in that, The creation message of the link aggregation group includes the member link information of the link aggregation group, and the method further includes: Based on the member link information of the link aggregation group, modify the correspondence between the physical port and the link aggregation group in the receive port table of the network interface card device.
10. The method according to claim 8, characterized in that, After receiving the link aggregation group creation message corresponding to the network interface card aggregation group sent by the host device, the method further includes: If the aggregation mode corresponding to the link aggregation group is the Link Aggregation Control Protocol (LACP) mode, then create the redirection table corresponding to the link aggregation group; According to the redirection table corresponding to the link aggregation group, an LACP protocol message is sent to the host device. The LACP protocol message is used to negotiate the active members of the network interface card aggregation group. Receive the information of the activated member sent by the host device; Based on the information of the activated members, set the register corresponding to the link aggregation group.
11. The method according to claim 10, characterized in that, The method further includes: Receive the deletion message of the link aggregation group sent by the host device; In response to the deletion message of the link aggregation group, delete the setting information in the register corresponding to the link aggregation group and the traffic entry in the traffic table of at least one physical functional device in the network interface card aggregation group.
12. The method according to claim 8, characterized in that, The method further includes: During the port startup phase of the representative port device, a request to obtain the attributes of the representative port device sent by the host device is received. Send the attribute information of the representative port device to the host device; Receive the setting instruction information of the diversion entry of the representative port device corresponding to the attribute information sent by the host device; In response to the setting instruction information, the routing rules for the representative port device in the receiving and transmitting directions are set in the routing entry of the representative port device.
13. The method according to any one of claims 8-12, characterized in that, The method further includes: Receive a request from the host device to obtain capability information of the detected physical functional device, wherein the type of the detected physical functional device is not the representative port device of the link aggregation group; Send the hardware capability information of the detected physical functional device to the host device. The hardware capability information is used to generate the setting information of the physical functional device during the initialization of the kernel network driver of the detected physical functional device. Receive the setting information of the detected physical functional devices sent by the host device; Based on the setting information of the physical functional devices, set the transmit / receive queue and diversion table of the detected physical functional devices.
14. The method according to claim 8, characterized in that, The method further includes: In response to the setup request of the representative port device, the physical function entry of the representative port device of the link aggregation group is added to the device data of the stored file; After detecting that the network card device has started, read the device data from the storage file; Based on the device data, the forwarding domain and physical connection status of the representative port device are associated with the link aggregation group.
15. A deployment apparatus for hardware link aggregation, characterized in that, Applied to a host device, the device includes: The first processing module is used to respond to a network interface card (NIC) aggregation configuration request and create a NIC aggregation group, wherein the NIC aggregation group includes at least one physical functional device. The first sending module is used to send a creation message of the link aggregation group corresponding to the network interface card (NIC) aggregation group to the NIC device when the unloading conditions of the NIC aggregation group are met. The unloading conditions for the network interface card (NIC) aggregation group include that at least one physical functional device has the membership capability of the link aggregation group; the link aggregation group creation message is used to instruct the NIC device to activate the representative port device mapped to the link aggregation group and set the link aggregation group to an unloaded state; the representative port device is used for the host device's user-mode driver to control it in a virtual function input / output manner.
16. A deployment device for hardware link aggregation, characterized in that, Applied to network interface card (NIC) devices, the device includes: The second receiving module is used to receive a creation message of a link aggregation group corresponding to the network interface card aggregation group sent by the host device when the unloading conditions of the network interface card aggregation group are met. The network interface card aggregation group includes at least one physical function device, and the unloading conditions of the network interface card aggregation group include that the at least one physical function device has the membership capability of the link aggregation group. The second processing module is used to respond to the creation message of the link aggregation group, activate the representative port device mapped by the link aggregation group and set the link aggregation group to an unloaded state. The representative port device is used for the user-mode driver of the host device to control it in the form of virtual function input / output.
17. A CPU chip, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
18. A DPU chip, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 8 to 14.
19. A computer device, characterized in that, The device includes the CPU chip of claim 17 and the DPU chip of claim 18, wherein the DPU chip is used to schedule messages to the CPU chip or to process them itself, and the CPU chip processes the messages scheduled by the DPU chip.
20. A network interface card, characterized in that, It includes the DPU chip and interface as described in claim 18, wherein the chip communicates externally through the interface.
21. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7 or 8 to 14.
22. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7 or 8 to 14.
Citation Information
Patent Citations
Method and device for traffic offload forwarding in multi-binding mode, and medium
CN116055426A
DPU-based k8s cluster deployment method, apparatus and device, and storage medium
CN119211023A
Hardware unloading method for multiple virtual function devices, electronic device and medium
CN119342016A
Multi-host network card port aggregation service hardware unloading system under celestial vein operating system
CN119383152A
Cross-card link convergence method, device, equipment and medium
CN120034483A
