Flow table offloading system, device and cluster
By using hardware channels in the network card to write the configuration information of physical functions and virtual functions serially into registers, the dirty data problem caused by functional competition in the network virtualization environment is solved, and efficient traffic processing is achieved.
Patent Information
- Application Number
- CN202411836895.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In a network virtualization environment, competition between the physical functions and virtual functions of the network card leads to the emergence of dirty data, which cannot effectively meet the performance requirements of traffic processing.
By introducing hardware channels into the network card, the configuration information of physical functions and virtual functions is written serially into the registers to avoid competition between functions, thereby achieving seamless uninstallation of the flow table.
It effectively avoids competition between physical and virtual functions, prevents the emergence of dirty data, and improves the performance and efficiency of traffic processing.
Smart Images

Figure CN119299372B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communications, and in particular to a flow table unloading system, device, and cluster. Background Art
[0002] Network virtualization is a technology that abstracts, integrates, and virtualizes physical network resources into multiple logical networks. Through network virtualization, multiple isolated and independently running virtual networks can be created on the same physical network infrastructure. Each virtual network can have its own topology, IP address range, routing policy, security policy, etc., just like having an independent physical network. After network virtualization, the forwarding of traffic between virtual machines and between virtual machines and external devices has become an urgent problem to be solved. However, pure software forwarding can never meet performance requirements, and the massive traffic processing of software will also consume a lot of host resources; therefore, hardware offloading based on the virtual switch-data plane development kit came into being, that is, the processing of traffic is offloaded to the hardware processing of the network card through the virtual switch-data plane development kit. However, the physical and virtual functions of the network card currently compete, resulting in dirty data. Summary of the invention
[0003] The present application provides a flow table unloading system, device and cluster, which can avoid competition between the physical function and virtual function of the network card, thereby preventing dirty data from occurring.
[0004] In a first aspect, a flow table unloading system is provided, including:
[0005] A processor, used for communicating with the network card;
[0006] A network card, used for running a virtual switch and a data plane development kit, wherein the virtual switch is a switch virtualized based on hardware resources, the data plane development kit is used to assist the virtual switch to improve the performance of the virtual switch, the network card includes a first physical function and a first virtual function, the first physical function is used to manage the first virtual function, and the first physical function corresponds to a first register;
[0007] The network card further includes a physical driver and a virtual driver, the physical driver is used to drive the first physical function, the virtual driver is used to drive the first virtual function, the physical driver includes a first hardware channel, and the first hardware channel is used to serially write first virtual configuration information of the first virtual function and first physical configuration information of the first physical function into the first register;
[0008] The virtual switch and the data plane development kit are used to unload the first software forwarding flow table of the first virtual function to the memory of the network card after the configuration of the first register is completed.
[0009] In the above scheme, because the physical function and the virtual function virtualized based on the physical function send their respective configuration information to the hardware channel, the hardware channel writes this information serially into the first register, which avoids the competition between the physical function and the virtual function and causes dirty data.
[0010] In some possible designs, the network card includes a management tool,
[0011] The management tool is used to send the first virtual configuration information to the first virtual service of the virtual driver, the first virtual service is used to send the first virtual configuration information to the first virtual mailbox, the first virtual mailbox is used to send the first virtual configuration information to the first physical mailbox of the physical driver, and the first physical mailbox is used to send the first virtual configuration information to the first hardware channel; or
[0012] The management tool is used to send first physical configuration information to the first physical service of the physical driver, and the first physical service is used to send the first physical configuration information to the first hardware channel.
[0013] In some possible designs, the physical driver further includes a first user-mode character device,
[0014] The data plane development kit is further used to send the first physical configuration information to the first user-mode character device, and the first user-mode character device is used to send the first physical configuration information to the first hardware channel.
[0015] In some possible designs, the network card further includes a kernel driver, and the kernel driver is used to unload the first hardware forwarding flow table of the first virtual function to the memory of the network card after completing the configuration of the first register;
[0016] The network card is also used to use the first software forwarding flow table to forward the traffic of the first virtual function and stop using the first hardware forwarding flow table to forward the traffic of the first virtual function when sensing that the first physical function enters the unloaded network mode from the physical network mode.
[0017] In the above solution, the network card can store the forwarding flow table of the physical network mode and the uninstalled network mode at the same time. Different flow tables can be used in different modes, avoiding the need to uninstall the forwarding flow table when switching to different modes, resulting in unclean flow table unloading and erroneous forwarding.
[0018] In some possible designs, the network card is also used to open a first user-state character device when it detects that the data plane development kit adds a first detection device for the physical driver, and send a first switching command to the kernel driver through the first user-state character device, and the first switching command notifies the kernel driver to stop using the first hardware forwarding flow table to forward traffic of the first virtual function.
[0019] In the above solution, the network card can enter the unloaded network mode from the physical network mode imperceptibly through the above method, and the user is completely unaware of it, which is very convenient to use.
[0020] In some possible designs, the network card is also used to stop using the first software forwarding flow table to forward traffic of the first virtual function when sensing that the first physical function enters the physical network mode from the offload network mode, and use the first hardware forwarding flow table to forward traffic of the first virtual function.
[0021] In some possible designs, the network card is also used to send a second switching command to the first kernel-state character device of the kernel driver through the first user-state character device and close the first user-state character device when the data plane development kit is closed, and the second switching command is used to notify the kernel driver to reuse the first hardware forwarding flow table to forward the traffic of the first virtual function.
[0022] In the above solution, the network card can enter the physical network mode from the uninstall network mode imperceptibly through the above method, and the user is completely unaware of it, which is very convenient to use.
[0023] In some possible designs, the network card includes a second physical function and a second virtual function, the second physical function is used to manage the second virtual function, and the second physical function corresponds to a second register;
[0024] The physical driver is further used to drive the second physical function, the virtual driver is further used to drive the second virtual function, the second physical driver includes a second hardware channel, and the second hardware channel is used to serially write second virtual configuration information of the second virtual function and second physical configuration information of the second physical function into the second register;
[0025] The virtual switch and the data plane development kit are used to unload the second software forwarding flow table of the second virtual function to the memory of the network card after the configuration of the second register is completed.
[0026] In the above scheme, multiple physical functions correspond to different registers, thereby avoiding competition among physical functions for registers, which may lead to dirty data. Therefore, unlike the prior art that can only unload one physical function, multiple physical functions can be unloaded.
[0027] In a second aspect, a computing device is provided, including a flow table unloading system and a storage unit, wherein the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of the first aspects.
[0028] In a third aspect, a computing device cluster is provided, including a flow table unloading system and a storage unit, wherein the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0030] Figure 1 It is a structural diagram of a software defined network (SDN) provided in this application;
[0031] Figure 2 It is a structural schematic diagram of a flow table unloading system provided by this application;
[0032] Figure 3 is a schematic diagram of a writing method of a first register provided by the present application;
[0033] Figure 4 This is a schematic diagram of a flow table delivery provided by this application;
[0034] Figure 5 It is a schematic diagram of the corresponding relationship between a detection device and a virtual function provided by the present application;
[0035] Figure 6 It is a structural schematic diagram of a computing device provided by this application. DETAILED DESCRIPTION
[0036] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention. The terms used in the implementation mode of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0037] See also Figure 1 , Figure 1This is a schematic diagram of the structure of a software defined network (SDN) provided by this application. Figure 1 As shown, the software defined network of the present application includes: an SDN controller 110 and an open virtual switch (open vSwitch, OVS) 120.
[0038] The SDN controller 110 is a core component in the SDN architecture, which is responsible for the centralized management and control of the entire network. The SDN controller separates the control plane of the network from the data plane, thereby providing a more flexible, programmable and scalable network management method. The main functions of the SDN controller include: managing the control plane of the entire network, including topology discovery, route calculation, flow table delivery, etc. Specifically, the SDN controller 110 collects the topology information of the network by communicating with OVS120, calculates the route according to the application requirements, and then delivers the flow table to OVS120. Secondly, the SDN controller 110 can dynamically adjust the network routing and traffic distribution according to the characteristics and requirements of the traffic, thereby achieving load balancing, congestion control and service quality assurance of the traffic; it can implement security measures such as access control, traffic filtering and intrusion detection, and respond to network security events in a timely manner to protect the network from malicious attacks and data leakage threats, etc. The SDN controller 110 can be a physical device or a virtual device. When the number of SDN controllers 110 is multiple, physical devices and virtual devices can also be used in combination. The SDN controller 110 can run in physical servers, virtual machines, containers, cloud platforms, and bare metal servers.
[0039] OVS120 is an open source virtual switch software that implements a flexible, programmable and scalable switch platform for communicating with the SDN controller through the OpenFlow protocol, receiving the flow table issued by the SDN controller 110, and implementing traffic forwarding and routing according to the flow table. OVS120 supports packet switching and routing in Layer 2 and Layer 3 networks, so OVS120 supports the processing of Ethernet data frames and data packets, etc. OVS120 can run on physical servers, virtual machines, containers, cloud platforms, and bare metal servers. OVS120 can also be used in combination with physical switches, etc.
[0040] The SDN controller 110 and OVS120 can both be set in a container. In this case, the SDN controller 110 and OVS120 can be concentrated in the same container or distributed in different containers. The SDN controller 110 and OVS120 can both be set in a virtual machine. In this case, the SDN controller 110 and OVS120 can be concentrated in the same virtual machine or distributed in different virtual machines. The SDN controller 110 and OVS120 can both be set in a server. In this case, the SDN controller 110 and OVS120 can be concentrated in the same server or distributed in different servers. The SDN controller 110 and OVS120 can both be set in a bare metal server. In this case, the SDN controller 110 and OVS120 can be concentrated in the same bare metal server or distributed in different bare metal servers. Alternatively, the SDN controller 110 is set in a container, and OVS120 is set in any one of a virtual machine, a server, and a bare metal server. The SDN controller 110 is set in the virtual machine, and the OVS 120 is set in any one of the container, the server, and the bare metal server. The SDN controller 110 is set in the server, and the OVS 120 is set in any one of the container, the virtual machine, and the bare metal server. The SDN controller 110 is set in the bare metal server, and the OVS 120 is set in any one of the container, the virtual machine, and the server.
[0041] The message of the local end can be forwarded to the remote end through the above software defined network. Among them, the local end can be integrated with at least one of OVS120 and SDN controller 110 in the same server. The remote end can also be integrated with at least one of OVS120 and SDN controller 110 in the same server.
[0042] The above OVS120 is usually virtualized using computing resources (e.g., processor), storage resources, and network resources (e.g., network card) of computing devices, and in order to improve the forwarding performance of OVS120, it is often necessary to set up offloading hardware for acceleration. Therefore, the processor, offloading hardware, and network card can form a message transmission system.
[0043] In the above example, the controller is an SDN controller and the forwarding device is OVS. In actual applications, the controller can also be other open source controllers such as OpenStack, Kubernetes, etc. In addition, the controller can also be a privately developed controller, and the forwarding device can also be other privately developed forwarding devices, etc., which are not specifically limited here.
[0044] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a flow table unloading system provided by this application. Figure 2 As shown, the flow table unloading system of the present application includes a processor 11 and a network card 13.
[0045] The processor 11 is used to communicate with the network card. The processor 11 is a computing core and a control core, and can handle complex situations. The processor 11 can be a very large-scale integrated circuit. An operating system and other software programs are installed in the processor 11, so that the processor 11 can access the memory and various PCIE devices. The processor 11 can quickly access the memory through the on-chip bus. The processor 11 may include one or more processor cores. In one implementation, the processor 11 may be a multi-core chip, that is, a chip containing multiple processing cores. In another implementation, the processor 11 may include one or more processor cores. It can be a chip with one processing core. The processor 11 unloads the flow table to the network card cache 12.
[0046] The network card 13 is used to provide hardware resources for network communication. Since it has a Media Access Control Address (MAC) address, it belongs between Layer 1 and Layer 2 of the Open System Interconnection (OSI) model. It allows users to connect to each other via cables or wirelessly. Each network card has a unique 48-bit serial number called a MAC address, which is written in a read-only memory on the card. Here, the network card can be a Field Programmable Gate Array (FPGA) network card or an Application Specific Integrated Circuit (ASIC) network card, etc.
[0047] The network card 13 runs a virtual switch and a data plane development kit. The virtual switch is a switch virtualized based on hardware resources, and the data plane development kit is used to assist the virtual switch to improve the performance of the virtual switch. The network card 13 performs hardware virtualization through single root I / O virtualization (SR-IOV). SR-IOV allows a physical high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) device (such as network card 13) to be presented as multiple independent virtual devices, each of which can be directly assigned to a virtual machine for use. SR-IOV usually includes a physical function (Physical Function, PF) and a virtual function (Virtual Function, VF). Among them, PF is used for VF management, and VF can be directly assigned to virtual machines for use, and each PF is independent of each other. The following will take the network card including the first physical function and the second physical function as an example for explanation. Among them, the first virtual function is virtualized based on the first physical function, the first physical function is used to manage the first virtual function, and the first register is set corresponding to the first physical function. A second virtual function is virtualized based on the second physical function. The second physical function is used to manage the second virtual function. A second register is set corresponding to the second physical function.
[0048] like Figure 3 As shown, the network card also includes a physical driver and a virtual driver. The physical driver is used to drive the first physical function, and the virtual driver is used to drive the first virtual function. The virtual driver includes a first virtual service and a first virtual mailbox, and the physical driver includes a first user-mode character device, a first physical service, a first physical mailbox, and a first hardware channel.
[0049] When the management tool needs to write the first virtual configuration information to the first register, the management tool sends the first virtual configuration information to the first virtual service of the virtual driver, the first virtual service sends the first virtual configuration information to the first virtual mailbox, the first virtual mailbox sends the first virtual configuration information to the first physical mailbox of the physical driver, the first physical mailbox sends the first virtual configuration information to the first hardware channel, and then the first hardware channel writes the first virtual configuration information into the first register. The first virtual configuration information is used to respond to network device management commands such as ip, ifconfig, ethtool, etc. to set some properties of the first virtual function, such as setting the maximum transmission unit (Maximum Transmission Unit, MTU) and media access control (Media Access Control, MAC).
[0050] When the management tool needs to write the first physical configuration information to the first register, the management tool sends the first physical configuration information to the first physical service of the physical driver, the first physical service sends the first physical configuration information to the first hardware channel, and the first hardware channel writes the first physical configuration information into the first register. The first physical configuration information is used to respond to network device management commands such as ip, ifconfig, ethtool, etc. to set some properties of the first physical function, such as MTU, MAC, and even TCP Segmentation Offload (TSO), TCP Offload Engine (TOE), etc.
[0051] When the data plane development kit needs to write the first physical configuration information to the first register, the data plane development kit sends the first physical configuration information to the first user state character device, the first user state character device sends the first physical configuration information to the first hardware channel, and the first hardware channel writes the first physical configuration information into the first register.
[0052] Since the first physical configuration information of the first physical function and the first virtual configuration information of the first virtual function are both sent to the first hardware channel, in order to avoid competition between the first physical function and the first virtual function for the first register, resulting in dirty data, the first hardware channel serially writes the first virtual configuration information of the first virtual function and the first physical configuration information of the first physical function into the first register.
[0053] The network card also includes a second physical driver and a second virtual driver. The second physical driver is used to drive a second physical function, and the second virtual driver is used to drive a second virtual function. The second virtual driver includes a second virtual service and a second virtual mailbox, and the second physical driver includes a second user-mode character device, a second physical service, a second physical mailbox, and a first hardware channel.
[0054] When the management tool needs to write the second virtual configuration information to the second register, the management tool sends the second virtual configuration information to the second virtual service of the second virtual driver, the second virtual service sends the second virtual configuration information to the second virtual mailbox, the second virtual mailbox sends the second virtual configuration information to the second physical mailbox of the second physical driver, the second physical mailbox sends the second virtual configuration information to the second hardware channel, and the second hardware channel writes the second virtual configuration information into the second register. The second virtual configuration information is used to respond to network device management commands such as ip, ifconfig, ethtool, etc. to set some properties of the second virtual function, such as setting the maximum transmission unit (Maximum Transmission Unit, MTU) and media access control (Media Access Control, MAC).
[0055] When the management tool needs to write the second physical configuration information to the second register, the management tool sends the second physical configuration information to the second physical service of the second physical driver, the second physical service sends the second physical configuration information to the second hardware channel, and the second hardware channel writes the second physical configuration information into the second register. The second physical configuration information is used to respond to network device management commands such as ip, ifconfig, ethtool, etc. to set some properties of the second physical function, such as MTU, MAC, and even TSO, TOE, etc.
[0056] When the data plane development kit needs to write the second physical configuration information to the second register, the data plane development kit sends the second physical configuration information to the second user state character device, the second user state character device sends the second physical configuration information to the second hardware channel, and the second hardware channel writes the second physical configuration information into the second register.
[0057] Since the second physical configuration information of the second physical function and the second virtual configuration information of the second virtual function are both sent to the second hardware channel, in order to avoid competition between the second physical function and the second virtual function for the second register, resulting in dirty data, the second hardware channel serially writes the second virtual configuration information of the second virtual function and the second physical configuration information of the second physical function into the second register.
[0058] In the above example, a network card includes two physical functions, and each physical function has only one virtual function. In actual applications, the network card may include more physical functions, each physical function may include more virtual functions, and the number of virtual functions of different physical functions may be the same or different.
[0059] After completing the configuration, you can offload the forwarding flow table to the network card's memory. Figure 4 As shown, unloading the forwarding flow table to the memory of the network card may include:
[0060] When the first physical configuration information is configured and the first physical function is in physical network mode, the kernel driver unloads the first hardware forwarding flow table of the first virtual function to the memory of the network card. The physical network mode indicates that the traffic forwarding of the first virtual function is managed by the kernel driver, and all traffic is forwarded through the standard kernel driver and protocol stack collaboration. The kernel driver will send the first hardware forwarding flow table of the first virtual function to the memory of the network card, and the unloaded first hardware forwarding flow table can be called a physical network. Since the number of the first hardware forwarding flow tables is relatively small, the first physical driver can download the first hardware forwarding flow table to the memory of the network card through the first configuration interface channel.
[0061] When the second physical configuration information is configured and the second physical function is in physical network mode, the kernel driver unloads the second hardware forwarding flow table of the second virtual function to the memory of the network card. Since the number of the second hardware forwarding flow tables is relatively small, the second physical driver can download the second hardware forwarding flow table to the memory of the network card through the second configuration interface channel.
[0062] When the first virtual configuration information is configured and the first physical function is in the offload network mode, the data plane development kit offloads the first software forwarding flow table of the first virtual function to the memory of the network card. The offload network mode means that the traffic forwarding of the first virtual function is managed by the offload software (for example, the virtual switch and the data plane development kit), and all traffic is guided by the offload software to forward and offload. The data plane development kit will send the first software forwarding flow table of the first virtual function to the memory of the network card, and the offloaded first software forwarding flow table can be called an offload network. Since the number of first software forwarding flow tables is relatively large, the data plane development kit can download the first software forwarding flow table to the memory of the network card through the first command interface channel.
[0063] When the second virtual configuration information is configured and the second physical function is in the offload network mode, the kernel driver offloads the second software forwarding flow table of the second virtual function to the memory of the network card. Since the number of the second software forwarding flow tables is relatively small, the data plane development kit can download the second software forwarding flow table to the memory of the network card through the second command interface channel.
[0064] The above-mentioned first hardware forwarding flow table and the first software forwarding flow table exist in the memory of the network card at the same time, so it is necessary to mark the first hardware forwarding flow table and the first software forwarding flow table with different identifiers. For example, a single digit can be used for marking. When the value of the digit is a first value, it indicates that the corresponding flow table is the first hardware forwarding flow table. When the value of the digit is a second value, it indicates that the corresponding flow table is the first software forwarding flow table. The same is true for the first hardware forwarding flow table and the first software forwarding flow table.
[0065] The first physical function can enter the offload network mode from the physical network mode imperceptibly, and can also enter the physical network mode from the offload network mode imperceptibly, which will be introduced in detail below.
[0066] The process of the first physical function imperceptibly entering the unloaded network mode from the physical network mode is as follows: when it is detected that the data plane development kit adds the first detection device to the physical driver, the first user-mode character device is opened, and the first switching command is sent to the kernel driver through the first user-mode character device, and the first switching command notifies the kernel driver to stop using the first hardware forwarding flow table to forward the traffic of the first virtual function. Thereafter, when the network card senses that the first physical function enters the unloaded network mode from the physical network mode, it stops using the first hardware forwarding flow table to forward the traffic of the first virtual function, and uses the first software forwarding flow table to forward the traffic of the first virtual function.
[0067] The process of the first physical function imperceptibly entering the physical network mode from the uninstall network mode is as follows: when the data plane development kit is turned off, the second switching command is sent to the first kernel-mode character device of the kernel driver through the first user-mode character device, and the first user-mode character device is turned off. The second switching command is used to notify the kernel driver to reuse the first hardware forwarding flow table to forward the traffic of the first virtual function. Thereafter, the network card stops using the first software forwarding flow table to forward the traffic of the first virtual function, and uses the first hardware forwarding flow table to forward the traffic of the first virtual function.
[0068] The second physical function can enter the offload network mode from the physical network mode imperceptibly, and can also enter the physical network mode from the offload network mode imperceptibly, which will be introduced in detail below.
[0069] The process of the second physical function imperceptibly entering the unloaded network mode from the physical network mode is as follows: when it is detected that the data plane development kit adds a second detection device to the physical driver, the second user-mode character device is opened, and the third switching command is sent to the kernel driver through the second user-mode character device, and the third switching command notifies the kernel driver to stop using the second hardware forwarding flow table to forward the traffic of the second virtual function. Thereafter, when the network card senses that the second physical function enters the unloaded network mode from the physical network mode, it stops using the second hardware forwarding flow table to forward the traffic of the second virtual function, and uses the second software forwarding flow table to forward the traffic of the second virtual function.
[0070] The process of the second physical function imperceptibly entering the physical network mode from the uninstall network mode is as follows: when the data plane development kit is turned off, the fourth switching command is sent to the second kernel-mode character device of the kernel driver through the second user-mode character device, and the second user-mode character device is turned off. The fourth switching command is used to notify the kernel driver to reuse the second hardware forwarding flow table to forward the traffic of the second virtual function. Thereafter, the network card stops using the second software forwarding flow table to forward the traffic of the second virtual function, and uses the second hardware forwarding flow table to forward the traffic of the second virtual function.
[0071] like Figure 5 As shown, the first detection device corresponds to the first virtual function, and the second detection device corresponds to the second virtual function. Among them, the first detection device and the second detection device are both mounted on the bridge of the virtual switch. Therefore, the forwarding of the first virtual function can be realized through the forwarding of the first detection device (the name of the representative port also comes from this), and thus unloading can also be realized. If the first virtual function wants to realize the forwarding and unloading of the virtual switch and the data plane development kit, then the corresponding first detection device must be created first, the first virtual function is exposed to the user, and the corresponding first detection device is added to the bridge of the virtual switch for forwarding and unloading. The second detection device is similar to the first detection device and will not be repeated here.
[0072] See also Figure 6 , Figure 6 4 is a schematic diagram of a computing device provided by the present application. The computing device 400 includes: one or more processing units 410 , a communication interface 420 and a storage unit 430 .
[0073] The processing unit 410, the communication interface 420 and the storage unit 430 are interconnected via a bus 440. Optionally, the computing device 400 may also include an input / output interface 450, which is connected to an input / output device for receiving parameters set by a user, etc. The computing device 400 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 processing unit 410 can also be used to implement some or all of the operation 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 400 can refer to the specific details in the above-mentioned embodiment, such as the processing unit 410 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 the embodiment of the present application, the computing device 400 can be used to implement some or all of the functions of one or more components in the above-mentioned device embodiment, and the communication interface 420 can be specifically used for the communication functions necessary to implement the functions of these devices and components, and the processing unit 410 can be specifically used for the processing functions necessary to implement the functions of these devices and components, etc.
[0074] Figure 6 The computing device 400 may include one or more processing units 410, and the multiple processing units 410 may provide processing capabilities in a coordinated manner in a parallel connection manner, a serial connection manner, a serial-parallel connection manner, or any connection manner, or the multiple processing units 410 may constitute a processor sequence or a processor array, or the multiple processing units 410 may be divided into a main processor and an auxiliary processor, or the multiple processing units 410 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 6 The computing device 400 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 400 may include Figure 6 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0075] The processing unit 410 may have a variety of specific implementation forms. For example, the processing unit 410 may include a processor (central processing unit, CPU), a graphic processing unit (graphic processing unit, GPU), a neural-network processing unit (neural-network processing unit, NPU), a tensor processing unit (tensor processing unit, TPU) or a data processing unit (data processing unit, DPU) and other combinations thereof, which are not specifically limited in the embodiments of the present application. The processing unit 410 may also be a single-core processor or a multi-core processor. The processing unit 410 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a generic array logic (generic array logic, GAL) or any combination thereof. The processing unit 410 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (digital signal processor, DSP), etc. The communication interface 420 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.
[0076] The storage unit 430 may be a non-volatile memory, such as a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The storage unit 430 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 random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous connection dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). The storage unit 430 may also be used to store program codes and data, so that the processing unit 410 can call the program codes stored in the storage unit 430 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 6 Show more or fewer components, or have different component configurations.
[0077] The bus 440 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 440 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 440 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 6 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.
[0078] The present application also provides 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 embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0079] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one network site, computer, server or data center to another network site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or it can be a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape, etc.), an optical medium (e.g., a DVD, etc.), or a semiconductor medium (e.g., a solid-state hard disk), etc. In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
Claims
1. A flow table unloading system, characterized in that: include: A processor, used for communicating with the network card; A network card, used for running a virtual switch and a data plane development kit, wherein the virtual switch is a switch virtualized based on hardware resources, the data plane development kit is used to assist the virtual switch to improve the performance of the virtual switch, the network card includes a first physical function and a first virtual function, the first physical function is used to manage the first virtual function, and the first physical function corresponds to a first register; The network card further includes a physical driver and a virtual driver, the physical driver is used to drive the first physical function, the virtual driver is used to drive the first virtual function, the physical driver includes a first hardware channel, and the first hardware channel is used to serially write first virtual configuration information of the first virtual function and first physical configuration information of the first physical function into the first register; The virtual switch and the data plane development kit are used to unload the first software forwarding flow table of the first virtual function to the memory of the network card after the configuration of the first register is completed.
2. The system according to claim 1, characterized in that The network card includes a management tool, The management tool is used to send the first virtual configuration information to the first virtual service of the virtual driver, the first virtual service is used to send the first virtual configuration information to a first virtual mailbox, the first virtual mailbox is used to send the first virtual configuration information to the first physical mailbox of the physical driver, and the first physical mailbox is used to send the first virtual configuration information to the first hardware channel; or The management tool is used to send first physical configuration information to the first physical service of the physical driver, and the first physical service is used to send the first physical configuration information to the first hardware channel.
3. The system according to claim 2, characterized in that The physical driver also includes a first user-mode character device, The data plane development kit is further used to send the first physical configuration information to the first user-mode character device, and the first user-mode character device is used to send the first physical configuration information to the first hardware channel.
4. The system according to claim 1, characterized in that The network card further includes a kernel driver, wherein the kernel driver is used to unload the first hardware forwarding flow table of the first virtual function to the memory of the network card after completing the configuration of the first register; The network card is also used to use the first software forwarding flow table to forward the traffic of the first virtual function and stop using the first hardware forwarding flow table to forward the traffic of the first virtual function when sensing that the first physical function enters the unloaded network mode from the physical network mode.
5. The system according to claim 4, characterized in that The network card is also used to open a first user-state character device and send a first switching command to the kernel driver through the first user-state character device when it is detected that the data plane development kit adds a first detection device for the physical driver. The first switching command notifies the kernel driver to stop using the first hardware forwarding flow table to forward traffic of the first virtual function.
6. The system according to claim 5, characterized in that The network card is also used to stop using the first software forwarding flow table to forward the traffic of the first virtual function and use the first hardware forwarding flow table to forward the traffic of the first virtual function when sensing that the first physical function enters the physical network mode from the offload network mode.
7. The system according to claim 5, characterized in that The network card is also used to send a second switching command to the first kernel-state character device of the kernel driver through the first user-state character device and close the first user-state character device when the data plane development kit is closed, and the second switching command is used to notify the kernel driver to reuse the first hardware forwarding flow table to forward the traffic of the first virtual function.
8. The system according to claim 1, characterized in that The network card includes a second physical function and a second virtual function, the second physical function is used to manage the second virtual function, and the second physical function corresponds to a second register; The physical driver is further used to drive the second physical function, the virtual driver is further used to drive the second virtual function, the physical driver further includes a second hardware channel, and the second hardware channel is used to serially write the second virtual configuration information of the second virtual function and the second physical configuration information of the second physical function into the second register; The virtual switch and the data plane development kit are used to unload the second software forwarding flow table of the second virtual function to the memory of the network card after the configuration of the second register is completed.
9. A computing device, characterized in that It comprises a flow table unloading system and a storage unit, the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of claims 1-8.
10. A computing device cluster, characterized in that: It comprises a flow table unloading system and a storage unit, the flow table unloading system and the storage unit can communicate with each other, and the flow table unloading system is a system as described in any one of claims 1-8.
Citation Information
Patent Citations
Information processing method, physical machine and PCIE equipment
CN112306624A
Thermal migration method and device of virtual machine
CN114546604A