WO2014201623A1 - Method, apparatus and system for data transmission, and physical network card - Google Patents

Method, apparatus and system for data transmission, and physical network card Download PDF

Info

Publication number
WO2014201623A1
WO2014201623A1 PCT/CN2013/077412 CN2013077412W WO2014201623A1 WO 2014201623 A1 WO2014201623 A1 WO 2014201623A1 CN 2013077412 W CN2013077412 W CN 2013077412W WO 2014201623 A1 WO2014201623 A1 WO 2014201623A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
module group
group
network card
physical network
Prior art date
Application number
PCT/CN2013/077412
Other languages
French (fr)
Chinese (zh)
Inventor
赵晓雷
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2013/077412 priority Critical patent/WO2014201623A1/en
Priority to CN201380000801.1A priority patent/CN103609077B/en
Publication of WO2014201623A1 publication Critical patent/WO2014201623A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/14Multichannel or multilink protocols
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the present invention relates to the field of communications and, more particularly, to a method, apparatus and system for data transmission and a physical network card. Background technique
  • NIC virtualization is the key technology to solve the last mile of virtualization. It has experienced software simulation, Virtual Machine Device Queue (VMDq), and single root I/O virtualization (Single-Root I). /O
  • SR-IOV Virtualization
  • PCIe Peripheral Component Interconnect Express
  • the NIC device is virtualized into at least two PCIe NIC devices, and each virtual PCIe NIC device provides services to the upper layer software of the virtual machine just like the physical PCIe NIC device.
  • SR-IOV is a 10 virtualization technology standard that allows one physical device to support at least two virtual NICs. SR-IOV introduces two new types of functions, Physical Function (Physical Function,
  • the PF module has all the PCIe functions of the SR-IOV, and can perform SR-IOV function configuration and management.
  • the VF module has a lightweight PCIe function, including resources necessary for data transmission and a small amount of configuration resources.
  • the VF module can be managed via Virtual Machine Management (Virtual Machine Management,
  • VMM is assigned to the virtual machine (VM).
  • Embodiments of the present invention provide a method, an apparatus, and a system for data transmission, and a physical network card, which can avoid system failure and reduce resource waste.
  • the first aspect provides a method for data transmission, including: determining, from a physical function PF module group of a first physical NIC, a primary PF module, where the PF module group includes at least two PF modules, and the PF module group Each of the PF modules corresponds to a different virtual function VF module group; based on the VF module group corresponding to each PF module in the PF module group, the target VF module group managed by the main PF module is determined, wherein the VF in the target VF module group
  • the module is configured to be allocated to at least one virtual machine VM such that the at least one VM implements data transmission.
  • determining, by the PF module group of the first physical network card, the primary PF module includes: determining, according to a reference of each PF module in the PF module group a parameter, the primary PF module is determined, wherein the reference parameter of the PF module includes at least one of a PF module failure number, a number of VF modules in the VF module group corresponding to the PF module, a static bandwidth of the PF module, and a static bandwidth of the PF module.
  • the determining, according to the VF module group corresponding to each PF module in the PF module group, determining the primary The target VF module group managed by the PF module includes: 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.
  • the method further includes: determining The first PF module is re-enabled or fault-recovered, and the first PF module is determined as the PF module in the PF module group. Based on the first PF module, the VF module group corresponding to the first PF module is established.
  • the method further includes: determining the second PF module Deleting from the PF module group of the first physical network card; releasing the VF module group corresponding to the second PF module.
  • the method further includes: determining the first physics When the third PF module of the network card fails, determining whether the VF module in the 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, The at least one VF available in the VF module group corresponding to the first PF module The module is determined to continue to be available.
  • the method further comprises: determining the target
  • the first VF module allocated to the first VM of the at least one VM in the VF module group is faulty; from the VF module group corresponding to each PF module in the PF module group, selecting a second different from the first VF module VF module; update the target VF module group.
  • the first physical network card occupies at least two high speeds
  • the peripheral component interconnects the standard PCIe bus
  • the method further includes: determining that data of the VF module connected to the first PCIe bus of the at least two PCIe buses in the target VF module group needs to be sent to the target VF module group a VF module connected to the second PCIe bus of the at least two PCIe buses; and the data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
  • the method further includes: determining the primary PF module A fault occurs; from the PF module group, a PF module other than the main PF module is selected as a new main PF module; and the new main PF module is determined based on the VF module group corresponding to each PF module in the PF module group.
  • a new target VF module group is managed, wherein the VF module in the new target VF module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
  • the second aspect provides an apparatus for data transmission, including: a first determining unit, configured to determine, from a physical function PF module group of the first physical network card, a primary PF module, where the PF module group includes at least two PF module, each PF module in the PF module group corresponds to a different virtual function VF module group; and a second determining unit is configured to determine the main PF module management based on the virtual function VF module group corresponding to each PF module in the PF module group
  • the target VF module group wherein the VF module in the target VF module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
  • the first determining unit is specifically configured to: determine, according to a reference parameter of each PF module in the PF module group, the primary PF module, where The reference parameters of the PF module include at least the number of PF module failures, 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.
  • the reference parameters of the PF module include at least the number of PF module failures, 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.
  • the second determining unit is specifically configured to: use each PF module from the PF module group At least one VF module is selected from the corresponding VF module group to form the target VF module group.
  • the apparatus further includes: a determining unit, configured to determine that the first PF module is re-enabled or fault-recovered, determining the first PF module as a PF module in the PF module group; and establishing a unit, configured to establish the first PF module based on the first PF module A VF module group corresponding to a PF module.
  • the device further includes: a fifth determining unit, The second PF module is configured to be deleted from the PF module group of the first physical NIC; and the release unit is configured to release the VF module group corresponding to the second PF module.
  • the device further includes: a sixth determining unit, When it is determined that the third PF module of the first physical network card is faulty, determining whether the VF in the VF module group corresponding to the third PF module is available; the holding unit, configured to be in the VF module group corresponding to the third PF module When at least one VF module is available, the at least one VF module in the VF module group corresponding to the third PF module is determined to continue to be available.
  • the device further includes: a seventh determining unit, Determining that a first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; and selecting a unit for selecting 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; an update unit, configured to update the target VF module group, and assign the second VF module to the first VM.
  • the first physical network card occupies at least two high speeds
  • the peripheral component interconnects the standard PCIe bus
  • the device further includes: an eighth determining unit, configured to determine that data of the VF module connected to the first PCIe bus of the at least two PCIe buses in the target VF module group needs to be sent to a VF module connected to the second PCIe bus of the at least two PCIe buses in the target VF module group; a sending unit, configured to connect the VF to the first PCIe bus The data of the module is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
  • the device further includes a third determining unit, Determining that the main PF module is faulty; the first determining unit is further configured to: select, from the PF module group, a PF module other than the main PF module as a new main PF module; the second determining unit further uses And: determining, according to the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new main PF module, where the VF module in the new target VF module group is used to allocate to At least one virtual machine VM, such that the at least one VM implements data transmission.
  • a third determining unit Determining that the main PF module is faulty; the first determining unit is further configured to: select, from the PF module group, a PF module other than the main PF module as a new main PF module; the second determining unit further uses And: determining, according to the VF module group corresponding to each PF module in the PF module group, a new target VF module
  • an apparatus for data transmission including a processor and a memory; wherein the memory stores program code, the processor is configured to call the program code stored in the memory, and performs the following operations: Physical NIC module physical group PF module group, the main PF module is determined, the PF module group includes at least two PF modules, each PF module in the PF module group corresponds to a different virtual function VF module group; based on each of the PF module groups a virtual function VF module group corresponding to the PF module, determining a target VF module group managed by the main PF module, wherein the target
  • the VF module in the VF module group is used to allocate to at least one virtual machine VM, so that the at least one
  • the VM implements data transfer.
  • the processor is configured to invoke the program code stored in the memory, and specifically perform the following operations: based on a reference of each PF module in the PF module group a parameter, the primary PF module is determined, wherein the reference parameters of the PF module include the number of failures of the PF module, the number of VF modules in the VF module group corresponding to the PF module,
  • At least one of a static bandwidth of the PF module and a static bandwidth of the PF module At least one of a static bandwidth of the PF module and a static bandwidth of the PF module.
  • the processor is configured to invoke the program code stored in the memory, and specifically perform the following operations: At least one VF module is selected from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
  • the processor is used to invoke the The program code stored in the memory further performs the following operations: determining that the first PF module is re-enabled or failback, determining the first PF module as the PF module in the PF module group; establishing based on the first PF module The VF module group corresponding to the first PF module.
  • the processor is configured to invoke the storage in the memory
  • the program code also performs the following operations: determining that the second PF module is deleted from the PF module group of the first physical network card; releasing the VF module group corresponding to the second PF module.
  • the processor is configured to invoke the storage in the memory
  • the program code is further configured to: determine whether the 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 is faulty; and corresponding to the third PF module When at least one VF module in the VF module group is available, the at least one VF module available in the VF module group corresponding to the first PF module is determined to be continuously available.
  • the processor is configured to invoke the storage in the memory
  • the program code is further configured to: determine that the first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; from the VF module group corresponding to each PF module in the PF module group Selecting a second VF module different from the first VF module; updating the target VF module group, and assigning the second VF module to the first VM.
  • the first physical network card occupies at least two high speeds
  • the peripheral component interconnects a standard PCIe bus
  • the processor is configured to call the program code stored in the memory, and performs the following operations: determining that the target PCI module is required to be connected to the first PCIe bus of the at least two PCIe buses
  • the data of the VF module is sent to the VF module in the target VF module group and connected to the second PCIe bus of the at least two PCIe buses; and the data of the VF module connected to the first PCIe bus passes through the first physical network card.
  • the switch sends to the VF module connected to the second PCIe bus.
  • the processor is configured to invoke the storage in the memory
  • the program code also performs the following operations: determining that the main PF module is faulty; from the PF module group, selecting a PF module other than the main PF module as a new main PF module; based on each PF in the PF module group a VF module group corresponding to the module, determining a new target VF module group managed by the new main PF module, wherein the VF module in the new target VF module group is used to allocate to at least one virtual machine VM, so that the at least one The VM implements data transfer.
  • a physical network card including: a PF module group having at least two PF modules, and at least two VF module groups; wherein, one of the at least two PF modules corresponds to the at least one One of the two VF module groups, one of the at least two PF modules can manage the VF module in the VF module group to which the other PF modules are connected after being determined as the main PF module.
  • the VF module in each VF module group of the at least two VF module groups includes two types of spatial resources; a type of space resource is used to access the PF module corresponding to the VF module group to which the VF module to which the two types of space resources belong before the primary PF module is determined; the other two of the two types of space resources are accessed.
  • a type of spatial resource is used to establish a connection with the primary PF module for access by the primary PF module after the primary PF module is determined.
  • the physical network card occupies at least two high-speed peripheral components interconnecting a standard PCIe bus
  • the physical network card further includes a built-in switch; wherein the built-in switch is configured to send data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the at least two PCIe buses The VF module connected to the second PCIe bus.
  • the physical network card passes at least two a port is connected to the external switch; the physical network card is further configured to receive a data stream sent by the device for data transmission through the aggregated link, and uniformly send the data stream to the external switch by using each of the at least two ports .
  • a fifth aspect a system for data transmission, comprising the apparatus for data transmission in any of the possible implementations of the second aspect or the second aspect, and the fourth aspect or the fourth aspect
  • the physical network card in the implementation manner wherein the first physical network card or the third aspect or the third aspect of the possible implementation in any one of the possible implementation manners in the second aspect or the second aspect
  • the first physical network card referred to in the manner is the physical network card referred to in the fourth aspect or any possible implementation manner of the fourth aspect.
  • one physical network card has a PF module group composed of at least two PF modules, and one PF can be selected from at least two PF modules in the PF module group.
  • the module acts as the main PF module, which avoids system failures and reduces resource waste due to the many opportunities for selection.
  • 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.
  • 3 is a schematic block diagram of an apparatus for data transmission in accordance with another embodiment of the present invention.
  • 4 is a schematic block diagram of an apparatus for data transmission in accordance with 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.
  • 6 is a schematic block diagram of a physical network card in accordance with another embodiment of the present invention.
  • FIG. 7 is a schematic block diagram of a system for data transmission in accordance with another embodiment of the present invention. detailed description
  • the method 100 includes:
  • S110 Determine a primary PF module from a first PF module group of the first physical NIC, 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.
  • a device for data transmission for example, a device having at least one processor for data transmission function, such as a host, or a host group composed of at least two hosts, which can be from the first physics Determining a main PF module in a PF module group including at least two PF modules of the network card; and then determining, from the VF module group corresponding to each PF module in the PF module group, a target VF module group that needs to be managed by the main PF module, where The VF module in the target VF module group can then be assigned to at least one virtual machine, so that each virtual machine can implement data transmission through the VF module.
  • one physical network card has at least two PF modules to form a first PF module group, and one PF module can be selected as a main PF module from at least two PF modules in the first PF module group. Since there are at least two PF modules to choose from, the reliability of the main PF module is increased, thereby reducing the probability of system failure and reducing 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, which those skilled in the art should know, also referred to as PF and VF.
  • the PF module supports the PCIe function of the SR-IOV extended function, which is used to configure and manage the SR-IOV function;
  • the VF module implements the PCIe function.
  • the virtual machine management can treat each VF module in the target VF module group as A PCIe device is assigned to a virtual machine (VM).
  • the VM When the VM performs control plane access to the assigned VF module, the VM initiates a request, the primary PF module and the VMM respond to the request, and return the result to the VM.
  • the VM sends and receives data packets from the VF module, it combines the input/output memory management unit (IMMMU) technology provided by the CPU to realize complete and independent transmission and reception.
  • IMMMU input/output memory management unit
  • each PF module in the PF module group has a corresponding relationship with the VF module group.
  • each PF module can be used to manage all VF modules in the corresponding VF module group. That is to say, the VF modules in the corresponding VF module group are hung under each PF module.
  • the main PF module can implement unified management and resource allocation for the VF modules in the VF module group corresponding to all PF modules in the PF module group, so that the VF modules corresponding to all PF modules can be obtained. All or part of the VF modules in the group are selected to form a target VF module group, and the VF module in the target VF module group is allocated to the virtual machine by the VMM.
  • the VF module may include two types of space resources, and the first type of space resource is controlled by the directly corresponding PF module. Before the primary PF module is determined, the directly corresponding PF module accesses the first type of space resource. Manage the VF module; the second type of space resource is in the system After the primary PF module is selected, it is remapped to the area visible to the primary PF module (that is, the connection between the second spatial resource and the primary PF module is established), and the primary PF module can directly access the second type of spatial resource to implement The VF module is managed and is not controlled by the directly corresponding PF module.
  • determining the primary PF module from the PF module group of the first physical network card in S110 may include: determining the primary PF module based on a reference parameter of each PF module in the PF module group, where The reference parameter may include at least one of a number of failures of the PF module, a number of VF modules in the VF module group corresponding to the PF module, a static bandwidth of the PF module, and a dynamic bandwidth of the PF module.
  • the apparatus for data transmission may determine each of the PF module groups based on the reference parameter of each PF module in the PF module group.
  • the performance value of a PF module, and based on the performance value of each PF module, the priority ordering of the PF modules in the PF module group can be determined, and then the main PF module can be determined from the PF module group based on the priority ordering.
  • the reference parameter of each PF module can be obtained according to different reference performance values with respect to the PF module.
  • the baseline performance value of one failure can be set to -10, and the reference performance value of the VF module is 5, if the number of failures of PF module 0 is 2 and the number of VF modules in the corresponding VF module group is 6, the number of failures of PF module 1 is 3, and the number of VF modules in the corresponding VF module group is 5, then It can be calculated that the performance value of PF module 0 is 10, and the performance value of PF module 1 is -5, then the performance value of PF module 0 is greater than the performance value of PF module 1, and thus, the priority of PF module 0 is higher than that of PF module. 1 , you can select PF module 0 as the main PF module. It should be understood that the foregoing is only an example, and the embodiment of the present invention is not limited thereto.
  • the following principles can be determined for how to determine the primary PF module: If the reference parameter is only the number of PF module failures, the fewer the number of failures occurs, the higher the priority of the PF module is, and the more likely it is to be determined as the primary PF.
  • the reference parameter is only the number of VF modules in the VF module group corresponding to the PF module, the more the number of VF modules in the VF module group corresponding to the PF module, the higher the priority of the PF module is, the more likely it is to be
  • the reference parameter is only the static bandwidth of the PF module, the greater the static bandwidth of the PF module, the higher the priority of the PF module, the more likely it is to be determined as the primary PF module;
  • the reference parameter is only the PF module Dynamic bandwidth, the larger the dynamic bandwidth of the PF module, the higher the priority, the more likely it is to be determined as the primary PF module; if the reference parameter is the number of PF module failures, the number of VF modules in the VF module group corresponding to the PF module PF mode
  • At least two of the block dynamic bandwidth and the PF module static bandwidth can be prioritized by considering two factors to determine the main PF module.
  • the target VF module group managed by the main PF module is determined according to the VF module group corresponding to each PF module in the PF module group, and may include: each PF module from the first PF module group. At least one VF module is selected from the corresponding VF module group to form the target VF module group.
  • VF modules when at least two VF modules are required to implement the link aggregation function (otherwise, in other scenarios), after the primary PF module is determined, it may be from the VF module group corresponding to each PF module in the first PF module group. Select at least one VF module to form the target VF module group.
  • a certain PF module fails, the normal operation of the VF module in the VF module group corresponding to the other PF modules is not affected, so that the VF modules of different VF module groups can be isolated from each other, so that the present invention
  • Embodiments Selecting a VF module from a VF module group corresponding to different PF modules can improve system reliability and stability, thereby ensuring system bandwidth.
  • the aggregated link data stream needs to be sent (the aggregated link data stream refers to the data stream jointly sent by the at least two VF modules, that is, the channel through which at least two VF modules send and receive data can form an aggregated link.
  • the aggregated link data stream can be sent to the external switch through multiple ports on the physical NIC.
  • the traffic of each port can be monitored in real time.
  • the physical NIC has two ports connected to the external switch.
  • the sending scheduling module in the physical network card detects that the traffic of port 0 is 0.2 G, and the traffic of port 1 is 1 G.
  • the aggregation link sent to port 1 can be reduced.
  • the traffic is increased to the traffic of the aggregated link of port 0.
  • the traffic of port 0 and port 1 can be adjusted to 0.6G.
  • the data stream can also be sent to the external switch through multiple ports, and the traffic of the port can be monitored and adjusted in real time.
  • the VF module group corresponding to the main PF module may be directly determined as the target VF module group managed by the main PF module, or one or more other ones or more
  • the VF module group corresponding to the PF module is determined as the target VF module group managed by the main PF module.
  • the target VF module group is determined from the VF module group corresponding to each PF module in the PF module group, and the present invention is not limited.
  • the method 100 may further include: determining that the first PF module is re-enabled or failing, and determining the first PF module as the PF module in the first PF module group; The first PF module establishes a VF module group corresponding to the first PF module.
  • 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; releasing the VF module group corresponding to the second PF module.
  • the means for data transmission can monitor all VF modules of the first physical network card and manage the VF modules in groups.
  • the VF module connected to the PF module 0 can be composed of the VF module group 0, that is, the VF module 0, the VF module 1 and the VF module 127 form the VF module group 0, and the VF module connected to the PF module 1 constitutes the VF module group.
  • 1 that is, the VF module 128, the VF module 129, the VF module 130...
  • the VF module 255 constitutes the VF module group 1.
  • the device for data transmission may establish a VF corresponding to the first PF module based on the first PF module and the VF module connected to the first PF module.
  • Module group 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 or the user actively deletes), the established second PF module may be released. Group of VF modules.
  • the VF module group corresponding to the re-enabled or fault-recovering PF module may be established, or after the PF module is deleted, the deleted is deleted.
  • the VF module group corresponding to the PF module can dynamically adjust the VF module that can be used in the physical network card, making the system more flexible.
  • the method 100 may further include: determining whether the 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 is faulty; When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF available in the VF module group corresponding to the first PF module is determined to be continuously available.
  • 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 the VF modules under the PF module are faulty, the VF module group corresponding to the PF module can be directly released. If a part of the VF module under the PF module fails, only the failed VF module needs to be removed from the VF. Excluded from the module group.
  • the available VF module that is connected to the failed PF module is determined to continue to be available, thereby avoiding resource waste.
  • first PF module the second PF module and the third PF mentioned in the embodiments of the present invention Modules can be the same PF module or different PF modules.
  • the method 100 may further include: determining that a first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; corresponding to each PF module in the PF module group In the VF module group, a second VF module is determined, the second VF module is different from the VF module included in the target VF module group; the target VF module group is updated, and the second VF module is allocated to the first VM.
  • a new VF module can be reselected from the VF module group corresponding to each PF module in the PF module group of the physical network card, and the reselected VF is selected.
  • the module is different from the VF module included in the original target VF module group; then, the target VF module group is updated, that is, the reselected VF module is used as a member of the target VF module group, and the reselected VF module is assigned to The VM.
  • the method 100 may further include: determining that data of the VF module connected to the first PCIe bus in the target VF module group needs to be sent to the VF connected to the second PCIe bus in the target VF module group. And transmitting, by the switch of the first physical network card, the data of the VF module connected to the first PCIe bus to the VF module connected to the second PCIe bus.
  • the first physical network card can occupy at least two PCIe buses. If one VF module data on one PCIe bus needs to be sent to another VF module on the same PCIe bus, the data can be implemented through an internal switch of the physical network card. Send. If the VF module data connected to one PCIe bus needs to be sent to the VF module connected to another PCIe bus, the data can also be transmitted through the internal switch of the physical network card.
  • 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 pass the data exchange.
  • the switch built in the physical NIC can save network bandwidth and reduce data transmission and reception delay.
  • the method 100 may further include: determining that the primary PF module is faulty; and selecting, from the PF module group, a PF module other than the primary PF module as a new primary PF module; a VF module group corresponding to each PF module in the module group, determining a new target VF module group managed by the new main PF module; assigning the VF module in the new target VF module group to at least one virtual machine, so that At least one virtual machine implements data transfer.
  • the specific operation information of the main PF module can be tracked in real time, and the state of the main PF module is monitored. If the main PF module fails, it can be from PF Reselecting a PF module as a new main PF module in the module group, updating the recorded operation information to the new main PF module, and re-determining the new target VF module group for the new main PF module, and The VF module in the new target VF module group is allocated to at least one virtual machine, so that the at least one virtual machine implements data transmission.
  • a new primary PF module when the original primary PF module fails, a new primary PF module can be reselected from the PF module group having at least two PF modules, which can further avoid system failure and reduce resource waste.
  • a second PF module group can also exist in the network card, and the PF module in the second PF module group can virtualize at least two by software simulation.
  • vNICs for use by legacy virtual machines.
  • the PF module group 1 includes the PF module 0; the PF module group 2 includes the PF module 1 and the PF module 2, the PF module 1 has the VF module 1 and the VF module 2 attached thereto, and the PF module 2 has the VF module 3 attached thereto.
  • PF module 0, PF module 1 and PF module 2 are shown as PF0, PF1 and PF2 in the figure; VF module 1, VF module 2, VF module 3 and VF module 4 are respectively shown as VF 1, VF2, VF3 and VF4.
  • the VF DD shown in Figure 2 refers to the drive of the VF module (Device Driver), and the PF DD refers to the drive of the PF module.
  • the VMM can be run by the host for VM creation, deletion, management of hardware resources, allocation of VM resources, and so on. The method according to an embodiment of the present invention will be specifically described below with reference to FIG.
  • the VMM can select a PF module as the main PF module from the PF module group 2 in the physical network card (NIC). Specifically, the VMM can be based on the number of failures of each PF module, the number of VF modules in the corresponding VF module group, and the PF module. At least one of the static bandwidth and the dynamic bandwidth of the PF module determines the primary PF module. For example, as shown in FIG. 2, the PF module 1 may be determined as the primary PF module. After the main PF module is determined, the VMM can determine the VF module to be managed by the main PF module. If the link aggregation function is required, the VF module can be selected from the VF modules connected to different PF modules.
  • NIC physical network card
  • the target VF module group managed by the PF module for example, as shown in FIG. 2, the VF module 2, the VF module 3, and the VF module 4 can be determined as the target VF module group. Then, the VMM can allocate each VF module in the target VF module group that needs to be managed by the main PF module to each VM for subsequent data transmission of each VM, for example, as shown in FIG. 2, The VF module 2 is assigned to the VM 2, the VF module 3 is assigned to the VM 3, and the VF module 4 is assigned to the VM 4.
  • the VMM can reselect a PF module from the PF module group as the main PF module, and can reselect the target VF module group for the main PF module.
  • the VMM may also virtualize one or at least two vNICs through the PF module based on the software simulation manner. For example, as shown in FIG. 2, the vNIC1 and the vNIC 2 are virtualized by the PF module 0, respectively. Legacy) VM1 and legacy (legacy) VM2 services. After the VF module or vNIC is assigned to the VM, each VM can implement data transmission. The following describes the implementation of the four main data transmission paths:
  • Data Stream 1 Data exchange between Legacy VMs is achieved through VMM's built-in virtual software switch (Vi r tua l SW swi tch ).
  • Data Stream 2 The data channels sent and received by the virtual NIC in the Legacy VM are: External Switch Internal Switch - MAC - PF - VMM - VM; VM - VMM - PF - MAC - Internal Switch - External Switch.
  • Data Stream 3 The data exchange between the VMs using the VF module is implemented by the switch built in the NIC. Whether the VF module is connected to the same PCIe or a different PCIe, it can be implemented through the switch built into the NIC.
  • the VM data transceiver channel using the VF module is: External Switch - Internal Switch - Media Access Control (MAC) ⁇ VF; VF - MAC - Internal Switch - External Switch.
  • MAC External Switch - Internal Switch - Media Access Control
  • Data stream 5 The channel through which the primary PF performs resource management and control for the VF is: VM ⁇ VMM - primary PF-VF; VF-primary PF ⁇ VMM ⁇ VM.
  • a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
  • FIG. 3 is a schematic block diagram of an apparatus 200 for data transmission in accordance with an embodiment of the present invention. As shown
  • the apparatus 200 includes a first determining unit 210 and a second determining unit 220.
  • the first determining unit 210 is configured to determine, from the physical function PF module group of the first physical network card, the main PF module, 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, according to the virtual function VF module group corresponding to each PF module in the PF module group, the target VF module group managed by the main PF module, where the VF module in the target VF module group is used for Assigned to at least one virtual machine VM so that the at least one VMs implement data transfer.
  • the first determining unit 210 is specifically configured to: determine, according to a reference parameter of each PF module in the PF module group, the primary PF module, where the reference parameter of the PF module includes a PF module failure number, a PF module At least one of the number of corresponding VF modules, the static bandwidth of the PF module, and the static bandwidth of the PF module.
  • the second determining unit 220 is specifically configured to: select 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.
  • the apparatus 200 further includes a fourth determining unit 252 and an establishing unit 254.
  • the fourth determining unit 252 is configured to determine that the first PF module is re-enabled or fault-recovered, and the first PF module is determined as a PF module in the PF module group; and the establishing unit 254 is configured to be based on the first PF module. Establishing a VF module group corresponding to the first PF module.
  • the apparatus 200 further includes 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; and the releasing unit 258 is configured to release the VF module group corresponding to the second PF module.
  • the apparatus 200 further includes a sixth determining unit 262, a holding unit 264, and a holding unit 264.
  • the sixth determining unit 262 is configured to determine whether the VF in the VF module group corresponding to the third PF module is available when the third PF module of the first physical network card is faulty; the holding unit 264 is configured to be in the When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF module in the VF module group corresponding to the third PF module is determined to continue to be available.
  • 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 the first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; the selecting unit 274 is configured to use the VF corresponding to each PF module in the PF module group. In the module group, a second VF module different from the first VF module is selected; the update unit 276 is used to update the target VF module group.
  • the apparatus 200 further includes: an eighth determining unit 282, configured to determine that the target needs to be Transmitting, by the VF module group, the data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the VF module of the target VF module group and the second PCIe bus of the at least two PCIe buses; a sending unit 284, configured to connect to the first PCIe bus The data of the connected VF module is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
  • the apparatus 200 further includes a third determining unit 240.
  • the third determining unit 240 is configured to determine that the primary PF module is faulty; the first determining unit 210 is further configured to: select, from the PF module group, a PF module other than the primary PF module as a new primary PF.
  • the second determining unit 220 is further configured to: determine, according to the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new primary PF module, where the new target VF The VF module in the module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
  • a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
  • FIG. 5 is a schematic block diagram of an apparatus 300 for data transmission in accordance with an embodiment of the present invention.
  • the apparatus 300 includes: a processor 310310 and a memory 320320; wherein the memory 320 stores program code, and the processor 310 is configured to invoke the program code stored in the memory 320 to perform the following operations: The physical function of a physical network card in the PF module group, determine the main
  • 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; and based on the 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, wherein, the target
  • the VF module in the VF module group is used to allocate to at least one virtual machine VM, so that the at least one
  • the VM implements data transfer.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and specifically perform the following operations: determining the primary PF module based on a reference parameter of each PF module in the PF module group, where the PF The reference parameters of the module include at least one of the number of PF module failures, 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.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and specifically perform the following operations: selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group, The target VF module group.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the first PF module is re-enabled or failback, and the first PF module is The PF module in the PF module group is determined; based on the first PF module, the VF module group corresponding to the first PF module is established.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the second PF module is deleted from the PF module group of the first physical network card; releasing the second PF The VF module group corresponding to the module.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: when determining that the third PF module of the first physical network card fails, determining a VF corresponding to the third PF module Whether the VF module in the module group is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining the at least one VF module available in the VF module group corresponding to the first PF module To continue to be available.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the first VF module allocated to the first VM of the at least one VM in the target VF module group appears The second VF module different from the first VF module is selected from the VF module group corresponding to each PF module in the PF module group; and the target VF module group is updated.
  • the first physical NIC occupies at least two high-speed peripheral components interconnecting a standard PCIe bus
  • the processor 310 is configured to invoke the program code stored in the memory 320, and performs the following operations: determining that the target needs to be And transmitting, by the VF module group, the data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the VF module of the target VF module group and the second PCIe bus of the at least two PCIe buses;
  • the data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
  • the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the primary PF module is faulty; and selecting, from the PF module group, other than the primary PF module The PF module is used as a new main PF module; based on the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new main PF module is determined, wherein the new target VF module group The VF module is configured to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
  • a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities to choose, you can avoid system failures. And reduce waste of resources.
  • the physical network card 400 includes: a PF module group 410 composed of at least two PF modules 411, and at least two VF module groups 420; wherein one of the at least two PF modules 411 is a PF module. 411 corresponds to one of the at least two VF module groups 420, and any one of the at least two PF modules 411 can manage other after being determined to be the main PF module.
  • the VF module 421 in the VF module group 420 to which the PF module 411 is connected is connected.
  • each PF module 411 in the PF module group 410 is connected to each other, and any PF module 411 in the PF module group 410 can manage the VF module group connected to the other PF module 411 through other PF modules 411.
  • VF module 421 in 420 is connected to each other, and any PF module 411 in the PF module group 410 can manage the VF module group connected to the other PF module 411 through other PF modules 411.
  • the VF module 421 in each of the at least two VF module groups 420 includes two types of spatial resources; wherein, one of the two types of spatial resources is used in the Before the primary PF module is determined, 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 belongs is accessed; another type of spatial resource in the two types of spatial resources is used in the After the primary PF module is determined, establishing a connection with the primary PF module is accessed by the primary PF module.
  • the physical network card 400 occupies at least two high-speed peripheral components interconnecting a standard PCIe bus, and the physical network card 400 further includes a built-in switch; wherein the built-in switch is used to connect with the at least two PCIe buses The data of the VFE module connected to the first PCIe bus is transmitted to the VF module connected to the second PCIe bus of the at least two PCIe buses.
  • the physical network card is connected to the external switch by using at least two ports; the physical network card is further configured to receive a data stream sent by the device for data transmission through the aggregation link, and pass each port of the at least two ports. Equalizing the data stream to the external switch.
  • a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
  • FIG. 7 is a schematic block diagram of a system 500 for data transmission in accordance with an embodiment of the present invention.
  • the system 400 includes a device 410 for data transmission and a physical network card 420; wherein the device 510 for data transmission may correspond to the device 200 or 300 for data transmission in the embodiment of the present invention, physical
  • the network card 520 can correspond to the physical network card 400, and the device 200 for data transmission
  • the first physical network card mentioned in 300 or 300 is the physical network card 400. For the sake of cleanliness, we will not repeat them here.
  • a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, or the part contributing to the prior art, or the part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .

Abstract

The embodiment of the present invention provides a method, apparatus and system for data transmission, and a physical network card. The method comprises: determining a main physical function (PF) module in a physical function (PF) module group of a first physical network card, the PF module group comprising at least two PF modules; determining a target virtual function (VF) module cluster managed by the main PF module on the basis of virtual function (VF) module groups corresponding to each of the PF modules in the PF module group; and allocating VF modules in the target VF module cluster to at least one virtual machine, enabling the at least one virtual machine to realize data transmission. The method, apparatus and system for data transmission in the embodiment of the present invention can avoid system failures and reduce resource waste.

Description

用于数据传输的方法、 装置和系统以及物理网卡 技术领域  Method, device and system for data transmission and physical network card
本发明涉及通信领域, 并且更具体地, 涉及一种用于数据传输的方法、 装置和系统以及物理网卡。 背景技术  The present invention relates to the field of communications and, more particularly, to a method, apparatus and system for data transmission and a physical network card. Background technique
作为云计算快速发展的基础, 虚拟化技术在计算、 存储、 网络和集群管 理等方面的逐渐成熟, 推动着云计算在各个领域的应用。  As the foundation of the rapid development of cloud computing, virtualization technology has gradually matured in computing, storage, network and cluster management, and promotes the application of cloud computing in various fields.
随着中央处理单元( Center Processing Unit, CPU )芯片技术的发展, 单 个物理 CPU能力越来越强, 能够提供的虚拟机个数越来越多, 同时对物理 网卡的性能要求更高, 要求提供的虚拟网卡数量越来越多, 以满足更多用户 的要求, 提高云资源的利用率。 在网络虚拟化中, 网卡虚拟化作为解决虚拟 化最后一公里的关键技术, 经历了软件模拟、 虚拟机设备队列 (Virtual Machine Device Queue , VMDq )、 单根 I/O 虚拟化 ( Single-Root I/O With the development of the central processing unit (CPU) chip technology, the capability of a single physical CPU is getting stronger and stronger, the number of virtual machines that can be provided is increasing, and the performance requirements of the physical network card are higher. The number of virtual network cards is increasing, to meet the requirements of more users, and to improve the utilization of cloud resources. In network virtualization, NIC virtualization is the key technology to solve the last mile of virtualization. It has experienced software simulation, Virtual Machine Device Queue (VMDq), and single root I/O virtualization (Single-Root I). /O
Virtualization, SR-IOV )三个阶段的发展后, SR-IOV技术已经成为解决虚 拟化最后一公里的理想设备, SR-IOV 用于将一个高速外设部件互连标准 ( Peripheral Component Interconnect Express, PCIe ) 网卡设备虚^■成至少两 个 PCIe网卡设备, 每个虚拟 PCIe网卡设备如同物理 PCIe网卡设备一样向 虚拟机上层软件提供服务。 Virtualization, SR-IOV) After three phases of development, SR-IOV technology has become the ideal device to solve the last mile of virtualization. SR-IOV is used to interconnect a high-speed peripheral component (Peripheral Component Interconnect Express, PCIe). The NIC device is virtualized into at least two PCIe NIC devices, and each virtual PCIe NIC device provides services to the upper layer software of the virtual machine just like the physical PCIe NIC device.
SR-IOV是一种 10虚拟化的技术标准,允许一个物理设备支持至少两个 虚拟网卡。 SR-IOV引入了两种新的功能类型,即物理功能( Physical Function, SR-IOV is a 10 virtualization technology standard that allows one physical device to support at least two virtual NICs. SR-IOV introduces two new types of functions, Physical Function (Physical Function,
PF )模块和虚拟功能( Virtual Function, VF )模块。其中, PF模块拥有 SR-IOV 的全部 PCIe功能, 可以进行 SR-IOV功能配置和管理, VF模块具有轻量级 的 PCIe功能, 包含数据传输所必要的资源和少量的配置资源。 VF模块作为 一个单独的 PCIe设备,可以经由虚拟机管理层( Virtual Machine Management,PF) module and Virtual Function (VF) module. Among them, the PF module has all the PCIe functions of the SR-IOV, and can perform SR-IOV function configuration and management. The VF module has a lightweight PCIe function, including resources necessary for data transmission and a small amount of configuration resources. As a separate PCIe device, the VF module can be managed via Virtual Machine Management (Virtual Machine Management,
VMM )分配给虚拟机 ( Virtual Machine, VM )使用。 VMM) is assigned to the virtual machine (VM).
然而, PF模块作为系统的关键节点, 一旦出现故障, 将会造成系统故 障和资源浪费。 发明内容 本发明实施例提供一种用于数据传输的方法、 装置和系统以及物理网 卡, 可以避免系统出现故障, 并减少资源浪费。 However, as a key node of the system, the PF module will cause system failure and waste of resources in the event of a failure. Summary of the invention Embodiments of the present invention provide a method, an apparatus, and a system for data transmission, and a physical network card, which can avoid system failure and reduce resource waste.
第一方面, 提供了一种用于数据传输的方法, 包括: 从第一物理网卡的 物理功能 PF模块组中, 确定主 PF模块, 该 PF模块组包括至少两个 PF模 块, 该 PF模块组中各个 PF模块对应不同的虚拟功能 VF模块组; 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 该目标 VF模块群中的 VF模块用于分配给至少一个虚拟 机 VM, 以便该至少一个 VM实现数据传输。  The first aspect provides a method for data transmission, including: determining, from a physical function PF module group of a first physical NIC, a primary PF module, where the PF module group includes at least two PF modules, and the PF module group Each of the PF modules corresponds to a different virtual function VF module group; based on the VF module group corresponding to each PF module in the PF module group, the target VF module group managed by the main PF module is determined, wherein the VF in the target VF module group The module is configured to be allocated to at least one virtual machine VM such that the at least one VM implements data transmission.
结合第一方面, 在第一方面的第一种可能的实现方式中, 该从第一物理 网卡的 PF模块组中, 确定主 PF模块, 包括: 基于该 PF模块组中每一个 PF 模块的基准参数, 确定该主 PF模块, 其中, 该 PF模块的基准参数包括 PF 模块故障次数、 PF模块对应的 VF模块组中 VF模块的个数、 PF模块静态带 宽和 PF模块静态带宽中的至少一种。  With reference to the first aspect, in a first possible implementation manner of the first aspect, determining, by the PF module group of the first physical network card, the primary PF module includes: determining, according to a reference of each PF module in the PF module group a parameter, the primary PF module is determined, wherein the reference parameter of the PF module includes at least one of a PF module failure number, a number of VF modules in the VF module group corresponding to the PF module, a static bandwidth of the PF module, and a static bandwidth of the PF module. .
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二 种可能的实现方式中,该基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 包括: 从该 PF模块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块,组成该目标 VF模块群。  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, according to the VF module group corresponding to each PF module in the PF module group, determining the primary The target VF module group managed by the PF module includes: 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.
结合第一方面, 第一方面的第一种可能的实现方式或第一方面的第二种 可能的实现方式中,在第一方面的第三种可能的实现方式中,该方法还包括: 确定第一 PF模块重新使能或故障恢复, 将该第一 PF模块确定为该 PF模块 组中的 PF模块; 基于该第一 PF模块, 建立该第一 PF模块对应的 VF模块 组。  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 The first PF module is re-enabled or fault-recovered, and the first PF module is determined as the PF module in the PF module group. Based on the first PF module, the VF module group corresponding to the first PF module is established.
结合第一方面, 或第一方面的第一种至第三种中任一种可能的实现方 式, 在第一方面的第四种可能的实现方式中, 该方法还包括: 确定第二 PF 模块从该第一物理网卡的该 PF模块组中删除; 释放该第二 PF模块对应的 VF模块组。  With reference to the first aspect, or any one of the first to the third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes: determining the second PF module Deleting from the PF module group of the first physical network card; releasing the VF module group corresponding to the second PF module.
结合第一方面, 或第一方面的第一种至第四种中任一种可能的实现方 式, 在第一方面的第五种可能的实现方式中, 该方法还包括: 确定该第一物 理网卡的第三 PF模块发生故障时,确定该第三 PF模块对应的 VF模块组中 的 VF模块是否可用; 在该第三 PF模块对应的 VF模块组中的至少一个 VF 模块可用时, 将该第一 PF模块对应的 VF模块组中的可用的该至少一个 VF 模块确定为继续可用。 With reference to the first aspect, or any one of the first to fourth possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the method further includes: determining the first physics When the third PF module of the network card fails, determining whether the VF module in the 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, The at least one VF available in the VF module group corresponding to the first PF module The module is determined to continue to be available.
结合第一方面, 或第一方面的第一种至第五种中任一种可能的实现方 式, 在第一方面的第六种可能的实现方式中, 该方法还包括: 确定该目标 In conjunction with the first aspect, or any one of the first to fifth aspects of the first aspect, in a sixth possible implementation of the first aspect, the method further comprises: determining the target
VF模块群中分配给该至少一个 VM中的第一 VM的第一 VF模块出现故障; 从该 PF模块组中各个 PF模块对应的 VF模块组中, 选择不同于该第一 VF 模块的第二 VF模块; 更新该目标 VF模块群。 The first VF module allocated to the first VM of the at least one VM in the VF module group is faulty; from the VF module group corresponding to each PF module in the PF module group, selecting a second different from the first VF module VF module; update the target VF module group.
结合第一方面, 或第一方面的第一种至第六种中任一种可能的实现方 式, 在第一方面的第七种可能的实现方式中, 该第一物理网卡占用至少两个 高速外设部件互连标准 PCIe 总线, 该方法还包括: 确定需要将该目标 VF 模块群中与该至少两个 PCIe总线中第一 PCIe总线连接的 VF模块的数据发 送到该目标 VF模块群中与该至少两个 PCIe总线中第二 PCIe总线连接的 VF 模块;将该与第一 PCIe总线连接的 VF模块的数据通过该第一物理网卡的交 换机发送到该与第二 PCIe总线连接的 VF模块。  With reference to the first aspect, or any one of the first to the sixth possible implementation manners of the first aspect, in the seventh possible implementation manner of the first aspect, the first physical network card occupies at least two high speeds The peripheral component interconnects the standard PCIe bus, the method further includes: determining that data of the VF module connected to the first PCIe bus of the at least two PCIe buses in the target VF module group needs to be sent to the target VF module group a VF module connected to the second PCIe bus of the at least two PCIe buses; and the data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
结合第一方面, 或第一方面的第一种至第七种中任一种可能的实现方 式, 在第一方面的第八种可能的实现方式中, 该方法还包括: 确定该主 PF 模块出现故障; 从该 PF模块组中, 选择除该主 PF模块之外的 PF模块作为 新的主 PF模块; 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定 该新的主 PF模块管理的新的目标 VF模块群, 其中, 该新的目标 VF模块群 中的 VF模块用于分配给至少一个虚拟机 VM, 以便该至少一个 VM实现数 据传输。  With reference to the first aspect, or any one of the first to the seventh possible implementation manners of the first aspect, in the eighth possible implementation manner of the first aspect, the method further includes: determining the primary PF module A fault occurs; from the PF module group, a PF module other than the main PF module is selected as a new main PF module; and the new main PF module is determined based on the VF module group corresponding to each PF module in the PF module group. A new target VF module group is managed, wherein the VF module in the new target VF module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
第二方面, 提供了一种用于数据传输的装置, 包括: 第一确定单元, 用 于从第一物理网卡的物理功能 PF模块组中, 确定主 PF模块, 该 PF模块组 包括至少两个 PF模块, 该 PF模块组中各个 PF模块对应不同的虚拟功能 VF模块组; 第二确定单元, 用于基于该 PF模块组中各个 PF模块对应的虚 拟功能 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 该目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便该至少一个 VM实现数据传输。  The second aspect provides an apparatus for data transmission, including: a first determining unit, configured to determine, from a physical function PF module group of the first physical network card, a primary PF module, where the PF module group includes at least two PF module, each PF module in the PF module group corresponds to a different virtual function VF module group; and a second determining unit is configured to determine the main PF module management based on the virtual function VF module group corresponding to each PF module in the PF module group The target VF module group, wherein the VF module in the target VF module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
结合第二方面, 在第二方面的第一种可能的实现方式中, 该第一确定单 元具体用于: 基于该 PF模块组中每一个 PF模块的基准参数, 确定该主 PF 模块, 其中, 该 PF模块的基准参数包括 PF模块故障次数、 PF模块对应的 VF模块组中 VF模块的个数、 PF模块静态带宽和 PF模块静态带宽中的至少 一种。 With reference to the second aspect, in a first possible implementation manner of the second aspect, the first determining unit is specifically configured to: determine, according to a reference parameter of each PF module in the PF module group, the primary PF module, where The reference parameters of the PF module include at least the number of PF module failures, 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. One.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二 种可能的实现方式中, 该第二确定单元具体用于: 从该 PF模块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块,组成该目标 VF模块群。  With reference to the second aspect, or the first possible implementation manner of the second aspect, in the second possible implementation manner of the second aspect, the second determining unit is specifically configured to: use each PF module from the PF module group At least one VF module is selected from the corresponding VF module group to form the target VF module group.
结合第二方面, 第二方面的第一种可能的实现方式或第二方面的第二种 可能的实现方式中,在第二方面的第三种可能的实现方式中,该装置还包括: 第四确定单元, 用于确定第一 PF模块重新使能或故障恢复, 将该第一 PF 模块确定为该 PF模块组中的 PF模块;建立单元,用于基于该第一 PF模块, 建立该第一 PF模块对应的 VF模块组。  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 determining unit, configured to determine that the first PF module is re-enabled or fault-recovered, determining the first PF module as a PF module in the PF module group; and establishing a unit, configured to establish the first PF module based on the first PF module A VF module group corresponding to a PF module.
结合第二方面, 或第二方面的第一种至第三种中任一种可能的实现方 式,在第二方面的第四种可能的实现方式中,该装置还包括: 第五确定单元, 用于确定第二 PF模块从该第一物理网卡的该 PF模块组中删除; 释放单元, 用于释放该第二 PF模块对应的 VF模块组。  With reference to the second aspect, or any one of the first to the third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the device further includes: a fifth determining unit, The second PF module is configured to be deleted from the PF module group of the first physical NIC; and the release unit is configured to release the VF module group corresponding to the second PF module.
结合第二方面, 或第二方面的第一种至第四种中任一种可能的实现方 式,在第二方面的第五种可能的实现方式中,该装置还包括: 第六确定单元, 用于确定该第一物理网卡的第三 PF模块发生故障时,确定该第三 PF模块对 应的 VF模块组中的 VF是否可用; 保持单元, 用于在该第三 PF模块对应的 VF模块组中的至少一个 VF模块可用时, 将该第三 PF模块对应的 VF模块 组中的该至少一个 VF模块确定为继续可用。  With reference to the second aspect, or any one of the first to the fourth possible implementation manners of the second aspect, in a fifth possible implementation manner of the second aspect, the device further includes: a sixth determining unit, When it is determined that the third PF module of the first physical network card is faulty, determining whether the VF in the VF module group corresponding to the third PF module is available; the holding unit, configured to be in the VF module group corresponding to the third PF module When at least one VF module is available, the at least one VF module in the VF module group corresponding to the third PF module is determined to continue to be available.
结合第二方面, 或第二方面的第一种至第五种中任一种可能的实现方 式,在第二方面的第六种可能的实现方式中,该装置还包括: 第七确定单元, 用于确定该目标 VF模块群中分配给该至少一个 VM中的第一 VM的第一 VF模块出现故障;选择单元,用于从该 PF模块组中各个 PF模块对应的 VF 模块组中, 选择不同于该第一 VF模块的第二 VF模块; 更新单元, 用于更 新该目标 VF模块群, 并将该第二 VF模块分配给该第一 VM。  With reference to the second aspect, or any one of the first to the fifth possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect, the device further includes: a seventh determining unit, Determining that a first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; and selecting a unit for selecting 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; an update unit, configured to update the target VF module group, and assign the second VF module to the first VM.
结合第二方面, 或第二方面的第一种至第六种中任一种可能的实现方 式, 在第二方面的第七种可能的实现方式中, 该第一物理网卡占用至少两个 高速外设部件互连标准 PCIe总线, 该装置还包括: 第八确定单元, 用于确 定需要将该目标 VF模块群中与该至少两个 PCIe总线中第一 PCIe总线连接 的 VF模块的数据发送到该目标 VF模块群中与该至少两个 PCIe总线中第二 PCIe总线连接的 VF模块; 发送单元, 用于将该与第一 PCIe总线连接的 VF 模块的数据通过该第一物理网卡的交换机发送到该与第二 PCIe总线连接的 VF模块。 With reference to the second aspect, or any one of the first to the sixth possible implementation manners of the second aspect, in the seventh possible implementation manner of the second aspect, the first physical network card occupies at least two high speeds The peripheral component interconnects the standard PCIe bus, the device further includes: an eighth determining unit, configured to determine that data of the VF module connected to the first PCIe bus of the at least two PCIe buses in the target VF module group needs to be sent to a VF module connected to the second PCIe bus of the at least two PCIe buses in the target VF module group; a sending unit, configured to connect the VF to the first PCIe bus The data of the module is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
结合第二方面, 或第二方面的第一种至第七种中任一种可能的实现方 式, 在第二方面的第八种可能的实现方式中, 该装置还包括第三确定单元, 用于确定该主 PF模块出现故障;该第一确定单元还用于:从该 PF模块组中, 选择除该主 PF模块之外的 PF模块作为新的主 PF模块; 该第二确定单元还 用于: 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该新的主 PF模块管理的新的目标 VF模块群, 其中, 该新的目标 VF模块群中的 VF 模块用于分配给至少一个虚拟机 VM, 以便该至少一个 VM实现数据传输。  With reference to the second aspect, or any one of the first to the seventh possible implementation manners of the second aspect, in the eighth possible implementation manner of the second aspect, the device further includes a third determining unit, Determining that the main PF module is faulty; the first determining unit is further configured to: select, from the PF module group, a PF module other than the main PF module as a new main PF module; the second determining unit further uses And: determining, according to the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new main PF module, where the VF module in the new target VF module group is used to allocate to At least one virtual machine VM, such that the at least one VM implements data transmission.
第三方面, 提供了一种用于数据传输的装置, 包括处理器和存储器; 其 中, 该存储器存储程序代码, 该处理器用于调用该存储器中存储的该程序代 码, 执行以下操作: 从第一物理网卡的物理功能 PF模块组中, 确定主 PF 模块, 该 PF模块组包括至少两个 PF模块, 该 PF模块组中各个 PF模块对 应不同的虚拟功能 VF模块组;基于该 PF模块组中各个 PF模块对应的虚拟 功能 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 该目标 In a third aspect, an apparatus for data transmission is provided, including a processor and a memory; wherein the memory stores program code, the processor is configured to call the program code stored in the memory, and performs the following operations: Physical NIC module physical group PF module group, the main PF module is determined, the PF module group includes at least two PF modules, each PF module in the PF module group corresponds to a different virtual function VF module group; based on each of the PF module groups a virtual function VF module group corresponding to the PF module, determining a target VF module group managed by the main PF module, wherein the target
VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便该至少一个The VF module in the VF module group is used to allocate to at least one virtual machine VM, so that the at least one
VM实现数据传输。 The VM implements data transfer.
结合第三方面, 在第三方面的第一种可能的实现方式中, 该处理器用于 调用该存储器中存储的该程序代码, 具体执行以下操作: 基于该 PF模块组 中每一个 PF模块的基准参数, 确定该主 PF模块, 其中, 该 PF模块的基准 参数包括 PF模块故障次数、 PF模块对应的 VF模块组中 VF模块的个数、 With reference to the third aspect, in a first possible implementation manner of the third aspect, the processor is configured to invoke the program code stored in the memory, and specifically perform the following operations: based on a reference of each PF module in the PF module group a parameter, the primary PF module is determined, wherein the reference parameters of the PF module include the number of failures of the PF module, the number of VF modules in the VF module group corresponding to the PF module,
PF模块静态带宽和 PF模块静态带宽中的至少一种。 At least one of a static bandwidth of the PF module and a static bandwidth of the PF module.
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二 种可能的实现方式中, 该处理器用于调用该存储器中存储的该程序代码, 具 体执行以下操作: 从该 PF模块组中每一个 PF模块对应的 VF模块组中选出 至少一个 VF模块, 组成该目标 VF模块群。  In conjunction with 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 invoke the program code stored in the memory, and specifically perform the following operations: At least one VF module is selected from the VF module group corresponding to each PF module in the PF module group to form the target VF module group.
结合第三方面, 第三方面的第一种可能的实现方式或第三方面的第二种 可能的实现方式中, 在第三方面的第三种可能的实现方式中, 该处理器用于 调用该存储器中存储的该程序代码, 还执行以下操作: 确定第一 PF模块重 新使能或故障恢复, 将该第一 PF模块确定为该 PF模块组中的 PF模块; 基 于该第一 PF模块, 建立该第一 PF模块对应的 VF模块组。 结合第三方面, 或第三方面的第一种至第三种中任一种可能的实现方 式, 在第三方面的第四种可能的实现方式中, 该处理器用于调用该存储器中 存储的该程序代码, 还执行以下操作: 确定第二 PF模块从该第一物理网卡 的该 PF模块组中删除; 释放该第二 PF模块对应的 VF模块组。 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 used to invoke the The program code stored in the memory further performs the following operations: determining that the first PF module is re-enabled or failback, determining the first PF module as the PF module in the PF module group; establishing based on the first PF module The VF module group corresponding to the first PF module. With reference to the third aspect, or any one of the first to the third possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, the processor is configured to invoke the storage in the memory The program code also performs the following operations: determining that the second PF module is deleted from the PF module group of the first physical network card; releasing the VF module group corresponding to the second PF module.
结合第三方面, 或第三方面的第一种至第四种中任一种可能的实现方 式, 在第三方面的第五种可能的实现方式中, 该处理器用于调用该存储器中 存储的该程序代码, 还执行以下操作: 确定该第一物理网卡的第三 PF模块 发生故障时, 确定该第三 PF模块对应的 VF模块组中的 VF模块是否可用; 在该第三 PF模块对应的 VF模块组中的至少一个 VF模块可用时,将该第一 PF模块对应的 VF模块组中的可用的该至少一个 VF模块确定为继续可用。  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 invoke the storage in the memory The program code is further configured to: determine whether the 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 is faulty; and corresponding to the third PF module When at least one VF module in the VF module group is available, the at least one VF module available in the VF module group corresponding to the first PF module is determined to be continuously available.
结合第三方面, 或第三方面的第一种至第五种中任一种可能的实现方 式, 在第三方面的第六种可能的实现方式中, 该处理器用于调用该存储器中 存储的该程序代码, 还执行以下操作: 确定该目标 VF模块群中分配给该至 少一个 VM中的第一 VM的第一 VF模块出现故障; 从该 PF模块组中各个 PF模块对应的 VF模块组中, 选择不同于该第一 VF模块的第二 VF模块; 更新该目标 VF模块群, 并将该第二 VF模块分配给该第一 VM。  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 storage in the memory The program code is further configured to: determine that the first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; from the VF module group corresponding to each PF module in the PF module group Selecting a second VF module different from the first VF module; updating the target VF module group, and assigning the second VF module to the first VM.
结合第三方面, 或第三方面的第一种至第六种中任一种可能的实现方 式, 在第三方面的第七种可能的实现方式中, 该第一物理网卡占用至少两个 高速外设部件互连标准 PCIe总线, 该处理器用于调用该存储器中存储的该 程序代码, 还执行以下操作: 确定需要将该目标 VF模块群中与该至少两个 PCIe总线中第一 PCIe总线连接的 VF模块的数据发送到该目标 VF模块群 中与该至少两个 PCIe总线中第二 PCIe总线连接的 VF模块;将该与第一 PCIe 总线连接的 VF模块的数据通过该第一物理网卡的交换机发送到该与第二 PCIe总线连接的 VF模块。  With reference to the third aspect, or any one of the first to the sixth possible implementation manners of the third aspect, in the seventh possible implementation manner of the third aspect, the first physical network card occupies at least two high speeds The peripheral component interconnects a standard PCIe bus, the processor is configured to call the program code stored in the memory, and performs the following operations: determining that the target PCI module is required to be connected to the first PCIe bus of the at least two PCIe buses The data of the VF module is sent to the VF module in the target VF module group and connected to the second PCIe bus of the at least two PCIe buses; and the data of the VF module connected to the first PCIe bus passes through the first physical network card. The switch sends to the VF module connected to the second PCIe bus.
结合第三方面, 或第三方面的第一种至第七种中任一种可能的实现方 式, 在第三方面的第八种可能的实现方式中, 该处理器用于调用该存储器中 存储的该程序代码, 还执行以下操作: 确定该主 PF模块出现故障; 从该 PF 模块组中, 选择除该主 PF模块之外的 PF模块作为新的主 PF模块; 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该新的主 PF模块管理的 新的目标 VF模块群, 其中, 该新的目标 VF模块群中的 VF模块用于分配 给至少一个虚拟机 VM, 以便该至少一个 VM实现数据传输。 第四方面, 提供了一种物理网卡, 包括: 有至少两个 PF模块组成的 PF 模块组, 以及至少两个 VF模块组; 其中, 该至少两个 PF模块中的一个 PF 模块对应于该至少两个 VF模块组中的一个 VF模块组,该至少两个 PF模块 中的任一 PF模块在被确定为主 PF模块后能够管理其他 PF模块连接的 VF 模块组中的 VF模块。 With reference to the third aspect, or any one of the first to 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 storage in the memory The program code also performs the following operations: determining that the main PF module is faulty; from the PF module group, selecting a PF module other than the main PF module as a new main PF module; based on each PF in the PF module group a VF module group corresponding to the module, determining a new target VF module group managed by the new main PF module, wherein the VF module in the new target VF module group is used to allocate to at least one virtual machine VM, so that the at least one The VM implements data transfer. In a fourth aspect, a physical network card is provided, including: a PF module group having at least two PF modules, and at least two VF module groups; wherein, one of the at least two PF modules corresponds to the at least one One of the two VF module groups, one of the at least two PF modules can manage the VF module in the VF module group to which the other PF modules are connected after being determined as the main PF module.
结合第四方面, 在第四方面的第一种可能的实现方式中, 所述至少两个 VF模块组中各个 VF模块组中的 VF模块包括两类空间资源; 其中, 所述两 类空间资源中的一类空间资源用于在所述主 PF模块被确定前, 由所述两类 空间资源所属的 VF模块所属的 VF模块组对应的 PF模块进行访问;所述两 类空间资源中的另一类空间资源用于在所述主 PF模块被确定后, 与所述主 PF模块建立连接由所述主 PF模块进行访问。  With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the VF module in each VF module group of the at least two VF module groups includes two types of spatial resources; a type of space resource is used to access the PF module corresponding to the VF module group to which the VF module to which the two types of space resources belong before the primary PF module is determined; the other two of the two types of space resources are accessed. A type of spatial resource is used to establish a connection with the primary PF module for access by the primary PF module after the primary PF module is determined.
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二 种可能的实现方式中, 所述物理网卡占用至少两个高速外设部件互连标准 PCIe总线, 所述物理网卡还包括内置交换机; 其中, 所述内置交换机用于将 与所述至少两个 PCIe总线中的第一 PCIe总线连接的 VF模块的数据通过发 送到与所述至少两个 PCIe总线中的第二 PCIe总线连接的 VF模块。  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 high-speed peripheral components interconnecting a standard PCIe bus, The physical network card further includes a built-in switch; wherein the built-in switch is configured to send data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the at least two PCIe buses The VF module connected to the second PCIe bus.
结合第四方面, 第四方面的第一种可能的实现方式或第四方面的第二种 可能的实现方式, 在第四方面的第三种可能的实现方式中, 所述物理网卡通 过至少两个端口与外部交换机连接; 所述物理网卡还用于接收数据传输的装 置通过聚合链路发送的数据流, 并通过所述至少两个端口中各个端口均衡发 送所述数据流至所述外部交换机。  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 passes at least two a port is connected to the external switch; the physical network card is further configured to receive a data stream sent by the device for data transmission through the aggregated link, and uniformly send the data stream to the external switch by using each of the at least two ports .
第五方面, 提供了一种用于数据传输的系统, 包括第二方面或第二方面 中的任一种可能的实现方式中的用于数据传输的装置和第四方面或第四方 面的任一种可能的实现方式中的物理网卡, 或者包括第三方面或第三方面中 的任一种可能的实现方式中的用于数据传输的装置和第四方面或第四方面 的任一种可能的实现方式中的物理网卡; 其中, 第二方面或第二方面中的任 一种可能的实现方式中所指的第一物理网卡或第三方面或第三方面中的任 一种可能的实现方式中所指的第一物理网卡为第四方面或第四方面的任一 种可能的实现方式中所指的物理网卡。  A fifth aspect, a system for data transmission, comprising the apparatus for data transmission in any of the possible implementations of the second aspect or the second aspect, and the fourth aspect or the fourth aspect A physical network card in a possible implementation, or a device for data transmission in any of the possible implementations of the third aspect or the third aspect, and any one of the fourth aspect or the fourth aspect The physical network card in the implementation manner; wherein the first physical network card or the third aspect or the third aspect of the possible implementation in any one of the possible implementation manners in the second aspect or the second aspect The first physical network card referred to in the manner is the physical network card referred to in the fourth aspect or any possible implementation manner of the fourth aspect.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。 附图说明 Therefore, in the embodiment of the present invention, one physical network card has a PF module group composed of at least two PF modules, and one PF can be selected from at least two PF modules in the PF module group. The module acts as the main PF module, which avoids system failures and reduces resource waste due to the many opportunities for selection. DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例或现有技 术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图 仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造 性劳动的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图 1是根据本发明实施例的用于数据传输的方法的示意性流程图。  1 is a schematic flow chart of a method for data transmission according to an embodiment of the present invention.
图 2是根据本发明另一实施例的用于数据传输的方法的示意性流程图。 图 3是根据本发明另一实施例的用于数据传输的装置的示意性框图。 图 4是根据本发明另一实施例的用于数据传输的装置的示意性框图。 图 5是根据本发明另一实施例的用于数据传输的装置的示意性框图。 图 6是根据本发明另一实施例的物理网卡的示意性框图。  2 is a schematic flow chart of a method for data transmission according to another embodiment of the present invention. 3 is a schematic block diagram of an apparatus for data transmission in accordance with another embodiment of the present invention. 4 is a schematic block diagram of an apparatus for data transmission in accordance with 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. 6 is a schematic block diagram of a physical network card in accordance with another embodiment of the present invention.
图 7是根据本发明另一实施例的用于数据传输的系统的示意性框图。 具体实施方式  7 is a schematic block diagram of a system for data transmission in accordance with another embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创 造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without making creative labor are within the scope of the present invention.
图 1是根据本发明实施例的一种用于数据传输的方法。 如图 1所示, 该 方法 100包括:  1 is a method for data transmission in accordance with an embodiment of the present invention. As shown in FIG. 1, the method 100 includes:
S110, 从第一物理网卡的第一 PF模块组中, 确定主 PF模块, 第一 PF 模块组包括至少两个 PF模块, 第一 PF模块组中各个 PF模块对应不同的 VF模块组。  S110: Determine a primary PF module from a first PF module group of the first physical NIC, 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, 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 主 PF模块管理的目标 VF模块群中 的 VF模块被分配给至少一个虚拟机,以便该至少一个虚拟机实现数据传输。  S120. Determine, according to 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, where the VF module in the target VF module group managed by the main PF module is allocated to at least one virtual Machine, so that the at least one virtual machine implements data transmission.
用于数据传输的装置, 例如, 具备数据传输功能的至少一个处理器的装 置, 例如可以是主机, 或者由至少两个主机组成的主机组, 可以从第一物理 网卡的包括至少两个 PF模块的 PF模块组中,确定主 PF模块; 然后从该 PF 模块组中各个 PF模块对应的 VF模块组中,确定需要该主 PF模块管理的目 标 VF模块群, 其中然后可以将该目标 VF模块群中的 VF模块可以被分配 给至少一个虚拟机, 从而各个虚拟机可以通过 VF模块实现数据传输。 A device for data transmission, for example, a device having at least one processor for data transmission function, such as a host, or a host group composed of at least two hosts, which can be from the first physics Determining a main PF module in a PF module group including at least two PF modules of the network card; and then determining, from the VF module group corresponding to each PF module in the PF module group, a target VF module group that needs to be managed by the main PF module, where The VF module in the target VF module group can then be assigned to at least one virtual machine, so that each virtual machine can implement data transmission through the VF module.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成第一 PF模块组, 且可以从第一 PF模块组中的至少两个 PF模块中选择一 个 PF模块作为主 PF模块, 由于存在至少两个 PF模块可供选择, 增加了主 PF模块的可靠性, 从而可以减少了系统出现故障的概率, 并减少了因为系 统故障而造成的资源浪费。  Therefore, in the embodiment of the present invention, one physical network card has at least two PF modules to form a first PF module group, and one PF module can be selected as a main PF module from at least two PF modules in the first PF module group. Since there are at least two PF modules to choose from, the reliability of the main PF module is increased, thereby reducing the probability of system failure and reducing resource waste caused by system failure.
本发明实施例中提到的物理网卡也可以称之为为 SR-IOV网卡, 其可以 包括两种功能模块, PF模块和 VF模块, 本领域技术人员应当知道, 也筒称 为 PF和 VF。 其中, PF模块支持 SR-IOV扩展功能的 PCIe功能, 被用于配 置和管理 SR-IOV功能特性; VF模块实现筒化的 PCIe功能。 在从 PF模块 组中确定了主 PF模块且确定了主 PF模块管理的目标 VF模块群之后,虚拟 机管理层( Virtual Machine Management , VMM )可以将目标 VF模块群中的 每一个 VF模块分别作为一个 PCIe设备分给虚拟机( Virtual Machine, VM )。 VM对被分配的 VF模块进行控制面访问时, 由 VM发起请求, 主 PF模块 和 VMM响应请求, 并返回结果到 VM中。 VM从 VF模块收发数据报文时, 结合 CPU提供的输入输出存储管理单元 ( input/output memory management unit, IOMMU )技术, 实现收发完全独立, 不需要主 PF模块和 VMM参与。  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, which those skilled in the art should know, also referred to as PF and VF. Among them, the PF module supports the PCIe function of the SR-IOV extended function, which is used to configure and manage the SR-IOV function; the VF module implements the PCIe function. After the primary PF module is determined from the PF module group and the target VF module group managed by the primary PF module is determined, the virtual machine management (VMM) can treat each VF module in the target VF module group as A PCIe device is assigned to a virtual machine (VM). When the VM performs control plane access to the assigned VF module, the VM initiates a request, the primary PF module and the VMM respond to the request, and return the result to the VM. When the VM sends and receives data packets from the VF module, it combines the input/output memory management unit (IMMMU) technology provided by the CPU to realize complete and independent transmission and reception. The main PF module and the VMM do not need to participate.
在本发明实施例中, PF模块组中各个 PF模块与 VF模块组存在对应关 系, 在没有选择主 PF模块之前, 各个 PF模块可以用于管理其所对应的 VF 模块组中的所有 VF模块,也就是说各个 PF模块下挂有其所对应的 VF模块 组中的 VF模块。 而在选择了主 PF模块之后, 主 PF模块能够实现针对 PF 模块组中所有 PF模块对应的 VF模块组中的 VF模块的统一管理和资源分配 等,从而, 可以从所有 PF模块对应的 VF模块组中选择全部或部分 VF模块 组成目标 VF模块群, 由 VMM将目标 VF模块群中的 VF模块分配给虚拟 机。  In the embodiment of the present invention, each PF module in the PF module group has a corresponding relationship with the VF module group. Before the main PF module is selected, each PF module can be used to manage all VF modules in the corresponding VF module group. That is to say, the VF modules in the corresponding VF module group are hung under each PF module. 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 group corresponding to all PF modules in the PF module group, so that the VF modules corresponding to all PF modules can be obtained. All or part of the VF modules in the group are selected to form a target VF module group, and the VF module in the target VF module group is allocated to the virtual machine by the VMM.
本发明实施例中, VF模块可以包括两类空间资源, 第一类空间资源是 受直接对应的 PF模块的控制, 在主 PF模块被确定之前, 直接对应的 PF模 块通过访问第一类空间资源对该 VF模块进行管理; 第二类空间资源在系统 选择了主 PF模块之后,被重新映射为主 PF模块可见的区域(即建立第二空 间资源与该主 PF模块的连接), 可以由主 PF模块直接对该第二类空间资源 进行访问以实现对该 VF模块进行管理, 不受直接对应的 PF模块的控制。 In the embodiment of the present invention, the VF module may include two types of space resources, and the first type of space resource is controlled by the directly corresponding PF module. Before the primary PF module is determined, the directly corresponding PF module accesses the first type of space resource. Manage the VF module; the second type of space resource is in the system After the primary PF module is selected, it is remapped to the area visible to the primary PF module (that is, the connection between the second spatial resource and the primary PF module is established), and the primary PF module can directly access the second type of spatial resource to implement The VF module is managed and is not controlled by the directly corresponding PF module.
在本发明实施例中, S110中从第一物理网卡的 PF模块组中,确定主 PF 模块, 可以包括: 基于该 PF模块组中每一个 PF模块的基准参数, 确定该主 PF模块, 其中, 该基准参数可以包括 PF模块的故障次数、 PF模块对应的 VF模块组中 VF模块的个数、 PF模块静态带宽和 PF模块动态带宽中的至少 一种。  In the embodiment of the present invention, determining the primary PF module from the PF module group of the first physical network card in S110 may include: determining the primary PF module based on a reference parameter of each PF module in the PF module group, where The reference parameter may include at least one of a number of failures of the PF module, a number of VF modules in the VF module group corresponding to the PF module, a static bandwidth of the PF module, and a dynamic bandwidth of the PF module.
具体地说,在需要从第一物理网卡的 PF模块组中确定主 PF模块时,用 于数据传输的装置可以基于该 PF模块组中每一个 PF模块的基准参数,确定 该 PF模块组中每一个 PF模块的性能值, 并基于每一个 PF模块的性能值, 可以确定该 PF模块组中 PF模块的优先级排序, 然后可以基于优先级排序, 从 PF模块组中确定主 PF模块。 在本发明实施例中, 每一个 PF模块的基准 参数相对于该 PF模块可以根据不同的基准性能值得到。例如,若 PF模块的 基准参数为 PF模块故障次数和 PF模块对应的 VF模块组中 VF模块的个数, 可以设置发生一次故障的基准性能值为 -10,—个 VF模块的基准性能值为 5 , 若 PF模块 0的故障次数为 2以及对应的 VF模块组中 VF模块的个数为 6 个, PF模块 1的故障次数 3以及对应的 VF模块组中 VF模块的个数 5个, 则可以计算得到 PF模块 0 的性能值为 10, 而 PF模块 1的性能值为 -5, 则 PF模块 0的性能值大于 PF模块 1的性能值, 从而, PF模块 0 的优先级高 于 PF模块 1 , 则可以选择 PF模块 0作为主 PF模块。 应理解, 上述只是一 个举例, 本发明实施例并不对此作限定。  Specifically, when it is required to determine the main PF module from the PF module group of the first physical network card, the apparatus for data transmission may determine each of the PF module groups based on the reference parameter of each PF module in the PF module group. The performance value of a PF module, and based on the performance value of each PF module, the priority ordering of the PF modules in the PF module group can be determined, and then the main PF module can be determined from the PF module group based on the priority ordering. In the embodiment of the present invention, the reference parameter of each PF module can be obtained according to different reference performance values with respect to the PF module. For example, if the reference parameter of the PF module is the number of PF module failures and the number of VF modules in the VF module group corresponding to the PF module, the baseline performance value of one failure can be set to -10, and the reference performance value of the VF module is 5, if the number of failures of PF module 0 is 2 and the number of VF modules in the corresponding VF module group is 6, the number of failures of PF module 1 is 3, and the number of VF modules in the corresponding VF module group is 5, then It can be calculated that the performance value of PF module 0 is 10, and the performance value of PF module 1 is -5, then the performance value of PF module 0 is greater than the performance value of PF module 1, and thus, the priority of PF module 0 is higher than that of PF module. 1 , you can select PF module 0 as the main PF module. It should be understood that the foregoing is only an example, and the embodiment of the present invention is not limited thereto.
在本发明实施例中, 对于如何确定主 PF模块可以具有以下原则: 若基 准参数只是 PF模块故障次数, 则发生故障次数越少, 则 PF模块的优先级越 高, 越可能被确定为主 PF模块; 若基准参数只是 PF模块对应的 VF模块组 中 VF模块的个数, 则 PF模块对应的 VF模块组中 VF模块的个数越多, 则 该 PF模块的优先级越高, 越可能被确定为主 PF模块; 若基准参数只是 PF 模块的静态带宽, 则 PF模块的静态带宽越大, 则该 PF模块的优先级越高, 越可能被确定为主 PF模块; 若基准参数只是 PF模块的动态带宽, 则 PF模 块的动态带宽越大, 则优先级越高, 越可能被确定为主 PF模块; 若基准参 数为 PF模块故障次数、 PF模块对应的 VF模块组中 VF模块的个数、 PF模 块动态带宽和 PF模块静态带宽中的至少两种, 则可以综合考虑两种因素进 行优先级排序, 以确定出主 PF模块。 In the embodiment of the present invention, the following principles can be determined for how to determine the primary PF module: If the reference parameter is only the number of PF module failures, the fewer the number of failures occurs, the higher the priority of the PF module is, and the more likely it is to be determined as the primary PF. Module; If the reference parameter is only the number of VF modules in the VF module group corresponding to the PF module, the more the number of VF modules in the VF module group corresponding to the PF module, the higher the priority of the PF module is, the more likely it is to be If the reference parameter is only the static bandwidth of the PF module, the greater the static bandwidth of the PF module, the higher the priority of the PF module, the more likely it is to be determined as the primary PF module; if the reference parameter is only the PF module Dynamic bandwidth, the larger the dynamic bandwidth of the PF module, the higher the priority, the more likely it is to be determined as the primary PF module; if the reference parameter is the number of PF module failures, the number of VF modules in the VF module group corresponding to the PF module PF mode At least two of the block dynamic bandwidth and the PF module static bandwidth can be prioritized by considering two factors to determine the main PF module.
在本发明实施例中, S120中基于该 PF模块组中各个 PF模块对应的 VF 模块组, 确定该主 PF模块管理的目标 VF模块群, 可以包括: 从第一 PF模 块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块,组成该目 标 VF模块群。  In the embodiment of the present invention, the target VF module group managed by the main PF module is determined according to the VF module group corresponding to each PF module in the PF module group, and may include: each PF module from the first PF module group. At least one VF module is selected from the corresponding VF module group to form the target VF module group.
例如, 需要至少两个 VF模块实现链路聚合功能(当然也可以是其它场 景下) 时, 在确定了主 PF模块之后, 可以从第一 PF模块组中每一个 PF模 块对应的 VF模块组中分别选出至少一个 VF模块, 组成该目标 VF模块群。 在本发明实施例, 如果某一 PF模块故障, 不会影响到其他 PF模块对应的 VF模块组中的 VF模块的正常工作, 从而可以实现不同 VF模块组的 VF模 块的相互隔离, 从而本发明实施例从不同的 PF模块对应的 VF模块组中, 选择 VF模块, 可以提高系统的可靠性和稳定性, 从而可以保证系统带宽。  For example, when at least two VF modules are required to implement the link aggregation function (otherwise, in other scenarios), after the primary PF module is determined, it may be from the VF module group corresponding to each PF module in the first PF module group. Select at least one VF module 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 module in the VF module group corresponding to the other PF modules is not affected, so that the VF modules of different VF module groups can be isolated from each other, so that the present invention Embodiments Selecting a VF module from a VF module group corresponding to different PF modules can improve system reliability and stability, thereby ensuring system bandwidth.
在本发明实施例中, 在需要发送聚合链路数据流(聚合链路数据流指通 过至少两个 VF模块联合发送的数据流, 也就是至少两个 VF模块收发数据 的通道可以形成聚合链路) 时, 可以通过物理网卡上的多个端口 (port ) 向 外部交换机发送聚合链路数据流, 此时, 可以实时监测各个端口的流量, 例 如, 该物理网卡与外部交换机有两个端口连接, 在某一段时间内, 该物理网 卡中的发送调度模块监测到端口 0的流量为 0.2G, 端口 1的流量为 1G, 则 为了实现链路带宽均衡, 则可以减少发到端口 1的聚合链路的流量, 增加到 端口 0的聚合链路的流量, 例如, 可以将端口 0和端口 1 的流量均调整为 0.6G。  In the embodiment of the present invention, the aggregated link data stream needs to be sent (the aggregated link data stream refers to the data stream jointly sent by the at least two VF modules, that is, the channel through which at least two VF modules send and receive data can form an aggregated link. The aggregated link data stream can be sent to the external switch through multiple ports on the physical NIC. In this case, the traffic of each port can be monitored in real time. For example, the physical NIC has two ports connected to the external switch. During a certain period of time, the sending scheduling module in the physical network card detects that the traffic of port 0 is 0.2 G, and the traffic of port 1 is 1 G. In order to achieve link bandwidth balancing, the aggregation link sent to port 1 can be reduced. The traffic is increased to the traffic of the aggregated link of port 0. For example, the traffic of port 0 and port 1 can be adjusted to 0.6G.
应理解, 对于非聚合链路数据流, 也可以通过多端口向外部交换机发送 该数据流, 并可以实时监测端口的流量, 并进行调整。  It should be understood that for non-aggregated link data streams, the data stream can also be sent to the external switch through multiple ports, and the traffic of the port can be monitored and adjusted in real time.
应理解, 在本发明实施例中, 在确定了主 PF模块之后, 也可以直接将 主 PF模块对应的 VF模块组确定为该主 PF模块管理的目标 VF模块群, 或 者将其他一个或多个 PF模块对应的 VF模块组确定为该主 PF模块管理的目 标 VF模块群。 具体如何从 PF模块组中各个 PF模块对应的 VF模块组中, 确定目标 VF模块群, 本发明并不作限定。  It should be understood that, in the embodiment of the present invention, after determining the main PF module, the VF module group corresponding to the main PF module may be directly determined as the target VF module group managed by the main PF module, or one or more other ones or more The VF module group corresponding to the PF module is determined as the target VF module group managed by the main PF module. Specifically, the target VF module group is determined from the VF module group corresponding to each PF module in the PF module group, and the present invention is not limited.
在本发明实施例中, 该方法 100还可以包括: 确定第一 PF模块重新使 能或故障恢复, 将该第一 PF模块确定为第一 PF模块组中的 PF模块; 基于 该第一 PF模块, 建立该第一 PF模块对应的 VF模块组。 或者, 该方法 100 还可以包括: 确定第二 PF模块从该第一物理网卡的第一 PF模块组中删除; 释放该第二 PF模块对应的 VF模块组。 In the embodiment of the present invention, the method 100 may further include: determining that the first PF module is re-enabled or failing, and determining the first PF module as the PF module in the first PF module group; The first PF module establishes a VF module group corresponding to 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; releasing the VF module group corresponding to the second PF module.
具体地说,用于数据传输的装置可以监控第一物理网卡的所有 VF模块, 并把 VF模块进行分组管理。 例如, 可以将 PF模块 0下挂的 VF模块组成 VF模块组 0, 即 VF模块 0、 VF模块 1...VF模块 127组成 VF模块组 0, PF 模块 1下挂的 VF模块组成 VF模块组 1 , 即 VF模块 128, VF模块 129、 VF 模块 130... VF模块 255组成 VF模块组 1。 在第一物理网卡中的第一 PF模 块重新使能或者故障恢复之后, 用于数据传输的装置可以基于第一 PF模块 以及第一 PF模块下挂的 VF模块, 建立第一 PF模块对应的 VF模块组。 在 该第一物理网卡的 PF模块组中的第二 PF模块被从系统中删除时(例如, 因 第二 PF模块发生故障而删除或用户主动删除), 可以释放已建立的第二 PF 模块对应的 VF模块组。  Specifically, the means for data transmission can monitor all VF modules of the first physical network card and manage the VF modules in groups. For example, the VF module connected to the PF module 0 can be composed of the VF module group 0, that is, the VF module 0, the VF module 1 and the VF module 127 form the VF module group 0, and the VF module connected to the PF module 1 constitutes the VF module group. 1 , that is, the VF module 128, the VF module 129, the VF module 130... The VF module 255 constitutes the VF module group 1. After the first PF module in the first physical network card is re-enabled or the fault is recovered, the device for data transmission may establish a VF corresponding to the first PF module based on the first PF module and the VF module connected to the first PF module. Module group. 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 or the user actively deletes), the established second PF module may be released. Group of VF modules.
因此, 在本发明实施例中, 在 PF模块重新使能或故障恢复之后, 可以 建立该重新使能或故障恢复的 PF模块对应的 VF模块组, 或在删除了 PF模 块后, 释放该被删除的 PF模块对应的 VF模块组, 从而可以动态调整物理 网卡中能够被使用的 VF模块, 使得系统更为灵活。  Therefore, in the embodiment of the present invention, after the PF module is re-enabled or the fault is re-established, the VF module group corresponding to the re-enabled or fault-recovering PF module may be established, or after the PF module is deleted, the deleted is deleted. The VF module group corresponding to the PF module can dynamically adjust the VF module that can be used in the physical network card, making the system more flexible.
在本发明实施例中, 该方法 100还可以包括: 确定该第一物理网卡的第 三 PF模块发生故障时, 确定该第三 PF模块对应的 VF模块组中的 VF模块 是否可用;在该第三 PF模块对应的 VF模块组中的至少一个 VF模块可用时, 将该第一 PF模块对应的 VF模块组中的可用的至少一个 VF确定为继续可 用。  In the embodiment of the present invention, the method 100 may further include: determining whether the 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 is faulty; When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF available in the VF module group corresponding to the first PF module is determined to be continuously available.
具体地说, 在本发明实施例中, 在某一物理网卡的某一 PF模块出现故 障时, 可以不直接释放该 PF模块对应的 VF模块组, 可以进一步确定该 PF 模块下的 VF模块的状态,如果该 PF模块下的所有 VF模块发生故障, 则可 以直接释放该 PF模块对应的 VF模块组, 如果该 PF模块下的部分 VF模块 发生故障, 则只需将发生故障的 VF模块从该 VF模块组中剔除。 因此, 在 本发明实施例中, 在 PF模块发生故障时, 如果该 PF模块下挂的 VF模块可 用, 将该发生故障的 PF模块下挂的可用的 VF模块确定为继续可用, 可以 避免资源浪费。  Specifically, in the embodiment of the present invention, when a certain PF module of a 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 the VF modules under the PF module are faulty, the VF module group corresponding to the PF module can be directly released. If a part of the VF module under the PF module fails, only the failed VF module needs to be removed from the VF. Excluded from the module group. Therefore, in the embodiment of the present invention, when the PF module fails, if the VF module that is connected to the PF module is available, the available VF module that is connected to the failed PF module is determined to continue to be available, thereby avoiding resource waste. .
应理解, 本发明实施例中提到的第一 PF模块, 第二 PF模块和第三 PF 模块可以是相同的 PF模块, 也可以是不同的 PF模块。 It should be understood that the first PF module, the second PF module and the third PF mentioned in the embodiments of the present invention Modules can be the same PF module or different PF modules.
在本发明实施例中, 该方法 100还可以包括: 确定该目标 VF模块群中 分配给该至少一个 VM中的第一 VM的第一 VF模块出现故障; 从该 PF模 块组中各个 PF模块对应的 VF模块组中, 确定第二 VF模块, 该第二 VF模 块不同于该目标 VF模块群包括的 VF模块; 更新该目标 VF模块群, 并将 该第二 VF模块分配给该第一 VM。  In the embodiment of the present invention, the method 100 may further include: determining that a first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; corresponding to each PF module in the PF module group In the VF module group, a second VF module is determined, the second VF module is different from the VF module included in the target VF module group; the target VF module group is updated, and the second VF module is allocated to the first VM.
具体地说, 在某一 VM中被分配的 VF模块发生故障时, 可以从物理网 卡的 PF模块组中各个 PF模块对应的 VF模块组中, 重新选择一个新的 VF 模块, 该重新选择的 VF模块不同于原有的目标 VF模块群包括的 VF模块; 然后, 更新该目标 VF模块群, 即将该重新选择的 VF模块作为该目标 VF 模块群的成员, 并将该重新选择的 VF模块分配给该 VM。  Specifically, when a VF module that is allocated in a VM fails, a new VF module can be reselected from the VF module group corresponding to each PF module in the PF module group of the physical network card, and the reselected VF is selected. The module is different from the VF module included in the original target VF module group; then, the target VF module group is updated, that is, the reselected VF module is used as a member of the target VF module group, and the reselected VF module is assigned to The VM.
在本发明实施例中, 该方法 100还可以包括: 确定需要将该目标 VF模 块群中与第一 PCIe总线连接的 VF模块的数据发送到该目标 VF模块群中与 第二 PCIe总线连接的 VF模块; 将该与第一 PCIe总线连接的 VF模块的数 据通过该第一物理网卡的交换机发送到该与第二 PCIe总线连接的 VF模块。  In the embodiment of the present invention, the method 100 may further include: determining that data of the VF module connected to the first PCIe bus in the target VF module group needs to be sent to the VF connected to the second PCIe bus in the target VF module group. And transmitting, by the switch of the first physical network card, the data of the VF module connected to the first PCIe bus to the VF module connected to the second PCIe bus.
即, 第一物理网卡可以占用至少两个 PCIe总线, 若一个 PCIe总线上的 某一个 VF模块数据需要发送到同一个 PCIe总线上的另一个 VF模块,可以 通过该物理网卡的内部交换机实现该数据的发送。 若与某一个 PCIe总线连 接的 VF模块数据需要发送到与另一个 PCIe总线连接的 VF模块,也可以通 过该物理网卡的内部交换机实现该数据的发送。  That is, the first physical network card can occupy at least two PCIe buses. If one VF module data on one PCIe bus needs to be sent to another VF module on the same PCIe bus, the data can be implemented through an internal switch of the physical network card. Send. If the VF module data connected to one PCIe bus needs to be sent to the VF module connected to another PCIe bus, the data can also be transmitted through the internal switch of the physical network card.
因此, 在本发明实施例中, 同一物理网卡中的与不同 PCIe总线连接的 VF模块之间的数据交换, 或者同一物理网卡中与相同 PCIe总线连接的 VF 模块之间的数据交换, 可以通过该物理网卡中内置的交换机实现, 从而可以 节省网络带宽, 降低数据收发时延。  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 pass the data exchange. The switch built in the physical NIC can save network bandwidth and reduce data transmission and reception delay.
在本发明实施例中, 该方法 100还可以包括: 确定该主 PF模块出现故 障; 从该 PF模块组中, 选择除该主 PF模块之外的 PF模块作为新的主 PF 模块; 基于该 PF模块组中各个 PF模块对应的 VF模块组, 确定该新的主 PF模块管理的新的目标 VF模块群;将该新的目标 VF模块群中的 VF模块, 分配给至少一个虚拟机, 以便该至少一个虚拟机实现数据传输。  In the embodiment of the present invention, the method 100 may further include: determining that the primary PF module is faulty; and selecting, from the PF module group, a PF module other than the primary PF module as a new primary PF module; a VF module group corresponding to each PF module in the module group, determining a new target VF module group managed by the new main PF module; assigning the VF module in the new target VF module group to at least one virtual machine, so that At least one virtual machine implements data transfer.
具体地说, 在系统的运行过程中, 可以实时跟踪记录主 PF模块的具体 操作信息, 监控主 PF模块的状态。 如果主 PF模块出现故障, 则可以从 PF 模块组中重选选择一个 PF模块作为新的主 PF模块,并把记录的操作信息更 新到新的主 PF模块, 并重新为该新的主 PF模块确定新的目标 VF模块群, 并将该新的目标 VF模块群中的 VF模块, 分配给至少一个虚拟机, 以便该 至少一个虚拟机实现数据传输。 Specifically, during the running of the system, the specific operation information of the main PF module can be tracked in real time, and the state of the main PF module is monitored. If the main PF module fails, it can be from PF Reselecting a PF module as a new main PF module in the module group, updating the recorded operation information to the new main PF module, and re-determining the new target VF module group for the new main PF module, and The VF module in the new target VF module group is allocated to at least one virtual machine, so that the at least one virtual machine implements data transmission.
因此, 在本发明实施例中, 在原主 PF模块出现故障时, 可以从具有至 少两个 PF模块的 PF模块组中重新选择一个新的主 PF模块, 可以进一步避 免系统出现故障并减少资源浪费。  Therefore, in the embodiment of the present invention, when the original primary PF module fails, a new primary PF module can be reselected from the PF module group having at least two PF modules, which can further avoid system failure and reduce resource waste.
应理解, 本发明还可以与软件模拟虚拟技术相结合, 也就是说, 网卡中 还可以存在第二 PF模块组, 第二 PF模块组中的 PF模块可以通过软件模拟 的方式, 虚拟出至少两个 vNIC, 供传统( legacy )虚拟机使用。  It should be understood that the present invention can also be combined with a software simulation virtual technology, that is, a second PF module group can also exist in the network card, and the PF module in the second PF module group can virtualize at least two by software simulation. vNICs for use by legacy virtual machines.
为了更加清楚地理解本发明, 以下将结合图 2描述根据本发明实施例的 用于数据传输的方法。  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所示出的场景进行筒要说明。 在该场景下, PF模块组 1 包 括 PF模块 0; PF模块组 2包括 PF模块 1和 PF模块 2, PF模块 1下挂有 VF模块 1和 VF模块 2, PF模块 2下挂有 VF模块 3和 VF模块 4。 其中, 图中 PF模块 0、 PF模块 1和 PF模块 2分另' J示出为 PF0、 PF1 和 PF2; VF 模块 1、 VF模块 2、 VF模块 3和 VF模块 4 分别示出为 VF 1、 VF2、 VF3 和 VF4。 图 2中所示出的 VF DD指 VF模块的驱动( Device Driver ), PF DD 指 PF模块的驱动。 VMM可以由主机运行, 用于 VM的创建、 删除、 硬件 资源的管理, VM资源的分配等。 以下将结合图 2具体描述根据本发明实施 例的方法。  First, the scene shown in Fig. 2 will be described. In this scenario, the PF module group 1 includes the PF module 0; the PF module group 2 includes the PF module 1 and the PF module 2, the PF module 1 has the VF module 1 and the VF module 2 attached thereto, and the PF module 2 has the VF module 3 attached thereto. And VF module 4. PF module 0, PF module 1 and PF module 2 are shown as PF0, PF1 and PF2 in the figure; VF module 1, VF module 2, VF module 3 and VF module 4 are respectively shown as VF 1, VF2, VF3 and VF4. The VF DD shown in Figure 2 refers to the drive of the VF module (Device Driver), and the PF DD refers to the drive of the PF module. The VMM can be run by the host for VM creation, deletion, management of hardware resources, allocation of VM resources, and so on. The method according to an embodiment of the present invention will be specifically described below with reference to FIG.
VMM可以从物理网卡( NIC ) 中的 PF模块组 2中选择一个 PF模块作 为主 PF模块, 具体地, VMM可以根据各个 PF模块的故障次数、 对应 VF 模块组中 VF模块的个数、 PF模块静态带宽和 PF模块动态带宽中的至少一 种确定主 PF模块, 例如, 可以如图 2中所示, 将 PF模块 1确定为主 PF模 块。 在确定了主 PF模块之后, VMM可以确定该主 PF模块需要管理的 VF 模块, 其中, 如果需要实现链路聚合功能, 可以从不同的 PF模块下挂的 VF 模块中选择 VF模块, 组成需要主 PF模块管理的目标 VF模块群, 例如, 如 图 2中所示, 可以将 VF模块 2、 VF模块 3和 VF模块 4确定为目标 VF模 块群。 然后, VMM可以将需要主 PF模块管理的目标 VF模块群中的各个 VF模块分配给各个 VM, 供各个 VM后续数据传输, 例如如图 2所示, 将 VF模块 2分配给 VM 2 , 将 VF模块 3分配给 VM 3 , 以及将 VF模块 4分 配给 VM4。 在选择的主 PF模块发生故障时, VMM可以从 PF模块组中重 新选择一个 PF模块作为主 PF模块, 并可以重新为该主 PF模块选择目标 VF模块群。 在本发明实施例中, VMM也可以基于软件模拟的方式通过 PF 模块虚拟出一个或至少两个 vNIC, 例如如图 2中所示, 通过 PF模块 0虚 拟出 vNICl 和 vNIC 2, 分别为传统( Legacy ) VM1和传统( Legacy ) VM2 服务。 在为 VM分配了 VF模块或 vNIC之后, 各个 VM可以实现数据的传 输。 以下将介绍四种主要的数据传输路径的实现方式: The VMM can select a PF module as the main PF module from the PF module group 2 in the physical network card (NIC). Specifically, the VMM can be based on the number of failures of each PF module, the number of VF modules in the corresponding VF module group, and the PF module. At least one of the static bandwidth and the dynamic bandwidth of the PF module determines the primary PF module. For example, as shown in FIG. 2, the PF module 1 may be determined as the primary PF module. After the main PF module is determined, the VMM can determine the VF module to be managed by the main PF module. If the link aggregation function is required, the VF module can be selected from the VF modules connected to different PF modules. The target VF module group managed by the PF module, for example, as shown in FIG. 2, the VF module 2, the VF module 3, and the VF module 4 can be determined as the target VF module group. Then, the VMM can allocate each VF module in the target VF module group that needs to be managed by the main PF module to each VM for subsequent data transmission of each VM, for example, as shown in FIG. 2, The VF module 2 is assigned to the VM 2, the VF module 3 is assigned to the VM 3, and the VF module 4 is assigned to the VM 4. When the selected main PF module fails, the VMM can reselect a PF module from the PF module group as the main PF module, and can 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 the software simulation manner. For example, as shown in FIG. 2, the vNIC1 and the vNIC 2 are virtualized by the PF module 0, respectively. Legacy) VM1 and legacy (legacy) VM2 services. After the VF module or vNIC is assigned to the VM, each VM can implement data transmission. The following describes the implementation of the four main data transmission paths:
数据流①: Legacy VM之间的数据交换是通过 VMM内置的虚拟软件交换 机 ( Vi r tua l SW swi tch ) 实现的。  Data Stream 1: Data exchange between Legacy VMs is achieved through VMM's built-in virtual software switch (Vi r tua l SW swi tch ).
数据流②: Legacy VM 中的虚拟网卡收发的数据通道是: 外部交换机 内部交换机— MAC— PF— VMM— VM; VM— VMM— PF— MAC—内部交换机—外部交换机。  Data Stream 2: The data channels sent and received by the virtual NIC in the Legacy VM are: External Switch Internal Switch - MAC - PF - VMM - VM; VM - VMM - PF - MAC - Internal Switch - External Switch.
数据流③: 采用 VF模块的 VM之间的数据交换是通过 NIC中内置的交换 机实现的, 不论 VF模块连接的是相同的 PCIe还是不同的 PCIe, 均可以通过 NIC内置的交换机实现。  Data Stream 3: The data exchange between the VMs using the VF module is implemented by the switch built in the NIC. Whether the VF module is connected to the same PCIe or a different PCIe, it can be implemented through the switch built into the NIC.
数据流④: 采用 VF模块的 VM数据收发通道是: 外部交换机 -内部交换 机—介质访问控制 (Media Access Control, MAC ) →VF; VF— MAC—内部交换 机—外部交换机。  Data Stream 4: The VM data transceiver channel using the VF module is: External Switch - Internal Switch - Media Access Control (MAC) → VF; VF - MAC - Internal Switch - External Switch.
数据流⑤: 主 PF对 VF进行资源管理和控制的通道是: VM→ VMM -主 PF—VF; VF—主 PF→VMM→VM。  Data stream 5: The channel through which the primary PF performs resource management and control for the VF is: VM→VMM - primary PF-VF; VF-primary PF→VMM→VM.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。  Therefore, in the embodiment of the present invention, a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
图 3是根据本发明实施例用于数据传输的装置 200的示意性框图。如图 3 is a schematic block diagram of an apparatus 200 for data transmission in accordance with an embodiment of the present invention. As shown
3所示, 该装置 200包括第一确定单元 210和第二确定单元 220。 第一确定 单元 210用于从第一物理网卡的物理功能 PF模块组中,确定主 PF模块,该 PF模块组包括至少两个 PF模块, 该 PF模块组中各个 PF模块对应不同的 VF模块组; 第二确定单元 220用于基于该 PF模块组中各个 PF模块对应的 虚拟功能 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 该目 标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM , 以便该至少一 个 VM实现数据传输。 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, from the physical function PF module group of the first physical network card, the main PF module, 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, according to the virtual function VF module group corresponding to each PF module in the PF module group, the target VF module group managed by the main PF module, where the VF module in the target VF module group is used for Assigned to at least one virtual machine VM so that the at least one VMs implement data transfer.
可选地, 该第一确定单元 210具体用于: 基于该 PF模块组中每一个 PF 模块的基准参数, 确定该主 PF模块, 其中, 该 PF模块的基准参数包括 PF 模块故障次数、 PF模块对应的 VF模块个数、 PF模块静态带宽、 PF模块静 态带宽中的至少一种。  Optionally, the first determining unit 210 is specifically configured to: determine, according to a reference parameter of each PF module in the PF module group, the primary PF module, where the reference parameter of the PF module includes a PF module failure number, a PF module At least one of the number of corresponding VF modules, the static bandwidth of the PF module, and the static bandwidth of the PF module.
可选地, 该第二确定单元 220具体用于: 从该 PF模块组中每一个 PF 模块对应的 VF模块组中选出至少一个 VF模块, 组成该目标 VF模块群。  Optionally, the second determining unit 220 is specifically configured to: select 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所示, 该装置 200还包括第四确定单元 252和建立单元 254。 第 四确定单元 252用于确定第一 PF模块重新使能或故障恢复, 将所述第一 PF 模块确定为所述 PF模块组中的 PF模块; 建立单元 254用于基于所述第一 PF模块, 建立所述第一 PF模块对应的 VF模块组。  As shown in FIG. 4, the apparatus 200 further includes a fourth determining unit 252 and an establishing unit 254. The fourth determining unit 252 is configured to determine that the first PF module is re-enabled or fault-recovered, and the first PF module is determined as a PF module in the PF module group; and the establishing unit 254 is configured to be based on the first PF module. Establishing a VF module group corresponding to the first PF module.
可选地, 如图 4所示, 该装置 200还包括第五确定单元 256和释放单元 258。 第五确定单元 256用于确定第二 PF模块从所述第一物理网卡的所述 PF模块组中删除; 释放单元 258用于释放所述第二 PF模块对应的 VF模块 组。  Optionally, as shown in FIG. 4, the apparatus 200 further includes 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; and the releasing unit 258 is configured to release the VF module group corresponding to the second PF module.
可选地, 如图 4所示, 该装置 200还包括第六确定单元 262、 保持单元 264和保持单元 264。 第六确定单元 262用于确定所述第一物理网卡的第三 PF模块发生故障时, 确定所述第三 PF模块对应的 VF模块组中的 VF是否 可用; 保持单元 264用于在所述第三 PF模块对应的 VF模块组中的至少一 个 VF模块可用时,将所述第三 PF模块对应的 VF模块组中的所述至少一个 VF模块确定为继续可用。  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. The sixth determining unit 262 is configured to determine whether the VF in the VF module group corresponding to the third PF module is available when the third PF module of the first physical network card is faulty; the holding unit 264 is configured to be in the When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF module in the VF module group corresponding to the third PF module is determined to continue to be available.
可选地, 如图 4所示, 该装置 200还包括第七确定单元 272、 选择单元 274和更新单元 276。第七确定单元 272用于确定该目标 VF模块群中分配给 该至少一个 VM中的第一 VM的第一 VF模块出现故障; 选择单元 274用于 从该 PF模块组中各个 PF模块对应的 VF模块组中, 选择不同于该第一 VF 模块的第二 VF模块; 更新单元 276用于更新该目标 VF模块群。  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 the first VF module allocated to the first VM of the at least one VM in the target VF module group is faulty; the selecting unit 274 is configured to use the VF corresponding to each PF module in the PF module group. In the module group, a second VF module different from the first VF module is selected; the update unit 276 is used to update the target VF module group.
可选地, 所述第一物理网卡占用至少两个高速外设部件互连标准 PCIe 总线, 如图 4所示, 该装置 200还包括: 第八确定单元 282, 用于确定需要 将所述目标 VF模块群中与所述至少两个 PCIe总线中第一 PCIe总线连接的 VF模块的数据发送到所述目标 VF模块群中与所述至少两个 PCIe总线中第 二 PCIe总线连接的 VF模块; 发送单元 284, 用于将该与第一 PCIe总线连 接的 VF模块的数据通过该第一物理网卡的交换机发送到该与第二 PCIe总线 连接的 VF模块。 Optionally, the first physical network card occupies at least two high-speed peripheral components to interconnect the standard PCIe bus. As shown in FIG. 4, the apparatus 200 further includes: an eighth determining unit 282, configured to determine that the target needs to be Transmitting, by the VF module group, the data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the VF module of the target VF module group and the second PCIe bus of the at least two PCIe buses; a sending unit 284, configured to connect to the first PCIe bus The data of the connected VF module is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
可选地, 如图 4所示, 该装置 200还包括第三确定单元 240。 该第三确 定单元 240用于确定所述主 PF模块出现故障;该第一确定单元 210还用于: 从该 PF模块组中, 选择除该主 PF模块之外的 PF模块作为新的主 PF模块; 该第二确定单元 220还用于:基于该 PF模块组中各个 PF模块对应的 VF模 块组, 确定该新的主 PF模块管理的新的目标 VF模块群, 其中, 该新的目 标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM , 以便该至少一 个 VM实现数据传输。  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 is faulty; the first determining unit 210 is further configured to: select, from the PF module group, a PF module other than the primary PF module as a new primary PF. The second determining unit 220 is further configured to: determine, according to the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new primary PF module, where the new target VF The VF module in the module group is used to allocate to at least one virtual machine VM, so that the at least one VM implements data transmission.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。  Therefore, in the embodiment of the present invention, a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
图 5是根据本发明实施例的用于数据传输的装置 300的示意性框图。如 图 5所示, 该装置 300包括: 处理器 310310和存储器 320320; 其中, 该存 储器 320存储程序代码, 该处理器 310用于调用该存储器 320中存储的该程 序代码, 执行以下操作: 从第一物理网卡的物理功能 PF模块组中, 确定主 Figure 5 is a schematic block diagram of an apparatus 300 for data transmission in accordance with 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 code, and the processor 310 is configured to invoke the program code stored in the memory 320 to perform the following operations: The physical function of a physical network card in the PF module group, determine the main
PF模块, 该 PF模块组包括至少两个 PF模块, 该 PF模块组中各个 PF模块 对应不同的虚拟功能 VF模块组;基于该 PF模块组中各个 PF模块对应的虚 拟功能 VF模块组, 确定该主 PF模块管理的目标 VF模块群, 其中, 该目标a PF module, 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; and based on the 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, wherein, the target
VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便该至少一个The VF module in the VF module group is used to allocate to at least one virtual machine VM, so that the at least one
VM实现数据传输。 The VM implements data transfer.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 具 体执行以下操作:基于该 PF模块组中每一个 PF模块的基准参数,确定该主 PF模块, 其中, 该 PF模块的基准参数包括 PF模块故障次数、 PF模块对应 的 VF模块个数、 PF模块静态带宽和 PF模块静态带宽中的至少一种。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and specifically perform the following operations: determining the primary PF module based on a reference parameter of each PF module in the PF module group, where the PF The reference parameters of the module include at least one of the number of PF module failures, 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.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 具 体执行以下操作: 从该 PF模块组中每一个 PF模块对应的 VF模块组中选出 至少一个 VF模块, 组成该目标 VF模块群。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and specifically perform the following operations: selecting at least one VF module from the VF module group corresponding to each PF module in the PF module group, The target VF module group.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还 执行以下操作: 确定第一 PF模块重新使能或故障恢复,将该第一 PF模块确 定为该 PF模块组中的 PF模块; 基于该第一 PF模块, 建立该第一 PF模块 对应的 VF模块组。 Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the first PF module is re-enabled or failback, and the first PF module is The PF module in the PF module group is determined; based on the first PF module, the VF module group corresponding to the first PF module is established.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还 执行以下操作: 确定第二 PF模块从该第一物理网卡的该 PF模块组中删除; 释放该第二 PF模块对应的 VF模块组。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the second PF module is deleted from the PF module group of the first physical network card; releasing the second PF The VF module group corresponding to the module.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还 执行以下操作: 确定该第一物理网卡的第三 PF模块发生故障时, 确定该第 三 PF模块对应的 VF模块组中的 VF模块是否可用; 在该第三 PF模块对应 的 VF模块组中的至少一个 VF模块可用时, 将该第一 PF模块对应的 VF模 块组中的可用的该至少一个 VF模块确定为继续可用。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: when determining that the third PF module of the first physical network card fails, determining a VF corresponding to the third PF module Whether the VF module in the module group is available; when at least one VF module in the VF module group corresponding to the third PF module is available, determining the at least one VF module available in the VF module group corresponding to the first PF module To continue to be available.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还 执行以下操作: 确定该目标 VF模块群中分配给该至少一个 VM 中的第一 VM的第一 VF模块出现故障; 从该 PF模块组中各个 PF模块对应的 VF模 块组中, 选择不同于该第一 VF模块的第二 VF模块; 更新该目标 VF模块 群。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the first VF module allocated to the first VM of the at least one VM in the target VF module group appears The second VF module different from the first VF module is selected from the VF module group corresponding to each PF module in the PF module group; and the target VF module group is updated.
可选地, 该第一物理网卡占用至少两个高速外设部件互连标准 PCIe总 线, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还执行以下 操作: 确定需要将该目标 VF模块群中与该至少两个 PCIe总线中第一 PCIe 总线连接的 VF模块的数据发送到该目标 VF模块群中与该至少两个 PCIe总 线中第二 PCIe总线连接的 VF模块; 将该与第一 PCIe总线连接的 VF模块 的数据通过该第一物理网卡的交换机发送到该与第二 PCIe 总线连接的 VF 模块。  Optionally, the first physical NIC occupies at least two high-speed peripheral components interconnecting a standard PCIe bus, and the processor 310 is configured to invoke the program code stored in the memory 320, and performs the following operations: determining that the target needs to be And transmitting, by the VF module group, the data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the VF module of the target VF module group and the second PCIe bus of the at least two PCIe buses; The data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
可选地, 该处理器 310用于调用该存储器 320中存储的该程序代码, 还 执行以下操作: 确定该主 PF模块出现故障; 从该 PF模块组中, 选择除该主 PF模块之外的 PF模块作为新的主 PF模块; 基于该 PF模块组中各个 PF模 块对应的 VF模块组, 确定该新的主 PF模块管理的新的目标 VF模块群, 其 中, 该新的目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便该至少一个 VM实现数据传输。  Optionally, the processor 310 is configured to invoke the program code stored in the memory 320, and further perform the following operations: determining that the primary PF module is faulty; and selecting, from the PF module group, other than the primary PF module The PF module is used as a new main PF module; based on the VF module group corresponding to each PF module in the PF module group, a new target VF module group managed by the new main PF module is determined, wherein the new target VF module group The VF module is configured to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。 Therefore, in the embodiment of the present invention, a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities to choose, you can avoid system failures. And reduce waste of resources.
图 6是根据本发明实施例的物理网卡的示意性框图。 如图 6所示, 该物 理网卡 400包括: 有至少两个 PF模块 411组成的 PF模块组 410, 以及至少 两个 VF模块组 420;其中,所述至少两个 PF模块 411中的一个 PF模块 411 对应于所述至少两个 VF模块组 420中的一个 VF模块组 420 , 所述至少两 个 PF模块 411中的任一 PF模块 411在被确定为主 PF模块后能够管理其他 6 is a schematic block diagram of a physical network card in accordance with an embodiment of the present invention. As shown in FIG. 6, the physical network card 400 includes: a PF module group 410 composed of at least two PF modules 411, and at least two VF module groups 420; wherein one of the at least two PF modules 411 is a PF module. 411 corresponds to one of the at least two VF module groups 420, and any one of the at least two PF modules 411 can manage other after being determined to be the main PF module.
PF模块 411连接的 VF模块组 420中的 VF模块 421。 The VF module 421 in the VF module group 420 to which the PF module 411 is connected.
可选地, 所述 PF模块组 410中的各个 PF模块 411相互连接, 所述 PF 模块组 410中的任一 PF模块 411能够通过其他 PF模块 411管理所述其他 PF模块 411连接的 VF模块组 420中的 VF模块 421。  Optionally, each PF module 411 in the PF module group 410 is connected to each other, and any PF module 411 in the PF module group 410 can manage the VF module group connected to the other PF module 411 through other PF modules 411. VF module 421 in 420.
可选地,, 所述至少两个 VF模块组 420中各个 VF模块组 420中的 VF 模块 421包括两类空间资源; 其中, 所述两类空间资源中的一类空间资源用 于在所述主 PF模块被确定前, 由所述两类空间资源所属的 VF模块 421所 属的 VF模块组 420对应的 PF模块 411进行访问; 所述两类空间资源中的 另一类空间资源用于在所述主 PF模块被确定后,与所述主 PF模块建立连接 由所述主 PF模块进行访问。  Optionally, the VF module 421 in each of the at least two VF module groups 420 includes two types of spatial resources; wherein, one of the two types of spatial resources is used in the Before the primary PF module is determined, 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 belongs is accessed; another type of spatial resource in the two types of spatial resources is used in the After the primary PF module is determined, establishing a connection with the primary PF module is accessed by the primary PF module.
可选地, 所述物理网卡 400 占用至少两个高速外设部件互连标准 PCIe 总线, 所述物理网卡 400还包括内置交换机; 其中, 所述内置交换机用于将 与所述至少两个 PCIe总线中的第一 PCIe总线连接的 VF模块的数据通过发 送到与所述至少两个 PCIe总线中的第二 PCIe总线连接的 VF模块。  Optionally, the physical network card 400 occupies at least two high-speed peripheral components interconnecting a standard PCIe bus, and the physical network card 400 further includes a built-in switch; wherein the built-in switch is used to connect with the at least two PCIe buses The data of the VFE module connected to the first PCIe bus is transmitted to the VF module connected to the second PCIe bus of the at least two PCIe buses.
可选地, 所述物理网卡通过至少两个端口与外部交换机连接; 所述物理 网卡还用于接收数据传输的装置通过聚合链路发送的数据流, 并通过所述至 少两个端口中各个端口均衡发送所述数据流至所述外部交换机。  Optionally, the physical network card is connected to the external switch by using at least two ports; the physical network card is further configured to receive a data stream sent by the device for data transmission through the aggregation link, and pass each port of the at least two ports. Equalizing the data stream to the external switch.
因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。  Therefore, in the embodiment of the present invention, a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
图 7是根据本发明实施例的用于数据传输的系统 500的示意性框图。如 图 7所示, 该系统 400包括用于数据传输的装置 410和物理网卡 420; 其中 用于数据传输的装置 510 可对应于本发明实施例中的用于数据传输的装置 200或 300, 物理网卡 520可对应于物理网卡 400, 用于数据传输的装置 200 或 300中提到的第一物理网卡即为物理网卡 400。为了筒洁,在此不再赘述。 因此, 在本发明实施例中, 由于一个物理网卡具有至少两个 PF模块组 成的 PF模块组,且可以从该 PF模块组中的至少两个 PF模块中选择一个 PF 模块作为主 PF模块, 从而由于选择的机会较多, 可以避免系统出现故障, 并减少资源浪费。 FIG. 7 is a schematic block diagram of a system 500 for data transmission in accordance with 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; wherein the device 510 for data transmission may correspond to the device 200 or 300 for data transmission in the embodiment of the present invention, physical The network card 520 can correspond to the physical network card 400, and the device 200 for data transmission The first physical network card mentioned in 300 or 300 is the physical network card 400. For the sake of cleanliness, we will not repeat them here. Therefore, in the embodiment of the present invention, a physical network card has a PF module group composed of at least two PF modules, and one PF module can be selected as a main PF module from at least two PF modules in the PF module group, thereby Due to the many opportunities for selection, system failures can be avoided and resource waste can be reduced.
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各 示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结 合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特 定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方 法来实现所描述的功能, 但是这种实现不应认为超出本发明的范围。  Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in a combination of electronic hardware or computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述描 述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应 过程, 在此不再赘述。  It will be apparent to those skilled in the art that, for the convenience of the description and the cleaning process, the specific operation of the system, the device and the unit described above may be referred to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。  In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。  The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一 个单元中。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明 的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部 分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质 中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前 述的存储介质包括: U盘、移动硬盘、只读存储器( ROM , Read-Only Memory )、 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可 以存储程序代码的介质。 The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, or the part contributing to the prior art, or the part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应所述以权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims

权利要求 Rights request
1、 一种用于数据传输的方法, 其特征在于, 包括: 1. A method for data transmission, characterized by including:
从第一物理网卡的物理功能 PF模块组中, 确定主 PF模块, 所述 PF模 块组包括至少两个 PF模块, 所述 PF模块组中各个 PF模块对应不同的虚拟 功能 VF模块组; Determine the main PF module from the physical function PF module group of the first physical network card. 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;
基于所述 PF模块组中各个 PF模块对应的 VF模块组, 确定所述主 PF 模块管理的目标 VF模块群, 其中, 所述目标 VF模块群中的 VF模块用于 分配给至少一个虚拟机 VM, 以便所述至少一个 VM实现数据传输。 Based on the VF module group corresponding to each PF module in the PF module group, determine the target VF module group managed by the main PF module, wherein the VF modules in the target VF module group are used to be allocated to at least one virtual machine VM , so that the at least one VM implements data transmission.
2. 根据权利要求 1所述的方法, 其特征在于, 所述从第一物理网卡的 2. The method according to claim 1, characterized in that: the slave first physical network card
PF模块组中, 确定主 PF模块, 包括: In the PF module group, determine the main PF module, including:
基于所述 PF模块组中每一个 PF模块的基准参数,确定所述主 PF模块, 其中, 所述 PF模块的基准参数包括 PF模块故障次数、 PF模块对应的 VF 模块组中 VF模块的个数、 PF模块静态带宽和 PF模块静态带宽中的至少一 种。 The main PF module is determined based on the reference parameters of each PF module in the PF module group, where the reference parameters of the PF module include the number of PF module failures and the number of VF modules in the VF module group corresponding to the PF module. , at least one of PF module static bandwidth and PF module static bandwidth.
3. 根据权利要求 1或 2所述的方法, 其特征在于, 所述基于所述 PF模 块组中各个 PF模块对应的 VF模块组, 确定所述主 PF模块管理的目标 VF 模块群, 包括: 3. The method according to claim 1 or 2, characterized in that, based on the VF module group corresponding to each PF module in the PF module group, determining the target VF module group managed by the main PF module includes:
从所述 PF模块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块, 组成所述目标 VF模块群。 Select 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. 根据权利要求 1至 3中任一项所述的方法, 其特征在于, 所述方法 还包括: 4. The method according to any one of claims 1 to 3, characterized in that, the method further includes:
确定第一 PF模块重新使能或故障恢复,将所述第一 PF模块确定为所述 PF模块组中的 PF模块; Determine whether the first PF module is re-enabled or fault restored, and determine the first PF module as the PF module in the PF module group;
基于所述第一 PF模块, 建立所述第一 PF模块对应的 VF模块组。 Based on the first PF module, a VF module group corresponding to the first PF module is established.
5. 根据权利要求 1至 4中任一项所述的方法, 其特征在于, 所述方法 还包括: 5. The method according to any one of claims 1 to 4, characterized in that, the method further includes:
确定第二 PF模块从所述第一物理网卡的所述 PF模块组中删除; 释放所述第二 PF模块对应的 VF模块组。 Determine that the second PF module is deleted from the PF module group of the first physical network card; release the VF module group corresponding to the second PF module.
6. 根据权利要求 1至 5中任一项所述的方法, 其特征在于, 所述方法 还包括: 确定所述第一物理网卡的第三 PF模块发生故障时, 确定所述第三 PF 模块对应的 VF模块组中的 VF模块是否可用; 6. The method according to any one of claims 1 to 5, characterized in that, the method further includes: When it is determined that the third PF module of the first physical network card fails, determine whether the VF module in the VF module group corresponding to the third PF module is available;
在所述第三 PF模块对应的 VF模块组中的至少一个 VF模块可用时,将 所述第一 PF模块对应的 VF模块组中的可用的所述至少一个 VF模块确定为 继续可用。 When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF module available in the VF module group corresponding to the first PF module is determined to continue to be available.
7. 根据权利要求 1至 6中任一项所述的方法, 其特征在于, 所述方法 还包括: 7. The method according to any one of claims 1 to 6, characterized in that, the method further includes:
确定所述目标 VF模块群中分配给所述至少一个 VM中的第一 VM的第 一 VF模块出现故障; Determining that the first VF module assigned to the first VM in the at least one VM in the target VF module group fails;
从所述 PF模块组中各个 PF模块对应的 VF模块组中,选择不同于所述 第一 VF模块的第二 VF模块; Select a second VF module that is different from the first VF module from the VF module group corresponding to each PF module in the PF module group;
更新所述目标 VF模块群。 Update the target VF module group.
8. 根据权利要求 1至 7中任一项所述的方法, 其特征在于, 所述第一 物理网卡占用至少两个高速外设部件互连标准 PCIe总线, 所述方法还包括: 确定需要将所述目标 VF模块群中与所述至少两个 PCIe 总线中第一 8. The method according to any one of claims 1 to 7, characterized in that the first physical network card occupies at least two high-speed peripheral component interconnection standard PCIe buses, and the method further includes: determining the need to The first of the target VF module group and the at least two PCIe buses
PCIe总线连接的 VF模块的数据发送到所述目标 VF模块群中与所述至少两 个 PCIe总线中第二 PCIe总线连接的 VF模块; The data of the VF module connected to the PCIe bus is sent to the VF module in the target VF module group connected to the second PCIe bus of the at least two PCIe buses;
将所述与第一 PCIe总线连接的 VF模块的数据通过所述第一物理网卡的 交换机发送到所述与第二 PCIe总线连接的 VF模块。 The data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
9. 根据权利要求 1至 8中任一项所述的方法, 其特征在于, 所述方法 还包括: 9. The method according to any one of claims 1 to 8, characterized in that, the method further includes:
确定所述主 PF模块出现故障; It is determined that the main PF module is faulty;
从所述 PF模块组中, 选择除所述主 PF模块之外的 PF模块作为新的主 PF模块; From the PF module group, select a PF module other than the main PF module as the new main PF module;
基于所述 PF模块组中各个 PF模块对应的 VF模块组,确定所述新的主 Based on the VF module group corresponding to each PF module in the PF module group, determine the new primary
PF模块管理的新的目标 VF模块群, 其中, 所述新的目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便所述至少一个 VM实现数据 传输。 A new target VF module group managed by the PF module, wherein the VF modules in the new target VF module group are used to be assigned to at least one virtual machine VM, so that the at least one VM implements data transmission.
10、 一种用于数据传输的装置, 其特征在于, 包括: 10. A device for data transmission, characterized in that it includes:
第一确定单元, 用于从第一物理网卡的物理功能 PF模块组中, 确定主 The first determination unit is used to determine the master module from the physical function PF module group of the first physical network card.
PF模块, 所述 PF模块组包括至少两个 PF模块, 所述 PF模块组中各个 PF 模块对应不同的虚拟功能 VF模块组; PF module, the PF module group includes at least two PF modules, each PF in the PF module group The modules correspond to different virtual function VF module groups;
第二确定单元,用于基于所述 PF模块组中各个 PF模块对应的虚拟功能 VF模块组, 确定所述主 PF模块管理的目标 VF模块群, 其中, 所述目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM,以便所述至少一个 VM实现数据传输。 The second determination unit is configured to determine the 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 Used to be allocated to at least one virtual machine VM so that the at least one VM implements data transmission.
11. 根据权利要求 10所述的装置, 其特征在于, 所述第一确定单元具 体用于: 11. The device according to claim 10, characterized in that the first determining unit is specifically used to:
基于所述 PF模块组中每一个 PF模块的基准参数,确定所述主 PF模块, 其中, 所述 PF模块的基准参数包括 PF模块故障次数、 PF模块对应的 VF 模块组中的 VF模块的个数、 PF模块静态带宽和 PF模块静态带宽中的至少 一种。 The main PF module is determined based on the reference parameters of each PF module in the PF module group, where the reference parameters of the PF module include the number of PF module failures, the number of VF modules in the VF module group corresponding to the PF module. Number, at least one of PF module static bandwidth and PF module static bandwidth.
12. 根据权利要求 10或 11所述的装置, 其特征在于, 所述第二确定单 元具体用于: 12. The device according to claim 10 or 11, characterized in that the second determination unit is specifically used to:
从所述 PF模块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块, 组成所述目标 VF模块群。 Select 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. 根据权利要求 10至 12中任一项所述的方法, 其特征在于, 所述装 置还包括: 13. The method according to any one of claims 10 to 12, characterized in that the device further includes:
第四确定单元, 用于确定第一 PF模块重新使能或故障恢复, 将所述第 一 PF模块确定为所述 PF模块组中的 PF模块; The fourth determination unit is used to determine the re-enabling or fault recovery of the first PF module, and determine the first PF module as the PF module in the PF module group;
建立单元, 用于基于所述第一 PF模块, 建立所述第一 PF模块对应的 An establishment unit, configured to establish, based on the first PF module, the corresponding
VF模块组。 VF module set.
14. 根据权利要求 10至 13中任一项所述的装置, 其特征在于, 所述装 置还包括: 14. The device according to any one of claims 10 to 13, characterized in that the device further includes:
第五确定单元, 用于确定第二 PF模块从所述第一物理网卡的所述 PF 模块组中删除; The fifth determination unit is used to determine that the second PF module is deleted from the PF module group of the first physical network card;
释放单元, 用于释放所述第二 PF模块对应的 VF模块组。 A release unit is used to release the VF module group corresponding to the second PF module.
15. 根据权利要求 10至 14中任一项所述的方法, 其特征在于, 所述装 置还包括: 15. The method according to any one of claims 10 to 14, characterized in that the device further includes:
第六确定单元,用于确定所述第一物理网卡的第三 PF模块发生故障时, 确定所述第三 PF模块对应的 VF模块组中的 VF是否可用; The sixth determination unit is used to determine whether the VF 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;
保持单元, 用于在所述第三 PF模块对应的 VF模块组中的至少一个 VF 模块可用时,将所述第三 PF模块对应的 VF模块组中的所述至少一个 VF模 块确定为继续可用。 Holding unit, used for at least one VF in the VF module group corresponding to the third PF module When a module is available, the at least one VF module in the VF module group corresponding to the third PF module is determined to continue to be available.
16. 根据权利要求 10至 15中任一项所述的装置, 其特征在于, 所述装 置还包括: 16. The device according to any one of claims 10 to 15, characterized in that the device further includes:
第七确定单元,用于确定所述目标 VF模块群中分配给所述至少一个 VM 中的第一 VM的第一 VF模块出现故障; A seventh determination unit, configured to determine that the first VF module assigned to the first VM in the at least one VM in the target VF module group fails;
选择单元, 用于从所述 PF模块组中各个 PF模块对应的 VF模块组中, 选择不同于所述第一 VF模块的第二 VF模块; A selection 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;
更新单元, 用于更新所述目标 VF模块群。 An update unit, used to update the target VF module group.
17. 根据权利要求 10至 16中任一项所述的装置, 其特征在于, 所述第 一物理网卡占用至少两个高速外设部件互连标准 PCIe总线, 所述装置还包 括: 17. The device according to any one of claims 10 to 16, wherein the first physical network card occupies at least two high-speed peripheral component interconnection standard PCIe buses, and the device further includes:
第八确定单元, 用于确定需要将所述目标 VF模块群中与所述至少两个 PCIe总线中第一 PCIe总线连接的 VF模块的数据发送到所述目标 VF模块 群中与所述至少两个 PCIe总线中第二 PCIe总线连接的 VF模块; The eighth determination unit is used to determine that the data of the VF module in the target VF module group connected to the first PCIe bus of the at least two PCIe buses needs to be sent to the target VF module group connected to the at least two PCIe buses. The VF module connected to the second PCIe bus in the first PCIe bus;
发送单元,用于将所述与第一 PCIe总线连接的 VF模块的数据通过所述 第一物理网卡的交换机发送到所述与第二 PCIe总线连接的 VF模块。 A sending unit, 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.
18. 根据权利要求 10至 17中任一项所述的装置, 其特征在于, 所述装 置还包括第三确定单元, 用于确定所述主 PF模块出现故障; 18. The device according to any one of claims 10 to 17, characterized in that the device further includes a third determination unit for determining that the main PF module is faulty;
所述第一确定单元还用于: 从所述 PF模块组中,选择除所述主 PF模块 之外的 PF模块作为新的主 PF模块; The first determination unit is also used to: select a PF module other than the main PF module from the PF module group as a new main PF module;
所述第二确定单元还用于: 基于所述 PF模块组中各个 PF模块对应的 VF模块组, 确定所述新的主 PF模块管理的新的目标 VF模块群, 其中, 所 述新的目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便 所述至少一个 VM实现数据传输。 The second determination unit is also configured to: determine 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 new target The VF module in the VF module group is used to be assigned to at least one virtual machine VM, so that the at least one VM implements data transmission.
19、 一种用于数据传输的装置, 其特征在于, 包括处理器和存储器; 其 中, 所述存储器存储程序代码, 所述处理器用于调用所述存储器中存储的所 述程序代码, 执行以下操作: 19. A device for data transmission, characterized in that it includes a processor and a memory; wherein the memory stores program code, and the processor is used to call the program code stored in the memory to perform the following operations :
从第一物理网卡的物理功能 PF模块组中, 确定主 PF模块, 所述 PF模 块组包括至少两个 PF模块, 所述 PF模块组中各个 PF模块对应不同的虚拟 功能 VF模块组; 基于所述 PF模块组中各个 PF模块对应的虚拟功能 VF模块组,确定所 述主 PF模块管理的目标 VF模块群, 其中, 所述所述目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便所述至少一个 VM实现数据 传输。 Determine the main PF module from the physical function PF module group of the first physical network card. 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; Based on the virtual function VF module group corresponding to each PF module in the PF module group, the target VF module group managed by the main PF module is determined, wherein the VF modules in the target VF module group are used to be allocated to at least A virtual machine VM, so that the at least one VM implements data transmission.
20. 根据权利要求 19所述的装置, 其特征在于, 所述处理器用于调用 所述存储器中存储的所述程序代码, 具体执行以下操作: 20. The device according to claim 19, wherein the processor is configured to call the program code stored in the memory, and specifically perform the following operations:
基于所述 PF模块组中每一个 PF模块的基准参数,确定所述主 PF模块, 其中, 所述 PF模块的基准参数包括 PF模块故障次数、 PF模块对应的 VF 模块组中 VF模块的个数、 PF模块静态带宽和 PF模块静态带宽中的至少一 种。 The main PF module is determined based on the reference parameters of each PF module in the PF module group, where the reference parameters of the PF module include the number of PF module failures and the number of VF modules in the VF module group corresponding to the PF module. , at least one of PF module static bandwidth and PF module static bandwidth.
21. 根据权利要求 19或 20所述的装置, 其特征在于, 所述处理器用于 调用所述存储器中存储的所述程序代码, 具体执行以下操作: 21. The device according to claim 19 or 20, characterized in that the processor is configured to call the program code stored in the memory, and specifically perform the following operations:
从所述 PF模块组中每一个 PF模块对应的 VF模块组中选出至少一个 VF模块, 组成所述目标 VF模块群。 Select 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. 根据权利要求 19至 21中任一项所述的装置, 其特征在于, 所述处 理器用于调用所述存储器中存储的所述程序代码, 还执行以下操作: 22. The device according to any one of claims 19 to 21, characterized in that the processor is configured to call the program code stored in the memory, and also perform the following operations:
确定第一 PF模块重新使能或故障恢复,将所述第一 PF模块确定为所述 PF模块组中的 PF模块; Determine whether the first PF module is re-enabled or fault restored, and determine the first PF module as the PF module in the PF module group;
基于所述第一 PF模块, 建立所述第一 PF模块对应的 VF模块组。 Based on the first PF module, a VF module group corresponding to the first PF module is established.
23. 根据权利要求 19至 22中任一项所述的装置, 其特征在于, 所述处 理器用于调用所述存储器中存储的所述程序代码, 还执行以下操作: 23. The device according to any one of claims 19 to 22, characterized in that the processor is configured to call the program code stored in the memory, and also perform the following operations:
确定第二 PF模块从所述第一物理网卡的所述 PF模块组中删除; 释放所述第二 PF模块对应的 VF模块组。 Determine that the second PF module is deleted from the PF module group of the first physical network card; release the VF module group corresponding to the second PF module.
24. 根据权利要求 19至 23中任一项所述的装置, 其特征在于, 所述处 理器用于调用所述存储器中存储的所述程序代码, 还执行以下操作: 24. The device according to any one of claims 19 to 23, characterized in that the processor is configured to call the program code stored in the memory, and also perform the following operations:
确定所述第一物理网卡的第三 PF模块发生故障时, 确定所述第三 PF 模块对应的 VF模块组中的 VF模块是否可用; When it is determined that the third PF module of the first physical network card fails, determine whether the VF module in the VF module group corresponding to the third PF module is available;
在所述第三 PF模块对应的 VF模块组中的至少一个 VF模块可用时,将 所述第一 PF模块对应的 VF模块组中的可用的所述至少一个 VF模块确定为 继续可用。 When at least one VF module in the VF module group corresponding to the third PF module is available, the at least one VF module available in the VF module group corresponding to the first PF module is determined to continue to be available.
25. 根据权利要求 19至 24中任一项所述的装置, 其特征在于, 所述处 理器用于调用所述存储器中存储的所述程序代码, 还执行以下操作: 确定所述目标 VF模块群中分配给所述至少一个 VM中的第一 VM的第 一 VF模块出现故障; 25. The device according to any one of claims 19 to 24, characterized in that: The processor is configured to call the program code stored in the memory, and also perform the following operations: determine that the first VF module assigned to the first VM in the at least one VM in the target VF module group fails;
从所述 PF模块组中各个 PF模块对应的 VF模块组中,选择不同于所述 第一 VF模块的第二 VF模块; Select a second VF module that is different from the first VF module from the VF module group corresponding to each PF module in the PF module group;
更新所述目标 VF模块群。 Update the target VF module group.
26. 根据权利要求 19至 25中任一项所述的装置, 其特征在于, 所述第 一物理网卡占用至少两个高速外设部件互连标准 PCIe总线, 所述处理器用 于调用所述存储器中存储的所述程序代码, 还执行以下操作: 26. The device according to any one of claims 19 to 25, wherein the first physical network card occupies at least two high-speed peripheral component interconnection standard PCIe buses, and the processor is used to call the memory The program code stored in also performs the following operations:
确定需要将所述目标 VF模块群中与所述至少两个 PCIe 总线中第一 Determine the need to place the target VF module in the cluster with the at least two PCIe buses in the first
PCIe总线连接的 VF模块的数据发送到所述目标 VF模块群中与所述至少两 个 PCIe总线中第二 PCIe总线连接的 VF模块; The data of the VF module connected to the PCIe bus is sent to the VF module in the target VF module group connected to the second PCIe bus of the at least two PCIe buses;
将所述与第一 PCIe总线连接的 VF模块的数据通过所述第一物理网卡的 交换机发送到所述与第二 PCIe总线连接的 VF模块。 The data of the VF module connected to the first PCIe bus is sent to the VF module connected to the second PCIe bus through the switch of the first physical network card.
27. 根据权利要求 19至 26中任一项所述的方法, 其特征在于, 所述处 理器用于调用所述存储器中存储的所述程序代码, 还执行以下操作: 27. The method according to any one of claims 19 to 26, characterized in that the processor is configured to call the program code stored in the memory, and also perform the following operations:
确定所述主 PF模块出现故障; It is determined that the main PF module is faulty;
从所述 PF模块组中, 选择除所述主 PF模块之外的 PF模块作为新的主 PF模块; From the PF module group, select a PF module other than the main PF module as the new main PF module;
基于所述 PF模块组中各个 PF模块对应的 VF模块组,确定所述新的主 Based on the VF module group corresponding to each PF module in the PF module group, determine the new primary
PF模块管理的新的目标 VF模块群, 其中, 所述所述目标 VF模块群中的 VF模块用于分配给至少一个虚拟机 VM, 以便所述至少一个 VM实现数据 传输。 A new target VF module group managed by the PF module, wherein the VF modules in the target VF module group are used to be allocated to at least one virtual machine VM, so that the at least one VM implements data transmission.
28. 一种物理网卡, 其特征在于, 包括: 有至少两个 PF模块组成的 PF 模块组, 以及至少两个 VF模块组; 其中, 所述至少两个 PF模块中的一个 28. A physical network card, characterized in that it includes: a PF module group composed of at least two PF modules, and at least two VF module groups; wherein, one of the at least two PF modules
PF模块对应于所述至少两个 VF模块组中的一个 VF模块组, 所述至少两个 PF模块中的任一 PF模块在被确定为主 PF模块后能够管理其他 PF模块连接 的 VF模块组中的 VF模块。 The PF module corresponds to one VF module group among the at least two VF module groups, and any PF module among the at least two PF modules can manage VF module groups connected to other PF modules after being determined as the main PF module. VF module in .
29. 根据权利要求 28所述的物理网卡, 其特征在于, 所述至少两个 VF 模块组中各个 VF模块组中的 VF模块包括两类空间资源; 其中, 29. The physical network card according to claim 28, wherein the VF modules in each of the at least two VF module groups include two types of space resources; wherein,
所述两类空间资源中的一类空间资源用于在所述主 PF模块被确定前, 由所述两类空间资源所属的 VF模块所属的 VF模块组对应的 PF模块进行访 问; One type of space resource among the two types of space resources is used before the main PF module is determined. Accessed by the PF module corresponding to the VF module group to which the VF module of the two types of space resources belongs;
所述两类空间资源中的另一类空间资源用于在所述主 PF模块被确定 后, 与所述主 PF模块建立连接由所述主 PF模块进行访问。 The other type of space resource among the two types of space resources is used to establish a connection with the main PF module for access by the main PF module after the main PF module is determined.
30. 根据权利要求 28或 29所述的物理网卡, 其特征在于, 所述物理网 卡占用至少两个高速外设部件互连标准 PCIe总线, 所述物理网卡还包括内 置交换机; 其中, 所述内置交换机用于将与所述至少两个 PCIe总线中的第 一 PCIe总线连接的 VF模块的数据通过发送到与所述至少两个 PCIe总线中 的第二 PCIe总线连接的 VF模块。 30. The physical network card according to claim 28 or 29, characterized in that, the physical network card occupies at least two high-speed peripheral components interconnecting standard PCIe buses, and the physical network card also includes a built-in switch; wherein, the built-in The switch is configured to transmit data of the VF module connected to the first PCIe bus of the at least two PCIe buses to the VF module connected to the second PCIe bus of the at least two PCIe buses.
31. 根据权利 28至 31中任一项所述的物理网卡, 其特征在于, 所述物 理网卡通过至少两个端口与外部交换机连接; 所述物理网卡还用于接收数据 传输的装置通过聚合链路发送的数据流, 并通过所述至少两个端口中各个端 口均衡发送所述数据流至所述外部交换机。 31. The physical network card according to any one of claims 28 to 31, characterized in that, the physical network card is connected to an external switch through at least two ports; the physical network card is also used to receive data transmission through an aggregation chain. The data stream is sent through the port, and the data stream is evenly sent to the external switch through each port of the at least two ports.
32. 一种用于数据传输的系统, 其特征在于, 包括根据权利要求 10至 18中任一项所述的用于数据传输的装置和权利要求 28至 31中任一项所述的 物理网卡, 或者包括根据权利要求 19至 27中任一项所述的用于数据传输的 装置和权利要求 28至 31中任一项所述的物理网卡; 其中, 权利要求 10至 18中任一项权利要求中所指的第一物理网卡或权利要求 19至 27中任一项权 利要求中所指的第一物理网卡为权利要求 28至 31 中任一项所述的物理网 卡。 32. A system for data transmission, characterized by comprising the device for data transmission according to any one of claims 10 to 18 and the physical network card according to any one of claims 28 to 31 , or include the device for data transmission according to any one of claims 19 to 27 and the physical network card according to any one of claims 28 to 31; wherein, any one of claims 10 to 18 The first physical network card referred to in the claims or the first physical network card referred to in any one of claims 19 to 27 is the physical network card described in any one of claims 28 to 31.
PCT/CN2013/077412 2013-06-18 2013-06-18 Method, apparatus and system for data transmission, and physical network card WO2014201623A1 (en)

Priority Applications (2)

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
CN201380000801.1A CN103609077B (en) 2013-06-18 2013-06-18 Method, apparatus and system for data transmission, and physical adapter

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 (1)

Publication Number Publication Date
WO2014201623A1 true WO2014201623A1 (en) 2014-12-24

Family

ID=50126079

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/077412 WO2014201623A1 (en) 2013-06-18 2013-06-18 Method, apparatus and system for data transmission, and physical network card

Country Status (2)

Country Link
CN (1) CN103609077B (en)
WO (1) WO2014201623A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105591780B (en) * 2014-10-24 2019-01-29 新华三技术有限公司 Cluster monitoring method and equipment
CN104486234B (en) * 2014-11-21 2018-10-30 华为技术有限公司 A kind of method and server that service switch is unloaded to physical network card
US9588791B2 (en) 2015-04-27 2017-03-07 Altera Corporation Flexible physical function and virtual function mapping
WO2017004746A1 (en) 2015-07-03 2017-01-12 华为技术有限公司 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
CN107181679A (en) * 2016-03-09 2017-09-19 中兴通讯股份有限公司 A kind of port binding implementation method and device
CN107278362B (en) 2016-11-09 2019-04-05 华为技术有限公司 The method of Message processing, host and system in cloud computing system
CN112217746A (en) * 2016-11-09 2021-01-12 华为技术有限公司 Method, host and system for processing message in cloud computing system
CN107643938A (en) * 2017-08-24 2018-01-30 中国科学院计算机网络信息中心 Data transmission method, device and storage medium
CN113132200B (en) * 2019-12-30 2024-01-19 中兴通讯股份有限公司 Data forwarding method, repeater, system, server and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436165A (en) * 2007-11-15 2009-05-20 国际商业机器公司 System and method for management of an IOV adapter
US20110202702A1 (en) * 2010-02-17 2011-08-18 Frankie Fan Method and system for pci hybrid function
US20120167085A1 (en) * 2010-12-28 2012-06-28 Plx Technology, Inc. Sharing multiple virtual functions to a host using a pseudo physical function
CN102946366A (en) * 2012-11-12 2013-02-27 杭州华为数字技术有限公司 In-band management method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7984454B2 (en) * 2006-12-19 2011-07-19 International Business Machines Corporation Migration of single root stateless virtual functions
JP5232602B2 (en) * 2008-10-30 2013-07-10 株式会社日立製作所 Storage device and storage controller internal network data path failover method
JP2012048546A (en) * 2010-08-27 2012-03-08 Hitachi Ltd Computing system, i/o device control method, and i/o drawer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436165A (en) * 2007-11-15 2009-05-20 国际商业机器公司 System and method for management of an IOV adapter
US20110202702A1 (en) * 2010-02-17 2011-08-18 Frankie Fan Method and system for pci hybrid function
US20120167085A1 (en) * 2010-12-28 2012-06-28 Plx Technology, Inc. Sharing multiple virtual functions to a host using a pseudo physical function
CN102946366A (en) * 2012-11-12 2013-02-27 杭州华为数字技术有限公司 In-band management method and system

Also Published As

Publication number Publication date
CN103609077A (en) 2014-02-26
CN103609077B (en) 2017-02-22

Similar Documents

Publication Publication Date Title
WO2014201623A1 (en) Method, apparatus and system for data transmission, and physical network card
US10986171B2 (en) Method for unified communication of server, baseboard management controller, and server
US9031081B2 (en) Method and system for switching in a virtualized platform
US11005755B2 (en) Packet processing method in cloud computing system, host, and system
US11086650B2 (en) Technologies for application-specific network acceleration with unified coherency domain
US8677023B2 (en) High availability and I/O aggregation for server environments
CA2991208C (en) Packet processing method in cloud computing system, host, and system
US20100287262A1 (en) Method and system for guaranteed end-to-end data flows in a local networking domain
JP4620776B2 (en) Method and system for managing virtual instances of physical ports attached to a network
TWI515572B (en) System and method for register access in distributed virtual bridge environment
JP2015521779A (en) System and method for input / output virtualization
WO2018133035A1 (en) Method, network card, host device and computer system for forwarding data packages
CN106557444B (en) Method and device for realizing SR-IOV network card and method and device for realizing dynamic migration
CA2961283C (en) Resource management method, host, and endpoint
US20140108584A1 (en) Method and Apparatus for Network Resource Virtual Partitioning
EP3629162B1 (en) Technologies for control plane separation at a network interface controller
US20150113114A1 (en) Network interface adapter registration method, driver, and server
WO2016107023A1 (en) Cloud server system
US11263162B2 (en) System decoder for training accelerators
WO2013086861A1 (en) Method for accessing multi-path input/output (i/o) equipment, i/o multi-path manager and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13887489

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13887489

Country of ref document: EP

Kind code of ref document: A1