Method, device, chip, network card and equipment for deploying hardware link aggregation
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. This enables the user-space driver to take over directly without enabling single root input/output virtualization, thus improving the efficiency and reliability of link aggregation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, hardware link aggregation offloading relies on the host kernel's network driver and single root input/output virtualization, 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 inputs and outputs, avoiding the virtualization of single root inputs and outputs of physical function devices.
It enables user-mode drivers to directly take over physical functional devices without enabling single root input/output virtualization, improving link bandwidth and reliability, achieving load balancing, reducing maintenance costs, and providing flexibility for user deployment.
Smart Images

Figure CN121334040B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of chips, and in particular to a hardware link aggregation deployment method and device, a chip, a network card and equipment. BACKGROUND
[0002] In the technical field of chips, a Link Aggregation Group (LAG) bundles multiple physical network interfaces into a 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 Network Interface Bonding (BOND) configuration on the host side to the network card hardware side through a private kernel network driver. When implementing hardware LAG offloading, the network card hardware needs to rely on the network protocol stack of the host kernel to process protocol packets, and by configuring two or more physical function (PF) devices to a BOND group in the kernel, and offloading the private kernel network driver to the firmware side of the network card hardware.
[0004] However, when implementing hardware LAG offloading in the above manner, the PF device needs to be taken over by the kernel network driver. In order for the user process to pass through the kernel protocol stack and the network card directly, the kernel network driver can be exited first, and then taken over by the user state through a Virtual Function I / O (VFIO) method. This requires enabling a certain PF device of one of the BOND group members to Single Root I / O Virtualization (SRIOV) to generate a Virtual Function (VF) device, and then providing the VF device to the user state to take over in the VFIO manner. Therefore, the hardware LAG offloading in related technologies cannot directly take over the PF device by the user state driver without starting single root input / output virtualization. SUMMARY
[0005] Therefore, it is necessary to provide a hardware link aggregation deployment method, device, chip, equipment, network interface card, storage medium and program product capable of directly taking over a physical function device by a user state driver without starting single root input / output virtualization in view of the above technical problems.
[0006] In a first aspect, the present application provides a hardware link aggregation deployment method applied to a host device, comprising:
[0007] In response to a network card aggregation configuration request, a network card aggregation group is created, and the network card aggregation group includes at least one physical function device;
[0008] In a case where an offloading condition of the network card aggregation group is met, a creation message of a link aggregation group corresponding to the network card aggregation group is sent to a network card device;
[0009] The offloading condition of the network card aggregation group includes that the at least one physical function device has a member capability of the link aggregation group; the creation message of the link aggregation group is used to instruct the network card device to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state; and the representative port device is used for a user mode driver of the host device to control in a virtual function input / output manner.
[0010] In one of the embodiments, the creation message of the link aggregation group includes member link information of the link aggregation group, and the member link information of the link aggregation group is used to modify a correspondence between a physical port and the link aggregation group in a receiving port table of the network card device.
[0011] In one of the embodiments, after the creation message of the link aggregation group corresponding to the network card aggregation group is sent to the network card device, the method further includes:
[0012] If an aggregation mode corresponding to the link aggregation group is a link aggregation control protocol (LACP) mode, an LACP protocol packet sent by the network card device is received, and the LACP protocol packet is used to negotiate an active member of the network card aggregation group.
[0013] A state of the negotiated active member is updated to an active link state of the link aggregation group.
[0014] Information of the active member is sent to the network card device, and the information of the active member is used to set a register corresponding to the link aggregation group.
[0015] In one of the embodiments, after the creation message of the link aggregation group corresponding to the network card aggregation group is sent to the network card device, the method further includes:
[0016] In response to a network card aggregation deletion request, a deletion message of a link aggregation group corresponding to the network card aggregation group is sent to the network card device.
[0017] The deletion message of the link aggregation group is used to instruct the network card device to delete setting information in a register corresponding to the link aggregation group and a flow entry of at least one physical function device in the network card aggregation group in a flow table.
[0018] In one of the embodiments, the method further includes:
[0019] sending an attribute obtaining request of the representative port device to the network card device in a port starting stage of the representative port device;
[0020] receiving attribute information of the representative port device sent by the network card device;
[0021] sending setting indication information of a flow entry of the representative port device to the network card device according to the attribute information of the representative port device.
[0022] In one embodiment, before the network card aggregation group is created in response to the network card aggregation configuration request, the method further comprises:
[0023] detecting a physical function device configured in the network card device and obtaining identification information of the detected physical function device when it is detected that the network card device is started;
[0024] determining a type of the detected physical function device according to the identification information of the detected physical function device;
[0025] loading a kernel network driver of the detected physical function device in a case where the type of the detected physical function device is not a representative port device of a link aggregation group.
[0026] In one embodiment, the loading of the kernel network driver of the detected physical function device comprises:
[0027] sending a capability information obtaining request of the detected physical function device to the network card device;
[0028] receiving hardware capability information of the detected physical function device sent by the network card device;
[0029] initializing the kernel network driver of the detected physical function device according to the hardware capability information to obtain setting information of the physical function device, the setting information being used for indicating setting of a transmit-receive queue and a flow table of the detected physical function device;
[0030] sending the setting information of the detected physical function device to the network card device.
[0031] In a second aspect, the application provides a hardware link aggregation deployment method, applied to a network card device, comprising:
[0032] In a case where an offload condition of the network card aggregation group is met, a link aggregation group corresponding to the network card aggregation group is created according to a creation message sent by a host device, the network card aggregation group including at least one physical function device, and the offload condition of the network card aggregation group including the at least one physical function device having a member capability of the link aggregation group.
[0033] In response to the creation message of the link aggregation group, a representative port device mapped by the link aggregation group is activated, and the link aggregation group is set to an offloaded state, the representative port device being used for a user space driver of the host device to control in a virtual function input / output manner.
[0034] In one of the embodiments, the creation message of the link aggregation group includes member link information of the link aggregation group, and the method further includes:
[0035] According to the member link information of the link aggregation group, a corresponding relationship between a physical port and the link aggregation group is modified in a receiving port table of the network card device.
[0036] In one of the embodiments, after the creation message of the link aggregation group corresponding to the network card aggregation group sent by the host device, the method further includes:
[0037] If an aggregation mode corresponding to the link aggregation group is a link aggregation control protocol (LACP) mode, a flow table corresponding to the link aggregation group is created.
[0038] According to the flow table corresponding to the link aggregation group, an LACP protocol packet is sent to the host device, the LACP protocol packet being used for negotiating an active member of the network card aggregation group.
[0039] Information of the active member is received, which is sent by the host device.
[0040] According to the information of the active member, a register corresponding to the link aggregation group is set.
[0041] In one of the embodiments, the method further includes:
[0042] A deletion message of the link aggregation group is received, which is sent by the host device.
[0043] In response to the deletion message of the link aggregation group, setting information in the register corresponding to the link aggregation group and a flow entry of the at least one physical function device in the network card aggregation group in the flow table are deleted.
[0044] In one of the embodiments, the method further includes:
[0045] In a port start-up stage of the representative port device, a property acquisition request of the representative port device sent by the host device is received;
[0046] Property information of the representative port device is sent to the host device;
[0047] Setting indication information of a steering entry of the representative port device corresponding to the property information is received, which is sent by the host device;
[0048] In response to the setting indication information, a steering rule of the representative port device in a receiving direction and a sending direction is set in the steering entry of the representative port device.
[0049] In one of the embodiments, the method further comprises:
[0050] A capability information acquisition request of a detected physical function device is received, which is sent by the host device, and the type of the detected physical function device is not a representative port device of a link aggregation group;
[0051] Hardware capability information of the detected physical function device is sent to the host device, and the hardware capability information is used for initialization generation of a kernel network driver of the detected physical function device to generate setting information of the physical function device;
[0052] The setting information of the detected physical function device is received, which is sent by the host device;
[0053] According to the setting information of the physical function device, a transceiving queue and a steering table of the detected physical function device are set.
[0054] In one of the embodiments, the method further comprises:
[0055] In response to the setting request of the representative port device, a physical function entry of the representative port device of the link aggregation group is added in device data of a storage file;
[0056] After detecting that the network card device is started, device data in the storage file is read;
[0057] According to the device data, a forwarding domain and a physical connection state of the representative port device are associated with the link aggregation group.
[0058] In a third aspect, the application provides a hardware link aggregation deployment device, which is applied to a host device and comprises:
[0059] A first processing module is configured to create a network card aggregation group in response to a network card aggregation configuration request, and the network card aggregation group comprises at least one physical function device;
[0060] The first sending module is configured to send, to the network card device, a creation message of a link aggregation group corresponding to the network card aggregation group, if the unloading condition of the network card aggregation group is met.
[0061] The unloading condition of the network card aggregation group comprises that the at least one physical function device has a member capability of the link aggregation group; the creation message of the link aggregation group is used to instruct the network card device to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an unloaded state; and the representative port device is used for a user mode driver of the host device to control in a virtual function input / output manner.
[0062] In one of the embodiments, the creation message of the link aggregation group comprises member link information of the link aggregation group, and the member link information of the link aggregation group is used to modify a correspondence between a physical port and the link aggregation group in a receiving port table of the network card device.
[0063] In one of the embodiments, the device further comprises:
[0064] The first receiving module is configured to receive an LACP (Link Aggregation Control Protocol) protocol packet sent by the network card device, if an aggregation mode corresponding to the link aggregation group is an LACP mode, and the LACP protocol packet is used to negotiate an activated member of the network card aggregation group.
[0065] The first processing module is further configured to update a state of the negotiated activated member to an activated link state of the link aggregation group.
[0066] The first sending module is further configured to send information of the activated member to the network card device, and the information of the activated member is used to set a register corresponding to the link aggregation group.
[0067] In one of the embodiments, the first sending module is further configured to send, to the network card device, a deletion message of a link aggregation group corresponding to the network card aggregation group, in response to a network card aggregation deletion request.
[0068] The deletion message of the link aggregation group is used to instruct the network card device to delete setting information in the register corresponding to the link aggregation group and a flow entry of the at least one physical function device in the network card aggregation group in a flow table.
[0069] In one of the embodiments, the first sending module is further configured to send, to the network card device, an attribute acquisition request of the representative port device in a port startup stage of the representative port device; and send, to the network card device, setting indication information of a flow entry of the representative port device according to 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 of the embodiments, the first processing module is further configured to, when detecting that the network card device is started, detect a physical function device configured in the network card device and acquire identification information of the detected physical function device; determine a type of the detected physical function device according to the identification information of the detected physical function device; and load a kernel network driver of the detected physical function device in a case where the type of the detected physical function device is not a representative port device of a link aggregation group.
[0072] In one of the embodiments, the first sending module is further configured to send a capability information acquisition request of the detected physical function device to the network card device; and send setting information of the detected physical function device to the network card device.
[0073] The first receiving module is further configured to receive 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, to obtain setting information of the physical function device, the setting information being used to instruct to set a transmit-receive queue and a flow table of the detected physical function device.
[0075] In a fourth aspect, the present application further provides a hardware link aggregation deployment apparatus applied to a network card device, comprising:
[0076] The second receiving module is configured to receive a creation message of a link aggregation group corresponding to a network card aggregation group sent by a host device in a case where an offloading condition of the network card aggregation group is met, the network card aggregation group comprising at least one physical function device, and the offloading condition of the network card aggregation group comprising that all the at least one physical function device has a member capability of the link aggregation group.
[0077] The second processing module is configured to, in response to the creation message of the link aggregation group, activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state, the representative port device being used for a user space driver of the host device to control in a virtual function input-output manner.
[0078] In one of the embodiments, the creation message of the link aggregation group comprises member link information of the link aggregation group; and the second processing module is further configured to modify a correspondence relationship between a physical port and the link aggregation group in a receiving port table of the network card device according to the member link information of the link aggregation group.
[0079] In one of the embodiments, the second processing module is further configured to create a steering table corresponding to the link aggregation group if the aggregation mode corresponding to the link aggregation group is a link aggregation control protocol (LACP) mode; and set a register corresponding to the link aggregation group according to the information of the active member.
[0080] The apparatus further includes a second sending module configured to send a LACP protocol packet to the host device according to the steering table corresponding to the link aggregation group, the LACP protocol packet being used to negotiate the active member of the network card aggregation group.
[0081] The second receiving module is further configured to receive the information of the active member sent by the host device.
[0082] In one of the embodiments, the second receiving module is further configured to receive a deletion message of the link aggregation group sent by the host device.
[0083] The second processing module is further configured to delete the setting information in the register corresponding to the link aggregation group and the steering entry of at least one physical function device in the network card aggregation group in the steering table in response to the deletion message of the link aggregation group.
[0084] In one of the embodiments, the second receiving module is further configured to receive an attribute acquisition request of the representative port device sent by the host device in a port startup stage of the representative port device; and receive setting indication information of the steering 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 set the steering rules of the representative port device in the receiving direction and the sending direction in the steering entry of the representative port device in response to the setting indication information.
[0087] In one of the embodiments, the second receiving module is further configured to receive a capability information acquisition request of a detected physical function device sent by the host device, the type of the detected physical function device not being a representative port device of a link aggregation group; and receive setting information of the detected physical function device sent by the host device.
[0088] The second sending module is further configured to send hardware capability information of the detected physical function device to the host device, the hardware capability information being used for the kernel network driver of the detected physical function device to generate the setting information of the physical function device in an initialization process.
[0089] The second processing module is further configured to set a transceiving queue and a flow table of the detected physical function device according to the setting information of the physical function device.
[0090] In one of the embodiments, 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 in device data of a storage file; read the device data in the storage file after detecting that the network card device is started; and associate a forwarding domain and a physical connection state of the representative port device with the link aggregation group according to the device data.
[0091] In a fifth aspect, the present application further provides a CPU chip, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in the first aspect when executing the computer program.
[0092] In a sixth aspect, the present application further provides a DPU chip, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in the first aspect when executing the computer program.
[0093] In a seventh aspect, the present application further provides a computer device, comprising a processor and the DPU chip in the sixth aspect, the chip is used for scheduling a packet to the processor or processing the packet by itself, and the processor is used for processing the packet scheduled by the chip.
[0094] In an eighth aspect, the present application further provides a network interface card, comprising the chip in the sixth aspect and an interface, and the chip communicates with the outside through the interface.
[0095] In a ninth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method in the first aspect or the second aspect when executed by a processor.
[0096] In a tenth aspect, the present application further provides a computer program product, comprising a computer program, and the computer program implements the steps of the method in the first aspect or the second aspect when executed by a processor.
[0097] The deployment method, device, chip, equipment, network interface card, storage medium and program product of the hardware link aggregation create a network card aggregation group in response to a network card aggregation configuration request, the network card aggregation group including at least one physical function device; and send a creation message of a link aggregation group corresponding to the network card aggregation group to a network card device in a case where an offloading condition of the network card aggregation group is met, the offloading condition of the network card aggregation group including that at least one physical function device has a member capability of the link aggregation group, and the creation message of the link aggregation group being used to instruct the network card device to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state, and the representative port device being used for a user mode driver of the host device to control in a virtual function input / output manner. In the embodiment of the present application, when the physical function devices in the created network card aggregation group all have the member capability of the link aggregation group, the creation message of the link aggregation group is sent to the network card device, so as to activate the representative port device mapped by the link aggregation group, and the user mode driver is controlled in the virtual function input / output manner by the representative port device, and the service traffic is directly carried on the aggregated link group of the network card device. Since it is not required to enable a single root input / output virtualization of a certain physical function device in the network card aggregation group, the user mode driver can directly take over the physical function device without starting the single root input / output virtualization. BRIEF DESCRIPTION OF DRAWINGS
[0098] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0099] Figure 1 An application environment diagram of a hardware link aggregation deployment method provided by the embodiments of the present application;
[0100] Figure 2 A principle diagram of a hardware link aggregation deployment method provided by the embodiments of the present application;
[0101] Figure 3 A signaling interaction diagram of a hardware link aggregation deployment method provided by the embodiments of the present application;
[0102] Figure 4 A signaling interaction diagram of another hardware link aggregation deployment method provided by the embodiments of the present application;
[0103] Figure 5 A signaling interaction diagram of still another hardware link aggregation deployment method provided by the embodiments of the present application;
[0104] Figure 6 A structural block diagram of a hardware link aggregation deployment device provided for an embodiment of the present application is provided.
[0105] Figure 7 A structural block diagram of another hardware link aggregation deployment device provided for an embodiment of the present application is provided.
[0106] Figure 8 An internal structural diagram of a computer device provided for an embodiment of the present application is provided. DETAILED DESCRIPTION
[0107] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0108] First, the related art will be described below.
[0109] In chip technology, a Link Aggregation Group (LAG) bundles multiple physical network interfaces into one logical interface, thereby increasing link bandwidth, improving link reliability, and achieving load balancing.
[0110] Through the LAG technology, multiple physical network interfaces corresponding to physical links can be bundled into one whole, and when a certain physical link fails, traffic can be automatically switched to other normal links in the LAG, thereby ensuring the continuity of the service. At the same time, in the process of data transmission, the LAG can distribute traffic to each member link in the LAG according to a preset traffic distribution algorithm, thereby achieving effective utilization of bandwidth.
[0111] In the related art, hardware LAG offloading is achieved by offloading the kernel's network card aggregation (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, the network card hardware needs to rely on the network protocol stack of the host kernel to process protocol packets when implementing hardware LAG offloading. Two or more physical function (Physical Function, PF) devices are configured to a BOND group through the private kernel network driver, and then the BOND group is offloaded to the firmware side of the network card hardware.
[0112] The network card hardware can include an intelligent network or a data processing unit (Data Processing Unit, DPU).
[0113] However, when the hardware LAG offload is achieved by the above manner, the PF device needs to be taken over by the network driver of the kernel, in order for the user process to pass the service data through the kernel protocol stack and the network card, the kernel network driver can be exited first, and then the user state is taken over through the virtual function input / output (Virtual Function I / O, VFIO) mode.
[0114] It should be understood that in direct memory access, virtual function input / output (Virtual Function I / O, VFIO) plays a key role. Through input / output memory management unit (Input / Output Memory Management Unit, IOMMU) mapping, VFIO can map the direct memory access (Direct Memory Access, DMA) physical memory address of the device to the user state. Thus, the user state program has the ability to independently control data transmission, and allows the user state program to register an interrupt processing function by itself, and realizes the function of the device driver in the user state. Through VFIO, device pass-through can be realized, so that the user state driving device can directly interact with the network card hardware, successfully avoiding part of the processing flow of the kernel protocol stack, and significantly improving the efficiency and flexibility of data transmission.
[0115] In the scenario where the user state traffic is carried on the hardware LAG, since the PF device has been taken over by the kernel network driver of the host side as a BOND group member, it is necessary to enable single root I / O virtualization (Single Root I / O Virtualization, SRIOV) for a certain PF device of one of the BOND group members to generate a virtual function (Virtual Function, VF) device, and then provide the VF device for the user state driving in the VFIO mode. Therefore, the hardware LAG offload in the related art cannot directly take over the PF device by the user state driving without starting single root I / O virtualization.
[0116] To solve the above technical problems, the embodiments of the present application provide a hardware link aggregation deployment method, device, chip, equipment, network interface card, storage medium and program product. When the physical function devices in the created network card aggregation group all have the member capability of the link aggregation group, the host device sends a creation message of the link aggregation group to the network card device, thereby activating the representative port device mapped by the link aggregation group, and the representative port device is used to provide the user state driving in the virtual function input / output mode for control, and the service traffic is directly carried on the aggregation link group of the network card device. Since it is not necessary to enable single root I / O virtualization for a certain physical function device in the network card aggregation group, the physical function device can be directly taken over by the user state driving without starting single root I / O virtualization.
[0117] The hardware link aggregation deployment method provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 . A user inputs a network card aggregation configuration request to the host device 101, and the host device 101 creates a network card aggregation group in response to the network card aggregation configuration request, wherein the network card aggregation group includes at least one physical function device. Subsequently, the host device 101 sends a creation message of a link aggregation group corresponding to the network card aggregation group to the network card device 102 in the case that the unloading condition of the network card aggregation group is met, wherein the unloading condition of the network card aggregation group includes that each of the at least one physical function device has the member capability of the link aggregation group. The network card device 102 activates a representative port device mapped by the link aggregation group and sets the link aggregation group to an unloaded state in response to the creation message of the link aggregation group, and the representative port device is used for the user mode driver of the host device to control in the manner of virtual function input and output.
[0118] Wherein, the above-mentioned host device 101 and network card device 102 can be two devices interacting with each other, or can be integrated in a DPU, and the embodiments of the present application do not limit this.
[0119] Figure 2 The principle diagram of the hardware link aggregation deployment method provided by the embodiments of the present application is as shown in Figure 2 . The user mode of the host device side maps the PF device as a representative device (LAG0 REP PF2) of a link aggregation group (LAG0). After the host device side core network card aggregation group (BOND0) is unloaded to the firmware of the network card device, the representative port device (LAG0 REP PF2) mapped by the link aggregation group (LAG0) is activated, and the representative port device (LAG0 REP PF2) is used for the user mode driver of the host device to control in the manner of virtual function input and output, so as to realize the transmission of service traffic on the link aggregation group, so as to achieve the purposes of increasing link bandwidth, improving link reliability and realizing load balancing.
[0120] In an exemplary embodiment, as shown in Figure 3 , a hardware link aggregation deployment method is provided, and the host device and the network card device in Figure 1 are taken as examples for illustration. The hardware link aggregation deployment method includes S201 to S203.
[0121] S201, the host device creates a network card aggregation group in response to a network card aggregation configuration request.
[0122] In some embodiments, the above network card aggregation configuration request is used to instruct the host device to create a network card aggregation group (BOND) in the kernel configuration. The network card aggregation configuration request can indicate the aggregation mode of the network card aggregation group, the identification information of the network card aggregation group, the member port of the network card aggregation group, etc.
[0123] Among them, the network card aggregation group includes at least one physical function (Physical Function, PF) device.
[0124] For example, a user can create a network card aggregation group with identification information BOND0 by sending a network card aggregation configuration request to the host device, and then add two PF devices as master members in BOND0, including PF0 and PF1. Finally, set the aggregation mode of BOND0 to Link Aggregation Control Protocol (LACP) mode (i.e., mode 4).
[0125] S202, the host device sends a creation message of the link aggregation group corresponding to the network card aggregation group to the network card device if the offloading condition of the network card aggregation group is met.
[0126] In this step, after the host device creates the network card aggregation group, it can be determined whether the offloading condition of the network card aggregation group is met. If the offloading condition of the network card aggregation group is not met, the deployment of the hardware link aggregation is ended. If the offloading condition of the network card aggregation group is met, the host device sends a creation message of the link aggregation group corresponding to the network card aggregation group to the network card device.
[0127] It should be understood that the embodiments of the present application do not limit the offloading condition of the network card aggregation group. In some embodiments, the offloading condition of the network card aggregation group includes that at least one physical function device has the member capability of the link aggregation group. That is, when the physical function devices in the same network card aggregation group all have the member capability of the link aggregation group, the host device can send a creation message of the link aggregation group to the network card device to deploy the hardware link aggregation group.
[0128] Among them, the physical function devices all have the member capability of the link aggregation group, that is, the network card device associated with the physical function device has the capability of executing link aggregation logic directly at the hardware level without relying on the host and kernel protocol stack.
[0129] For example, the above creation message of the link aggregation group can be generated by converting the information of the network card aggregation group and the member information in the network card aggregation group.
[0130] S203, the network card device activates the representative port device mapped by the link aggregation group and sets the link aggregation group to an offloaded state in response to the creation message of the link aggregation group.
[0131] In this step, when the network card device receives the creation message of the link aggregation group, the representative port device mapped by the link aggregation group can be activated in response to the creation message of the link aggregation group, and the link aggregation group is set to an offloaded state.
[0132] The representative port device can be a pre-configured physical function device, which is a representative port (REP) of a corresponding group of link aggregation groups, and is a PF device of a 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 host device user mode driver can be controlled by the representative port device in the VFIO manner after the network card device activates the representative port device mapped by the link aggregation group in response to the creation message of the link aggregation group, and the service traffic is directly carried on the aggregation link group of the network card device, without the need to enable SRIOV for a certain physical function device in the network card aggregation group, thereby realizing that the user mode driver directly takes over the physical function device without starting SRIOV, and increasing link bandwidth, improving link reliability, and realizing load balancing.
[0134] In some embodiments, the creation message of the link aggregation group includes member link information of the link aggregation group. Correspondingly, the network card device can modify the correspondence between the physical port and the link aggregation group in the receive port table after receiving the creation message of the link aggregation group.
[0135] The member link information of the link aggregation group is used to modify the correspondence between the physical port and the link aggregation group in the receive port table of the network card device. The physical port can be a receive (RX) port.
[0136] For example, the member link information of the link aggregation group (BOND0) can indicate the corresponding receive (RX) port, for example, it can indicate physical port 0 (physical port 0) and physical port 1 (physical port 1). Then, in the RX port table, the firmware of the network card device will correspond physical port 0 and physical port 1 to BOND0 respectively.
[0137] In some embodiments, after sending the creation message of the link aggregation corresponding to the network card aggregation group to the network card device, if the aggregation mode corresponding to the link aggregation group is the LACP mode, the network card device can create the flow table corresponding to the link aggregation group. Subsequently, the network card device sends the LACP protocol packet to the host device, and the LACP protocol packet is used to negotiate the active member of the network card aggregation group. Finally, the host device updates the state of the negotiated active member to the active link state of the link aggregation group, and sends the information of the active member to the network card device, and the information of the active member is used to set the register corresponding to the link aggregation group.
[0138] In the LACP mode, the multiple physical links of the two end devices (e.g., the host and the switch) can be bound as a logical aggregation link through dynamic negotiation.
[0139] For example, in the preset mode number, the LACP mode can correspond to mode 4. When the network card device detects that the aggregation mode of the created network card aggregation group is mode 4, the firmware of the network card device can create the flow table corresponding to the link aggregation group, so that the kernel network protocol stack of the host device can receive the LACP protocol packet. Through the interaction of the LACP protocol packet, the negotiation of the active member of the network card aggregation group can be completed.
[0140] For example, after the BOND group negotiates the active member, the kernel network of the host device can update the state of the active member to the active link (physical port) state of the link aggregation group, and send the information of the active member to the network card device to inform the network card device of the active member in the active link (physical port) state. After receiving the information of the active member, the network card device can set a series of registers related to the link aggregation group to create the relationship between the link aggregation group and the active member (physical port), so that the link aggregation group on the network card device side is in the active state.
[0141] In some embodiments, in response to the network card aggregation deletion request, the host device can also send a deletion message of the link aggregation group to the network card device. Subsequently, in response to the deletion message of the link aggregation group, the network card device deletes at least one of the setting information in the register corresponding to the link aggregation group and the flow entry of the at least one physical function device in the network card aggregation group in the flow table.
[0142] For example, the user can send a network card aggregation deletion request to the host device to instruct the pursuit device to delete the kernel network card aggregation group (BOND0). Then, the host device converts the network card aggregation deletion request into a deletion message of a link aggregation group (LAG0) corresponding to the network card aggregation group, and sends the deletion message of the link aggregation group (LAG0) to the network card device. After the firmware of the network card device receives the deletion message of the link aggregation group (LAG0), the firmware can delete the setting message in the LAG0 related register, and delete the flow table entry of the protocol packet of PF0 and PF1 in BOND0, so that all the packets sent to LAG0 will be discarded by the network card device.
[0143] The hardware link aggregation deployment method provided in the embodiments of the present application responds to a network card aggregation configuration request to create a network card aggregation group, and the network card aggregation group includes at least one physical function device. In the case that an offloading condition of the network card aggregation group is met, a creation message of a link aggregation group corresponding to the network card aggregation group is sent to a network card device. The offloading condition of the network card aggregation group includes that at least one physical function device has a member capability of the link aggregation group. The creation message of the link aggregation group is used to instruct the network card device to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state. The representative port device is used for a user mode driver of the host device to control in a virtual function input / output manner. In the embodiments of the present application, when the physical function devices in the created network card aggregation group all have the member capability of the link aggregation group, the creation message of the link aggregation group is sent to the network card device, so as to activate the representative port device mapped by the link aggregation group, and the representative port device is used for the user mode driver to control in the virtual function input / output manner. The service traffic is directly carried on the aggregation link group of the network card device. Since a single root input / output virtualization of a certain physical function device in the network card aggregation group is not enabled, the user mode driver can directly take over the physical function device without starting the single root input / output virtualization.
[0144] In the present application, since the user mode driver directly takes over the physical function device without starting the single root input / output virtualization, the maintenance cost is lower. The user can take over the representative port device in a VFIO manner without starting the single root input / output virtualization, so that the service traffic of the user mode process can be directly forwarded on the link of the LAG of the network card device without passing through the kernel protocol stack, and the flexibility of user deployment is provided.
[0145] The firmware flow processing after the host device controls the representative port device is described below. Figure 4 Another signaling interaction diagram of the hardware link aggregation deployment method provided in the embodiments of the present application is shown in FIG. 3. Figure 4 The hardware link aggregation deployment method includes S301 to S307.
[0146] S301, the host device creates a network card aggregation group in response to a network card aggregation configuration request.
[0147] S302, the host device sends a creation message of a link aggregation group corresponding to the network card aggregation group to the network card device in the case that the unloading condition of the network card aggregation group is met.
[0148] S303, the network card device activates a representative port device mapped by the link aggregation group and sets the link aggregation group to an unloaded state in response to the creation message of the link aggregation group.
[0149] S304, the host device sends an attribute acquisition request of the representative port device to the network card device in a port startup stage of the representative port device.
[0150] S305, the network card device sends attribute information of the representative port device to the host device.
[0151] The attribute acquisition request is used to acquire the attribute information of the representative port device, and the attribute information is used to reflect the hardware capability of the representative port device, including indication information of whether a port corresponding to the representative port device is a representative port of a LAG, and forwarding domain information of the representative port device.
[0152] The forwarding domain information of the representative port device can be identification information of the LAG mapped by the representative port device, and the forwarding domain information of other physical function devices other than the representative port device can be a physical port ID.
[0153] Correspondingly, after the user-mode network driver of the host device takes over the representative port device in the VFIO mode, the user-mode network driver can send the attribute acquisition request of the representative port device to the network card device in a startup stage of the representative port device, so as to receive the attribute information of the representative port device sent by the network card device to the host device, and determine whether the attribute information is a representative port of a LAG and the forwarding domain of the representative port device.
[0154] S306, the host device sends setting indication information of a flow diversion entry of the representative port device to the network card device according to the attribute information of the representative port device.
[0155] The user-mode network driver of the host device can determine that the representative port device is a representative port of a LAG and determine the forwarding domain of the representative port device based on the attribute information of the representative port device after the user-mode network driver is loaded, and can send the setting indication information of the flow diversion entry of the representative port device to the network card device, so as to set the flow diversion entry of the representative port device based on the forwarding domain of the representative port device.
[0156] The flow diversion entry can include a plurality of flow diversion rule information for condition matching and processing of traffic of the representative port device.
[0157] S307, the network card device sets the flow steering rules of the representative port device in the receiving direction and the sending direction in the flow steering entry of the representative port device in response to the setting indication information.
[0158] The flow steering rules include a rule of matching a flow condition and a rule of processing the flow.
[0159] It should be understood that since the firmware of the network card device determines that the forwarding domain of the representative port device is the LAG domain, accordingly, the firmware of the network card device iterates all member links in the LAG, and sets the flow steering rules of the representative port device in the receiving direction (RX) and the sending direction (TX) in the flow steering entry of the representative port device based on the setting indication information, to ensure that the flow steering rules take effect in the range of multiple member links in the LAG group associated with the representative port device.
[0160] For example, since the physical port of each corresponding physical function device in the LAG is assigned a corresponding identifier in advance and is bound to the identifier of the LAG, when the firmware of the network card device receives the setting indication information of the flow steering entry, the flow steering rules can be set in the receiving direction and the sending direction, so that the service data entering from any physical port can be correctly identified and forwarded to the corresponding representative port device of the LAG.
[0161] It should be noted that after the setting of the flow steering rules is completed, the LACP packet received by the physical port is still sent to the physical function device of the kernel of the host device, and is processed by the kernel network protocol stack.
[0162] In some embodiments, on the network card forwarding chip, a default flow steering rule of the corresponding representative port device in the sending direction (TX) can also be set, which takes effect in the LAG forwarding domain and the destination port is not LAG.
[0163] In some embodiments, when the user mode driver of the host device exits the control of the representative port device, the host device can send a notification message to the firmware of the network card device to instruct the firmware of the network card device to delete the flow steering entry and / or the flow steering rules in the receiving direction and the sending direction. At this time, the representative port device does not receive any packet in the receiving direction, and all packets sent in the sending direction are discarded by the network card device.
[0164] It should be noted that S304 to S307 can be after S301 to S303, can be before S301 to S303, and the embodiments of the present application do not limit this. In some embodiments, the user state of the host device can first control the representative port device in the VFIO mode and set the flow diversion rule. At this time, the traffic or message cannot be temporarily transmitted, and the user can use the Internet Protocol Link (IP Link) command to configure the network card aggregation group, and offload the hardware LAG to the fixed network card device.
[0165] The configuration of the representative port device will be described below. Figure 5 Another signaling interaction diagram of a hardware link aggregation deployment method provided by the embodiments of the present application is shown in Figure 5 The hardware link aggregation deployment method includes S401 to S413.
[0166] S401, the network card device increases the physical function entry of the representative port device of the link aggregation group in the device data of the storage file in response to the setting request of the representative port device.
[0167] In the present application, the physical function entry of the representative port device of the link aggregation group in the device data of the storage file can be increased by sending a setting request of the representative port device to the network card device, so as to set the representative port device mapped by the link aggregation group.
[0168] The storage file can be a Non-Volatile Memory (NVM) configuration file.
[0169] For example, through the setting request of the representative port device, the device data of the NVM configuration file can be configured, the physical function entry of the representative port device of the link aggregation group is increased, and the physical function device in a certain PCIe is defined as the representative port of a certain hardware LAG.
[0170] For example, a PF entry can be added in the NVM configuration file as the physical function entry of the representative port device of the link aggregation group. In the PF entry, the identifier of the representative port device is 2, the corresponding LAG identifier is 0, and the indication message (lag rep flag) of the LAG representative port device 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, for example, a mapping relationship parameter between the physical function device and the LAG. That is, the physical function entry can not only include the identifier information of the physical function device and the related parameters of the LAG, but also include the mapping relationship parameter between the physical function device and the LAG.
[0172] The identification information of the physical function device can include a device ID, a manufacturer identification code ID, and the like of the physical function device, and the representative port device can be accurately identified through the identification information of the physical function device. The related parameters of the LAG can include an LAG ID, a member link list, and the like, and the composition structure and characteristics of the hardware LAG can be described in detail through the related parameters of the LAG.
[0173] The mapping relationship parameter between the physical function device and the LAG binds the representative port device and the corresponding LAG in one-to-one through specific syntax and rules, so that the connection between the representative port device and the LAG can be quickly and accurately established according to the physical function item in the running process.
[0174] S402, the network card device reads the device data in the storage file after detecting that the network card device is started.
[0175] For example, after detecting the start, the network card device can first scan the NVM configuration file in the preset position of the storage medium. Then, the network card device reads and analyzes each parameter in the NVM configuration file line by line according to specific file parsing rules to obtain the device data.
[0176] S403, the network card device associates the forwarding domain and the physical connection state of the representative port device with the link aggregation group according to the device data.
[0177] For example, the configurations of all the physical function devices supported by the network card are saved in the device data of the NVM configuration file. Correspondingly, the firmware of the network card device can load the configuration data of all the physical function devices in the device data during the initialization process after the start, so as to associate the forwarding domain and the physical connection state of the representative port device with the link aggregation group.
[0178] For example, for the physical function device of the representative port device, the forwarding domain can be set as the corresponding LAG domain, and the member links included in the LAG domain are determined by the configuration of the LAG itself. Correspondingly, the physical connection state of the representative port device is associated with the LAG. After the physical connection state of the representative port device is associated with the LAG, only when all the member links of the LAG are disconnected, the firmware of the network card device will change the physical connection state of the representative port device from the connected state to the disconnected state, and will notify the user state of the host device in the form of an event.
[0179] For example, for the physical function device of the non-representative port device, the forwarding domain can be set as a certain physical link, and correspondingly, the physical connection state of the physical function device of the non-representative port device can be consistent with the state of the corresponding physical link.
[0180] S404, when detecting that the network card device is started, the host device probes the physical function device configured in the network card device and obtains the identification information of the detected physical function device.
[0181] In some embodiments, when detecting that the network card device is started, the host device can determine the physical function device configured in the network card device through a probing (prob) mechanism.
[0182] The probing (prob) mechanism can be a process of scanning and discovering, driver matching, resource allocation and hardware activation of the physical function device in the network card device by the host device, so that the kernel in the host device fully controls the network card and determines the physical function device configured in the network card device.
[0183] S405, the host device determines the type of the detected physical function device according to the identification information of the detected physical function device.
[0184] The type of the physical function device can include the type of the representative port device and the type of the non-representative port device.
[0185] For example, the host device can distinguish whether the physical function device is of the type of the representative port device or the type of the non-representative port device based on the identification information of the physical function device, and the device identification information of the type of the representative port device can be set with a special flag bit.
[0186] S406, the host device loads the kernel network driver of the detected physical function device in the case that the type of the detected physical function device is not the representative port device of the link aggregation group.
[0187] In some embodiments, in the case that the type of the detected physical function device is the representative port device of the link aggregation group, the host device does not load the kernel network driver of the detected physical function device by default. In the case that the type of the detected physical function device is not the representative port device of the link aggregation group, the host device loads the kernel network driver of the detected physical function device. In this way, the number of physical function devices and the number of physical ports seen by the user through the IP link display (ip link show) information in the kernel remain consistent.
[0188] It should be understood that the embodiments of the present application do not limit how the kernel network driver of the detected physical function device is loaded. In some embodiments, the host device can send a capability information acquisition request of the detected physical function device to the network card device. The network card device then sends the hardware capability information of the detected physical function device to the host device. The host device initializes the kernel network driver of the detected physical function device according to the hardware capability information, and obtains the setting information of the physical function device. Finally, the host device sends the setting information of the detected physical function device to the network card device, and the network card device sets the transmit-receive queue and the flow table of the detected physical function device according to the setting information of the physical function device.
[0189] The hardware capability information can include forwarding domain information of the physical function device, offload capability information of the PF hardware physical function device, and LAG identification information to which the physical function device belongs.
[0190] For example, based on the forwarding domain information of the physical function device, the offload capability information of the PF hardware physical function device, and the LAG identification information to which the physical function device belongs, the host device initializes the kernel network driver of the detected physical function device, determines the setting information of the physical function device, and then sends the setting information of the physical function device to the network card device to set the transmit-receive queue and the flow table of the detected physical function device.
[0191] The setting information of the physical function device includes the setting information of the transmit-receive queue and the device of the flow table. For example, by setting the transmit-receive queue and the flow entry in the flow table, the traffic forwarding of the physical function device is one-to-one corresponding to the physical link corresponding thereto. At this time, the physical function device (for example, PF0 and PF1) can normally transmit and receive packets, and the link connection state is one-to-one corresponding to the physical link (for example, physical port 0 and physical port 1) corresponding thereto.
[0192] S407, the host device creates a network card aggregation group in response to a network card aggregation configuration request.
[0193] S408, the host device sends a creation message of a link aggregation group corresponding to the network card aggregation group to the network card device under the condition that the offload condition of the network card aggregation group is met.
[0194] S409, the network card device activates the representative port device mapped by the link aggregation group and sets the link aggregation group to an offloaded state in response to the creation message of the link aggregation group.
[0195] S410, the host device sends an attribute acquisition request of the representative port device to the network card device in a port startup stage of the representative port device.
[0196] S411, the network card device sends attribute information of the representative port device to the host device.
[0197] S412, the host device sends setting indication information of the representative port device to the network card device according to the attribute information of the representative port device.
[0198] S413, the network card device sets the flow steering rules of the representative port device in the receiving direction and the sending direction in the flow steering entry of the representative port device in response to the setting indication information.
[0199] In the present application, since the association between the representative port device and the 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 sequence between the kernel BOND configuration and the user state network drive control representative port operation. 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 state network drive. The firmware of the network card device can still correctly release the related forwarding resources and will not cause resource residue. Since there is no need for the user to change the existing configuration habit, the network drive does not load the representative port device, and the number of physical function devices queried by the user in the kernel state remains consistent with the number of physical network ports. Correspondingly, if the representative port device is not needed, the device can also not be loaded, and the PF function and the SRIOV function of the kernel are not affected.
[0200] The hardware link aggregation deployment method provided in the embodiments of the present application creates a network card aggregation group in response to a network card aggregation configuration request, the network card aggregation group including at least one physical function device; in the case that the unloading condition of the network card aggregation group is met, a creation message of a link aggregation group corresponding to the network card aggregation group is sent to the network card device; wherein the unloading condition of the network card aggregation group includes that each of the at least one physical function device has a member capability of the link aggregation group; the creation message of the link aggregation group is used to instruct the network card device to activate a 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 state drive of the host device to control in a virtual function input and output manner. In the embodiments of the present application, when each of the physical function devices in the created network card aggregation group has the member capability of the link aggregation group, the creation message of the link aggregation group is sent to the network card device, so as to activate the representative port device mapped by the link aggregation group, and the user state drive is controlled in a virtual function input and output manner by the representative port device, and the service traffic is directly carried on the aggregation link group of the network card device. Since it is not necessary to enable single root input and output virtualization of a certain physical function device in the network card aggregation group, the user state drive can directly take over the physical function device under the condition that the single root input and output virtualization is not started.
[0201] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately executed with other steps or steps or stages in other steps.
[0202] Based on the same inventive concept, the embodiments of the present application also provide a hardware link aggregation deployment apparatus for implementing the above-mentioned hardware link aggregation deployment method on the host device side. The problem-solving implementation scheme provided by the apparatus is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more hardware link aggregation deployment apparatus embodiments provided below can refer to the limitations of the hardware link aggregation deployment method on the host device side described above, and will not be described here again.
[0203] In one exemplary embodiment, as shown in Figure 6 a hardware link aggregation deployment apparatus 500 is provided, comprising: a first processing module 501, a first sending module 502, and a first receiving module 503, wherein:
[0204] The first processing module 501 is configured to create a network card aggregation group in response to a network card aggregation configuration request, the network card aggregation group including at least one physical function device.
[0205] The first sending module 502 is configured to send a link aggregation group creation message corresponding to the network card aggregation group to a network card device in the case that the offloading condition of the network card aggregation group is met.
[0206] The offloading condition of the network card aggregation group includes that at least one physical function device has a member capability of the link aggregation group; the link aggregation group creation message is used to instruct the network card device to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state; and the representative port device is used for the user mode driver of the host device to control in a virtual function input and output manner.
[0207] In some embodiments, the link aggregation group creation message includes member link information of the link aggregation group, and the member link information of the link aggregation group is used to modify the correspondence between the physical port and the link aggregation group in the receiving port table of the network card device.
[0208] In some embodiments, the hardware link aggregation deployment apparatus 500 further comprises:
[0209] The first receiving module 503 is configured to receive an LACP protocol packet sent by the network card device if the aggregation mode corresponding to the link aggregation group is an LACP mode, and the LACP protocol packet is used to negotiate the active member of the network card aggregation group.
[0210] The first processing module 501 is further configured to update the state of the negotiated active member to the active link state of the link aggregation group.
[0211] The first sending module 502 is further configured to send the information of the active member to the network card device, and the information of the active member 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 card aggregation group to the network card device in response to a network card aggregation deletion request.
[0213] The deletion message of the link aggregation group is used to instruct the network card device to delete at least one of the setting information in the register corresponding to the link aggregation group and the steering entry of the at least one physical function device in the network card aggregation group in the steering table.
[0214] In some embodiments, the first sending module 502 is further configured to send an attribute acquisition request of the representative port device to the network card device in a port startup stage of the representative port device, and send setting indication information of the steering entry of the representative port device to the network card device according to the attribute information of the representative port device.
[0215] The first receiving module 503 is further configured to receive the 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 detect the physical function device configured in the network card device and acquire the identification information of the detected physical function device when detecting that the network card device is started, determine the type of the detected physical function device according to the identification information of the detected physical function device, and load the kernel network driver of the detected physical function device in a case where the type of the detected physical function device 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 capability information acquisition request of the detected physical function device to the network card device, and send the setting information of the detected physical function device to the network card device.
[0218] The first receiving module 503 is further configured to receive the hardware capability information of the detected physical function device sent by the network card device.
[0219] The first processing module 501 is further configured to initialize, according to the hardware capability information, a kernel network driver of the detected physical function device to obtain setting information of the physical function device, the setting information being used to indicate setting of a transmit queue and a flow table of the detected physical function device.
[0220] The modules in the deployment apparatus for hardware link aggregation described above can be implemented in whole or in part by software, hardware, or a combination thereof. The modules described above can be embedded in a processor in a hardware form or independent of the processor in the computer device, or stored in a memory in the computer device in a software form, so as to be invoked and executed by the processor to perform the operations corresponding to the modules.
[0221] Based on the same inventive concept, the embodiments of the present application further provide a deployment apparatus for hardware link aggregation for implementing the deployment method of hardware link aggregation on the side of the network card device. The apparatus provides a solution to the problem similar to the implementation solution described in the above method, and therefore the specific limitations in one or more deployment apparatus embodiments for hardware link aggregation provided below can be referred to the limitations of the deployment method of hardware link aggregation on the side of the network card device described above, which will not be repeated here.
[0222] In one exemplary embodiment, as shown in Figure 7 a deployment apparatus 600 for hardware link aggregation is provided, comprising a second receiving module 601, a second processing module 602, and a second sending module 603, wherein:
[0223] The second receiving module 601 is configured to receive a creation message of a link aggregation group corresponding to a network card aggregation group sent by a host device, in a case where an offloading condition of the network card aggregation group is met, the network card aggregation group comprising at least one physical function device, the offloading condition of the network card aggregation group comprising that at least one physical function device has a member capability of the link aggregation group.
[0224] The second processing module 602 is configured to activate a representative port device mapped by the link aggregation group and set the link aggregation group to an offloaded state in response to the creation message of the link aggregation group, the representative port device being used for a user space driver of the host device to control in a virtual function input / output manner.
[0225] In one embodiment, the creation message of the link aggregation group comprises member link information of the link aggregation group; and the second processing module is further configured to modify a correspondence between a physical port and the link aggregation group in a receiving port table of the network 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 an exemplary embodiment, a CPU chip is provided. The CPU chip comprises a memory and a processor, the memory stores a computer program, and the processor implements the method for deploying hardware link aggregation on the host device side when executing the computer program.
[0242] In an exemplary embodiment, a DPU chip is provided. The DPU chip comprises a memory and a processor, the memory stores a computer program, and the processor implements the method for deploying hardware link aggregation on the network card device side when executing the computer program.
[0243] In an exemplary embodiment, a network interface card (NIC) is provided. The network interface card comprises a DPU chip and a plurality of interfaces (e.g., PCI / PCIE interface, USB interface, etc.) as in the foregoing embodiment, and the DPU chip communicates with the outside through the interfaces.
[0244] In an exemplary embodiment, a computer device is provided. The computer device comprises a processor and a DPU chip or a network interface card as in the foregoing embodiment, the DPU chip is configured to schedule a packet to the central processor or the chip itself to process the packet, and the processor is configured to process the packet scheduled by the chip.
[0245] In an embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method for deploying hardware link aggregation on the host device side or the method for deploying hardware link aggregation on the network card device side.
[0246] In an embodiment, a computer program product is provided, and the computer program product comprises a computer program, and the computer program is executed by a processor to implement the method for deploying hardware link aggregation on the host device side or the method for deploying hardware link aggregation on the network card device side.
[0247] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., but is not limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but is not limited thereto.
[0248] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, it should be considered as the scope of the present application.
[0249] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to 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 (PFM) has the capability to be a member of the link aggregation group; the link aggregation group creation message is used to instruct the NIC 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 to be controlled by the host device's user-space driver in a virtual function input / output manner without enabling SRIOV, so as to directly carry service traffic on the NIC's aggregated link group; the representative port device can be a pre-configured physical functional device.
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 to the link aggregation group is activated and the link aggregation group is set to an unloaded state. The representative port device is used to be controlled by the user-space driver of the host device in the form of virtual function input / output without enabling SRIOV, so as to directly carry service traffic on the aggregated link group of the network interface card device. The representative port device can be a pre-configured physical function device.
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 (PFM) has the capability to be a member of the link aggregation group; the link aggregation group creation message is used to instruct the NIC 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 to be controlled by the host device's user-space driver in a virtual function input / output manner without enabling SRIOV, so as to directly carry service traffic on the NIC's aggregated link group; the representative port device can be a pre-configured physical functional device.
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 to be controlled by the user-mode driver of the host device in the form of virtual function input / output without enabling SRIOV, so as to directly carry service traffic on the aggregated link group of the network card device. The representative port device can be a pre-configured physical function device.
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
Multi-host network card port aggregation service hardware unloading system under celestial vein operating system
CN119383152A