WO2014063463A1 - 一种物理网卡管理方法、装置及物理主机 - Google Patents

一种物理网卡管理方法、装置及物理主机 Download PDF

Info

Publication number
WO2014063463A1
WO2014063463A1 PCT/CN2013/073414 CN2013073414W WO2014063463A1 WO 2014063463 A1 WO2014063463 A1 WO 2014063463A1 CN 2013073414 W CN2013073414 W CN 2013073414W WO 2014063463 A1 WO2014063463 A1 WO 2014063463A1
Authority
WO
WIPO (PCT)
Prior art keywords
network card
virtual
physical
virtual network
physical network
Prior art date
Application number
PCT/CN2013/073414
Other languages
English (en)
French (fr)
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 EP13849266.5A priority Critical patent/EP2892181B1/en
Publication of WO2014063463A1 publication Critical patent/WO2014063463A1/zh
Priority to US14/676,191 priority patent/US9780998B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0843Configuration by using pre-existing information, e.g. using templates or copying from other elements based on generic templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/604Address structures or formats
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/40Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks using virtualisation of network functions or resources, e.g. SDN or NFV entities

Definitions

  • the present invention relates to computer technology, and in particular, to a physical network card management method, apparatus, and physical host. Background technique
  • Virtualization is now a hotspot technology in the data center. Its core meaning is to help data centers, large workstations to take the flexibility and responsiveness of the environment to a new level at a lower cost.
  • the embodiments of the present invention provide a convenient and efficient unified management of a large number of heterogeneous physical network cards by providing a physical network card management method, device, and physical host, thereby improving network resource utilization.
  • the embodiment of the present invention provides the following technical solutions:
  • an embodiment of the present invention provides a physical network card management method, where the physical network card is used to connect to a network resource, and the method is applied to a physical host running one or more virtual machines, and the method includes: creating a Or a plurality of virtual network cards, wherein the virtual network card has a standard network card feature and an operation interface; and the one or more virtual network cards are respectively associated with each functional module of the physical network card, and the functional modules of the physical network card are associated with the same
  • the virtual network cards communicate with each other through a data stream and a control stream, where the data stream is used for sending and receiving data packets between the functional modules of the physical network card and the virtual network card associated with the virtual network card, and the control flow is used for the virtual network card.
  • the virtual network card configures a data flow interface, where the data flow interface includes the virtual network card and a corresponding Interface transmit and receive data packets between the packet interface data management function module card; the virtual media access card
  • the control layer MAC address is configured as a MAC address of a function module of the physical network card corresponding to the virtual network card; configuring a bandwidth of the virtual network card; registering a sysfs interface and a procfs interface, the sysfs interface, and a procfs interface for the virtual network card For controlling registration and destruction of the virtual network card; registering the virtual network card into an operating system kernel.
  • the managing the physical network card by implementing the management of the one or more virtual network cards includes: The bandwidth requirement of the virtual machine determines one or more virtual network cards that meet the bandwidth requirement, and the virtual network card is associated with a functional module of the same physical network card or the virtual network card is associated with a functional module of a different physical network card; One or more virtual network cards are allocated for use by the virtual machine.
  • the embodiment of the present invention provides a physical network card management device, where the device includes: a virtual network card creating unit, configured to create one or more virtual network cards, where the virtual network card has standard network card characteristics and an operation interface; a network card association unit, configured to associate the one or more virtual network cards with each functional module of the physical network card, where the functional module of the physical network card communicates with the corresponding virtual network card by using a data flow and a control flow,
  • the data stream is used for sending and receiving data packets between the two, the control flow is used for controlling the functional modules of the physical network card by the virtual network card; and the virtual network card management unit is used for adopting the first implementation manner.
  • the virtual network card association unit is specifically configured to: configure a data flow interface for the virtual network card, where the data flow interface includes a data packet sending interface between the virtual network card and a functional module of the physical network card corresponding thereto And a receiving interface of the data packet; configuring a MAC address of the media access control layer of the virtual network card as Virtual network card pair The MAC address of the functional module of the physical NIC. Configuring a bandwidth of the virtual network card; registering a sysfs interface and a procfs interface for the virtual network card, where the sysfs interface and the procfs interface are used to control registration and destruction of the virtual network card; and registering the virtual network card into an operating system kernel.
  • the virtual network card management unit is specifically configured to: determine, according to a bandwidth requirement of the virtual machine, one or the one that meets the bandwidth requirement a plurality of virtual network cards, wherein the virtual network card is associated with a functional module of the same physical network card or the virtual network card is associated with a functional module of a different physical network card; and the one or more virtual network cards are allocated to the virtual machine for use.
  • an embodiment of the present invention provides a physical host, where the physical host includes: a hardware layer, a virtual machine monitor VMM running on the hardware layer, and a running on the VMM. a virtual machine; the hardware layer includes one or more physical network cards; the VMM includes the physical network card management device according to any one of the embodiments of the present invention, and the physical mechanism is configured to facilitate the virtual machine to the hardware layer. The use of physical network cards.
  • the physical network card management method, the device, and the physical host provide a virtual network card VN corresponding to each physical network card or a physical network card, and the VNs have the same data structure and interface, thereby It shields the difference of the underlying hardware, provides a unified interface and device type, facilitates efficient and unified management, and improves the utilization of network resources.
  • Figure la is a schematic flowchart of a physical network card management method according to an embodiment of the present invention
  • Figure lb is a schematic flowchart of another physical network card management method according to an embodiment of the present invention.
  • Figure lc is a schematic flowchart of another physical network card management method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a principle for creating a VN according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of implementing VF or VQ as a VN according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a VN implemented by a common network card according to an embodiment of the present invention
  • FIG. sample graph is a schematic flowchart of a VN implemented by a common network card according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a physical network card management apparatus according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a physical host according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of another physical host according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic flowchart of a method for managing a physical network card according to an embodiment of the present invention.
  • the physical network card is used to connect to a network resource. Therefore, in the following description, a physical network card may be understood as indicating a network resource.
  • the method is applied to a physical host running one or more virtual machines, and the method includes:
  • VN Virtual Network Interface Cards
  • the virtual network card may have the same network card characteristics and an operation interface, for example, the virtual network card has the same bandwidth;
  • the one or more virtual network cards are respectively associated with each functional module of the physical network card, and the functional modules of the physical network card communicate with the virtual network card associated with the data network by using a data flow and a control flow, where the data flow is used. Transmitting and receiving a data packet between a functional module of the physical network card and a virtual network card associated with the physical network card, where the control flow is used for controlling, by the virtual network card, a functional module of a physical network card associated with the virtual network card;
  • VN virtual network card
  • the functional modules of the physical network card are configured to construct a virtual network card VN.
  • VNs have the same data structure and interface, thereby shielding the difference of the underlying hardware from the upper layer, providing a unified interface and device type, and realizing resource management of a large number of heterogeneous network cards. Allocation, etc., thereby increasing network resources Source utilization.
  • step S102 specifically includes:
  • the data flow interface is configured for the virtual network card, where the data flow interface includes a data packet sending interface and a data packet receiving interface between the virtual network card and a functional module of the physical network card corresponding thereto.
  • a media access control layer MAC address of the virtual network card as a MAC address of a function module of a physical network card corresponding to the virtual network card.
  • sysfs registering a sysfs interface and a procfs interface for the virtual network card, where the sysfs interface and the procfs interface are used to control registration and destruction of the virtual network card; Procfs and sysfs are respectively two file management systems of linux.
  • step S103 specifically includes:
  • the physical network card may be an SRI0V network card, a VMDQ network card, or a common network card, or any two or three of the above three network cards may exist in the same physical host.
  • the common network card in the embodiment of the present invention is in addition to the application SRIOV and
  • the functional modules of the physical network card include VF (Virtual Function) and PF (Physical Function, physical function); when the physical network card is a VMDQ network card, the function module of the physical network card includes a VQ (Virtual Queue); when the physical network card is a common network card, the ordinary network card itself is A functional module of the physical network card.
  • the present invention does not limit the physical network card to be one or more of the above three types, and the technical solutions disclosed by those skilled in the art according to the embodiments of the present invention, without any creative work, The technical solutions disclosed in the embodiments of the present invention are applied to more types of network cards that appear in the future, and are also within the scope of protection of the present invention.
  • the functional modules of the physical network card are configured to construct a virtual network card VN. These VNs have the same data structure and interface, thereby shielding the difference of the underlying hardware from the upper layer, providing a unified interface and device type, and realizing resource management of a large number of heterogeneous network cards. Distribution, etc., thereby increasing the utilization of network resources.
  • FIG. 2 it is a schematic diagram of a principle for creating a VN according to an embodiment of the present invention.
  • Two paths need to be implemented between a VF (PF or VQ or a common network card) and a VN, and one is a data stream, which is mainly responsible for sending data packets.
  • the other is the control flow, which is mainly responsible for VN control of VF (PF or VQ or ordinary network card), such as bandwidth setting, MAC setting, acquisition of hardware information, and registration and destruction of VN.
  • the functional modules of each type of network card or network card need to meet the data flow and control flow to achieve the transition to VN.
  • FIG. 3 is a schematic flowchart of a VF being implemented as a VN according to an embodiment of the present invention, where the process includes:
  • the specific implementation may be a callback function.
  • the callback function When the operating system needs to send and receive data with the VN, the previously registered interface is called by the callback function.
  • the bandwidth of the VN can be consistent with the bandwidth of the corresponding VF.
  • User space is relative to kernel space and refers to a runlevel in the operating system. User programs are all working in user space, and the operating system kernel runs in kernel space. This step allows the user or administrator to manipulate the interface using commands to control the registration and destruction of the VN.
  • Destroying the original VF device removes the VF device from the system's network framework, so that users cannot view or operate the VF device through network commands. The purpose of this is to prevent the user from misusing the VF device and affecting the normal use of the VN.
  • VN can also be implemented as shown in Figure 3.
  • FIG. 4 a schematic diagram of a process in which an ordinary network card Eth is implemented as a VN according to an embodiment of the present invention, and an Eth refers to a normal network card, such as a Realtek 8139 network card, which is relative to an advanced network card. Under Linux, network card naming generally starts with Eth.
  • the method Includes:
  • Register a VN data stream interface with an operating system kernel, including a registration data sending interface and a data receiving interface.
  • FIG. 5 it is an example of a data structure of a VN according to an embodiment of the present invention, where name is a name of a VN, and may be set to uniquely identify a VN identifier; dev is associated with a data structure of the original network card; MAC is the VN The MAC address; duplex indicates the duplex mode of the VN; speed indicates the bandwidth of the VN.
  • name is a name of a VN, and may be set to uniquely identify a VN identifier
  • dev is associated with a data structure of the original network card
  • MAC is the VN The MAC address
  • duplex indicates the duplex mode of the VN
  • speed indicates the bandwidth of the VN.
  • the previous part of the above is the type of project defined in this programming language.
  • FIG. 5 is only an implementation example of a VN in a programming language, and other implementations of the VN can be obtained by those skilled in the art through FIG. 5 and the technical solutions disclosed in the present application.
  • the structure of the VN of the present application is not limited to FIG. 5.
  • the functional modules of the physical network card are configured to construct a virtual network card VN.
  • These VNs have the same data structure and interface, thereby shielding the difference of the underlying hardware from the upper layer, providing a unified interface and device type, and realizing resource management of a large number of heterogeneous network cards. Allocation, etc., thereby increasing network resources Source utilization.
  • the guest operating system requires 11G network bandwidth
  • 10 virtual pools are not used, the bandwidth of a single NIC is only 10G, which cannot be satisfied.
  • 11 VNs are directly taken out, and each VN bandwidth is 1G.
  • this can provide 11G bandwidth for the virtual machine, and completely shields the heterogeneous unpolymerizable features of different network cards such as SRIOV and VMDQ.
  • FIG. 6 is a schematic structural diagram of a physical network card management apparatus 11 according to an embodiment of the present invention, where the apparatus includes:
  • the virtual network card creating unit 111 is configured to create one or more virtual network cards, where the virtual network card has a standard network card feature and an operation interface;
  • the virtual network card association unit 112 is configured to associate the one or more virtual network cards with each functional module of the physical network card, and the function module of the physical network card and the corresponding virtual network card are performed by using a data flow and a control flow.
  • the data stream is used for sending and receiving data packets between the two, and the control flow is used by the virtual network card to control a function module of the physical network card;
  • the virtual network card association unit 112 is specifically configured to configure a data flow interface for the virtual network card, where the data flow interface includes a function module between the virtual network card and a physical network card corresponding thereto. a sending interface of the data packet and a receiving interface of the data packet; configuring a MAC address of the media access control layer of the virtual network card as a MAC address of a functional module of the physical network card corresponding to the virtual network card.
  • the virtual network card management unit 113 is configured to implement management of the physical network card by managing the one or more virtual network cards.
  • the virtual network card management unit 113 is specifically configured to determine one or more virtual network cards that meet the bandwidth requirement according to the bandwidth requirement of the virtual machine, where the virtual network card and the same physical network card are The functional module association or the virtual network card is associated with a functional module of a different physical network card; and the one or more virtual network cards are allocated to the virtual machine for use.
  • the physical network card includes: an SRIOV network card, a virtual device queue VMDQ network card, and/or a common network card.
  • the function module of the physical network card includes a virtual function VF and a physical function PF;
  • the functional module of the physical network card includes a virtual queue VQ;
  • the physical network card is a common network card, the ordinary network card itself is a functional module of the physical network card.
  • the physical network card management apparatus constructs a virtual network card VN by using a functional module of each physical network card or a physical network card, and these VNs have the same data structure and interface, thereby shielding the difference of the underlying hardware from the upper layer.
  • a unified interface and device type are provided to implement unified management and allocation of a large number of heterogeneous network card resources, thereby improving the utilization of network resources.
  • FIG. 7 is a schematic structural diagram of a physical host according to an embodiment of the present invention.
  • the physical host includes: a hardware layer 100 running on the hardware layer 100.
  • the VMM (Virtual Machine Monitor) 200, and the virtual machine 300 running on the VMM 200, may be one or more.
  • the hardware layer includes one or more physical network cards 140; in addition, the hardware layer further includes a processor 110, a physical memory 120, and a hard disk 130.
  • the VMM 200 includes the physical network card management device according to any embodiment of the present invention.
  • the physical network card management device 210 is configured to implement management of the physical network card 140 of the hardware layer 100 by managing a virtual network card, so as to facilitate the use of the physical network card 140 of the hardware layer 100 by the virtual machine 300.
  • the VMM 200 can also include other modules that are already in the prior art.
  • the physical network card management device 210 is configured to: create one or more virtual network cards; associate the one or more virtual network cards with respective functional modules of the physical network card, and the functional modules of the physical network card are associated with
  • the virtual network cards communicate with each other through a data stream and a control stream, where the data stream is used for sending and receiving data packets between the functional modules of the physical network card and the virtual network card associated therewith, and the control flow is used for the virtual Control of the functional modules of the physical network card associated with the network card; management of the physical network card by management of the one or more virtual network cards.
  • the physical network card management device 210 may include: a virtual network card creating unit, configured to create one or more virtual network cards; and a virtual network card association unit, configured to separately separate the one or more virtual network cards Associated with each functional module of the physical network card, the functional module of the physical network card communicates with the corresponding virtual network card through a data flow and a control flow, and the data flow is used for sending and receiving data packets between the two.
  • the control flow is used by the virtual network card to control a function module of the physical network card; virtual network card management And a unit, configured to implement management of the physical network card by managing the one or more virtual network cards.
  • the specific implementation or functional module division of the physical network card management device 210 can be referred to the foregoing method and device embodiment.
  • the virtual machine 300 includes a guest operating system 340, a virtual processor 310, a virtual memory 320, and a virtual hard disk 330, and uses and manages the virtual network card through the physical network card management device 210 provided by the VMM 200.
  • FIG. 8 is a schematic structural diagram of another physical host according to an embodiment of the present invention.
  • the physical host includes multiple guest operating systems (which may also be understood to include multiple virtual machines), and the bandwidth requirement of the guest operating system 1 is required. For llGbit/s, the bandwidth requirement of the guest operating system 2 is 2 Gbit/s, the bandwidth requirement of the guest operating system 3 is 6 Gbit/s, and the bandwidth requirements of the guest operating system 4 and the guest operating system 5 are all 1;
  • the physical host also includes a variety of heterogeneous physical network cards: SRIOV network card, VMDQ network card and common network card, wherein the bandwidth of the SRIOV network card is 10 Gbit/s, the bandwidth of the VMDQ network card is 10 Gbit/s, and the common network card Eth7 (Eth7 is An example of a normal NIC in the Linux operating system) has a bandwidth of 1 Gbit/s.
  • one PF and multiple VFs of the SRIOV NIC are associated with one VN respectively.
  • Multiple VQs of the VMDQ NIC are associated with one VN respectively.
  • Eth7 of the common NIC is also associated with one VN.
  • the bandwidth of all VNs is set to 1 Gbit/s.
  • 11 VNs are allocated to the guest operating system 1.
  • 10 of the 11 VNs are from the functional modules of the SRIOV network card, and one is from the VMDQ.
  • the function module of the network card so that the physical host provided by the embodiment of the present invention implements unified management and allocation of a large number of heterogeneous network card resources.
  • the system 5 allocates the VN in the same manner, as shown in FIG. 8, and details are not described herein again.
  • the physical host constructs a virtual network card VN by using a functional module of each physical network card or a physical network card, and these VNs have the same data structure and interface, thereby shielding the difference of the underlying hardware from the upper layer and providing
  • a unified interface and device type implements unified management and allocation of a large number of heterogeneous network card resources, thereby improving the utilization of network resources.
  • these NICs can have the same bandwidth (or set different bandwidths according to requirements), can be sorted by sequence number, sorted, and then together form a 10 virtual pool in the VMM layer, and then taken out according to the actual needs of the virtual machine. A certain number of VNs are allocated for use by the virtual machine.
  • the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • the connection relationship between the modules indicates that there is a communication connection between them, and specifically may be implemented as one or more communication buses or signal lines.
  • the specific hardware structure used to implement the same function can be various, such as analog circuits, digital circuits, or dedicated circuits. Circuits, etc.
  • software program implementation is a better implementation in more cases.
  • the computer software product is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a read-only memory (ROM), and a random memory.
  • a random access memory (RAM), a magnetic disk or an optical disk, etc. includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例涉及一种物理网卡管理方法、装置及物理主机,通过创建一个或多个虚拟网卡,所述虚拟网卡具备标准的网卡特性和操作接口;将所述一个或多个虚拟网卡分别与物理网卡的各个功能模块关联,通过对所述一个或多个虚拟网卡的管理实现对所述物理网卡的管理,从而向上层屏蔽了底层硬件的差异,提供统一的接口和设备类型,方便高效的统一管理,进而提高了网络资源的利用率。

Description

一种物理网卡管理方法、 装置及物理主机 技术领域
本发明涉及计算机技术, 尤其涉及一种物理网卡管理方法、 装置及 物理主机。 背景技术
虚拟化是现在数据中心的一个热点技术, 其核心意义是帮助数据中 心, 大型工作站以更低的成本将环境的灵活性和反应能力提升到一个新 的水平。
如今 CPU ( Central Process Unit, 中央处理器)和内存的虚拟化技术 飞速发展, 而 10 ( Input/Output, 输入输出)虚拟化却相对落后, 成为了 虚拟化技术快速发展的性能瓶颈,许多硬件厂家都针对 10虚拟化技术提 出和使用了不同的解决方案。 网络设备是数据中心的服务器中必不可少 的重要组成部分, 为了提高网络设备的虚拟化性能, 一些新的虚拟化技 术不断应用到新的网卡中, 例如 SRIOV ( Single Root I/O Virtualization ) 技术和 VMDQ ( Virtual Machine Device Queue, 虚拟设备队列)技术。 而 由于成本问题,原有的大量传统的 NIC(Network Interface Card, 网络接口 设备, 也简称为网卡)也继续被使用, 因此, 一个现代的大型数据中心的 机房里, 普通网卡、 SRIOV网卡和 VMDQ网卡都被作为网络设备 (可看 做网络资源) 而使用, 而这些异构网卡的使用方式各有不同。 目前服务 器中基本采用管理员的方式, 或者控制管理程序动态的为虚拟机划分网 络资源, 获得资源的虚拟机可以独享分配到的网络资源。 但随着服务器 数量的增多, 大量的异构网卡存在管理混乱, 无法实现统一的管理和分 配机制, 进而造成网络资源利用率不高。 发明内容
本发明实施例通过提供一种物理网卡管理方法、 装置及物理主机, 实现对大量异构物理网卡的方便高效的统一管理, 进而提高网络资源的 利用率。
为了解决上述问题, 本发明实施例提供如下技术方案:
第一方面, 本发明实施例提供一种物理网卡管理方法, 所述物理网 卡用于连接网络资源, 所述方法应用于运行有一个或多个虚拟机的物理 主机, 所述方法包括: 创建一个或多个虚拟网卡, 所述虚拟网卡具备标 准的网卡特性和操作接口; 将所述一个或多个虚拟网卡分别与物理网卡 的各个功能模块关联, 所述物理网卡的功能模块与与之关联的虚拟网卡 之间通过数据流和控制流进行通信, 所述数据流用于所述物理网卡的功 能模块与与之关联的虚拟网卡之间数据包的发送和接收, 所述控制流用 于所述虚拟网卡对与之关联的物理网卡的功能模块的控制; 通过对所述 在第一种实现方式下, 所述将所述一个或多个虚拟网卡分别与物理 网卡的各个功能模块关联, 具体包括: 为所述虚拟网卡配置数据流接口, 所述数据流接口包括所述虚拟网卡与与之对应的物理网卡的功能模块之 间的数据包的发送接口和数据包的接收接口; 将所述虚拟网卡的媒体访 问控制层 MAC地址配置为与所述虚拟网卡对应的物理网卡的功能模块 的 MAC地址; 配置所述虚拟网卡的带宽; 为所述虚拟网卡注册 sysfs接 口和 procfs接口, 所述 sysfs接口和 procfs接口用于控制所述虚拟网卡的 注册和销毁; 将所述虚拟网卡注册进操作系统内核。
结合第一方面或第一方面的第一种实现方式, 在第二种实现方式下, 所述通过对所述一个或多个虚拟网卡的管理实现对所述物理网卡的管 理, 具体包括: 根据所述虚拟机的带宽需求确定满足所述带宽需求的一 个或多个虚拟网卡, 所述虚拟网卡与同一物理网卡的功能模块关联或所 述虚拟网卡与不同的物理网卡的功能模块关联; 将所述一个或多个虚拟 网卡分配给所述虚拟机使用。
第二方面, 本发明实施例提供一种物理网卡管理装置, 所述装置包 括: 虚拟网卡创建单元, 用于创建一个或多个虚拟网卡, 所述虚拟网卡 具备标准的网卡特性和操作接口; 虚拟网卡关联单元, 用于将所述一个 或多个虚拟网卡分别与物理网卡的各个功能模块关联, 所述物理网卡的 功能模块与与之对应的虚拟网卡之间通过数据流和控制流进行通信, 所 述数据流用于二者之间数据包的发送和接收, 所述控制流用于所述虚拟 网卡对所述物理网卡的功能模块的控制; 虚拟网卡管理单元, 用于通过 在第一种实现方式下, 所述虚拟网卡关联单元具体用于: 为所述虚 拟网卡配置数据流接口, 所述数据流接口包括所述虚拟网卡与与之对应 的物理网卡的功能模块之间的数据包的发送接口和数据包的接收接口; 将所述虚拟网卡的媒体访问控制层 MAC地址配置为与所述虚拟网卡对 应的物理网卡的功能模块的 MAC地址。 配置所述虚拟网卡的带宽; 为所 述虚拟网卡注册 sysfs接口和 procfs接口, 所述 sysfs接口和 procfs接口 用于控制所述虚拟网卡的注册和销毁; 将所述虚拟网卡注册进操作系统 内核。
结合第二方面或第二方面的第一种实现方式, 在第二种实现方式下, 所述虚拟网卡管理单元具体用于: 根据所述虚拟机的带宽需求确定满足 所述带宽需求的一个或多个虚拟网卡, 所述虚拟网卡与同一物理网卡的 功能模块关联或所述虚拟网卡与不同的物理网卡的功能模块关联; 将所 述一个或多个虚拟网卡分配给所述虚拟机使用。
第三方面, 本发明实施例提供一种物理主机, 其特征在于, 所述物 理主机包括: 硬件层, 运行在所述硬件层之上的虚拟机监视器 VMM, 以 及运行在所述 VMM上的虚拟机; 所述硬件层包括一个或多个物理网卡; 所述 VMM包括本发明任一实施例所述的物理网卡管理装置, 所述物理 理, 以便于所述虚拟机对所述硬件层的物理网卡的使用。
可见, 本发明实施例通过提供一种物理网卡管理方法、 装置及物理 主机, 将每个物理网卡或物理网卡的功能模块对应构造虚拟网卡 VN, 这 些 VN具有相同的数据结构和接口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设备类型, 方便高效的统一管理, 进而提高了网络资 源的利用率。 附图说明 对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见 地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技 术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得 其他的附图。
图 la为本发明实施例提供的一种物理网卡管理方法的流程示意图; 图 lb为本发明实施例提供的另一种物理网卡管理方法的流程示意 图;
图 lc为本发明实施例提供的另一种物理网卡管理方法的流程示意 图;
图 2为本发明实施例提供的创建 VN的原理示意图;
图 3为本发明实施例提供的 VF或 VQ实现为 VN的流程示意图; 图 4为本发明实施例提供的普通网卡实现为 VN的流程示意图; 图 5为本发明实施例提供的 VN的数据结构示例图;
图 6为本发明实施例提供的一种物理网卡管理装置的结构示意图; 图 7为本发明实施例提供的一种物理主机的结构示意图;
图 8为本发明实施例提供的另一种物理主机的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案 进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实 施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术 人员在没有作出创造性劳动前提下所获得的所有其他实施例, 都属于本 发明保护的范围。
请参考图 la, 为本发明实施例提供的一种物理网卡管理方法的流程 示意图, 所述物理网卡用于连接网络资源 (因此, 在以下实施例的介绍 中物理网卡可以理解为指示网络资源), 所述方法应用于运行有一个或多 个虚拟机的物理主机, 所述方法包括:
5101 , 创建一个或多个虚拟网卡(Virtual Network Interface Card, 虚 拟网络接口设备, 简称为 VN )。
所述虚拟网卡可以具备相同的网卡特性和操作接口, 例如虚拟网卡 具备相同的带宽;
5102 , 将所述一个或多个虚拟网卡分别与物理网卡的各个功能模块 关联, 所述物理网卡的功能模块与与之关联的虚拟网卡之间通过数据流 和控制流进行通信, 所述数据流用于所述物理网卡的功能模块与与之关 联的虚拟网卡之间数据包的发送和接收, 所述控制流用于所述虚拟网卡 对与之关联的物理网卡的功能模块的控制;
5103 , 通过对所述一个或多个虚拟网卡的管理实现对所述物理网卡 的管理。 或物理网卡的功能模块对应构造虚拟网卡 VN,这些 VN具有相同的数据 结构和接口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设 备类型, 实现了大量异构网卡的资源管理和分配等, 进而提高了网络资 源的利用率。
在本发明的一些实施例中, 如图 lb所示, 步骤 S102具体包括:
51021 , 为所述虚拟网卡配置数据流接口, 所述数据流接口包括所述 虚拟网卡与与之对应的物理网卡的功能模块之间的数据包的发送接口和 数据包的接收接口;
51022, 将所述虚拟网卡的媒体访问控制层 MAC地址配置为与所述 虚拟网卡对应的物理网卡的功能模块的 MAC地址;
51023, 配置所述虚拟网卡的带宽;
51024, 为所述虚拟网卡注册 sysfs接口和 procfs接口, 所述 sysfs接 口和 procfs接口用于控制所述虚拟网卡的注册和销毁; Procfs和 sysfs分 别为 linux的两种文件管理系统。
51025, 将所述虚拟网卡注册进操作系统内核。
在本发明的一些实施例中, 如图 lc所示, 步骤 S103具体包括:
51031 ,根据所述虚拟机的带宽需求确定满足所述带宽需求的一个或 多个虚拟网卡, 所述虚拟网卡与同一物理网卡的功能模块关联或所述虚 拟网卡与不同的物理网卡的功能模块关联;
51032, 将所述一个或多个虚拟网卡分配给所述虚拟机使用。
在本发明的一些实施例中,所述物理网卡可以为 SRI0V网卡、 VMDQ 网卡或普通网卡, 也可以在同一个物理主机中同时存在以上三种网卡的 任意两种或三种。 本发明实施例中所述普通网卡为除应用 SRIOV和
VMDQ技术之外的其它网卡。 当所述物理网卡为 SRIOV网卡时,所述物 理网卡的功能模块包括 VF ( Virtual Function, 虚拟功能)和 PF ( Physical Function, 物理功能); 当所述物理网卡为 VMDQ网卡时, 所述物理网卡 的功能模块包括 VQ ( Virtual Queue, 虚拟队列); 当所述物理网卡为普通 网卡时, 所述普通网卡本身即为所述物理网卡的一个功能模块。
需说明的是, 本发明并不限定物理网卡必须为以上三种的中的一种 或多种, 本领域技术人员根据本发明实施例公开的技术方案在不付出创 造性劳动的前提下, 若将本发明实施例公开的技术方案应用于今后出现 的更多类型的网卡上, 也属于本发明保护的范围。 或物理网卡的功能模块对应构造虚拟网卡 VN,这些 VN具有相同的数据 结构和接口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设 备类型, 实现了大量异构网卡的资源管理和分配等, 进而提高了网络资 源的利用率。
下面通过一些具体的实施例来详细介绍本发明技术方案的实现。 如图 2所示, 为本发明实施例提供的创建 VN的原理示意图, VF(PF 或 VQ或者普通网卡)和 VN之间需要实现两条通路, 一条是数据流, 主 要负责数据包的发送和接收; 另一条是控制流, 主要负责 VN对 VF(PF 或 VQ或者普通网卡)的控制, 例如带宽设置、 MAC设置、 获取硬件信息 以及 VN的注册和销毁等。 每种结构的网卡或网卡的功能模块都需要满 足数据流和控制流才能实现到 VN的转变。
如图 3所示, 为本发明实施例提供的 VF实现为 VN的流程示意图, 该过程包括:
S301 , 向操作系统内核注册 VN的数据流接口, 包括注册数据发送 接口和数据接收接口;
具体实现可以为设置回调函数, 当操作系统需要用该 VN收发数据 时, 会通过该回调函数调用之前注册的接口。
5302, 读取 VF的 MAC并将所述 VF的 MAC设置为 VN的 MAC; 在本发明其它一些实施例中, 若 VF不存在 MAC, 则随机生成 MAC。
5303, 设置 VN的带宽。 VN的带宽可以与与之对应的 VF的带宽一 致。
5304 , 注册 procfs和 sysfs接口, 这样通过用户空间可以控制 VN的 注册和销毁。
用户空间是相对于内核空间而言的, 是指操作系统中的一种运行级 另' J。 用户程序都是工作在用户空间, 操作系统内核运行在内核空间。 该 步骤可以使用户或管理员能够使用命令来操作接口, 从而控制 VN的注 册和销毁。
5305, 将 VN注册进操作系统内核, 实现 VN设备, 将原 VF设备销 毁。
将原 VF设备销毁即将 VF设备从系统的网络框架中移除, 这样用户 就不能通过网络命令查看或操作 VF设备。这么做的目的是防止用户误操 作 VF设备, 影响 VN的正常使用。
当然对于 PF和 VQ也可以采用如图 3所示的方法实现 VN。
如图 4所示,为本发明实施例提供的普通网卡 Eth实现为 VN的流程 示意图, Eth是指普通网卡, 例如 Realtek 8139网卡, 是相对于高级网卡 而言的。 在 Linux下, 网卡命名一般都以 Eth开头。 如图 4所示, 该方法 包括:
5401 , 向操作系统内核注册 VN的数据流接口, 包括注册数据发送 接口和数据接收接口;
5402, 读取 Eth的 MAC并将所述 Eth的 MAC设置为 VN的 MAC; 在本发明其它一些实施例中, 若 Eth不存在 MAC, 则随机生成 MAC。
5403, 设置 VN的带宽为 Eth的带宽。
5404 , 注册 procfs和 sysfs接口, 这样通过用户空间可以控制 VN的 注册和销毁。
5405, 将 Eth注册进操作系统内核, 实现 VN设备, 将原 VF设备销 毁。
如图 5所示, 为本发明实施例提供的 VN的数据结构示例图, 其中 name是 VN的名称, 可以设置为唯一确定一个 VN的标识; dev与原来 网卡的数据结构关联; MAC是该 VN的 MAC地址; duplex指示 VN的 双工方式; speed指示 VN的带宽。 以上各项的前面部分是该种程序语言 中定义的项目类型。
本领域技术人员应当理解图 5所示仅为一种程序语言下的 VN的实 现示例, 本领域普通技术人员可以通过图 5以及本申请公开的技术方案 得到 VN的其它实现方式。 本申请 VN的结构并不以图 5为限。 或物理网卡的功能模块对应构造虚拟网卡 VN,这些 VN具有相同的数据 结构和接口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设 备类型, 实现了大量异构网卡的资源管理和分配等, 进而提高了网络资 源的利用率。 例如, 客户操作系统需求 11G的网络带宽, 如果不使用 10 虚拟池, 由于单块网卡的带宽只有 10G, 无法满足, 使用 10虚拟池后, 直接取出 11个 VN, 每个 VN带宽为 1G, 聚合为一个虚拟网卡, 这样能 为虚拟机提供 11G的带宽, 而且完全屏蔽了 SRIOV和 VMDQ等不同网 卡的异构无法聚合的特性。
请参阅图 6, 为本发明实施例提供的一种物理网卡管理装置 11的结 构示意图, 该装置包括:
虚拟网卡创建单元 111 , 用于创建一个或多个虚拟网卡, 所述虚拟网 卡具备标准的网卡特性和操作接口;
虚拟网卡关联单元 112,用于将所述一个或多个虚拟网卡分别与物理 网卡的各个功能模块关联, 所述物理网卡的功能模块与与之对应的虚拟 网卡之间通过数据流和控制流进行通信, 所述数据流用于二者之间数据 包的发送和接收, 所述控制流用于所述虚拟网卡对所述物理网卡的功能 模块的控制;
在本发明的一些实施例中, 虚拟网卡关联单元 112具体用于为所述 虚拟网卡配置数据流接口, 所述数据流接口包括所述虚拟网卡与与之对 应的物理网卡的功能模块之间的数据包的发送接口和数据包的接收接 口;将所述虚拟网卡的媒体访问控制层 MAC地址配置为与所述虚拟网卡 对应的物理网卡的功能模块的 MAC地址。 配置所述虚拟网卡的带宽; 为 所述虚拟网卡注册 sysfs接口和 procfs接口, 所述 sysfs接口和 procfs接 口用于控制所述虚拟网卡的注册和销毁; 将所述虚拟网卡注册进操作系 统内核。 虚拟网卡管理单元 113 ,用于通过对所述一个或多个虚拟网卡的管理 实现对所述物理网卡的管理。
在本发明的一些实施例中, 虚拟网卡管理单元 113具体用于才艮据所 述虚拟机的带宽需求确定满足所述带宽需求的一个或多个虚拟网卡, 所 述虚拟网卡与同一物理网卡的功能模块关联或所述虚拟网卡与不同的物 理网卡的功能模块关联; 将所述一个或多个虚拟网卡分配给所述虚拟机 使用。
在本发明实施例中, 所述物理网卡包括: SRIOV网卡、 虚拟设备队 列 VMDQ网卡和 /或普通网卡。 当所述物理网卡为 SRIOV网卡时, 所述 物理网卡的功能模块包括虚拟功能 VF和物理功能 PF; 当所述物理网卡 为 VMDQ网卡时, 所述物理网卡的功能模块包括虚拟队列 VQ; 当所述 物理网卡为普通网卡时, 所述普通网卡本身即为所述物理网卡的一个功 能模块。
需说明的是, 本发明实施例提供的物理网卡管理装置的具体实现可 参考前述方法实施例, 在此不再赘述。
综上, 本发明实施例提供的物理网卡管理装置通过将每个物理网卡 或物理网卡的功能模块对应构造虚拟网卡 VN,这些 VN具有相同的数据 结构和接口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设 备类型, 实现了大量异构网卡资源的统一管理和分配等, 进而提高了网 络资源的利用率。
请参阅图 7, 为本发明实施例提供的一种物理主机的结构示意图, 其 特征在于, 所述物理主机包括: 硬件层 100, 运行在所述硬件层 100之上 的 VMM ( Virtual Machine Monitor, 虚拟机监视器) 200, 以及运行在所 述 VMM200上的虚拟机 300, 所述虚拟机可以为一个, 也可以为多个。
所述硬件层包括一个或多个物理网卡 140; 除此之外, 该硬件层还包 括处理器 110、 物理内存 120以及硬盘 130。
所述 VMM200包括本发明任一实施例所述的物理网卡管理装置
210, 所述物理网卡管理装置 210用于通过管理虚拟网卡实现对所述硬件 层 100的物理网卡 140的管理,以便于所述虚拟机 300对所述硬件层 100 的物理网卡 140的使用。 当然, VMM200还可以包括现有技术中已存在 的其它模块。
具体的, 该物理网卡管理装置 210用于: 创建一个或多个虚拟网卡; 将所述一个或多个虚拟网卡分别与物理网卡的各个功能模块关联, 所述 物理网卡的功能模块与与之关联的虚拟网卡之间通过数据流和控制流进 行通信, 所述数据流用于所述物理网卡的功能模块与与之关联的虚拟网 卡之间数据包的发送和接收, 所述控制流用于所述虚拟网卡对与之关联 的物理网卡的功能模块的控制; 通过对所述一个或多个虚拟网卡的管理 实现对所述物理网卡的管理。
在本发明的一些实施例中, 该物理网卡管理装置 210可以包括: 虚 拟网卡创建单元, 用于创建一个或多个虚拟网卡; 虚拟网卡关联单元, 用于将所述一个或多个虚拟网卡分别与物理网卡的各个功能模块关联, 所述物理网卡的功能模块与与之对应的虚拟网卡之间通过数据流和控制 流进行通信, 所述数据流用于二者之间数据包的发送和接收, 所述控制 流用于所述虚拟网卡对所述物理网卡的功能模块的控制; 虚拟网卡管理 单元, 用于通过对所述一个或多个虚拟网卡的管理实现对所述物理网卡 的管理。
另外, 该物理网卡管理装置 210的具体实现或功能模块划分可以参 考前述方法和装置实施例所述。
虚拟机 300包括客户操作系统 340、 虚拟处理器 310、 虚拟内存 320 以及虚拟硬盘 330, 并通过 VMM200提供的物理网卡管理装置 210使用 和管理虚拟网卡。
请参阅图 8, 为本发明实施例提供的另一种物理主机的结构示意图, 该物理主机包含多个客户操作系统(也可以理解为包含多个虚拟机), 客 户操作系统 1对带宽的需求为 llGbit/s,客户操作系统 2对带宽的需求为 2 Gbit/s, 客户操作系统 3对带宽的需求为 6 Gbit/s, 客户操作系统 4和客 户操作系统 5对带宽的需求都为 1 ;该物理主机还包括多种异构的物理网 卡: SRIOV网卡、 VMDQ网卡以及普通网卡, 其中, SRIOV网卡的带宽 为 10 Gbit/s, VMDQ网卡的带宽为 10 Gbit/s, 普通网卡 Eth7 ( Eth7是 普通网卡在 Linux操作系统下的一个示例) 的带宽为 1 Gbit/s。
如图 8所示, SRIOV网卡的一个 PF和多个 VF分别与一个 VN关联, VMDQ网卡的多个 VQ分别与一个 VN关联,普通网卡的 Eth7也与一个 VN关联, 所有 VN的带宽都设置为 1 Gbit/s。 根据客户操作系统 1对带 宽的需求和每个 VN的带宽, 将 11个 VN分配给客户操作系统 1使用, 这 11个 VN中有 10个来自于 SRIOV网卡的功能模块, 有 1个来自于 VMDQ网卡的功能模块, 由此可见本发明实施例提供的物理主机实现了 大量异构网卡资源的统一管理和分配。 对于客户操作系统 2至客户操作 系统 5依据同样的方式分配 VN, 参考图 8所示, 在此不再赘述。
综上, 本发明实施例提供的物理主机通过将每个物理网卡或物理网 卡的功能模块对应构造虚拟网卡 VN,这些 VN具有相同的数据结构和接 口, 从而向上层屏蔽了底层硬件的差异, 提供统一的接口和设备类型, 实现了大量异构网卡资源的统一管理和分配等, 进而提高了网络资源的 利用率。 进一步的, 这些网卡可以具有相同的带宽 (或者才艮据需求设置 不同的带宽), 可以通过序号区分, 排序, 然后在 VMM层里一起组成一 个 10虚拟池, 然后根据虚拟机的实际需求, 取出一定数量的 VN分配给 虚拟机使用。
本说明书中的各个实施例均采用递进的方式描述, 各个实施例之间 相同相似的部分互相参见即可, 每个实施例重点说明的都是与其他实施 例的不同之处。 尤其, 对于装置和系统实施例而言, 由于其基本相似于 方法实施例, 所以描述得比较简单, 相关之处参见方法实施例的部分说 明即可。
需说明的是, 以上所描述的装置实施例仅仅是示意性的, 其中所述
或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部 分或者全部模块来实现本实施例方案的目的。 另外, 本发明提供的装置 实施例附图中, 模块之间的连接关系表示它们之间具有通信连接, 具体 可以实现为一条或多条通信总线或信号线。 本领域普通技术人员在不付 出创造性劳动的情况下, 即可以理解并实施。 通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解 到本发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过 专用硬件包括专用集成电路、 专用 CPU、 专用存储器、 专用元器件等来 实现。 一般情况下, 凡由计算机程序完成的功能都可以很容易地用相应 的硬件来实现, 而且, 用来实现同一功能的具体硬件结构也可以是多种 多样的, 例如模拟电路、 数字电路或专用电路等。 但是, 对本发明而言 更多情况下软件程序实现是更佳的实施方式。 基于这样的理解, 本发明 形式体现出来, 该计算机软件产品存储在可读取的存储介质中, 如计算 机的软盘, U盘、 移动硬盘、 只读存储器(ROM, Read-Only Memory ), 随机存取存储器 (RAM, Random Access Memory ), 磁碟或者光盘等, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述的方法。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不 局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本 发明的保护范围应以所述权利要求的保护范围为准。

Claims

权 利 要 求
1、 一种物理网卡管理方法, 其特征在于, 所述物理网卡用于连接网络资 源, 所述方法应用于运行有一个或多个虚拟机的物理主机, 所述方法包括: 创建一个或多个虚拟网卡;
将所述一个或多个虚拟网卡分别与物理网卡的各个功能模块关联,所述物 理网卡的功能模块与与之关联的虚拟网卡之间通过数据流和控制流进行通信, 所述数据流用于所述物理网卡的功能模块与与之关联的虚拟网卡之间数据包 的发送和接收,所述控制流用于所述虚拟网卡对与之关联的物理网卡的功能模 块的控制;
通过对所述一个或多个虚拟网卡的管理实现对所述物理网卡的管理。
2、 根据权利要求 1所述的方法, 其特征在于, 所述将所述一个或多个虚 拟网卡分别与物理网卡的各个功能模块关联, 具体包括:
为所述虚拟网卡配置数据流接口,所述数据流接口包括所述虚拟网卡与与 之对应的物理网卡的功能模块之间的数据包的发送接口和数据包的接收接口; 将所述虚拟网卡的媒体访问控制层 MAC地址配置为与所述虚拟网卡对应 的物理网卡的功能模块的 MAC地址;
配置所述虚拟网卡的带宽;
为所述虚拟网卡注册 sysfs接口和 procfs接口, 所述 sysfs接口和 procfs 接口用于控制所述虚拟网卡的注册和销毁;
将所述虚拟网卡注册进操作系统内核。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述通过对所述一个 或多个虚拟网卡的管理实现对所述物理网卡的管理, 具体包括: 根据所述虚拟机的带宽需求确定满足所述带宽需求的一个或多个虚拟网 卡,所述虚拟网卡与同一物理网卡的功能模块关联或所述虚拟网卡与不同的物 理网卡的功能模块关联;
将所述一个或多个虚拟网卡分配给所述虚拟机使用。
4、 根据权利要求 1-3任一项所述的方法, 其特征在于, 所述物理网卡包 括: SRIOV网卡、 虚拟设备队列 VMDQ网卡和 /或普通网卡。
5、 根据权利要求 4所述的方法, 其特征在于, 当所述物理网卡为 SRIOV 网卡时, 所述物理网卡的功能模块包括虚拟功能 VF和物理功能 PF; 当所述 物理网卡为 VMDQ网卡时, 所述物理网卡的功能模块包括虚拟队列 VQ; 当 所述物理网卡为普通网卡时,所述普通网卡本身即为所述物理网卡的一个功能 模块。
6、 一种物理网卡管理装置, 其特征在于, 所述装置包括:
虚拟网卡创建单元, 用于创建一个或多个虚拟网卡;
虚拟网卡关联单元,用于将所述一个或多个虚拟网卡分别与物理网卡的各 个功能模块关联,所述物理网卡的功能模块与与之对应的虚拟网卡之间通过数 据流和控制流进行通信, 所述数据流用于二者之间数据包的发送和接收, 所述 控制流用于所述虚拟网卡对所述物理网卡的功能模块的控制;
虚拟网卡管理单元,用于通过对所述一个或多个虚拟网卡的管理实现对所 述物理网卡的管理。
7、 根据权利要求 6所述的装置, 其特征在于, 所述虚拟网卡关联单元具 体用于: 为所述虚拟网卡配置数据流接口, 所述数据流接口包括所述虚拟网卡 与与之对应的物理网卡的功能模块之间的数据包的发送接口和数据包的接收 接口; 将所述虚拟网卡的媒体访问控制层 MAC地址配置为与所述虚拟网卡对 应的物理网卡的功能模块的 MAC地址。 配置所述虚拟网卡的带宽; 为所述虚 拟网卡注册 sysfs接口和 procfs接口,所述 sysfs接口和 procfs接口用于控制所 述虚拟网卡的注册和销毁; 将所述虚拟网卡注册进操作系统内核。
8、 根据权利要求 6或 7所述的装置, 其特征在于, 所述虚拟网卡管理单 元具体用于:根据所述虚拟机的带宽需求确定满足所述带宽需求的一个或多个 虚拟网卡,所述虚拟网卡与同一物理网卡的功能模块关联或所述虚拟网卡与不 同的物理网卡的功能模块关联;将所述一个或多个虚拟网卡分配给所述虚拟机 使用。
9、 根据权利要求 6-8任一项所述的装置, 其特征在于, 所述物理网卡包 括: SRIOV网卡、 虚拟设备队列 VMDQ网卡和 /或普通网卡。
10、根据权利要求 9所述的装置,其特征在于, 当所述物理网卡为 SRIOV 网卡时, 所述物理网卡的功能模块包括虚拟功能 VF和物理功能 PF; 当所述 物理网卡为 VMDQ网卡时, 所述物理网卡的功能模块包括虚拟队列 VQ; 当 所述物理网卡为普通网卡时,所述普通网卡本身即为所述物理网卡的一个功能 模块。
11、 一种物理主机, 其特征在于, 所述物理主机包括: 硬件层, 运行在所 述硬件层之上的虚拟机监视器 VMM, 以及运行在所述 VMM上的虚拟机; 所述硬件层包括一个或多个物理网卡;
所述 VMM包括如权利要求 6-10任一项所述的物理网卡管理装置, 所述 理, 以便于所述虚拟机对所述硬件层的物理网卡的使用。
PCT/CN2013/073414 2012-10-25 2013-03-29 一种物理网卡管理方法、装置及物理主机 WO2014063463A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13849266.5A EP2892181B1 (en) 2012-10-25 2013-03-29 Method, device and physical host for managing physical network card
US14/676,191 US9780998B2 (en) 2012-10-25 2015-04-01 Method and apparatus for managing physical network interface card, and physical host

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210413377.0A CN102932174B (zh) 2012-10-25 2012-10-25 一种物理网卡管理方法、装置及物理主机
CN201210413377.0 2012-10-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/676,191 Continuation US9780998B2 (en) 2012-10-25 2015-04-01 Method and apparatus for managing physical network interface card, and physical host

Publications (1)

Publication Number Publication Date
WO2014063463A1 true WO2014063463A1 (zh) 2014-05-01

Family

ID=47646881

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073414 WO2014063463A1 (zh) 2012-10-25 2013-03-29 一种物理网卡管理方法、装置及物理主机

Country Status (4)

Country Link
US (1) US9780998B2 (zh)
EP (1) EP2892181B1 (zh)
CN (1) CN102932174B (zh)
WO (1) WO2014063463A1 (zh)

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932174B (zh) * 2012-10-25 2015-07-29 华为技术有限公司 一种物理网卡管理方法、装置及物理主机
CN103164255B (zh) * 2013-03-04 2016-08-03 华为技术有限公司 虚拟机网络通信实现方法和虚拟机监控器以及物理主机
CN104104518A (zh) * 2013-04-12 2014-10-15 南京南瑞继保电气有限公司 一种嵌入式系统中虚拟多个以太网控制器的方法
CN103312601B (zh) * 2013-05-31 2017-04-19 汉柏科技有限公司 用户态到内核态的数据报文处理方法
CN103428226B (zh) * 2013-08-30 2017-04-19 天津汉柏汉安信息技术有限公司 一种用户态与内核通信的方法与系统
CN103473136B (zh) * 2013-09-02 2017-06-13 华为技术有限公司 一种虚拟机的资源配置方法和通信设备
US9288135B2 (en) 2013-12-13 2016-03-15 International Business Machines Corporation Managing data flows in software-defined network using network interface card
CN103731514B (zh) * 2013-12-29 2017-01-18 国云科技股份有限公司 一种虚拟网络管理方法
CN103986614A (zh) * 2014-06-06 2014-08-13 浪潮电子信息产业股份有限公司 一种基于多mac地址的数据网与管理网融合共用方法
CN104168135B (zh) * 2014-08-06 2018-11-02 中国船舶重工集团公司第七0九研究所 网卡资源池化管理方法及系统
CN104219093B (zh) * 2014-08-30 2017-09-12 杭州华为数字技术有限公司 网卡功能配置方法和相关设备
CN104468311A (zh) * 2014-11-18 2015-03-25 浪潮(北京)电子信息产业有限公司 一种物理网卡虚拟成多个虚拟网卡的方法及系统
AU2015419335B2 (en) * 2015-12-31 2022-01-27 Razer (Asia-Pacific) Pte. Ltd. Methods for controlling a computing device, computer-readable media, and computing devices
CN105847053B (zh) * 2016-03-23 2019-04-09 成都民航空管科技发展有限公司 Linux系统下自动设置多网卡多网段任意绑定的方法及系统
CN107306234A (zh) * 2016-04-20 2017-10-31 北京亿阳信通科技有限公司 一种云平台资源分配系统和方法
CN106209449A (zh) * 2016-07-06 2016-12-07 天脉聚源(北京)传媒科技有限公司 一种绑定网卡的方法及装置
CN106250211A (zh) * 2016-08-05 2016-12-21 浪潮(北京)电子信息产业有限公司 一种基于sr_iov的虚拟化实现方法
CN106533700B (zh) * 2016-10-31 2021-03-02 新华三技术有限公司 一种接口功能的实现方法及装置
CN108023837B (zh) * 2016-10-31 2020-11-20 鸿富锦精密电子(天津)有限公司 虚拟网络交换机系统及其建立方法
CN106657433B (zh) * 2016-11-15 2020-03-10 郑州云海信息技术有限公司 一种多网卡环境下物理网卡的命名方法和装置
CN107005495B (zh) * 2017-01-20 2020-03-27 华为技术有限公司 用于转发数据包的方法、网卡、主机设备和计算机系统
CN106789363A (zh) * 2017-02-20 2017-05-31 郑州云海信息技术有限公司 一种向虚拟机配置网卡的方法及装置
US10243840B2 (en) * 2017-03-01 2019-03-26 Juniper Networks, Inc. Network interface card switching for virtual networks
CN108667750B (zh) * 2017-03-31 2021-01-29 华为技术有限公司 虚拟资源管理方法及装置
CN107643938A (zh) * 2017-08-24 2018-01-30 中国科学院计算机网络信息中心 数据传输方法、装置及存储介质
US11533271B2 (en) * 2017-09-29 2022-12-20 Intel Corporation Technologies for flexible and automatic mapping of disaggregated network communication resources
CN107832242A (zh) * 2017-10-31 2018-03-23 郑州云海信息技术有限公司 一种数据传输方法、系统、装置及计算机可读存储介质
CN109768871B (zh) * 2017-11-09 2022-09-16 阿里巴巴集团控股有限公司 配置多个虚拟网卡的方法、宿主机和存储介质
CN108614726B (zh) 2018-03-22 2022-06-10 华为云计算技术有限公司 虚拟机创建方法及装置
CN109525515B (zh) * 2018-10-23 2021-04-30 郑州云海信息技术有限公司 一种云平台中网卡的管理方法和装置
CN110505164B (zh) * 2019-07-25 2022-05-31 联想(北京)有限公司 虚拟设备的处理方法及电子设备
CN111147391B (zh) * 2019-12-05 2023-04-07 深圳市任子行科技开发有限公司 DPDK用户态与linux内核网络协议栈之间的数据传输方法及系统
CN111488219B (zh) * 2020-04-07 2022-08-02 中国科学院自动化研究所 用于高速数据采集系统的以太网数据流记录方法
CN112463255B (zh) * 2020-12-10 2024-06-07 广州极飞科技股份有限公司 虚拟接口加载方法和装置、物理网卡及存储介质
CN112615889B (zh) * 2020-12-30 2022-11-04 绿盟科技集团股份有限公司 一种网络攻击处理方法、探针设备和电子设备
CN113438184B (zh) * 2021-06-25 2022-09-06 北京汇钧科技有限公司 网卡的队列管理方法、装置及电子设备
CN114710774A (zh) * 2022-03-04 2022-07-05 阿里云计算有限公司 资源管理方法、设备及存储介质
CN115665026A (zh) * 2022-09-26 2023-01-31 京东科技信息技术有限公司 一种集群组网的方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076155A1 (en) * 2003-10-01 2005-04-07 Lowell David E. Runtime virtualization and devirtualization of I/O devices by a virtual machine monitor
CN102368725A (zh) * 2011-09-09 2012-03-07 北京东方网信科技股份有限公司 一种多网卡的数据接收方法及系统
CN102609298A (zh) * 2012-01-11 2012-07-25 中国科学技术大学苏州研究院 基于硬件队列扩展的网卡虚拟化系统及其方法
CN102932174A (zh) * 2012-10-25 2013-02-13 华为技术有限公司 一种物理网卡管理方法、装置及物理主机

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7792140B2 (en) * 2006-06-30 2010-09-07 Oracle America Inc. Reflecting the bandwidth assigned to a virtual network interface card through its link speed
US7965714B2 (en) * 2008-02-29 2011-06-21 Oracle America, Inc. Method and system for offloading network processing
JP2012048546A (ja) * 2010-08-27 2012-03-08 Hitachi Ltd 計算機システム、i/oデバイス制御方法、及びi/oドロワ

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076155A1 (en) * 2003-10-01 2005-04-07 Lowell David E. Runtime virtualization and devirtualization of I/O devices by a virtual machine monitor
CN102368725A (zh) * 2011-09-09 2012-03-07 北京东方网信科技股份有限公司 一种多网卡的数据接收方法及系统
CN102609298A (zh) * 2012-01-11 2012-07-25 中国科学技术大学苏州研究院 基于硬件队列扩展的网卡虚拟化系统及其方法
CN102932174A (zh) * 2012-10-25 2013-02-13 华为技术有限公司 一种物理网卡管理方法、装置及物理主机

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2892181A4 *

Also Published As

Publication number Publication date
CN102932174A (zh) 2013-02-13
EP2892181A1 (en) 2015-07-08
US20150207678A1 (en) 2015-07-23
EP2892181B1 (en) 2017-10-04
EP2892181A4 (en) 2015-09-30
CN102932174B (zh) 2015-07-29
US9780998B2 (en) 2017-10-03

Similar Documents

Publication Publication Date Title
WO2014063463A1 (zh) 一种物理网卡管理方法、装置及物理主机
US10649798B2 (en) Virtual switching method, related apparatus, and computer system
US20100287262A1 (en) Method and system for guaranteed end-to-end data flows in a local networking domain
US8776090B2 (en) Method and system for network abstraction and virtualization for a single operating system (OS)
EP3206339B1 (en) Network card configuration method and resource management center
US11301303B2 (en) Resource pool processing to determine to create new virtual resource pools and storage devices based on currebt pools and devices not meeting SLA requirements
US9176767B2 (en) Network interface card device pass-through with multiple nested hypervisors
US10397132B2 (en) System and method for granting virtualized network function life cycle management
US10489207B2 (en) System for resource management using performance specification and description information of the process
US20150113114A1 (en) Network interface adapter registration method, driver, and server
US20110032944A1 (en) Method and System for Switching in a Virtualized Platform
WO2017162089A1 (zh) 网络服务的业务配置方法和装置
WO2020024413A1 (zh) 一种云计算平台部署的控制方法、服务器及存储介质
JP2007158870A (ja) 仮想計算機システム及びそのネットワーク通信方法
WO2014169870A1 (zh) 虚拟网元自动装载及虚拟机ip地址获取的方法与系统、存储介质
EP3125504B1 (en) Resource allocation method, packet communication method and device
KR102022441B1 (ko) 하드웨어 가속 방법 및 관련 장치
US8566847B2 (en) Out-of-band host management via a management controller
US20170322788A1 (en) Parallel distribution of application services to virtual nodes
Wang et al. Build an SR-IOV hypervisor
JP2012160981A (ja) 管理サーバ装置、仮想マシン間ネットワーク構成システム及びそれらに用いるネットワーク構成方法
CN114629794A (zh) 硬件资源管理方法及通信装置

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: 13849266

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2013849266

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013849266

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE