CN103609077A - Method, apparatus and system for data transmission, and physical adapter - Google Patents
Method, apparatus and system for data transmission, and physical adapter Download PDFInfo
- Publication number
- CN103609077A CN103609077A CN201380000801.1A CN201380000801A CN103609077A CN 103609077 A CN103609077 A CN 103609077A CN 201380000801 A CN201380000801 A CN 201380000801A CN 103609077 A CN103609077 A CN 103609077A
- Authority
- CN
- China
- Prior art keywords
- module
- module group
- group
- determining
- network card
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 66
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000006870 function Effects 0.000 claims description 24
- 230000003068 static effect Effects 0.000 claims description 21
- 230000002093 peripheral effect Effects 0.000 claims description 8
- 230000002776 aggregation Effects 0.000 claims description 5
- 238000004220 aggregation Methods 0.000 claims description 5
- 239000002699 waste material Substances 0.000 abstract description 12
- 238000010586 diagram Methods 0.000 description 9
- 238000007726 management method Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/14—Multichannel or multilink protocols
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
- Computer And Data Communications (AREA)
Abstract
Embodiments of the present invention provide a method, apparatus and system for data transmission, and a physical adapter. The method comprises determining a main physical function (PF) module, which includes at least two PF modules, in a physical function module group; determining a target virtual function (VF) module cluster managed by the main PF module based on the VF module groups corresponding to the PF modules in the PF module group; allocating the VF modules in the target VF module cluster to at least one virtual machine for realizing data transmission. The method, apparatus and system for data transmission in the embodiments can help the system from having failures and help to reduce a waste of resources.
Description
Technical Field
The present invention relates to the field of communications, and more particularly, to a method, an apparatus, and a system for data transmission and a physical network card.
Background
As the basis of the rapid development of cloud computing, the gradual maturity of virtualization technology in the aspects of computing, storage, network, cluster management and the like promotes the application of cloud computing in various fields.
With the development of a Central Processing Unit (CPU) chip technology, a single physical CPU has stronger and stronger capacity, the number of virtual machines that can be provided is increased, the performance requirement on a physical network card is higher, and the number of virtual network cards required to be provided is increased, so as to meet the requirements of more users and improve the utilization rate of cloud resources. In network virtualization, network card virtualization is used as a key technology for solving the last kilometer of virtualization, and after three stages of software simulation and virtual machine Device Queue (VMDq) and Single-Root I/O virtualization (SR-IOV) are developed, the SR-IOV technology has become an ideal Device for solving the last kilometer of virtualization, and the SR-IOV is used for virtualizing a high-speed Peripheral Component Interconnect standard (PCIe) network card Device into at least two PCIe network card devices, and each virtual PCIe network card Device provides services to upper-layer software of a virtual machine as a physical PCIe Device.
SR-IOV is a technical standard of IO virtualization, and allows one physical device to support at least two virtual network cards. The SR-IOV introduces two new Function types, namely a Physical Function (PF) module and a Virtual Function (VF) module. The VF module has a light-weight PCIe function and comprises resources necessary for data transmission and a small amount of configuration resources. The VF module is a separate PCIe device, and can be allocated to a Virtual Machine (VM) for use via a Virtual Machine Management layer (VMM).
However, the PF module, as a key node of the system, will cause system failure and waste of resources once a failure occurs.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a system for data transmission and a physical network card, which can avoid the system from faults and reduce the resource waste.
In a first aspect, a method for data transmission is provided, including: determining a main PF module from a physical function PF module group of a first physical network card, wherein the PF module group comprises at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group; and determining a target VF module group managed by the main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein the VF module in the target VF module group is used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the determining a master PF module from a PF module group of the first physical network card includes: and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module and the static bandwidth of the PF module.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the determining, based on the VF module group corresponding to each PF module in the PF module group, a target VF module group managed by the main PF module includes: and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
With reference to the first aspect, the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the method further includes: determining that the first PF module is re-enabled or recovered from the failure, and determining the first PF module as a PF module in the PF module group; and establishing a VF module group corresponding to the first PF module based on the first PF module.
With reference to the first aspect or any one of the first to third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes: determining that a second PF module is deleted from the PF module group of the first physical network card; and releasing the VF module group corresponding to the second PF module.
With reference to the first aspect or any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes: determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining that the at least one available VF module in the VF module group corresponding to the first PF module is continuously available.
With reference to the first aspect or any one of the first to fifth possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect, the method further includes: determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails; selecting a second VF module different from the first VF module from the VF module group corresponding to each PF module in the PF module group; and updating the target VF module group.
With reference to the first aspect or any one of the first to the sixth possible implementation manners of the first aspect, in a seventh possible implementation manner of the first aspect, the first physical network card occupies at least two PCIe buses, and the method further includes: determining that data of a VF module in the target VF module group connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group connected to a second PCIe bus of the at least two PCIe buses; and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
With reference to the first aspect or any one of the first to the seventh possible implementation manners of the first aspect, in an eighth possible implementation manner of the first aspect, the method further includes: determining that the primary PF module is malfunctioning; selecting PF modules except the main PF module from the PF module group as a new main PF module; and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
In a second aspect, an apparatus for data transmission is provided, including: a first determining unit, configured to determine a main PF module from a physical function PF module group of a first physical network card, where the PF module group includes at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group; a second determining unit, configured to determine, based on a virtual function VF module group corresponding to each PF module in the PF module group, a target VF module group managed by the main PF module, where a VF module in the target VF module group is used to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the first determining unit is specifically configured to: and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module and the static bandwidth of the PF module.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the second determining unit is specifically configured to: and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
With reference to the second aspect, the first possible implementation manner of the second aspect, or the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the apparatus further includes: a fourth determining unit, configured to determine that the first PF module is re-enabled or fails to recover, and determine the first PF module as a PF module in the PF module group; and the establishing unit is used for establishing the VF module group corresponding to the first PF module based on the first PF module.
With reference to the second aspect or any one of the first to third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the apparatus further includes: a fifth determining unit, configured to determine that the second PF module is deleted from the PF module group of the first physical network card; and the releasing unit is used for releasing the VF module group corresponding to the second PF module.
With reference to the second aspect or any one of the first to fourth possible implementation manners of the second aspect, in a fifth possible implementation manner of the second aspect, the apparatus further includes: a sixth determining unit, configured to determine whether a VF module in the VF module group corresponding to the third PF module is available when the third PF module of the first physical network card fails; a holding unit, configured to determine, when at least one VF module in the VF module group corresponding to the third PF module is available, that at least one VF module in the VF module group corresponding to the third PF module is continuously available.
With reference to the second aspect or any one of the first to fifth possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect, the apparatus further includes: a seventh determining unit, configured to determine that a first VF module of the target VF module group that is assigned to a first VM of the at least one VM fails; a selecting unit, configured to select a second VF module different from the first VF module from the VF module group corresponding to each PF module in the PF module group; and an updating unit, configured to update the target VF module group and allocate the second VF module to the first VM.
With reference to the second aspect or any one of the first to the sixth possible implementation manners of the second aspect, in a seventh possible implementation manner of the second aspect, the first physical network card occupies at least two PCIe buses based on a peripheral component interconnect express (PCIe) high speed standard, and the apparatus further includes: an eighth determining unit, configured to determine that data of a VF module in the target VF module group that is connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group that is connected to a second PCIe bus of the at least two PCIe buses; and the sending unit is used for sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
With reference to the second aspect or any one of the first to seventh possible implementation manners of the second aspect, in an eighth possible implementation manner of the second aspect, the apparatus further includes a third determining unit, configured to determine that the main PF module fails; the first determination unit is further configured to: selecting PF modules except the main PF module from the PF module group as a new main PF module; the second determination unit is further configured to: and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
In a third aspect, an apparatus for data transmission is provided, comprising a processor and a memory; wherein the memory stores program codes, and the processor is configured to call the program codes stored in the memory, and perform the following operations: determining a main PF module from a physical function PF module group of a first physical network card, wherein the PF module group comprises at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group; and determining a target VF module group managed by the main PF module based on the virtual function VF module group corresponding to each PF module in the PF module group, wherein the VF module in the target VF module group is used for being distributed to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the processor is configured to call the program code stored in the memory, and specifically perform the following operations: and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module and the static bandwidth of the PF module.
With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the processor is configured to call the program code stored in the memory, and specifically perform the following operations: and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
With reference to the third aspect, the first possible implementation manner of the third aspect, or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the processor is configured to invoke the program code stored in the memory, and further perform the following operations: determining that the first PF module is re-enabled or recovered from the failure, and determining the first PF module as a PF module in the PF module group; and establishing a VF module group corresponding to the first PF module based on the first PF module.
With reference to the third aspect or any one of the first to third possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, the processor is configured to call the program code stored in the memory, and further perform the following operations: determining that a second PF module is deleted from the PF module group of the first physical network card; and releasing the VF module group corresponding to the second PF module.
With reference to the third aspect or any one of the first to fourth possible implementation manners of the third aspect, in a fifth possible implementation manner of the third aspect, the processor is configured to call the program code stored in the memory, and further perform the following operations: determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining that the at least one available VF module in the VF module group corresponding to the first PF module is continuously available.
With reference to the third aspect or any one of the first to fifth possible implementation manners of the third aspect, in a sixth possible implementation manner of the third aspect, the processor is configured to invoke the program code stored in the memory, and further perform the following operations: determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails; selecting a second VF module different from the first VF module from the VF module group corresponding to each PF module in the PF module group; and updating the target VF module group and allocating the second VF module to the first VM.
With reference to the third aspect or any one of the first to sixth possible implementation manners of the third aspect, in a seventh possible implementation manner of the third aspect, the first physical network card occupies at least two PCIe buses, and the processor is configured to call the program code stored in the memory, and further perform the following operations: determining that data of a VF module in the target VF module group connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group connected to a second PCIe bus of the at least two PCIe buses; and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
With reference to the third aspect or any one of the first to the seventh possible implementation manners of the third aspect, in an eighth possible implementation manner of the third aspect, the processor is configured to invoke the program code stored in the memory, and further perform the following operations: determining that the primary PF module is malfunctioning; selecting PF modules except the main PF module from the PF module group as a new main PF module; and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
In a fourth aspect, a physical network card is provided, comprising: the system comprises a PF module group consisting of at least two PF modules and at least two VF module groups; wherein, one PF module of the at least two PF modules corresponds to one VF module group of the at least two VF module groups, and any PF module of the at least two PF modules can manage the VF modules in the VF module groups connected by other PF modules after being determined as the primary PF module.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the VF modules in each VF module group of the at least two VF module groups include two types of spatial resources; wherein, one of the two types of spatial resources is used for being accessed by a PF module corresponding to a VF module group to which the VF module to which the two types of spatial resources belong before the primary PF module is determined; and the other type of space resource is used for establishing connection with the main PF module and accessing the main PF module after the main PF module is determined.
With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the physical network card occupies at least two PCIe buses in the peripheral component interconnect express (PCIe) at high speed, and the physical network card further includes a built-in switch; the built-in switch is used for sending data of a VF module connected with a first PCIe bus of the at least two PCIe buses to a VF module connected with a second PCIe bus of the at least two PCIe buses.
With reference to the fourth aspect, the first possible implementation manner of the fourth aspect, or the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the physical network card is connected to the external switch through at least two ports; the physical network card is further configured to receive a data stream sent by the data transmission device through the aggregation link, and send the data stream to the external switch through each of the at least two ports in a balanced manner.
In a fifth aspect, a system for data transmission is provided, which includes the apparatus for data transmission in any possible implementation manner of the second aspect or the second aspect and the physical network card in any possible implementation manner of the fourth aspect or the fourth aspect, or includes the apparatus for data transmission in any possible implementation manner of the third aspect or the third aspect and the physical network card in any possible implementation manner of the fourth aspect or the fourth aspect; the first physical network card referred to in any possible implementation manner of the second aspect or the second aspect, or the first physical network card referred to in any possible implementation manner of the third aspect or the third aspect is a physical network card referred to in any possible implementation manner of the fourth aspect or the fourth aspect.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for data transmission according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of a method for data transmission according to another embodiment of the present invention.
Fig. 3 is a schematic block diagram of an apparatus for data transmission according to another embodiment of the present invention.
Fig. 4 is a schematic block diagram of an apparatus for data transmission according to another embodiment of the present invention.
Fig. 5 is a schematic block diagram of an apparatus for data transmission according to another embodiment of the present invention.
Fig. 6 is a schematic block diagram of a physical network card according to another embodiment of the present invention.
Fig. 7 is a schematic block diagram of a system for data transmission according to another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a method for data transmission according to an embodiment of the present invention. As shown in fig. 1, the method 100 includes:
s110, determine a main PF module from a first PF module group of a first physical network card, where the first PF module group includes at least two PF modules, and each PF module in the first PF module group corresponds to a different VF module group.
S120, determining a target VF module group managed by the main PF module based on the VF module group corresponding to each PF module in the PF module group, where VF modules in the target VF module group managed by the main PF module are allocated to at least one virtual machine, so that the at least one virtual machine realizes data transmission.
The device for data transmission, for example, the device having at least one processor with a data transmission function, for example, may be a host, or a host group composed of at least two hosts, and may determine a main PF module from a PF module group including at least two PF modules of the first physical network card; then, a target VF module group that needs to be managed by the main PF module is determined from the VF module group corresponding to each PF module in the PF module group, where the VF module in the target VF module group may be allocated to at least one virtual machine, so that each virtual machine may implement data transmission through the VF module.
Therefore, in the embodiment of the present invention, since one physical network card has at least two PF modules to form a first PF module group, and one PF module can be selected from at least two PF modules in the first PF module group as a main PF module, since at least two PF modules are available for selection, the reliability of the main PF module is increased, thereby reducing the probability of system failure and reducing the resource waste caused by system failure.
The physical network card mentioned in the embodiment of the present invention may also be referred to as an SR-IOV network card, which may include two functional modules, a PF module and a VF module, and those skilled in the art should know that these functional modules are also referred to as PF and VF for short. The PF module supports PCIe function of SR-IOV expansion function and is used for configuring and managing SR-IOV function characteristics; the VF module implements simplified PCIe functions. After determining the master PF module from the set of PF modules and determining the target VF module group managed by the master PF module, a Virtual Machine Management (VMM) may allocate each VF module in the target VF module group to a Virtual Machine (VM) as a PCIe device. When the VM accesses the allocated VF module, the VM initiates a request, the main PF module and the VMM respond to the request, and a result is returned to the VM. When the VM receives and transmits the data packet from the VF module, the VM implements completely independent reception and transmission by combining an input/output memory management unit (IOMMU) technology provided by the CPU, without the participation of the main PF module and the VMM.
In the embodiment of the present invention, each PF module in the PF module group has a corresponding relationship with the VF module group, and before the main PF module is not selected, each PF module may be used to manage all VF modules in the VF module group corresponding to the PF module group, that is, each PF module hangs a VF module in the VF module group corresponding to the PF module group. After the main PF module is selected, the main PF module can implement unified management and resource allocation for the VF modules in the VF module groups corresponding to all PF modules in the PF module group, so that all or part of the VF modules can be selected from the VF module groups corresponding to all PF modules to form a target VF module group, and the VMM allocates the VF modules in the target VF module group to the virtual machine.
In the embodiment of the present invention, the VF module may include two types of spatial resources, where the first type of spatial resource is controlled by the directly corresponding PF module, and before the main PF module is determined, the directly corresponding PF module manages the VF module by accessing the first type of spatial resource; after the system selects the main PF module, the second-class spatial resources are remapped to the visible region of the main PF module (i.e., the connection between the second spatial resources and the main PF module is established), and the main PF module can directly access the second-class spatial resources to manage the VF module without being controlled by the directly corresponding PF module.
In this embodiment of the present invention, determining the main PF module from the PF module group of the first physical network card in S110 may include: and determining the main PF module based on the reference parameter of each PF module in the PF module group, wherein the reference parameter may include at least one of the number of failures of the PF module, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module, and the dynamic bandwidth of the PF module.
Specifically, when a primary PF module needs to be determined from the PF module group of the first physical network card, the apparatus for data transmission may determine the performance value of each PF module in the PF module group based on the reference parameter of each PF module in the PF module group, and may determine the priority ranking of the PF modules in the PF module group based on the performance value of each PF module, and then may determine the primary PF module from the PF module group based on the priority ranking. In the embodiment of the invention, the reference parameter of each PF module can be obtained according to different reference performance values relative to the PF module. For example, if the reference parameter of the PF module is the PF module failure frequency and the number of VF modules in the VF module group corresponding to the PF module, the reference performance value of a failure may be set to-10, the reference performance value of a VF module may be set to 5, if the PF module 0 has a failure frequency of 2 and the number of VF modules in the corresponding VF module group is 6, and the PF module 1 has a failure frequency of 3 and the number of VF modules in the corresponding VF module group is 5, the performance value of the PF module 0 may be calculated to be 10, and the performance value of the PF module 1 is set to-5, the performance value of the PF module 0 is greater than the performance value of the PF module 1, so that the PF module 0 has higher priority than the PF module 1, and the PF module 0 may be selected as the main PF module. It should be understood that the above description is only an example, and the embodiments of the present invention are not limited thereto.
In the embodiment of the present invention, the following principles may be applied to how to determine the primary PF module: if the reference parameter is only the failure times of the PF module, the fewer the failure times are, the higher the priority of the PF module is, and the more likely the PF module is determined to be the main PF module; if the reference parameter is only the number of VF modules in the VF module group corresponding to the PF module, the greater the number of VF modules in the VF module group corresponding to the PF module is, the higher the priority of the PF module is, the more likely it is to be determined as the primary PF module; if the reference parameter is only the static bandwidth of the PF module, the larger the static bandwidth of the PF module is, the higher the priority of the PF module is, the more likely it is to be determined as the primary PF module; if the reference parameter is only the dynamic bandwidth of the PF module, the higher the dynamic bandwidth of the PF module is, the higher the priority is, and the PF module is more likely to be determined to be the main PF module; if the reference parameter is at least two of the PF module failure frequency, the number of VF modules in the VF module group corresponding to the PF module, the dynamic bandwidth of the PF module, and the static bandwidth of the PF module, priority ranking may be performed by comprehensively considering the two factors to determine the main PF module.
In this embodiment of the present invention, determining, in S120, a target VF module group managed by the main PF module based on the VF module group corresponding to each PF module in the PF module group may include: and selecting at least one VF module from the VF module group corresponding to each PF module in the first PF module group to form the target VF module group.
For example, when at least two VF modules are required to implement the link aggregation function (or in other scenarios, of course), after the primary PF module is determined, at least one VF module may be selected from the VF module group corresponding to each PF module in the first PF module group, so as to form the target VF module group. In the embodiment of the present invention, if a certain PF module fails, the normal operation of the VF modules in the VF module groups corresponding to other PF modules is not affected, so that the VF modules of different VF module groups can be isolated from each other.
In the embodiment of the present invention, when an aggregated link data stream needs to be sent (the aggregated link data stream refers to a data stream jointly sent by at least two VF modules, that is, a channel for receiving and sending data by at least two VF modules may form an aggregated link), the aggregated link data stream may be sent to an external switch through multiple ports (ports) on a physical network card, and at this time, the traffic of each port may be monitored in real time, for example, the physical network card is connected with an external switch through two ports, and in a certain period of time, a sending scheduling module in the physical network card monitors that the flow of a port 0 is 0.2G, the flow of a port 1 is 1G, then to achieve link bandwidth equalization, the traffic sent to the aggregated link of port 1 may be reduced, and the traffic sent to the aggregated link of port 0 may be increased, for example, the traffic of both port 0 and port 1 may be adjusted to 0.6G.
It should be understood that, for a non-aggregated link data stream, the data stream may also be sent to an external switch through multiple ports, and the traffic of the ports may be monitored in real time and adjusted.
It should be understood that, in the embodiment of the present invention, after the primary PF module is determined, the VF module group corresponding to the primary PF module may also be directly determined as the target VF module group managed by the primary PF module, or the VF module group corresponding to one or more other PF modules may also be determined as the target VF module group managed by the primary PF module. Specifically, how to determine the target VF module group from the VF module group corresponding to each PF module in the PF module group is not limited in the present invention.
In this embodiment of the present invention, the method 100 may further include: determining that the first PF module is re-enabled or fault-recovered, and determining the first PF module as a PF module in the first PF module group; and establishing a VF module group corresponding to the first PF module based on the first PF module. Alternatively, the method 100 may further include: determining that the second PF module is deleted from the first PF module group of the first physical network card; and releasing the VF module group corresponding to the second PF module.
Specifically, the apparatus for data transmission may monitor all VF modules of the first physical network card, and perform packet management on the VF modules. For example, the VF module hung under the PF module 0 may form a VF module group 0, that is, the VF module 0 and the VF module 1 … VF module 127 form a VF module group 0, the VF module hung under the PF module 1 forms a VF module group 1, that is, the VF module 128, and the VF module 129 and the VF module 130 … VF module 255 form a VF module group 1. After the first PF module in the first physical network card is re-enabled or the failure is recovered, the apparatus for data transmission may establish the VF module group corresponding to the first PF module based on the first PF module and the VF module hung below the first PF module. When the second PF module in the PF module group of the first physical network card is deleted from the system (for example, the second PF module is deleted due to a failure or the user actively deletes), the VF module group corresponding to the established second PF module may be released.
Therefore, in the embodiment of the present invention, after the PF module is re-enabled or recovered from a failure, the VF module group corresponding to the re-enabled or recovered from a failure may be established, or after the PF module is deleted, the VF module group corresponding to the deleted PF module is released, so that the VF modules that can be used in the physical network card may be dynamically adjusted, and the system is more flexible.
In this embodiment of the present invention, the method 100 may further include: determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining that at least one available VF in the VF module group corresponding to the first PF module is continuously available.
Specifically, in the embodiment of the present invention, when a certain PF module of a certain physical network card fails, the VF module group corresponding to the PF module may not be directly released, and the state of the VF module under the PF module may be further determined, if all VF modules under the PF module fail, the VF module group corresponding to the PF module may be directly released, and if part of the VF modules under the PF module fail, only the failed VF module needs to be removed from the VF module group. Therefore, in the embodiment of the present invention, when a PF module fails, if a VF module suspended from the PF module is available, the available VF module suspended from the failed PF module is determined to be continuously available, so that resource waste can be avoided.
It should be understood that the first PF module, the second PF module, and the third PF module mentioned in the embodiments of the present invention may be the same PF module, or may be different PF modules.
In this embodiment of the present invention, the method 100 may further include: determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails; determining a second VF module from the VF module group corresponding to each PF module in the PF module group, wherein the second VF module is different from the VF module included in the target VF module group; and updating the target VF module group and allocating the second VF module to the first VM.
Specifically, when a VF module allocated in a certain VM fails, a new VF module may be reselected from the VF module group corresponding to each PF module in the PF module group of the physical network card, where the reselected VF module is different from the VF module included in the original target VF module group; the target VF module group is then updated, i.e., the reselected VF module is taken as a member of the target VF module group, and the reselected VF module is assigned to the VM.
In this embodiment of the present invention, the method 100 may further include: determining that data of a VF module connected with a first PCIe bus in the target VF module group needs to be sent to a VF module connected with a second PCIe bus in the target VF module group; and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
That is, the first physical network card may occupy at least two PCIe buses, and if data of a VF module on one PCIe bus needs to be sent to another VF module on the same PCIe bus, the sending of the data may be implemented by the internal switch of the physical network card. If the VF module data connected to one PCIe bus needs to be sent to the VF module connected to another PCIe bus, the sending of the data may also be implemented by the internal switch of the physical network card.
Therefore, in the embodiment of the present invention, data exchange between VF modules connected to different PCIe buses in the same physical network card, or data exchange between VF modules connected to the same PCIe bus in the same physical network card, may be implemented by a switch built in the physical network card, so that network bandwidth may be saved, and data transceiving delay may be reduced.
In this embodiment of the present invention, the method 100 may further include: determining that the primary PF module is malfunctioning; selecting PF modules except the main PF module from the PF module group as a new main PF module; determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group; and distributing the VF module in the new target VF module group to at least one virtual machine so that the at least one virtual machine realizes data transmission.
Specifically, in the running process of the system, the specific operation information of the main PF module can be tracked and recorded in real time, and the state of the main PF module can be monitored. If the main PF module fails, a PF module may be reselected from the PF module group as a new main PF module, the recorded operation information is updated to the new main PF module, a new target VF module group is determined for the new main PF module again, and VF modules in the new target VF module group are allocated to at least one virtual machine, so that the at least one virtual machine realizes data transmission.
Therefore, in the embodiment of the invention, when the original main PF module fails, a new main PF module can be reselected from the PF module group with at least two PF modules, so that the system failure can be further avoided and the waste of resources can be reduced.
It should be understood that the present invention may also be combined with a software simulation virtualization technology, that is, a second PF module group may also exist in the network card, and a PF module in the second PF module group may virtualize at least two vnics in a software simulation manner for use by a traditional (legacy) virtual machine.
In order to more clearly understand the present invention, a method for data transmission according to an embodiment of the present invention will be described below with reference to fig. 2.
The scenario illustrated in fig. 2 will first be briefly explained. In this scenario, the PF module group 1 includes a PF module 0; the PF module group 2 comprises a PF module 1 and a PF module 2, a VF module 1 and a VF module 2 are hung under the PF module 1, and a VF module 3 and a VF module 4 are hung under the PF module 2. Wherein PF module 0, PF module 1, and PF module 2 are shown as PF0, PF1, and PF2, respectively; VF module 1, VF module 2, VF module 3, and VF module 4 are shown as VF1, VF2, VF3, and VF4, respectively. VF DD shown in fig. 2 refers to a drive (Device Driver) of the VF module, and PF DD refers to a drive of the PF module. The VMM may be run by the host for VM creation, deletion, management of hardware resources, allocation of VM resources, and the like. The method according to an embodiment of the present invention will be described in detail below with reference to fig. 2.
The VMM may select one PF module from a PF module group 2 in a physical network card (NIC) as a main PF module, and specifically, the VMM may determine the main PF module according to at least one of the number of failures of each PF module, the number of VF modules in a corresponding VF module group, a static bandwidth of the PF module, and a dynamic bandwidth of the PF module, for example, as shown in fig. 2, the PF module 1 may be determined as the main PF module. After determining the primary PF module, the VMM may determine a VF module that the primary PF module needs to manage, where if a link aggregation function needs to be implemented, a VF module may be selected from VF modules that are suspended from different PF modules to form a target VF module group that needs to be managed by the primary PF module, for example, as shown in fig. 2, VF module 3, and VF module 4 may be determined as the target VF module group. The VMM may then assign individual VF modules in the target VF module group that require management by the host PF module to individual VMs for subsequent data transfer by the individual VMs, e.g., VF module 2 to VM2, VF module 3 to VM3, and VF module 4 to VM4, as shown in fig. 2. When the selected main PF module fails, the VMM may reselect one PF module from the PF module group as the main PF module, and may reselect the target VF module group for the main PF module. In the embodiment of the present invention, the VMM may also virtualize one or at least two vnics through the PF module based on software emulation, for example, virtualize vnics 1 and 2 through PF module 0 to respectively serve a Legacy (Legacy) VM1 and a Legacy (Legacy) VM2, as shown in fig. 2. After the VF module or vNIC is allocated to a VM, each VM may implement the transmission of data. The following describes the implementation of four main data transmission paths:
data flow (r): data exchange between Legacy VMs is accomplished through a VMM built-in Virtual software switch (Virtual SW switch).
Data flow 2: the data channel for the virtual network card in the Legacy VM receives and transmits is as follows: external switch → internal switch → MAC → PF → VMM → VM; VM → VMM → PF → MAC → internal switch → external switch.
Data flow c: data exchange between the VMs using the VF module is implemented by a switch built in the NIC, and the switch built in the NIC can implement whether the VF module is connected to the same PCIe or a different PCIe.
Data flow (iv): the VM data transceiving channel using the VF module is: external switch → internal switch → Media Access Control (MAC) → VF; VF → MAC → internal switch → external switch.
Data flow fifth: the channels for the main PF to perform resource management and control on the VF are: VM → VMM → host PF → VF; VF → host PF → VMM → VM.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Fig. 3 is a schematic block diagram of an apparatus 200 for data transmission according to an embodiment of the present invention. As shown in fig. 3, the apparatus 200 includes a first determining unit 210 and a second determining unit 220. The first determining unit 210 is configured to determine a main PF module from a physical function PF module group of a first physical network card, where the PF module group includes at least two PF modules, and each PF module in the PF module group corresponds to a different VF module group; the second determining unit 220 is configured to determine, based on a virtual function VF module group corresponding to each PF module in the PF module group, a target VF module group managed by the main PF module, where a VF module in the target VF module group is used to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
Optionally, the first determining unit 210 is specifically configured to: and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module comprise at least one of the PF module failure times, the number of VF modules corresponding to the PF module, the static bandwidth of the PF module and the static bandwidth of the PF module.
Optionally, the second determining unit 220 is specifically configured to: and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
As shown in fig. 4, the apparatus 200 further comprises a fourth determining unit 252 and a establishing unit 254. The fourth determining unit 252 is configured to determine that a first PF module is re-enabled or fails and recovers, and determine the first PF module as a PF module in the PF module group; the establishing unit 254 is configured to establish, based on the first PF module, a VF module group corresponding to the first PF module.
Optionally, as shown in fig. 4, the apparatus 200 further comprises a fifth determining unit 256 and a releasing unit 258. The fifth determining unit 256 is configured to determine that the second PF module is deleted from the PF module group of the first physical network card; the releasing unit 258 is configured to release the VF module group corresponding to the second PF module.
Optionally, as shown in fig. 4, the apparatus 200 further includes a sixth determining unit 262, a holding unit 264 and a holding unit 264. A sixth determining unit 262 is configured to determine whether a VF module in the VF module group corresponding to the third PF module is available when determining that the third PF module of the first physical network card fails; the holding unit 264 is configured to determine that at least one VF module in the VF module group corresponding to the third PF module is continuously available when the at least one VF module in the VF module group corresponding to the third PF module is available.
Optionally, as shown in fig. 4, the apparatus 200 further includes a seventh determining unit 272, a selecting unit 274, and an updating unit 276. The seventh determining unit 272 is configured to determine that a first VF module of the target VF module group that is assigned to a first VM of the at least one VM fails; the selecting unit 274 is configured to select a second VF module different from the first VF module from the VF module group corresponding to each PF module in the PF module group; the updating unit 276 is used to update the target VF module group.
Optionally, the first physical network card occupies at least two PCIe buses, as shown in fig. 4, the apparatus 200 further includes: an eighth determining unit 282, configured to determine that data of a VF module in the target VF module group that is connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group that is connected to a second PCIe bus of the at least two PCIe buses; the sending unit 284 is configured to send the data of the VF module connected to the first PCIe bus to the VF module connected to the second PCIe bus through the switch of the first physical network card.
Optionally, as shown in fig. 4, the apparatus 200 further includes a third determining unit 240. The third determining unit 240 is configured to determine that the primary PF module fails; the first determining unit 210 is further configured to: selecting PF modules except the main PF module from the PF module group as a new main PF module; the second determining unit 220 is further configured to: and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Fig. 5 is a schematic block diagram of an apparatus 300 for data transmission according to an embodiment of the present invention. As shown in fig. 5, the apparatus 300 includes: a processor 310310 and a memory 320320; wherein the memory 320 stores program codes, and the processor 310 is configured to call the program codes stored in the memory 320, and perform the following operations: determining a main PF module from a physical function PF module group of a first physical network card, wherein the PF module group comprises at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group; and determining a target VF module group managed by the main PF module based on the virtual function VF module group corresponding to each PF module in the PF module group, wherein the VF module in the target VF module group is used for being distributed to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and specifically perform the following operations: and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module comprise at least one of the PF module failure times, the number of VF modules corresponding to the PF module, the static bandwidth of the PF module and the static bandwidth of the PF module.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and specifically perform the following operations: and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining that the first PF module is re-enabled or recovered from the failure, and determining the first PF module as a PF module in the PF module group; and establishing a VF module group corresponding to the first PF module based on the first PF module.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining that a second PF module is deleted from the PF module group of the first physical network card; and releasing the VF module group corresponding to the second PF module.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining that the at least one available VF module in the VF module group corresponding to the first PF module is continuously available.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails; selecting a second VF module different from the first VF module from the VF module group corresponding to each PF module in the PF module group; and updating the target VF module group.
Optionally, the first physical network card occupies at least two PCIe buses, and the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining that data of a VF module in the target VF module group connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group connected to a second PCIe bus of the at least two PCIe buses; and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
Optionally, the processor 310 is configured to call the program code stored in the memory 320, and further perform the following operations: determining that the primary PF module is malfunctioning; selecting PF modules except the main PF module from the PF module group as a new main PF module; and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM realizes data transmission.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Fig. 6 is a schematic block diagram of a physical network card according to an embodiment of the present invention. As shown in fig. 6, the physical network card 400 includes: a PF module group 410 consisting of at least two PF modules 411, and at least two VF module groups 420; wherein, one PF module 411 of the at least two PF modules 411 corresponds to one VF module group 420 of the at least two VF module groups 420, and after being determined as a main PF module, any PF module 411 of the at least two PF modules 411 can manage the VF module 421 in the VF module group 420 to which the other PF module 411 is connected.
Optionally, the PF modules 411 in the PF module group 410 are connected to each other, and any PF module 411 in the PF module group 410 can manage the VF module 421 in the VF module group 420 connected to the other PF module 411 through the other PF module 411.
Optionally, the VF modules 421 in each VF module group 420 of the at least two VF module groups 420 include two types of space resources; wherein, one of the two types of spatial resources is used for being accessed by the PF module 411 corresponding to the VF module group 420 to which the VF module 421 to which the two types of spatial resources belong before the primary PF module is determined; and the other type of space resource is used for establishing connection with the main PF module and accessing the main PF module after the main PF module is determined.
Optionally, the physical network card 400 occupies at least two PCIe buses in the high-speed peripheral component interconnect standard, and the physical network card 400 further includes a built-in switch; the built-in switch is used for sending data of a VF module connected with a first PCIe bus of the at least two PCIe buses to a VF module connected with a second PCIe bus of the at least two PCIe buses.
Optionally, the physical network card is connected with an external switch through at least two ports; the physical network card is further configured to receive a data stream sent by the data transmission device through the aggregation link, and send the data stream to the external switch through each of the at least two ports in a balanced manner.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Fig. 7 is a schematic block diagram of a system 500 for data transmission according to an embodiment of the present invention. As shown in fig. 7, the system 400 includes a device 410 for data transmission and a physical network card 420; the device 510 for data transmission may correspond to the device 200 or 300 for data transmission in the embodiment of the present invention, the physical network card 520 may correspond to the physical network card 400, and the first physical network card mentioned in the device 200 or 300 for data transmission is the physical network card 400. For brevity, no further description is provided herein.
Therefore, in the embodiment of the present invention, since one physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected from the at least two PF modules in the PF module group as a main PF module, the system can be prevented from malfunctioning due to more opportunities for selection, and the waste of resources is reduced.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (32)
1. A method for data transmission, comprising:
determining a main PF module from a physical function PF module group of a first physical network card, wherein the PF module group comprises at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group;
and determining a target VF module group managed by the main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein the VF module in the target VF module group is used for being allocated to at least one Virtual Machine (VM), so that the at least one VM can realize data transmission.
2. The method of claim 1, wherein determining the primary PF module from the set of PF modules of the first physical network card comprises:
and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module, and the static bandwidth of the PF module.
3. The method according to claim 1 or 2, wherein the determining a target VF module group managed by the primary PF module based on the VF module group corresponding to each PF module in the PF module group comprises:
and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
4. The method according to any one of claims 1 to 3, further comprising:
determining that a first PF module is re-enabled or fault-recovered, and determining the first PF module as a PF module in the PF module group;
and establishing a VF module group corresponding to the first PF module based on the first PF module.
5. The method according to any one of claims 1 to 4, further comprising:
determining that a second PF module is deleted from the PF module group of the first physical network card;
and releasing the VF module group corresponding to the second PF module.
6. The method according to any one of claims 1 to 5, further comprising:
determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available;
when at least one VF module in the VF module group corresponding to the third PF module is available, determining that the at least one available VF module in the VF module group corresponding to the first PF module is continuously available.
7. The method according to any one of claims 1 to 6, further comprising:
determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails;
selecting a second VF module different from the first VF module from the VF module groups corresponding to the PF modules in the PF module groups;
and updating the target VF module group.
8. The method of any of claims 1-7, wherein the first physical network card occupies at least two peripheral component interconnect express (PCIe) buses, the method further comprising:
determining that data of a VF module in the target VF module group connected with a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group connected with a second PCIe bus of the at least two PCIe buses;
and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
9. The method according to any one of claims 1 to 8, further comprising:
determining that the primary PF module is malfunctioning;
selecting PF modules other than the main PF module from the PF module group as a new main PF module;
and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM can realize data transmission.
10. An apparatus for data transmission, comprising:
a first determining unit, configured to determine a main PF module from a physical function PF module group of a first physical network card, where the PF module group includes at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group;
a second determining unit, configured to determine, based on a virtual function VF module group corresponding to each PF module in the PF module group, a target VF module group managed by the main PF module, where a VF module in the target VF module group is used to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
11. The apparatus according to claim 10, wherein the first determining unit is specifically configured to:
and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module, and the static bandwidth of the PF module.
12. The apparatus according to claim 10 or 11, wherein the second determining unit is specifically configured to:
and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
13. The method of any one of claims 10 to 12, wherein the apparatus further comprises:
a fourth determining unit, configured to determine that a first PF module is re-enabled or fails to recover, and determine the first PF module as a PF module in the PF module group;
and the establishing unit is used for establishing the VF module group corresponding to the first PF module based on the first PF module.
14. The apparatus of any one of claims 10 to 13, further comprising:
a fifth determining unit, configured to determine that the second PF module is deleted from the PF module group of the first physical network card;
and the releasing unit is used for releasing the VF module group corresponding to the second PF module.
15. The method according to any one of claims 10 to 14, wherein the apparatus further comprises:
a sixth determining unit, configured to determine whether a VF module in the VF module group corresponding to the third PF module is available when a third PF module of the first physical network card fails;
a holding unit, configured to determine that at least one VF module in the VF module group corresponding to the third PF module is continuously available when the at least one VF module in the VF module group corresponding to the third PF module is available.
16. The apparatus of any one of claims 10 to 15, further comprising:
a seventh determining unit, configured to determine that a first VF module allocated to a first VM of the at least one VM in the target VF module group has a failure;
a selecting unit, configured to select, from a VF module group corresponding to each PF module in the PF module group, a second VF module different from the first VF module;
and the updating unit is used for updating the target VF module group.
17. The apparatus of any of claims 10-16, wherein the first physical network card occupies at least two peripheral component interconnect express (PCIe) buses, the apparatus further comprising:
an eighth determining unit, configured to determine that data of a VF module in the target VF module group that is connected to a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group that is connected to a second PCIe bus of the at least two PCIe buses;
and the sending unit is used for sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
18. The apparatus according to any one of claims 10 to 17, further comprising a third determining unit for determining that the primary PF module is malfunctioning;
the first determination unit is further configured to: selecting PF modules other than the main PF module from the PF module group as a new main PF module;
the second determination unit is further configured to: and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein VF modules in the new target VF module group are used for being allocated to at least one Virtual Machine (VM), so that the at least one VM can realize data transmission.
19. An apparatus for data transmission, comprising a processor and a memory; wherein the memory stores program code and the processor is configured to call the program code stored in the memory to perform the following operations:
determining a main PF module from a physical function PF module group of a first physical network card, wherein the PF module group comprises at least two PF modules, and each PF module in the PF module group corresponds to a different virtual function VF module group;
and determining a target VF module group managed by the main PF module based on a virtual function VF module group corresponding to each PF module in the PF module group, wherein VF modules in the target VF module group are used for being distributed to at least one Virtual Machine (VM), so that the at least one VM can realize data transmission.
20. The apparatus of claim 19, wherein the processor is configured to call the program code stored in the memory to perform the following:
and determining the main PF module based on the reference parameters of each PF module in the PF module group, wherein the reference parameters of the PF module include at least one of the PF module failure times, the number of VF modules in the VF module group corresponding to the PF module, the static bandwidth of the PF module, and the static bandwidth of the PF module.
21. The apparatus according to claim 19 or 20, wherein the processor is configured to call the program code stored in the memory, and in particular to:
and selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
22. The apparatus according to any of claims 19 to 21, wherein the processor is configured to call the program code stored in the memory, and further configured to:
determining that a first PF module is re-enabled or fault-recovered, and determining the first PF module as a PF module in the PF module group;
and establishing a VF module group corresponding to the first PF module based on the first PF module.
23. The apparatus of any one of claims 19 to 22, wherein the processor is configured to call the program code stored in the memory, and further configured to:
determining that a second PF module is deleted from the PF module group of the first physical network card;
and releasing the VF module group corresponding to the second PF module.
24. The apparatus according to any of claims 19 to 23, wherein the processor is configured to call the program code stored in the memory, and further configured to:
determining whether a third PF module of the first physical network card fails, and determining whether a VF module in a VF module group corresponding to the third PF module is available;
when at least one VF module in the VF module group corresponding to the third PF module is available, determining that the at least one available VF module in the VF module group corresponding to the first PF module is continuously available.
25. The apparatus according to any of claims 19 to 24, wherein the processor is configured to call the program code stored in the memory, and further configured to:
determining that a first VF module of the target VF module group assigned to a first VM of the at least one VM fails;
selecting a second VF module different from the first VF module from the VF module groups corresponding to the PF modules in the PF module groups;
and updating the target VF module group.
26. The apparatus of any of claims 19 to 25, wherein the first physical network card occupies at least two peripheral component interconnect express (PCIe) buses, and wherein the processor is configured to invoke the program code stored in the memory and further perform the following:
determining that data of a VF module in the target VF module group connected with a first PCIe bus of the at least two PCIe buses needs to be sent to a VF module in the target VF module group connected with a second PCIe bus of the at least two PCIe buses;
and sending the data of the VF module connected with the first PCIe bus to the VF module connected with the second PCIe bus through the switch of the first physical network card.
27. The method of any one of claims 19 to 26, wherein the processor is configured to call the program code stored in the memory, and further configured to:
determining that the primary PF module is malfunctioning;
selecting PF modules other than the main PF module from the PF module group as a new main PF module;
and determining a new target VF module group managed by the new main PF module based on the VF module group corresponding to each PF module in the PF module group, wherein the VF modules in the target VF module group are used for being distributed to at least one Virtual Machine (VM), so that the at least one VM can realize data transmission.
28. A physical network card, comprising: the system comprises a PF module group consisting of at least two PF modules and at least two VF module groups; wherein, one PF module of the at least two PF modules corresponds to one VF module group of the at least two VF module groups, and after being determined as a primary PF module, any PF module of the at least two PF modules can manage VF modules of VF module groups to which other PF modules are connected.
29. The physical network card of claim 28, wherein the VF modules in each of the at least two VF module groups comprise two types of spatial resources; wherein,
one of the two types of spatial resources is used for being accessed by a PF module corresponding to a VF module group to which the VF modules to which the two types of spatial resources belong before the main PF module is determined;
and the other type of space resource is used for establishing connection with the main PF module and accessing the main PF module after the main PF module is determined.
30. The physical network card of claim 28 or 29, wherein the physical network card occupies at least two peripheral component interconnect express (PCIe) buses, the physical network card further comprising a built-in switch; the built-in switch is used for sending data of a VF module connected with a first PCIe bus of the at least two PCIe buses to a VF module connected with a second PCIe bus of the at least two PCIe buses.
31. The physical network card of any one of claims 28 to 31, wherein the physical network card is connected to an external switch through at least two ports; the physical network card is further configured to receive a data stream sent by the data transmission device through the aggregation link, and send the data stream to the external switch through each of the at least two ports in a balanced manner.
32. A system for data transmission, characterized by comprising the apparatus for data transmission according to any one of claims 10 to 18 and the physical network card of any one of claims 28 to 31, or comprising the apparatus for data transmission according to any one of claims 19 to 27 and the physical network card of any one of claims 28 to 31; the first physical network card according to any one of claims 10 to 18 or the first physical network card according to any one of claims 19 to 27 is the physical network card according to any one of claims 28 to 31.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2013/077412 WO2014201623A1 (en) | 2013-06-18 | 2013-06-18 | Method, apparatus and system for data transmission, and physical network card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103609077A true CN103609077A (en) | 2014-02-26 |
CN103609077B CN103609077B (en) | 2017-02-22 |
Family
ID=50126079
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201380000801.1A Active CN103609077B (en) | 2013-06-18 | 2013-06-18 | Method, apparatus and system for data transmission, and physical adapter |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103609077B (en) |
WO (1) | WO2014201623A1 (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104486234A (en) * | 2014-11-21 | 2015-04-01 | 华为技术有限公司 | Method and server for uninstalling service exchanger to physical network card |
WO2016062236A1 (en) * | 2014-10-24 | 2016-04-28 | Hangzhou H3C Technologies Co., Ltd. | Monitoring cluster |
CN106095563A (en) * | 2015-04-27 | 2016-11-09 | 阿尔特拉公司 | Physical function and virtual functions map flexibly |
CN106484492A (en) * | 2015-08-28 | 2017-03-08 | 杭州华为数字技术有限公司 | The method and system of configuration interface |
CN106664242A (en) * | 2015-07-03 | 2017-05-10 | 华为技术有限公司 | Network configuration method, network system and device |
CN106656539A (en) * | 2015-11-04 | 2017-05-10 | 中兴通讯股份有限公司 | Internet access state detection and synchronization method and apparatus |
WO2017152633A1 (en) * | 2016-03-09 | 2017-09-14 | 中兴通讯股份有限公司 | Port binding implementation method and device |
CN107278359A (en) * | 2016-11-09 | 2017-10-20 | 华为技术有限公司 | The method of Message processing, main frame and system in cloud computing system |
CN107643938A (en) * | 2017-08-24 | 2018-01-30 | 中国科学院计算机网络信息中心 | Data transmission method, device and storage medium |
US10491517B2 (en) | 2016-11-09 | 2019-11-26 | Huawei Technologies Co., Ltd. | Packet processing method in cloud computing system, host, and system |
CN113132200A (en) * | 2019-12-30 | 2021-07-16 | 中兴通讯股份有限公司 | Data forwarding method, data forwarding device, data forwarding system, server and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101206587A (en) * | 2006-12-19 | 2008-06-25 | 国际商业机器公司 | System and method for migration of single root stateless virtual functions |
CN101436165A (en) * | 2007-11-15 | 2009-05-20 | 国际商业机器公司 | System and method for management of an IOV adapter |
EP2423826A2 (en) * | 2010-08-27 | 2012-02-29 | Hitachi Ltd. | Computer system, i/o device control method, and i/o drawer |
US8271707B2 (en) * | 2010-02-17 | 2012-09-18 | Broadcom Corporation | Method and system for PCI hybrid function |
CN102841760A (en) * | 2008-10-30 | 2012-12-26 | 株式会社日立制作所 | Storage device, and data path failover method of internal network of storage controller |
CN102946366A (en) * | 2012-11-12 | 2013-02-27 | 杭州华为数字技术有限公司 | In-band management method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8645605B2 (en) * | 2010-12-28 | 2014-02-04 | Plx Technology, Inc. | Sharing multiple virtual functions to a host using a pseudo physical function |
-
2013
- 2013-06-18 CN CN201380000801.1A patent/CN103609077B/en active Active
- 2013-06-18 WO PCT/CN2013/077412 patent/WO2014201623A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101206587A (en) * | 2006-12-19 | 2008-06-25 | 国际商业机器公司 | System and method for migration of single root stateless virtual functions |
CN101436165A (en) * | 2007-11-15 | 2009-05-20 | 国际商业机器公司 | System and method for management of an IOV adapter |
CN102841760A (en) * | 2008-10-30 | 2012-12-26 | 株式会社日立制作所 | Storage device, and data path failover method of internal network of storage controller |
US8271707B2 (en) * | 2010-02-17 | 2012-09-18 | Broadcom Corporation | Method and system for PCI hybrid function |
EP2423826A2 (en) * | 2010-08-27 | 2012-02-29 | Hitachi Ltd. | Computer system, i/o device control method, and i/o drawer |
CN102946366A (en) * | 2012-11-12 | 2013-02-27 | 杭州华为数字技术有限公司 | In-band management method and system |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016062236A1 (en) * | 2014-10-24 | 2016-04-28 | Hangzhou H3C Technologies Co., Ltd. | Monitoring cluster |
CN104486234B (en) * | 2014-11-21 | 2018-10-30 | 华为技术有限公司 | A kind of method and server that service switch is unloaded to physical network card |
CN104486234A (en) * | 2014-11-21 | 2015-04-01 | 华为技术有限公司 | Method and server for uninstalling service exchanger to physical network card |
US10782995B2 (en) | 2015-04-27 | 2020-09-22 | Altera Corporation | Flexible physical function and virtual function mapping |
US11675613B2 (en) | 2015-04-27 | 2023-06-13 | Altera Corporation | Flexible physical function and virtual function mapping |
CN106095563A (en) * | 2015-04-27 | 2016-11-09 | 阿尔特拉公司 | Physical function and virtual functions map flexibly |
US10554485B2 (en) | 2015-07-03 | 2020-02-04 | Huawei Technologies Co., Ltd. | Method for configuring network, network system, and device |
CN106664242B (en) * | 2015-07-03 | 2019-09-03 | 华为技术有限公司 | A kind of configuration method of network, network system and equipment |
CN106664242A (en) * | 2015-07-03 | 2017-05-10 | 华为技术有限公司 | Network configuration method, network system and device |
CN106484492A (en) * | 2015-08-28 | 2017-03-08 | 杭州华为数字技术有限公司 | The method and system of configuration interface |
CN106656539A (en) * | 2015-11-04 | 2017-05-10 | 中兴通讯股份有限公司 | Internet access state detection and synchronization method and apparatus |
WO2017076089A1 (en) * | 2015-11-04 | 2017-05-11 | 中兴通讯股份有限公司 | Network port state detecting and synchronizing method and device |
WO2017152633A1 (en) * | 2016-03-09 | 2017-09-14 | 中兴通讯股份有限公司 | Port binding implementation method and device |
US10491517B2 (en) | 2016-11-09 | 2019-11-26 | Huawei Technologies Co., Ltd. | Packet processing method in cloud computing system, host, and system |
CN107278359B (en) * | 2016-11-09 | 2020-09-18 | 华为技术有限公司 | Method, host and system for processing message in cloud computing system |
US11005755B2 (en) | 2016-11-09 | 2021-05-11 | Huawei Technologies Co., Ltd. | Packet processing method in cloud computing system, host, and system |
CN107278359A (en) * | 2016-11-09 | 2017-10-20 | 华为技术有限公司 | The method of Message processing, main frame and system in cloud computing system |
CN107643938A (en) * | 2017-08-24 | 2018-01-30 | 中国科学院计算机网络信息中心 | Data transmission method, device and storage medium |
CN113132200A (en) * | 2019-12-30 | 2021-07-16 | 中兴通讯股份有限公司 | Data forwarding method, data forwarding device, data forwarding system, server and storage medium |
CN113132200B (en) * | 2019-12-30 | 2024-01-19 | 中兴通讯股份有限公司 | Data forwarding method, repeater, system, server and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2014201623A1 (en) | 2014-12-24 |
CN103609077B (en) | 2017-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103609077B (en) | Method, apparatus and system for data transmission, and physical adapter | |
US10572290B2 (en) | Method and apparatus for allocating a physical resource to a virtual machine | |
US10491517B2 (en) | Packet processing method in cloud computing system, host, and system | |
EP3556081B1 (en) | Reconfigurable server | |
US9569245B2 (en) | System and method for controlling virtual-machine migrations based on processor usage rates and traffic amounts | |
CN111490949B (en) | Method, network card, host device and computer system for forwarding data packets | |
CN107894913B (en) | Computer system and storage access device | |
US10305823B2 (en) | Network interface card configuration method and resource management center | |
CN110809760B (en) | Resource pool management method and device, resource pool control unit and communication equipment | |
US9031081B2 (en) | Method and system for switching in a virtualized platform | |
EP2892181B1 (en) | Method, device and physical host for managing physical network card | |
CN106301859B (en) | Method, device and system for managing network card | |
US9727386B2 (en) | Method and apparatus for network resource virtual partitioning | |
US20180357086A1 (en) | Container virtual switching | |
KR20150024845A (en) | Offloading virtual machine flows to physical queues | |
CN111903109A (en) | Overbookable resource allocation | |
US11263162B2 (en) | System decoder for training accelerators | |
JP2015521779A (en) | System and method for input / output virtualization | |
JP2021028820A (en) | Method, device, electronic apparatus, and storage medium for resource management | |
US9344376B2 (en) | Quality of service in multi-tenant network | |
CN111857943B (en) | Data processing method, device and equipment | |
CN115934624B (en) | Method, equipment and medium for managing multi-host remote direct memory access network | |
CN113127144A (en) | Processing method, processing device and storage medium | |
CN113535370A (en) | Method and equipment for realizing multiple RDMA network card virtualization of load balancing | |
JP2017142647A (en) | Resource management device and resource management method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |