Method, computer equipment and medium for shared binding port unloading

Through the shared binding port configuration scheme and shared binding port uninstallation between the kernel state and the user state, the problem of the kernel state not supporting user state drivers and complex link protocol processing in the existing technology is solved, and efficient forwarding performance is achieved and simplified user-state management.

CN119276703BActive Publication Date: 2025-02-18ZHUHAI XINGYUN ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411829915.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-02-18
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

In the prior art, the kernel-state binding port configuration scheme does not support user-state drivers and user-state software, it is difficult to deal with complex link protocols, and the hardware offload implementation is complex, which cannot meet the needs of complex and changeable application scenarios.

Method used

By sharing the binding port configuration scheme and sharing the binding port uninstallation between the kernel state and the user state, the configuration synchronization between the kernel state and the user state is achieved, the system burden is reduced, the forwarding performance is improved, the user software processing efficiency is improved, and the user is reduced. state code complexity.

Benefits of technology

The process of managing user-state software for user-state binding port configuration scheme is simplified, and the binding port forwarding is supported to unload bound port forwarding to dedicated hardware, reducing system burden, improving forwarding performance, improving user software processing efficiency, and reducing user-state code complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276703B_ABST
    Figure CN119276703B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology and provides a method, computer device and medium for sharing binding port unloading. In order to cope with the difference between the binding port configuration schemes in kernel state and user state, the method optimizes the implementation of the binding port configuration scheme in kernel state and the implementation of the binding port configuration scheme in user state, and only needs to set the binding port configuration scheme once, that is, determine the first kernel state binding port configuration, and then set the first user state binding port configuration accordingly according to the set first kernel state binding port configuration, so that the identification of the first link aggregation group is used to realize the sharing of the binding port configuration scheme and the shared binding port unloading between the kernel state and the user state, which helps to reduce the system burden, improve the forwarding performance, improve the user software processing efficiency, and reduce the complexity of the user state code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, computer device and medium for unloading a shared binding port. Background Art

[0002] With the development of data center networking technology, in order to ensure the reliability and continuity of services, various redundancy designs need to be considered, such as link redundancy, node redundancy, etc. For this reason, servers are usually connected to the network through dual homing, and network equipment stacking technology is applied. Stacking technology has problems such as control plane unification, difficulty in smooth upgrade, difficulty in supporting multi-vendor heterogeneity, and difficulty in operation and maintenance. In order to solve the shortcomings of stacking technology, in scenarios where networking reliability requirements are high, a de-stacking dual homing solution is used to overcome the shortcomings of virtualized stacking. However, in the de-stacking dual homing solution in the prior art, for example, in the application scenario where the server network is connected to the data center network through de-stacking dual homing, the kernel-mode binding port configuration solution does not support user-mode drivers and user-mode software, such as the Data Plane Development Kit (DPDK), and it is also difficult to use various mature development tools, applications, ready-made libraries, open source codes, etc. in the user mode. In addition, the user-mode binding port configuration solution requires separate configuration and additional adaptation, and it is difficult to handle complex link protocols such as the Link Layer Discovery Protocol and the Link Aggregation Control Protocol (LACP) in the user mode. In addition, the prior art requires separate configuration of the kernel-mode binding port configuration scheme and the user-mode binding port configuration scheme, which also makes the implementation of hardware offloading complicated and cumbersome, and is difficult to meet the needs of complex and changing application scenarios, and cannot achieve rapid response and flexible adaptation.

[0003] To this end, the present application provides a method, computer device and medium for shared binding port unloading, which realizes a shared binding port configuration scheme and shared binding port unloading between kernel state and user state, which helps to reduce system burden, improve forwarding performance, improve user software processing efficiency, and reduce user state code complexity. Summary of the invention

[0004] In a first aspect, the present application provides a method for shared binding port unloading. The method comprises: in the kernel space of the host machine, determining a first kernel-state binding port configuration and creating a first kernel-state binding port according to the first kernel-state binding port configuration, wherein the first kernel-state binding port configuration comprises an identifier of a first link aggregation group and a first link aggregation group configuration, the first link aggregation group configuration comprises at least a member port of the first link aggregation group and a first correspondence between a member port and a subordinate port of the first link aggregation group, the first link aggregation group corresponds to a first Ethernet port of a message transceiver hardware connected to the host machine, and a member port of the first link aggregation group corresponds to a physical function of the message transceiver hardware; in the user space of the host machine, determining a first user-state binding port configuration based on the first kernel-state binding port configuration, and then, according to A first user-state binding port is created according to the first user-state binding port configuration, wherein the first user-state binding port configuration includes an identifier of the first link aggregation group and specifies that the first user-state binding port is a master port relative to the slave port; a kernel-state driver in the kernel space, in response to completion of creation of the first kernel-state binding port, sends the identifier of the first link aggregation group and the first link aggregation group configuration to the message transceiver hardware, and, in response to an update of the first link aggregation group configuration, sends the updated first link aggregation group configuration to the message transceiver hardware; and a user-state software in the user space, based on the identifier of the first link aggregation group, collaborates with the message transceiver hardware to perform packet receiving and sending operations through the first user-state binding port.

[0005] Through the first aspect of the present application, a shared binding port configuration scheme and shared binding port unloading are implemented between kernel state and user state, which helps to reduce system burden, improve forwarding performance, improve user software processing efficiency, and reduce user state code complexity.

[0006] In a possible implementation of the first aspect of the present application, based on the identifier of the first link aggregation group, collaborate with the message transceiver hardware to perform packet receiving operations through the first user-state binding port, including: the message transceiver hardware receives traffic through the first Ethernet port and performs a flow table query, when the flow table query is successful, the message transceiver hardware forwards the traffic, and when the flow table query fails, the message transceiver hardware sends traffic to the slave port based on the identifier of the first link aggregation group.

[0007] In a possible implementation of the first aspect of the present application, based on the identifier of the first link aggregation group, collaboration with the message transceiver hardware is performed to perform a packet sending operation through the first user-state binding port, including: the user-state software adds a message extension header to the message to be sent to obtain the extended message to be sent, and then sends the extended message to be sent to the message transceiver hardware, wherein the message extension header includes target port information; the message transceiver hardware determines the identifier of the first link aggregation group by parsing the extended message to be sent, and then determines whether the updated first link aggregation group configuration exists based on the identifier of the first link aggregation group, and if so, forwards the message to be sent according to the updated first link aggregation group configuration; if not, forwards the message to be sent according to the first link aggregation group configuration.

[0008] In a possible implementation manner of the first aspect of the present application, the first link aggregation group configuration also includes a routing algorithm of the first link aggregation group, and the routing algorithm of the first link aggregation group is determined based on the binding mode of the first kernel state binding port.

[0009] In a possible implementation of the first aspect of the present application, updating the configuration of the first link aggregation group includes: changing the routing algorithm of the first link aggregation group to obtain an updated routing algorithm of the first link aggregation group, wherein the updated first link aggregation group configuration includes the updated routing algorithm of the first link aggregation group.

[0010] In a possible implementation of the first aspect of the present application, the binding mode of the first kernel-mode binding port is a polling mode, a master-slave mode, a selection policy mode, a broadcast policy mode, a dynamic link aggregation policy mode, a network card rate selection mode, or a load balancing policy mode.

[0011] In a possible implementation of the first aspect of the present application, updating the configuration of the first link aggregation group includes: changing the member port of the first link aggregation group to obtain the updated member port of the first link aggregation group, and changing the first correspondence to obtain an updated first correspondence between the updated member port of the first link aggregation group and the subordinate port, wherein the updated first link aggregation group configuration includes the updated member port of the first link aggregation group and the updated first correspondence.

[0012] In a possible implementation manner of the first aspect of the present application, after the configuration of the first link aggregation group is updated, the identifier of the first link aggregation group and the slave port remain unchanged.

[0013] In a possible implementation of the first aspect of the present application, the method also includes: determining a second kernel state binding port configuration different from the first kernel state binding port configuration, and then creating a second kernel state binding port different from the first kernel state binding port according to the second kernel state binding port configuration; and, based on the second kernel state binding port, determining a second user state binding port configuration different from the first user state binding port configuration, and then creating a second user state binding port different from the first user state binding port according to the second user state binding port configuration, thereby constructing a second link aggregation group configuration, wherein the second link aggregation group configuration has an identifier and subordinate port different from those of the first link aggregation group configuration.

[0014] In a possible implementation of the first aspect of the present application, the method also includes: the message receiving and sending hardware filters the data messages received through the first Ethernet port, thereby uploading the data messages that meet the message feature filtering rules to the first kernel state binding port or the first user state binding port.

[0015] In a possible implementation of the first aspect of the present application, when the data packet is a protocol type packet, the packet transceiver hardware uploads the data packet to the first kernel state binding port so as to process the data packet through the kernel protocol stack in the kernel space.

[0016] In a possible implementation of the first aspect of the present application, when the data message is associated with an application or library file in the user space, the message transceiver hardware uploads the data message to the first user-mode binding port.

[0017] In a possible implementation of the first aspect of the present application, the network device of the host machine includes a first virtual interface and a second virtual interface, the first virtual interface corresponds to the first kernel state binding port, and the second virtual interface corresponds to the first user state binding port, and the network device is configured to: be managed by the kernel state driver through the first virtual interface, or be managed by the user state driver in the user space through the second virtual interface.

[0018] In a possible implementation of the first aspect of the present application, the message sending and receiving hardware includes an email communication mechanism, the interaction between the kernel state driver and the user state driver is carried out through the email communication mechanism, and the user state driver obtains the first kernel state binding port configuration from the kernel state driver through the email communication mechanism.

[0019] In a possible implementation manner of the first aspect of the present application, the user-mode software is a data plane development tool set.

[0020] In a possible implementation manner of the first aspect of the present application, the first user-mode binding port is used as a representative port to implement complete hardware unloading.

[0021] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.

[0022] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.

[0023] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 A flowchart of a method for unloading a shared binding port provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a user space and kernel space shared binding port unloading provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0029] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0030] Figure 1 A flow chart of a method for unloading a shared binding port provided in an embodiment of the present application. Figure 1 As shown, the method includes the following steps.

[0031] Step S101: In the kernel space of the host machine, determine a first kernel state binding port configuration and create a first kernel state binding port according to the first kernel state binding port configuration, wherein the first kernel state binding port configuration includes an identifier of a first link aggregation group and a first link aggregation group configuration, the first link aggregation group configuration includes at least member ports of the first link aggregation group and a first correspondence between member ports and subordinate ports of the first link aggregation group, the first link aggregation group corresponds to a first Ethernet port of message transceiver hardware connected to the host machine, and the member ports of the first link aggregation group correspond to physical functions of the message transceiver hardware.

[0032] Step S103: In the user space of the host machine, determine the first user state binding port configuration based on the first kernel state binding port configuration, and then create a first user state binding port according to the first user state binding port configuration, wherein the first user state binding port configuration includes the identifier of the first link aggregation group and specifies that the first user state binding port is a master port relative to the slave port.

[0033] Step S105: In the kernel-state driver in the kernel space, in response to completion of creation of the first kernel-state binding port, the identifier of the first link aggregation group and the first link aggregation group configuration are sent to the message transceiver hardware; and, in response to an update of the first link aggregation group configuration, the updated first link aggregation group configuration is sent to the message transceiver hardware.

[0034] Step S107: The user-mode software in the user space cooperates with the message receiving and sending hardware based on the identifier of the first link aggregation group to perform packet receiving and sending operations through the first user-mode binding port.

[0035] Figure 1The method for shared binding port unloading shown can be applied to application scenarios such as data centers, cloud computing, and artificial intelligence. In these application scenarios, in order to ensure the reliability and continuity of the business, various redundant designs need to be considered, such as link redundancy, node redundancy, etc. For this reason, the server usually adopts dual-homing to access the network, and network device stacking technology is applied. In order to overcome the shortcomings brought by network device stacking, such as control plane unification, difficulty in smooth upgrade, difficulty in supporting multi-vendor heterogeneity, and difficulty in operation and maintenance, a de-stacking dual-homing solution is adopted, for example, the server network is connected to the data center network through de-stacking dual-homing. To this end, it is necessary to consider the difference between the kernel-state binding port configuration solution and the user-state binding port configuration solution. On the one hand, the kernel-mode binding port configuration solution does not support user-mode drivers and user-mode software, such as the Data Plane Development Kit (DPDK), and it is difficult to use various mature development tools, applications, ready-made libraries, open source codes, etc. in the user mode; on the other hand, the user-mode binding port configuration solution requires separate configuration and additional adaptation, and it is difficult to handle complex link protocols such as the Link Layer Discovery Protocol and the Link Aggregation Control Protocol (LACP) in the user mode. For this reason, Figure 1 The method for shared binding port unloading shown, by sharing the binding port configuration scheme between kernel state and user state and sharing the binding port unloading, greatly simplifies the process of user state software managing the binding port configuration scheme of user state, which is conducive to the user to customize the input and output; supports unloading the binding port forwarding to dedicated hardware, and the hardware completes the forwarding and routing, which helps to reduce the system burden and improve the forwarding performance; for protocol type messages, such as link protocols (LACP, LLDP or other link protocols), if these protocol type messages are processed separately in user state, they require complex and bloated user state processing protocols, but through shared binding port unloading, the protocol type messages can be selected to be handed over to the kernel protocol stack for processing, so that the protocol type messages can be bypassed in user state, improving the processing efficiency of user software and reducing the complexity of user state code. The following is a detailed description in conjunction with the drawings and specific embodiments of this application.

[0036] See also Figure 1, in step S101, in the kernel space of the host machine, a first kernel-state binding port configuration is determined and a first kernel-state binding port is created according to the first kernel-state binding port configuration. The first kernel-state binding port configuration includes an identifier of a first link aggregation group and a first link aggregation group configuration, the first link aggregation group configuration includes at least a member port of the first link aggregation group and a first correspondence between a member port of the first link aggregation group and a slave port, the first link aggregation group corresponds to a first Ethernet port of a message transceiver hardware connected to the host machine, and a member port of the first link aggregation group corresponds to a physical function of the message transceiver hardware. Then, in step S103, in the user space of the host machine, a first user-state binding port configuration is determined based on the first kernel-state binding port configuration, and then a first user-state binding port is created according to the first user-state binding port configuration, wherein the first user-state binding port configuration includes an identifier of the first link aggregation group and specifies that the first user-state binding port is a master port relative to the slave port. Here, the first link aggregation group is based on the Link Aggregation Group (LAG) technology, that is, multiple Ethernet links are bundled together to form a logical link, and each link aggregation group corresponds to a link aggregation interface, in which each physical interface becomes a member interface (also called a member port). Therefore, the member ports of the first link aggregation group represent the physical interfaces used to support the link aggregation interface corresponding to the first link aggregation group. The message transceiver hardware connected to the host machine can be dedicated hardware, such as an intelligent network card, etc., which is used to provide hardware processing capabilities for message transceiver. The first Ethernet port on the message transceiver hardware corresponds to the first link aggregation group, that is, the link aggregation interface corresponding to the first link aggregation group. The member ports of the first link aggregation group correspond to the physical functions of the message transceiver hardware, and each physical function corresponds to the input and output requirements of the network device of the host machine, such as a PCIe device connected to the host machine through a peripheral component interconnect express (PCIe) bus.

[0037] Continue reading Figure 1, it is only necessary to set the binding port configuration scheme once, that is, determine the first kernel-state binding port configuration, and then, based on the first kernel-state binding port configuration, respectively, in the kernel space, create the first kernel-state binding port according to the first kernel-state binding port configuration, and, in the user space, determine the first user-state binding port configuration based on the first kernel-state binding port configuration, and then create the first user-state binding port according to the first user-state binding port configuration. Wherein, the first kernel-state binding port configuration includes the identifier of the first link aggregation group, and the first user-state binding port configuration also includes the identifier of the first link aggregation group. Therefore, by identifying the identifier of the first link aggregation group, such as the sequence number of the first link aggregation group or any characteristic information that can be used for identification, the binding port configuration scheme is shared between the kernel state and the user state. It should be understood that in the user space, the first user-state binding port configuration is determined based on the first kernel-state binding port configuration, and the first user-state binding port configuration includes the identifier of the first link aggregation group and specifies that the first user-state binding port is the master port relative to the slave port. Therefore, the user-state driver and the user-state software rely on the identifier of the first link aggregation group to set the user-state binding port configuration scheme, including specifying the first user-state binding port as the master port of the slave port. Therefore, the user-state driver and the user-state software perform calculations based on the identifier of the first link aggregation group, such as the sequence number of the first link aggregation group, and are unaware of the corresponding relationship between the slave port and the member port of the first link aggregation group. Therefore, if a physical function or a physical interface fails or cannot work for some reason, such as a device offline, a link failure, etc., the kernel-state driver can perceive it and update the member port of the first link aggregation group, such as replacing the existing physical function with a new physical function, so that a new Ethernet link can be constructed to support the logical link and link aggregation interface corresponding to the first link aggregation group. Because the update of the member port of the first link aggregation group will not affect the identifier of the first link aggregation group, therefore, by managing the update of the member port of the first link aggregation group through the kernel-state driver, the user-state driver and the user-state software will only perceive the identifier of the first link aggregation group and will not perceive the update of the member port of the first link aggregation group made by the kernel-state driver, nor will they perceive the update of the corresponding relationship between the slave port and the member port of the first link aggregation group. For example, the implementation of the kernel-mode binding port configuration scheme may be that a user may set the first kernel-mode binding port configuration through an Internet Protocol (IP) command, including setting which physical functions of the message transceiver hardware are used as member ports of the first link aggregation group, that is, setting a first correspondence between the member ports and the slave ports of the first link aggregation group. For example, a user may set physical function A and physical function B as member ports of the first link aggregation group, thereby establishing a correspondence between physical function A and physical function B and the slave ports.The implementation of the binding port configuration scheme in user mode can specify the first user mode binding port as the master port of the slave port according to the identifier of the first link aggregation group. In this way, by optimizing the implementation of the binding port configuration scheme in kernel mode and the implementation of the binding port configuration scheme in user mode, it is only necessary to set the binding port configuration scheme once, that is, to determine the first kernel mode binding port configuration, and then set the first user mode binding port configuration accordingly according to the set first kernel mode binding port configuration. In this way, the identifier of the first link aggregation group is used to realize the sharing of the binding port configuration scheme between kernel mode and user mode.

[0038] Continue reading Figure 1In step S105, the kernel-state driver in the kernel space, in response to the completion of the creation of the first kernel-state binding port, sends the identifier of the first link aggregation group and the configuration of the first link aggregation group to the message transceiver hardware, and, in response to the update of the configuration of the first link aggregation group, sends the updated configuration of the first link aggregation group to the message transceiver hardware. By managing the update of the member ports of the first link aggregation group through the kernel-state driver, the user-state driver and the user-state software will only perceive the identifier of the first link aggregation group and will not perceive the update of the member ports of the first link aggregation group made by the kernel-state driver, nor will they perceive the update of the correspondence between the slave port and the member port of the first link aggregation group. The update of the configuration of the first link aggregation group may include, for example, the update of the member ports of the first link aggregation group, the update of the routing algorithm of the first link aggregation group, and the change made according to the update of the binding mode of the first kernel-state binding port. Here, the update of the configuration of the first link aggregation group will not affect the identifier of the first link aggregation group, so the identifier of the first link aggregation group can be used to maintain the shared binding port configuration scheme between the kernel state and the user state. In other words, the user-mode driver does not need to obtain the kernel-mode configuration information in real time. As long as the identifier of the first link aggregation group remains unchanged, the configuration synchronization requirements can be met. If a situation occurs that causes the identifier of the first link aggregation group to change, it is necessary to set a new kernel-mode binding port configuration and create a new kernel-mode binding port according to the new situation, and then create a new user-mode binding port based on the new kernel-mode binding port configuration to achieve configuration synchronization again. However, in general, the update of the first link aggregation group configuration does not involve changing the identifier of the first link aggregation group, nor does it change the subordinate port. For example, the addition of new network devices, the removal of existing network devices, the online and offline of devices, the turning on and off of functional characteristics of network devices, and for example, device failures, link blocking, link failures, etc., may affect the physical functions of the message sending and receiving hardware, and may also lead to the update of the member ports of the first link aggregation group. To this end, the kernel-state driver needs to maintain synchronization with the message transceiver hardware, including synchronizing updates to the first link aggregation group configuration to the message transceiver hardware, so that the message transceiver hardware can promptly learn of situations such as changes in the first correspondence between the member port and the slave port of the first link aggregation group, thereby achieving shared binding port unloading between kernel state and user state.On the one hand, the kernel-state driver, in response to the completion of the creation of the first kernel-state binding port, sends the identifier of the first link aggregation group and the configuration of the first link aggregation group to the message transceiver hardware, which means that the configuration of the first link aggregation group is synchronized to the message transceiver hardware, thereby realizing the shared binding port unloading between the kernel state and the user state based on the first link aggregation group configuration; on the other hand, when the configuration of the first link aggregation group changes, such as the update of the member port of the first link aggregation group, or the update of the routing algorithm of the first link aggregation group, or other possible updates, as long as the identifier and the subordinate port of the first link aggregation group are maintained unchanged, the user-state driver and the user-state software are unaware of it. Therefore, the kernel-state driver, in response to the update of the configuration of the first link aggregation group, sends the updated configuration of the first link aggregation group to the message transceiver hardware, which means that the updated configuration of the first link aggregation group is synchronized to the message transceiver hardware, thereby realizing the shared binding port unloading between the kernel state and the user state based on the updated configuration of the first link aggregation group.

[0039] Continue reading Figure 1, in step S107, the user-state software in the user space cooperates with the message transceiver hardware based on the identifier of the first link aggregation group, so as to perform packet receiving and sending operations through the first user-state binding port. As mentioned above, when the configuration of the first link aggregation group changes, as long as the identifier and the subordinate port of the first link aggregation group remain unchanged, the user-state driver and the user-state software are unaware. The kernel-state driver needs to be synchronized with the message transceiver hardware to ensure that the message transceiver hardware can be informed of the changes in the configuration of the first link aggregation group in a timely manner, such as the update of the member ports of the first link aggregation group, and the update of the routing algorithm of the first link aggregation group. This means that managing the update of the configuration of the first link aggregation group through the kernel-state driver includes managing the update of the member ports of the first link aggregation group and managing the update of the corresponding relationship between the subordinate port and the member ports of the first link aggregation group. In this way, through the user-state driver and the user-state software, it is only necessary to calculate according to the identifier of the first link aggregation group to achieve cooperation with the message transceiver hardware, so as to perform packet receiving and sending operations through the first user-state binding port. Furthermore, the user-state driver and user-state software do not need to obtain the kernel-state configuration information in real time, and the kernel-state driver completes the configuration synchronization required for the collaboration between the user-state driver and the message transceiver hardware. After the creation of the first kernel-state binding port is completed, the kernel-state driver sends the identifier of the first link aggregation group and the configuration of the first link aggregation group to the message transceiver hardware, so that the message transceiver hardware is synchronously configured to cooperate with the user-state driver to implement the packet receiving operation and the packet sending operation through the first user-state binding port. Furthermore, after the first link aggregation group configuration is updated, the kernel-state driver sends the updated first link aggregation group configuration to the message transceiver hardware, so that the message transceiver hardware is synchronously configured to cooperate with the user-state driver to implement the packet receiving operation and the packet sending operation through the first user-state binding port. This means that the process of the user-state software managing the user-state binding port configuration scheme is greatly simplified, which is conducive to the user to customize the input and output. Moreover, on the basis of ensuring that the hardware for sending and receiving messages is synchronously configured, the shared binding port configuration scheme between kernel state and user state is realized, and the shared binding port unloading between kernel state and user state based on the first link aggregation group configuration updated in real time is also realized, so that the respective advantages of the binding port configuration scheme in kernel state and the binding port configuration scheme in user state can be fully utilized. On the one hand, when it is necessary to use various mature development tools, applications, ready-made libraries, open source codes, etc. in user state, packets can be sent and received through user state software and user state drivers, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, and the first user state binding port can be used as a representative port to achieve complete hardware unloading, and the hardware can complete the forwarding and routing, which helps to reduce the system burden and improve the forwarding performance.On the other hand, when it is necessary to process complex protocol type messages, such as link protocols (LACP, LLDP or other link protocols), packets can be sent and received through the kernel state driver, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, so that the protocol type message can be handed over to the kernel protocol stack for processing, so that the protocol type message can be bypassed in the user state, improving the processing efficiency of user software and reducing the complexity of user state code. In addition, the same network device can be managed by the kernel state driver and the user state driver at the same time, that is, the kernel state driver and the user state driver of the same device can coexist, so that it is possible to flexibly control which traffic is handed over to the kernel state driver for processing and which traffic is handed over to the user state driver for processing, and avoid the problems caused by separately configuring the kernel state binding port configuration scheme and the user state binding port configuration scheme, which is conducive to meeting the needs of complex and changing application scenarios and helping to achieve rapid response and flexible adaptation.

[0040] In conclusion, Figure 1 The method for shared binding port unloading shown in the invention greatly simplifies the process of user-mode software managing user-mode binding port configuration schemes by sharing binding port configuration schemes and shared binding port unloading between kernel mode and user mode, which is beneficial for users to customize input and output; it supports unloading binding port forwarding to dedicated hardware, and the hardware completes forwarding and routing, which helps to reduce system burden and improve forwarding performance; for protocol type messages, such as link protocols, if these protocol type messages are processed separately in user mode, complex and bloated user mode processing protocols are required, but through shared binding port unloading, the protocol type messages can be handed over to the kernel protocol stack for processing, so that the protocol type messages can be bypassed in user mode, improving the processing efficiency of user software and reducing the complexity of user mode code.

[0041] Figure 2 A schematic diagram of a user space and kernel space shared binding port unloading provided in an embodiment of the present application. Figure 2 As shown, in the kernel space 203 of the host machine, a first kernel-state binding port configuration is determined and a first kernel-state binding port 213 is created according to the first kernel-state binding port configuration. The first kernel-state binding port configuration includes an identifier of a first link aggregation group and a first link aggregation group configuration 214, the first link aggregation group configuration 214 includes at least a member port of the first link aggregation group and a first correspondence between a member port of the first link aggregation group and a slave port (slave port A 241, slave port B 243), the first link aggregation group corresponds to a first Ethernet port 215 of a message transceiver hardware 205 connected to the host machine, and the member port of the first link aggregation group corresponds to a physical function of the message transceiver hardware 205. Figure 2exemplarily shows that slave port A241 and slave port B243 correspond to physical function A251 and physical function B253. In the user space 201 of the host machine, the first user-mode binding port configuration is determined based on the first kernel-mode binding port configuration, and then the first user-mode binding port 211 is created according to the first user-mode binding port configuration. The first user-mode binding port configuration includes the identifier of the first link aggregation group and specifies that the first user-mode binding port 211 is the master port relative to the slave ports (slave port A241, slave port B243). In the kernel-mode driver of the kernel space 203, in response to the completion of the creation of the first kernel-mode binding port 213, the identifier of the first link aggregation group and the first link aggregation group configuration 214 are sent to the message transceiver hardware 205, and in response to the update of the first link aggregation group configuration, the updated first link aggregation group configuration is sent to the message transceiver hardware 205. The user-mode software in the user space 201 cooperates with the message transceiver hardware 205 based on the identifier of the first link aggregation group, so as to perform packet receiving and sending operations through the first user-mode binding port 211 .

[0042] See also Figure 2 Managing the update of the first link aggregation group configuration 214 through the kernel state driver includes managing the update of the member ports of the first link aggregation group and managing the update of the correspondence between the slave ports (slave port A 241 and slave port B 243) and the member ports of the first link aggregation group. Figure 2It is shown in the figure that the correspondence between the slave ports (slave port A241, slave port B243) and the member ports of the first link aggregation group indicates that the slave port A241 and the slave port B243 correspond to the physical function A251 and the physical function B253. There are many situations that may affect the physical function of the message transceiver hardware 205, which may also lead to the update of the member ports of the first link aggregation group, such as the addition of new network devices, the removal of existing network devices, the online and offline of devices, the opening and closing of the functional characteristics of network devices, and another example is the failure of devices, link blocking, link failure, etc. Therefore, the update of the member ports of the first link aggregation group may cause the slave port A241 and the slave port B243 to no longer correspond to the physical function A251 and the physical function B253, but may correspond to the physical function A251 and the physical function C255, or may correspond to the physical function C255 and the physical function D257. To this end, the kernel state driver needs to keep synchronization with the message transceiver hardware 205, including synchronizing the update of the first link aggregation group configuration 214 to the message transceiver hardware 205, so that the message transceiver hardware 205 can timely learn, for example, that the first corresponding relationship between the member port of the first link aggregation group and the slave port (slave port A241, slave port B243) has changed, thereby realizing the shared binding port unloading between the kernel state and the user state. In this way, through the user state driver and the user state software, it is only necessary to calculate according to the identifier of the first link aggregation group to achieve the collaboration with the message transceiver hardware 205, so as to perform the packet transceiver operation through the first user state binding port 211. In addition, the user state driver and the user state software do not need to obtain the kernel state configuration information in real time, and the kernel state driver completes the configuration synchronization required for the collaboration between the user state driver and the message transceiver hardware 205. After the creation of the first kernel-mode binding port 213 is completed, the kernel-mode driver sends the identifier of the first link aggregation group and the first link aggregation group configuration 214 to the message transceiver hardware 205, so that the message transceiver hardware 205 is synchronously configured to cooperate with the user-mode driver to realize the packet receiving operation and the packet sending operation through the first user-mode binding port 211. In addition, after the first link aggregation group configuration 214 is updated, the kernel-mode driver sends the updated first link aggregation group configuration to the message transceiver hardware 205, so that the message transceiver hardware 205 is synchronously configured to cooperate with the user-mode driver to realize the packet receiving operation and the packet sending operation through the first user-mode binding port 211. This means that the process of user-mode software managing the user-mode binding port configuration scheme is greatly simplified, which is conducive to user customization of input and output.

[0043] In conclusion, Figure 2The user space and kernel space shared binding port offload shown in the figure greatly simplifies the process of user state software managing user state binding port configuration scheme by sharing binding port configuration scheme and shared binding port offload between kernel state and user state, which is beneficial for users to customize input and output; it supports offloading binding port forwarding to dedicated hardware, and hardware completes forwarding and routing, which helps to reduce system burden and improve forwarding performance; for protocol type messages, such as link protocols, if these protocol type messages are processed separately in user state, complex and bloated user state processing protocols are required, but through shared binding port offload, the protocol type messages can be selected to be handed over to the kernel protocol stack for processing, so that the protocol type messages can be bypassed in user state, improving the processing efficiency of user software and reducing the complexity of user state code.

[0044] See also Figure 1 and Figure 2 In a possible implementation, the user-state software cooperates with the message transceiver hardware based on the identifier of the first link aggregation group to perform packet receiving operations through the first user-state binding port, including: the message transceiver hardware receives traffic through the first Ethernet port and performs a flow table query, when the flow table query is successful, the message transceiver hardware forwards the traffic, and when the flow table query fails, the message transceiver hardware sends the traffic to the slave port based on the identifier of the first link aggregation group. In this way, by sharing the binding port configuration scheme between kernel state and user state and sharing the binding port unloading, the process of user-state software managing the user-state binding port configuration scheme is greatly simplified, which is conducive to users to customize input and output; it supports unloading the binding port forwarding to dedicated hardware, and the hardware completes the forwarding and routing, which helps to reduce the system burden and improve forwarding performance.

[0045] In a possible implementation, the user-state software collaborates with the message transceiver hardware based on the identifier of the first link aggregation group to perform a packet sending operation through the first user-state binding port, including: the user-state software adds a message extension header to the message to be sent to obtain an extended message to be sent, and then sends the extended message to be sent to the message transceiver hardware, wherein the message extension header includes target port information; the message transceiver hardware determines the identifier of the first link aggregation group by parsing the extended message to be sent, and then determines whether the updated first link aggregation group configuration exists based on the identifier of the first link aggregation group, and if so, forwards the message to be sent according to the updated first link aggregation group configuration; if not, forwards the message to be sent according to the first link aggregation group configuration. In this way, by sharing the binding port configuration scheme between kernel state and user state and sharing the binding port offload, the process of user state software managing the user state binding port configuration scheme is greatly simplified, which is conducive to users to customize input and output; it supports offloading the binding port forwarding to dedicated hardware, and the hardware completes the forwarding and routing, which helps to reduce the system burden and improve forwarding performance.

[0046] In some embodiments, the first link aggregation group configuration also includes a routing algorithm for the first link aggregation group, and the routing algorithm for the first link aggregation group is determined based on the binding mode of the first kernel-mode binding port. In this way, adaptation to various binding modes and routing algorithms is achieved, and the problems caused by separately configuring the kernel-mode binding port configuration scheme and the user-mode binding port configuration scheme are avoided, which is conducive to meeting the needs of complex and changeable application scenarios and helping to achieve rapid response and flexible adaptation.

[0047] In some embodiments, the updating of the configuration of the first link aggregation group includes: changing the routing algorithm of the first link aggregation group to obtain the updated routing algorithm of the first link aggregation group, wherein the updated first link aggregation group configuration includes the updated routing algorithm of the first link aggregation group. In this way, the adaptation of various binding modes and routing algorithms is achieved, and the problems caused by separately configuring the kernel-mode binding port configuration scheme and the user-mode binding port configuration scheme are avoided, which is conducive to meeting the needs of complex and changeable application scenarios and helps to achieve rapid response and flexible adaptation.

[0048] In some embodiments, the binding mode of the first kernel-state binding port is a polling mode, a master-slave mode, a selection strategy mode, a broadcast strategy mode, a dynamic link aggregation strategy mode, a network card rate selection mode, or a load balancing strategy mode. In this way, adaptation to various binding modes and routing algorithms is achieved, and the problems caused by separately configuring the kernel-state binding port configuration scheme and the user-state binding port configuration scheme are avoided, which is conducive to meeting the needs of complex and changeable application scenarios and helping to achieve rapid response and flexible adaptation.

[0049] In a possible implementation manner, the updating of the configuration of the first link aggregation group includes: changing the member ports of the first link aggregation group to obtain the updated member ports of the first link aggregation group, and changing the first corresponding relationship to obtain the updated first corresponding relationship between the updated member ports of the first link aggregation group and the subordinate ports, wherein the updated first link aggregation group configuration includes the updated member ports of the first link aggregation group and the updated first corresponding relationship. In this way, through the user state driver and the user state software, only calculation is required according to the identifier of the first link aggregation group to achieve the collaboration with the message transceiver hardware, so as to perform the packet transceiver operation through the first user state binding port. In addition, the user state driver and the user state software do not need to obtain the kernel state configuration information in real time, and the kernel state driver completes the configuration synchronization required for the collaboration between the user state driver and the message transceiver hardware. After the creation of the first kernel state binding port is completed, the kernel state driver sends the identifier of the first link aggregation group and the first link aggregation group configuration to the message transceiver hardware, so that the message transceiver hardware is synchronously configured to cooperate with the user state driver to achieve the packet receiving operation and the packet sending operation through the first user state binding port. Furthermore, after the update of the first link aggregation group configuration, the kernel-state driver sends the updated first link aggregation group configuration to the message transceiver hardware, so that the message transceiver hardware is synchronously configured to cooperate with the user-state driver to implement packet receiving and sending operations through the first user-state binding port. This means that the process of user-state software managing the user-state binding port configuration scheme is greatly simplified, which is beneficial for users to customize input and output. Furthermore, on the basis of ensuring that the message transceiver hardware is synchronously configured, the binding port configuration scheme is shared between the kernel state and the user state, and the shared binding port unloading between the kernel state and the user state based on the real-time updated first link aggregation group configuration is also realized, which can give full play to the respective advantages of the kernel-state binding port configuration scheme and the user-state binding port configuration scheme.

[0050] In some embodiments, after the update of the first link aggregation group configuration, the identifier of the first link aggregation group and the subordinate port remain unchanged. In general, the update of the first link aggregation group configuration will not involve changing the identifier of the first link aggregation group, nor will it change the subordinate port. For example, the addition of new network devices, the removal of existing network devices, the online and offline of devices, the opening and closing of functional characteristics of network devices, and for example, device failure, link blocking, link failure, etc., may affect the physical function of the message transceiver hardware, and may also lead to the update of the member ports of the first link aggregation group. To this end, the kernel state driver needs to keep synchronization with the message transceiver hardware, including synchronizing the update of the first link aggregation group configuration to the message transceiver hardware, so that the message transceiver hardware can promptly learn about, for example, the first corresponding relationship between the member port of the first link aggregation group and the subordinate port has changed, thereby realizing the shared binding port unloading between the kernel state and the user state. In this way, on the one hand, the kernel-state driver, in response to the completion of the creation of the first kernel-state binding port, sends the identifier of the first link aggregation group and the configuration of the first link aggregation group to the message transceiver hardware, which means that the configuration of the first link aggregation group is synchronized to the message transceiver hardware, thus realizing the shared binding port unloading between the kernel state and the user state based on the first link aggregation group configuration; on the other hand, when the configuration of the first link aggregation group changes, such as the update of the member port of the first link aggregation group, or the update of the routing algorithm of the first link aggregation group, or other possible updates, as long as the identifier and the subordinate port of the first link aggregation group are maintained unchanged, the user-state driver and the user-state software are unaware of it. Therefore, the kernel-state driver, in response to the update of the configuration of the first link aggregation group, sends the updated configuration of the first link aggregation group to the message transceiver hardware, which means that the updated configuration of the first link aggregation group is synchronized to the message transceiver hardware, thus realizing the shared binding port unloading between the kernel state and the user state based on the updated configuration of the first link aggregation group.

[0051] In some embodiments, the method further includes: determining a second kernel-state binding port configuration different from the first kernel-state binding port configuration, then creating a second kernel-state binding port different from the first kernel-state binding port according to the second kernel-state binding port configuration, and determining a second user-state binding port configuration different from the first user-state binding port configuration based on the second kernel-state binding port, then creating a second user-state binding port different from the first user-state binding port according to the second user-state binding port configuration, thereby constructing a second link aggregation group configuration, wherein the second link aggregation group configuration has an identifier and subordinate port different from the first link aggregation group configuration. If a situation occurs that causes the identifier of the first link aggregation group to change, it is necessary to set a new kernel-state binding port configuration and create a new kernel-state binding port according to the new situation, and then create a new user-state binding port according to the new kernel-state binding port configuration, and once again achieve configuration synchronization. In this way, synchronous configuration is achieved.

[0052] In a possible implementation, the method further includes: the message transceiver hardware filters the data messages received through the first Ethernet port, thereby uploading the data messages that meet the message feature screening rules to the first kernel state binding port or the first user state binding port. The same network device can be managed by the kernel state driver and the user state driver at the same time, that is, the kernel state driver and the user state driver of the same device can coexist, so that it is possible to flexibly control which traffic is handed over to the kernel state driver for processing and which traffic is handed over to the user state driver for processing, and avoid the problems caused by separately configuring the kernel state binding port configuration scheme and the user state binding port configuration scheme, which is conducive to meeting the needs of complex and changeable application scenarios, and is conducive to rapid response and flexible adaptation. In this way, by screening the data messages according to the message feature screening rules, the respective advantages of the kernel state binding port configuration scheme and the user state binding port configuration scheme can be fully utilized. On the one hand, when it is necessary to use various mature development tools, applications, ready-made libraries, open source codes, etc. in user mode, packets can be sent and received through user mode software and user mode drivers, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, and the first user mode binding port can be used as a representative port to achieve complete hardware unloading, and the hardware completes forwarding and routing, which helps to reduce the system burden and improve forwarding performance. On the other hand, when it is necessary to process complex protocol type messages, such as link protocols (LACP, LLDP or other link protocols), packets can be sent and received through kernel mode drivers, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, so that protocol type messages can be handed over to the kernel protocol stack for processing, so that protocol type messages can be bypassed in user mode, improving user software processing efficiency and reducing user mode code complexity.

[0053] In some embodiments, when the data message is a protocol type message, the message transceiver hardware uploads the data message to the first kernel state binding port so that the data message can be processed by the kernel protocol stack in the kernel space. In this way, packets can be sent and received through the kernel state driver, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, so that the protocol type message can be handed over to the kernel protocol stack for processing, so that the protocol type message can be bypassed in the user state, improving the user software processing efficiency and reducing the complexity of the user state code.

[0054] In some embodiments, when the data message is associated with an application or library file in the user space, the message transceiver hardware uploads the data message to the first user-mode binding port. In this way, when various mature development tools, applications, ready-made libraries, open source codes, etc. in the user mode are needed, packets can be sent and received through user-mode software and user-mode drivers, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, and the first user-mode binding port can be used as a representative port to achieve complete hardware unloading, and the hardware can complete the forwarding and routing, which helps to reduce the system burden and improve forwarding performance.

[0055] In a possible implementation, the network device of the host machine includes a first virtual interface and a second virtual interface, the first virtual interface corresponds to the first kernel-state binding port, the second virtual interface corresponds to the first user-state binding port, and the network device is configured to be managed by the kernel-state driver through the first virtual interface, or managed by the user-state driver in the user space through the second virtual interface. In this way, the same network device can be managed by both the kernel-state driver and the user-state driver at the same time, that is, the kernel-state driver and the user-state driver of the same device can coexist, so that it is possible to flexibly control which traffic is handed over to the kernel-state driver for processing and which traffic is handed over to the user-state driver for processing, and avoid the problems caused by separately configuring the kernel-state binding port configuration scheme and the user-state binding port configuration scheme, which is conducive to meeting the needs of complex and changing application scenarios and helps to achieve rapid response and flexible adaptation.

[0056] In some embodiments, the message receiving and sending hardware includes a mailbox communication mechanism, the interaction between the kernel state driver and the user state driver is performed through the mailbox communication mechanism, and the user state driver obtains the first kernel state binding port configuration from the kernel state driver through the mailbox communication mechanism. In this way, synchronous configuration is achieved.

[0057] In a possible implementation, the user-mode software is a data plane development tool set. In this way, packets can be sent and received through user-mode software and user-mode drivers, and no separate configuration and additional adaptation are required, because configuration synchronization has been achieved through the shared binding port configuration scheme and shared binding port unloading, and the first user-mode binding port can be used as a representative port to achieve complete hardware unloading, and forwarding and routing are completed by hardware, which helps to reduce system burden and improve forwarding performance.

[0058] In a possible implementation, the first user-mode binding port is used as a representative port to achieve complete hardware offloading. In this way, it supports offloading the binding port forwarding to dedicated hardware, and the hardware completes the forwarding and routing, which helps to reduce the system burden and improve the forwarding performance.

[0059] Figure 3 3 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.

[0060] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0061] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0062] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.

[0063] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0064] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.

[0065] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0066] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.

[0067] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0068] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for unloading a shared binding port, characterized in that: The method comprises: In the kernel space of the host machine, determine a first kernel state binding port configuration and create a first kernel state binding port according to the first kernel state binding port configuration, wherein the first kernel state binding port configuration includes an identifier of a first link aggregation group and a first link aggregation group configuration, the first link aggregation group configuration includes at least a member port of the first link aggregation group and a first corresponding relationship between a member port and a slave port of the first link aggregation group, the first link aggregation group corresponds to a first Ethernet port of a message transceiver hardware connected to the host machine, and the member port of the first link aggregation group corresponds to a physical function of the message transceiver hardware; In the user space of the host machine, determining a first user-state binding port configuration based on the first kernel-state binding port configuration, and then creating a first user-state binding port according to the first user-state binding port configuration, wherein the first user-state binding port configuration includes an identifier of the first link aggregation group and specifies that the first user-state binding port is a master port relative to the slave port; In the kernel-mode driver of the kernel space, in response to completion of creation of the first kernel-mode binding port, sending the identifier of the first link aggregation group and the first link aggregation group configuration to the message transceiver hardware, and, in response to update of the first link aggregation group configuration, sending the updated first link aggregation group configuration to the message transceiver hardware; The user-state software in the user space cooperates with the message receiving and sending hardware based on the identifier of the first link aggregation group, so as to perform packet receiving and sending operations through the first user-state binding port.

2. The method according to claim 1, characterized in that The user state software, based on the identifier of the first link aggregation group, cooperates with the message transceiver hardware to perform a packet receiving operation through the first user state binding port, including: The message transceiver hardware receives traffic through the first Ethernet port and performs a flow table query. When the flow table query is successful, the message transceiver hardware forwards the traffic. When the flow table query fails, the message transceiver hardware sends the traffic to the slave port based on the identifier of the first link aggregation group.

3. The method according to claim 1, characterized in that The user state software, based on the identifier of the first link aggregation group, cooperates with the message transceiver hardware to perform a packet sending operation through the first user state binding port, including: The user-mode software adds a message extension header to the message to be sent to obtain an extended message to be sent, and then sends the extended message to be sent to the message transceiver hardware, wherein the message extension header includes target port information; The message receiving and sending hardware determines the target port information and thus the identifier of the first link aggregation group by parsing the extended message to be sent, and then determines whether the updated first link aggregation group configuration exists based on the identifier of the first link aggregation group. If yes, the message to be sent is forwarded according to the updated first link aggregation group configuration; if not, the message to be sent is forwarded according to the first link aggregation group configuration.

4. The method according to claim 3, characterized in that The first link aggregation group configuration also includes a routing algorithm of the first link aggregation group, and the routing algorithm of the first link aggregation group is determined based on the binding mode of the first kernel state binding port.

5. The method according to claim 4, characterized in that The updating of the first link aggregation group configuration includes: changing the routing algorithm of the first link aggregation group to obtain an updated routing algorithm of the first link aggregation group, wherein the updated first link aggregation group configuration includes the updated routing algorithm of the first link aggregation group.

6. The method according to claim 4, characterized in that The binding mode of the first kernel-mode binding port is a polling mode, a master-slave mode, a selection policy mode, a broadcast policy mode, a dynamic link aggregation policy mode, a network card rate selection mode, or a load balancing policy mode.

7. The method according to claim 1, characterized in that The updating of the configuration of the first link aggregation group includes: changing the member port of the first link aggregation group to obtain the updated member port of the first link aggregation group, and changing the first corresponding relationship to obtain the updated first corresponding relationship between the updated member port of the first link aggregation group and the subordinate port, wherein the updated first link aggregation group configuration includes the updated member port of the first link aggregation group and the updated first corresponding relationship.

8. The method according to claim 7, characterized in that After the configuration of the first link aggregation group is updated, the identifier of the first link aggregation group and the slave port remain unchanged.

9. The method according to claim 8, characterized in that The method further comprises: Determine a second kernel state binding port configuration different from the first kernel state binding port configuration, then create a second kernel state binding port different from the first kernel state binding port according to the second kernel state binding port configuration, and, based on the second kernel state binding port, determine a second user state binding port configuration different from the first user state binding port configuration, then create a second user state binding port different from the first user state binding port according to the second user state binding port configuration, thereby constructing a second link aggregation group configuration, wherein the second link aggregation group configuration has an identifier and subordinate port different from those of the first link aggregation group configuration.

10. The method according to claim 1, characterized in that The method further comprises: The message transceiver hardware filters the data messages received through the first Ethernet port, thereby uploading the data messages that meet the message feature screening rules to the first kernel mode binding port or the first user mode binding port.

11. The method according to claim 10, characterized in that When the data message is a protocol type message, the message transceiver hardware uploads the data message to the first kernel state binding port so as to process the data message through the kernel protocol stack in the kernel space.

12. The method according to claim 10, characterized in that When the data message is associated with an application or a library file in the user space, the message transceiver hardware uploads the data message to the first user-mode binding port.

13. The method according to claim 1, characterized in that The network device of the host machine includes a first virtual interface and a second virtual interface, the first virtual interface corresponds to the first kernel-state binding port, and the second virtual interface corresponds to the first user-state binding port, and the network device is configured to be managed by the kernel-state driver through the first virtual interface, or managed by the user-state driver in the user space through the second virtual interface.

14. The method according to claim 13, characterized in that The message receiving and sending hardware includes an email communication mechanism, and the interaction between the kernel state driver and the user state driver is performed through the email communication mechanism. The user state driver obtains the first kernel state binding port configuration from the kernel state driver through the email communication mechanism.

15. The method according to claim 1, characterized in that The user-mode software is a data plane development tool set.

16. The method according to claim 1, characterized in that The first user-mode binding port is used as a representative port to achieve complete hardware unloading.

17. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 16 when executing the computer program.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • A method, apparatus, and device for accessing a user-space network file system.

    CN109040207B

  • Logic binding port management method, device and system and storage medium

    CN117768292A