A method and apparatus for intelligent network card link aggregation
By obtaining link aggregation information through the driver in user space, the technical problems of smart network interface cards (NICs) are solved, the reliability of smart NICs is improved, the problem of low communication reliability in link aggregation of smart NICs is solved, the reliability of data transmission is realized, the technical problems of smart NICs are solved, the communication technical problems of smart NICs are improved, and the reliability of link aggregation of smart NICs is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- RUIJIE NETWORKS CO LTD
- Filing Date
- 2023-03-08
- Publication Date
- 2026-05-19
AI Technical Summary
In link aggregation, when any physical port fails, the smart NIC cannot obtain the port status in time, causing data packets to still be sent to the faulty port, resulting in low communication reliability.
The link keep-alive information is obtained through the driver in user space to determine that the physical port is closed, and the physical port configuration of the aggregation interface is set to the disabled state to prevent data from being transmitted to the closed port.
It improves the reliability of data transmission in aggregated links and avoids data transmission failures.
Smart Images

Figure CN118631725B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method and apparatus for intelligent network interface card (NIC) link aggregation. Background Technology
[0002] Link aggregation (or bond) technology is widely used in the field of communication technology. Link aggregation combines multiple physical Ethernet links into a single logical link, creating redundancy between switches or between server network interface cards (NICs) and switches. While two or more links become redundant, the logical link can distribute the traffic load across the physical links, resulting in a bandwidth aggregation effect. NIC link aggregation effectively ensures network connectivity even if some links fail, achieving high availability and high reliability. Virtual bridges (Open vSwitch, OVS), the Data Plane Development Kit (DPDK) for user space data paths, operating system kernels (Linux), user space daemons (teamd), and switches all support bond technology.
[0003] Currently, smart network interface cards (NICs), like traditional Ethernet NICs, have two physical ports. Smart NICs support link aggregation by bundling the two physical ports to form an aggregated interface, thus providing link aggregation capabilities. However, due to the current link configuration, if either physical port fails, the aggregated interface cannot obtain the physical port's status in a timely manner. Therefore, data packets are still sent to the failed physical port, resulting in data transmission failure and low communication reliability. Summary of the Invention
[0004] This application provides a method for intelligent network interface card (NIC) link aggregation to improve the reliability of aggregated link data transmission.
[0005] In a first aspect, embodiments of this application provide a method for intelligent network interface card (NIC) link aggregation, comprising: a first device determining that a first physical port of the first device is closed through a first driver in user space, wherein the first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with an aggregation interface; the first device setting the physical port configuration of the aggregation interface through the first driver, such that the state of the first physical port in the physical port configuration is disabled.
[0006] According to this method, when the physical port is closed, the first device can set the physical port configuration of the aggregation interface through the first driver, so that the state corresponding to the first physical port in the physical port configuration is changed to the disabled state. Therefore, the data transmission between the aggregation interface and the first physical port can be stopped in time to avoid sending data packets to the closed physical port, thereby improving the reliability of data transmission of the aggregation link.
[0007] In one possible embodiment, the first device determines that the first physical port of the first device is closed through a first driver in the user space, including: the first device obtains link keep-alive information through a second driver in the user space, the link keep-alive information being used to indicate that the link corresponding to the first physical port is interrupted; the first device configures the port state of a first virtual port to a first state through the second driver, the first virtual port corresponding to the first physical port.
[0008] According to this method, the first device can obtain link keep-alive information through the second driver in the user space, and determine whether the physical port is closed based on the link keep-alive information, which can improve the accuracy of determining whether the physical port is closed.
[0009] In one possible embodiment, the method further includes: the first device obtaining a link aggregation control protocol message through the second driver, the link aggregation control protocol message including the link keep-alive information, the link aggregation control protocol message originating from the aggregation interface.
[0010] According to this method, the first device can obtain link keep-alive information from the link aggregation control protocol message from the aggregation interface through the second driver, thereby improving the efficiency of obtaining link keep-alive information.
[0011] In one possible embodiment, the first device determines that the first physical port of the first device is closed through a first driver in the user space, including: the first device polling and listening to the link status of the plurality of physical ports through the first driver to find out that the link corresponding to the first physical port is interrupted; the first device configuring the physical port status of the first virtual port to change to a first state through the first driver, wherein the first virtual port corresponds to the first physical port, and the port status of the first virtual port is the physical port status of the first physical port.
[0012] According to this method, the first device can determine whether a physical port is closed by monitoring the link status of the physical port, which can improve the accuracy of determining whether a physical port is closed.
[0013] In one possible embodiment, the method further includes: the first device forwarding the data to be sent to other physical ports other than the first physical port through the aggregation interface.
[0014] According to this method, the first device can send data through other physical ports that are not closed, which can improve data transmission efficiency.
[0015] Secondly, this application provides an apparatus for intelligent network interface card (NIC) link aggregation, the apparatus comprising:
[0016] The acquisition module is used to determine that the first physical port of the first device is closed through the first driver in the user space, wherein the first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with an aggregation interface; the processing module is used to set the physical port configuration of the aggregation interface through the first driver, such that the state of the first physical port in the physical port configuration is disabled.
[0017] In one possible embodiment, the acquisition module is specifically used to: acquire link keep-alive information through a second driver in the user space, the link keep-alive information being used to indicate a link interruption corresponding to the first physical port; and configure the port state of the first virtual port to change to a first state through the second driver, the first virtual port corresponding to the first physical port.
[0018] In one possible embodiment, the processing module is further configured to: obtain a link aggregation control protocol message through the second driver, the link aggregation control protocol message including the link keep-alive information, the link aggregation control protocol message originating from the aggregation interface.
[0019] In one possible embodiment, the processing module is specifically used to: poll and monitor the link status of the plurality of physical ports through the first driver to know that the link corresponding to the first physical port is interrupted; and configure the port status of the first virtual port to change to a first state through the first driver, wherein the first virtual port corresponds to the first physical port.
[0020] In one possible embodiment, the processing module is further configured to: forward the data to be sent to other physical ports other than the first physical port through the aggregation interface.
[0021] Thirdly, this application provides an electronic device, comprising:
[0022] Memory, used to store program instructions;
[0023] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method described in any one of the first aspects according to the obtained program instructions.
[0024] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method described in any one of the first aspects. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of an application scenario of an aggregated link in related technologies;
[0027] Figure 2 This application provides a schematic diagram of a smart network interface card (NIC) link aggregation process in an embodiment of the present application.
[0028] Figure 3 A schematic diagram of a processing procedure provided in an embodiment of this application;
[0029] Figure 4 This is a schematic diagram illustrating another processing procedure provided in an embodiment of this application;
[0030] Figure 5 A schematic diagram of a device structure provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of another device structure provided in an embodiment of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, a detailed description of the application will be provided below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. It should be understood that the specific operating methods in the method embodiments described below can also be applied to the device embodiments or system embodiments.
[0033] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0034] The data collection, dissemination, and use in this application all comply with relevant national laws and regulations.
[0035] Before introducing the intelligent network interface card link aggregation method provided in the embodiments of this application, the technical background of the embodiments of this application will be described in detail below for ease of understanding.
[0036] Smart network interface cards (NICs) can be specifically divided into a control plane and a data plane. The control plane provides high-speed data packet forwarding capabilities. The control plane can be implemented using field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs). The control plane can run virtual bridges (OpenVS). Virtual bridges can create the smart NIC data plane through the smart NIC driver. The smart NIC data plane includes an aggregation interface for configuring the data plane.
[0037] In addition, smart network interface cards (NICs) may also include internal components such as a data plane development kit (DPDK) for the user space data path, an operating system (Linux) kernel, a user space daemon (teamd), and virtual bridges. All of these components support link aggregation (bond) technology.
[0038] like Figure 1 The image shows an application scenario of intelligent network interface card (NIC) link aggregation in related technologies. Figure 1 In this context, the smart network interface card (NIC) has two physical ports, designated physical port 1 and physical port 2. Physical port 1 and physical port 2 can correspond to the two virtual ports of a virtual bridge, respectively. Additionally, as shown below... Figure 1As shown, physical ports 1 and 2 of the smart network interface card (NIC) are connected to physical ports 1 and 2 of the switch via network cables (such as fiber optic cables). Furthermore, the two physical ports of the smart NIC are associated with an aggregation interface, and the two physical ports of the switch are associated with another aggregation interface. Therefore, a bond aggregation link is formed between the smart NIC and the switch. This bond aggregation link corresponds to one aggregation interface on the smart NIC side and one aggregation interface on the switch side.
[0039] Currently, there are seven bond aggregation link modes, named from mode 0 to mode 6. The most commonly used modes are mode 1 and mode 4.
[0040] In this context, Mode 1 refers to the active-backup strategy mode, where only one physical port is running, and the other physical port serves as a backup port. The backup port is either not running or is either stopped or shut down. Furthermore, the smart NIC kernel has multiple virtual ports, each corresponding to the state of a physical port. Accordingly, in Mode 1, one virtual port in the virtual bridge corresponds to one physical port. When a physical port stops running, the smart NIC kernel module can change the port state of the virtual port corresponding to the primary physical port to a stopped state, and change the port state of the virtual port corresponding to the backup physical port to a running state. During data transmission, regardless of whether the primary or backup physical port is used, the address used for data transmission is unique.
[0041] Mode 4 refers to Dynamic Link Aggregation mode. This mode typically operates two or more physical ports, with multiple physical ports associated with a single aggregation interface. Correspondingly, in Mode 4, one virtual port in the virtual bridge corresponds to one physical port, and the virtual port status corresponds to the physical port status. Multiple virtual ports correspond to one aggregation interface, and the virtual port corresponding to each physical port can be called a member port of that aggregation interface. Each member port can share the same speed and duplex settings.
[0042] However, in the current bond aggregation link, when any physical port fails or shuts down, the smart NIC cannot know the status of the physical port in time. Therefore, data packets will still be sent to the failed physical port, which will cause data transmission failure and result in low communication reliability.
[0043] To address the above issues, this application provides a method for intelligent network interface card (NIC) link aggregation to improve the reliability of data transmission on the aggregated links.
[0044] It is understood that the method for link aggregation of a smart network interface card (NIC) provided in this application can be executed by a first device. The first device can be a smart NIC, a server NIC, or a communication device containing a smart NIC or a server NIC. Optionally, the method can also be executed by components (such as chips or modules) within these devices.
[0045] Based on this method, the first device can detect that a physical port is closed through a first driver in user space, and set the physical port configuration of the aggregation interface through the first driver, so that the state of the first physical port in the physical port configuration is disabled. The aggregation interface stops sending data to the disabled physical port, which can avoid data transmission failure and improve data transmission reliability.
[0046] like Figure 2 As shown in the embodiments of this application, the specific steps of a method for intelligent network interface card (NIC) link aggregation may include:
[0047] Step 101: The first device determines that the first physical port of the first device is closed through the first driver in the user space. The first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with the aggregation interface.
[0048] In one possible embodiment, the first device may be configured with a first driver. The first driver may create a virtual port corresponding to a physical port, and after creating the virtual port, the first driver may configure an aggregated interface according to the virtual port.
[0049] In one possible embodiment, the aggregation interface is located on the data plane of the smart network interface card (NIC). The aggregation interface can send data packets with multiple physical ports. For example, the aggregation interface in this application is a Link Aggregation Group (LAG) aggregation interface. Optionally, the LAG aggregation interface may include an FPGA LAG aggregation interface, etc., without specific limitation. The aggregation interface can obtain physical port configurations. When the physical port in the configuration is in an enabled (or running) state, the aggregation interface can transmit data packets with that physical port; when the physical port in the configuration is in a disabled (or closed or stopped) state, the aggregation interface stops transmitting data packets with that physical port. It is understood that the control plane of the smart NIC can also create bond virtual ports and multiple virtual ports corresponding one-to-one with physical ports. The virtual ports corresponding to physical ports can be called member ports of the bond virtual ports.
[0050] In one possible embodiment, the virtual port can be created on the system-on-chip (SOC) of the smart network interface card (NIC). The SOC can run the OVS process to form a virtual bridge. Specifically, the bond virtual port and the virtual port can be created on the virtual bridge. In this application, the system-on-chip of the smart NIC can also run a first driver. The first driver can configure the physical port state of the aggregation interface according to the control data sent by the physical port. When the operating state of the physical port changes, the state of the virtual port will change accordingly.
[0051] In one possible embodiment, the first driver can detect whether a physical port is closed based on changes in the state of the virtual port.
[0052] Optionally, the first device can obtain link keep-alive information through a second driver in the user space. This link keep-alive information can indicate whether the link associated with the physical port is interrupted. Therefore, the first device can determine whether the link corresponding to the first physical port is interrupted based on the link keep-alive information. For example, the link keep-alive information can be sent from the physical port to the SOC control plane (e.g., to the SOC control plane virtual bridge) via an aggregation interface. Correspondingly, the first device can obtain the link keep-alive information in the LACP message from the SOC control plane through the second driver to determine whether the link is interrupted. After determining that the link corresponding to the first physical port is interrupted, the first device can configure the port state of the first virtual port corresponding to the first physical port to a first state through the second driver. In this application, the first state is, for example, a closed state or a disabled state, etc., and is not specifically limited. Optionally, the link keep-alive information can be carried in a Link Aggregation Control Protocol (LACP) message. Further optionally, the LACP message refers to the IEEE 802.3ad standard's Link Aggregation Control Protocol.
[0053] For example, the first device can use the first driver to poll and monitor the link status of the multiple physical ports using a timer. When the link corresponding to the first physical port is interrupted, the first device can use the first driver to configure the port status of the virtual port corresponding to the first physical port to the first state.
[0054] In one possible embodiment, the first driver can detect whether a physical port is closed based on changes in the state of the virtual port. For example, when the port state of the first virtual port is detected to be in a first state, it can be determined that the corresponding first physical port is closed.
[0055] It is understood that in this application, the first driver is the smart network interface card (NIC) user-space driver in the NIC's user space. Furthermore, the second driver in this application is the DPDK net-bonding user-space driver in the NIC's user space. Optionally, the first device may configure the second driver in the NIC's user space.
[0056] The smart network interface card (NIC) can be configured via configuration commands to set the second driver, causing the second driver to perform the corresponding actions described in this application. Optionally, the configuration commands include at least one of the following: creating, deleting, mode setting, adding member ports, deleting member ports, setting primary / backup member ports, setting link policies, querying link status, querying member port status, querying link aggregation control protocol messages, and querying member port LACP protocol messages.
[0057] Step 102: The first device sets the physical port configuration of the aggregation interface through the first driver, so that the state of the first physical port in the physical port configuration is disabled.
[0058] In one possible embodiment, the first device can maintain the physical port configuration of all physical ports of the aggregation interface via a first driver. For example, the physical port configuration can indicate the port status of a corresponding physical port. As described above, when the physical port status in the configuration is enabled (or running), the aggregation interface can transmit data packets with that physical port; when the physical port status in the configuration is disabled (or off or stopped), the aggregation interface stops transmitting data packets with that physical port.
[0059] For example, if the aggregated interface corresponds to physical port 0 and physical port 1, the operating status of the two physical ports can be represented by a 2-bit field. For instance, the first bit represents the port status of physical port 0, and the second bit represents the port status of physical port 1. A bit value of 0 (or 1) indicates that the port is running, and a bit value of 1 (or 0) indicates that the port is closed. This 2-bit field is the physical port configuration.
[0060] In step 102, the first device can modify the physical port configuration of the aggregation interface through the first driver. For example, after determining that physical port 0 is closed according to step 101, the first device can set the value of the first bit to 1 through the first driver. Continuing with the previous example, when the value of the physical port configuration field is "10", it indicates that physical port 0 is closed and physical port 1 is operating normally. Therefore, the aggregation interface can stop sending and receiving data packets with physical port 0.
[0061] The first device can send configuration parameters to the first driver, which are used by the first device to complete port status configuration. Optionally, these configuration parameters can be provided by the driver manufacturer. The first driver can complete the corresponding configuration actions according to the configuration parameters. When the configuration parameter is to change the configuration of any physical port of the aggregation interface, the first driver receives the configuration parameter and changes the physical port status according to the configuration parameter. When the physical port configuration indicates that the physical port is closed, the aggregation interface will not transmit data with that physical port. For example, taking the first driver as the fcpf_mdev kernel driver and the aggregation interface as an FPGA LAG interface, after the link corresponding to any physical port is interrupted, the fcpf_mdev kernel driver reconfigures the status of the physical port of the FPGA LAG aggregation interface, setting the status of the physical port in the physical port configuration to the disabled state. After the physical port of the aggregation interface is configured to the disabled state, the FPGA LAG aggregation interface will no longer send packets to the physical port corresponding to the interrupted link.
[0062] In one possible embodiment, the first device can forward the data to be sent to other physical ports other than the first physical port through the aggregation interface.
[0063] For example, the smart network interface card (NIC) has at least two physical ports, denoted as physical port 1, physical port 2, ..., physical port N, where N is a positive integer greater than 1. Each of these at least two physical ports can correspond to an aggregation interface. The physical port status includes running or stopped running. The aggregation interface can store the running status of the physical ports. For example, the aggregation interface's physical port configuration stores the status of each physical port.
[0064] Optional, such as Figure 3As shown, in one embodiment provided in this application, the smart network interface card (NIC) can create a bond virtual port for a virtual bridge via configuration commands and set the link aggregation mode to mode 4. Physical ports 1 and 2 can send LACP messages to the physical NIC via the bond virtual port, where the LACP message can carry link keep-alive information. Therefore, the virtual bridge supports link negotiation and / or link status detection via LACP protocol messages. The virtual bridge can also create two virtual ports corresponding to physical ports 1 and 2 respectively. Assuming that the initial state of physical port 1 and the initial state of physical port 2 are both open, the links of physical port 1 and physical port 2 can work normally. When one of the links is interrupted, the second driver of the virtual bridge can identify the link interruption based on the link keep-alive information and set the corresponding virtual port state to the first state. After the first driver of the virtual bridge identifies the virtual port state as the first state, it determines that the first physical port corresponding to the first virtual port whose port state has changed to the first state is closed. Furthermore, after determining that the first physical port is closed, the first driver can set the physical port configuration of the aggregation interface, so that the aggregation interface stops sending data packets to the closed physical port to avoid data transmission failure.
[0065] Optional, such as Figure 4 As shown, in another embodiment provided in this application, the smart network card can create a bond virtual port of the virtual bridge through configuration commands and set the link aggregation mode to mode 1. In mode 1, the first driver can listen to the link status of the physical port according to a timer and determine whether the physical port is closed based on the link status. Assuming that the initial state of physical port 1 and the initial state of physical port 2 are both open, the links of physical port 1 and physical port 2 can work normally. When one of the links is interrupted, the second driver of the virtual bridge can identify the link interruption by listening to the timer and set the corresponding virtual port status to the first state. After the first driver of the virtual bridge can identify the virtual port status as the first state, it can determine that the first physical port corresponding to the first virtual port whose port status has changed to the first state is closed. Further, after determining that the first physical port is closed, the first driver can set the physical port configuration of the aggregation interface so that the aggregation interface stops sending data packets to the closed physical port to avoid data transmission failure.
[0066] In one possible embodiment, the first device can obtain configuration parameters from the cloud platform to create at least one of the aforementioned aggregated interface, bond virtual port, virtual port, first driver, or second driver. Optionally, the cloud platform can send the aggregated interface and other ports and parameters to the smart network interface card (NIC), which then performs creation and configuration based on the corresponding parameters. Optionally, the virtual bridge described in this application is located in the user space of the smart NIC's control plane. The cloud platform can be an open-source cloud platform such as an OpenStack cloud computing management platform.
[0067] In one possible embodiment, the smart network interface card (NIC) can use the link aggregation control command (bondctl) to access link aggregation information stored in the second driver, such as the link aggregation mode and the link status of virtual and physical ports, as a bond configuration file. If the virtual bridge restarts its process, the first driver can read the configuration file to obtain parameters such as the smart NIC's aggregation interface mode and physical port status configuration. For example, after the virtual bridge process starts, the smart NIC automatically creates a bond virtual port and reads the bond configuration file through the first driver. The smart NIC's user-space driver then modifies the configuration of the bond virtual port according to the bond configuration file. The smart NIC's user-space driver can also reconfigure the aggregation interface.
[0068] Based on the same inventive concept as the above method embodiments, this application also provides a smart network interface card (NIC) link aggregation device (or first device). This device can be used to perform the actions described in the above method embodiments. In this embodiment, the device structure can be as follows: Figure 5 As shown. Figure 5 As shown, this application provides an exemplary smart network interface card (NIC) link aggregation device, including an acquisition module 501 and a processing module 502.
[0069] The acquisition module 501 is used to determine that the first physical port of the first device is closed by the first driver in the user space. The first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with an aggregation interface.
[0070] The processing module 502 is configured to set the physical port configuration of the aggregation interface through the first driver, such that the state of the first physical port in the physical port configuration is disabled.
[0071] Optionally, the acquisition module 501 is specifically used to: acquire link keep-alive information through the second driver in the user space, the link keep-alive information being used to indicate a link interruption corresponding to the first physical port; configure the port state of the first virtual port to change to a first state through the second driver, the first virtual port corresponding to the first physical port; and determine the port state of the first physical port to change to the first state through the first driver.
[0072] Optionally, the processing module 502 is further configured to: obtain a link aggregation control protocol message through the second driver, wherein the link aggregation control protocol message includes the link keep-alive information and the link aggregation control protocol message originates from the aggregation interface.
[0073] Optionally, the processing module 502 is specifically used to: poll and monitor the link status of the plurality of physical ports through the first driver to know that the link corresponding to the first physical port is interrupted; configure the port status of the first virtual port to change to a first state through the first driver, wherein the first virtual port corresponds to the first physical port; and determine that the port status of the first physical port has changed to the first state through the first driver.
[0074] Optionally, the processing module 502 is further configured to: forward the data to be sent to other physical ports other than the first physical port through the aggregation interface.
[0075] Based on the same inventive concept as the above method embodiments, this application also provides an electronic device. This electronic device can be used to perform the actions described in the above method embodiments. In this embodiment, the structure of the electronic device can be as follows: Figure 6 As shown, it includes a memory 601 and one or more processors 602.
[0076] The memory 601 is used to store computer programs executed by the processor 602. The memory 601 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0077] Memory 601 may be volatile memory, such as random-access memory (RAM); memory 601 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 601 may be any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 601 may be a combination of the above-mentioned memories.
[0078] The processor 602 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 602 is used to implement the above-described method when calling a computer program stored in the memory 601.
[0079] This application embodiment does not limit the specific connection medium between the memory 601 and the processor 602 described above. As an example, this application embodiment... Figure 6 The memory 601 and the processor 602 are connected via a bus 603, and the bus 603 is in Figure 6 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 603 bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0080] Optionally, the processor 602 can be used to execute any one or more of the actions performed by the acquisition module 501 and the processing module 502.
[0081] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods described above.
[0082] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for intelligent network interface card (NIC) link aggregation, characterized in that, include: The first device determines that the first physical port of the first device is closed by a first driver in the user space. The first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with an aggregated interface. The first device sets the physical port configuration of the aggregation interface through the first driver, such that the state of the first physical port in the physical port configuration is disabled. The first device determines that the first physical port of the first device is closed through a first driver in user space, including: The first device obtains link keep-alive information through the second driver in the user space, and the link keep-alive information is used to indicate that the link corresponding to the first physical port is interrupted. The first device changes the port status of the first virtual port to the first state through the second driver configuration, and the first virtual port corresponds to the first physical port; The first device determines, through the first driver, that the port status of the first physical port has changed to the first state.
2. The method as described in claim 1, characterized in that, The method further includes: The first device obtains a link aggregation control protocol message through the second driver. The link aggregation control protocol message includes the link keep-alive information and comes from the aggregation interface.
3. The method as described in claim 1, characterized in that, The first device determines that the first physical port of the first device is closed through a first driver in user space, including: The first device monitors the link status of the multiple physical ports through the first driver polling, and learns that the link corresponding to the first physical port is interrupted; The first device changes the port status of the first virtual port to a first state through the first driver configuration, and the first virtual port corresponds to the first physical port; The first device determines, through the first driver, that the port status of the first physical port has changed to the first state.
4. The method as described in claim 3, characterized in that, The method further includes: The first device forwards the data to be sent to other physical ports other than the first physical port through the aggregation interface.
5. A device for intelligent network interface card (NIC) link aggregation, characterized in that, include: The acquisition module is used to determine that the first physical port of the first device is closed by the first driver in the user space, wherein the first physical port is one of a plurality of physical ports of the first device, and the plurality of physical ports are associated with an aggregation interface; The processing module is configured to set the physical port configuration of the aggregation interface through the first driver, such that the state of the first physical port in the physical port configuration is disabled. The acquisition module is specifically used for: The link keep-alive information is obtained through the second driver in the user space, and the link keep-alive information is used to indicate the link interruption corresponding to the first physical port. The port status of the first virtual port is changed to the first state through the second driver configuration, and the first virtual port corresponds to the first physical port; The first driver determines that the port state of the first physical port has changed to the first state.
6. The apparatus as claimed in claim 5, characterized in that, The processing module is also used for: The link aggregation control protocol message is obtained through the second driver. The link aggregation control protocol message includes the link keep-alive information and comes from the aggregation interface.
7. The apparatus as claimed in claim 5, characterized in that, The processing module is specifically used for: By polling the link status of the multiple physical ports through the first driver, it can be determined that the link corresponding to the first physical port is interrupted. The port status of the first virtual port is changed to the first state through the first driver configuration, and the first virtual port corresponds to the first physical port; The first driver determines that the port state of the first physical port has changed to the first state.
8. The apparatus as claimed in claim 6, characterized in that, The processing module is also used for: The aggregation interface forwards the data to be sent to other physical ports besides the first physical port.
9. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1-4 according to the program instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method as described in any one of claims 1-4.