WO2014023110A1 - 网络接口适配器注册方法及驱动设备、服务器 - Google Patents

网络接口适配器注册方法及驱动设备、服务器 Download PDF

Info

Publication number
WO2014023110A1
WO2014023110A1 PCT/CN2013/073952 CN2013073952W WO2014023110A1 WO 2014023110 A1 WO2014023110 A1 WO 2014023110A1 CN 2013073952 W CN2013073952 W CN 2013073952W WO 2014023110 A1 WO2014023110 A1 WO 2014023110A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
interface adapter
server
network interface
virtual
Prior art date
Application number
PCT/CN2013/073952
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 华为技术有限公司
Publication of WO2014023110A1 publication Critical patent/WO2014023110A1/zh
Priority to US14/584,597 priority Critical patent/US20150113114A1/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/20Network management software packages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Definitions

  • the present invention relates to communications technologies, and in particular, to a network interface adapter registration method, a driving device, and a server. Background technique
  • a traditional single-queue network interface adapter (referred to as a network card) has evolved into a multi-queue network card that supports hardware virtualization through a multi-queue network card.
  • Multi-queue NICs have multiple transceiver queues that can simultaneously send and receive data, improving network performance.
  • the chip manufacturer transferred the function of the Virtual Machine Monitor (VMM) distribution packet to the chip, and a multi-queue network card supporting virtualization was emerged.
  • VMM Virtual Machine Monitor
  • VMDq Virtual Machine Device Queue
  • SR-IOV Single Root LOV
  • the VMDq network card contains multiple hardware queues, and the network card will receive the data packets according to the Medium Access Control (MAC) address or the virtual local area network identity (Virtual Local Area Network).
  • MAC Medium Access Control
  • Virtual Local Area Network Virtual Local Area Network
  • VLAN IDentity distributes packets to different hardware queues.
  • a hardware queue is selected for data transmission according to the data feature value (such as the source MAC address, the source VLAN ID, or the corresponding hash value, etc.).
  • the VMDq NIC driver registers a network device (net_device) with the kernel and manages all its hardware queues.
  • each hardware queue corresponds to an abstraction, and the abstraction manages the hardware queue, and saves the description information of the data packet (such as the sending time stamp of the data packet, the data packet protocol, etc.).
  • a soft switch such as the L2 Software Switch
  • the L2 Software Switch implements mapping of hardware queue abstractions and applications in network devices so that applications can receive data from other physical machines in the same local area network. For example, when the application sends data, the data is first sent to the soft switch, and the soft switch selects the physical queue for transmission. The switch implements the mapping, so that the application cannot manage and directly operate the single hardware queue. Further, if one of the hardware queues is incorrect, the entire network card may be reset, affecting other application services. Summary of the invention
  • the present invention provides a network interface adapter registration method, a driving device, and a server, which are used to solve the problem that the single hardware queue of the network interface adapter cannot be managed and directly operated in the prior art. problem.
  • the method for registering a network interface adapter provided by the present invention includes:
  • the server's drive device registers the network interface adapter with the server core as a physical network device
  • the driving device registers some or all of the hardware queue transceiver groups of the network interface adapter to the server core as independent virtual network devices;
  • the physical network device is configured to manage the network interface adapter and all virtual network devices, and the virtual network device is configured to receive or send data of an application or a chip in the server.
  • the network interface adapter registration method provided by the present invention includes:
  • the drive device of the server registers all the hardware queue transceiver groups of the network interface adapter to the server core as independent virtual network devices;
  • the driving device selects one of the virtual network devices to manage the other virtual network devices.
  • the driving device provided by the present invention includes:
  • the first registration unit is configured to register the network interface adapter to the server core as a physical network Equipment
  • a second registration unit configured to register some or all of the hardware queue output groups of the network interface adapter to the server core as independent virtual network devices
  • the physical network device is configured to manage the network interface adapter and all virtual network devices, and the virtual network device is configured to receive or send data of an application or a chip in the server.
  • the driving device provided by the present invention includes:
  • a registration unit configured to register all hardware queue transceiver groups of the network interface adapter to the server core as separate virtual network devices
  • a selecting unit configured to select one of the virtual network devices to manage the other virtual network device.
  • the server provided by the present invention comprises: the driving device according to any one of the inventions.
  • the network interface adapter registration method, the driving device, and the server of the embodiment of the present invention register the network interface adapter as a physical network device by using the driving device, and send and receive some/all hardware queues of the network interface adapter to the server.
  • the kernel is registered as a separate virtual network device, and the physical network device manages a virtual network device for receiving or transmitting data of an application or a chip in the server, thereby solving the problem that the single hardware queue of the network interface adapter cannot be performed in the prior art. Management and direct operation issues.
  • Figure 1 is a schematic diagram of data transmission and reception in a network device in a KVM policy
  • FIG. 2 is a schematic flow chart of a method for registering a network interface adapter according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a mapping of a virtual network device according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a method for registering a network interface adapter according to an embodiment of the present invention
  • FIG. 5 is a network interface adapter according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of mapping of a virtual network device according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of a method for registering a network interface adapter according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a driving device according to an embodiment of the present invention.
  • FIG. 8B is a schematic structural diagram of a driving device according to another embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a driving device according to another embodiment of the present invention. detailed description
  • the network adapter is simply referred to as a network card in the present invention, and the hardware queue is simply referred to as a team ⁇ 1.
  • the VMDq NIC queues are managed separately, and at the same time try to be compatible with the traditional single-queue NIC.
  • the VM Dq driver registers a Vqueue in the operating system DomO (kernel) with a traditional network card queue or a transceiver group of the VM Dq network card to shield the hardware difference between the traditional network card and the VMDq network card.
  • KVM needs to start a qemu process in DomO.
  • This process is a back-end service program, which is mainly responsible for the interaction between the virtual machine and the network card driver.
  • the virtual machine front-end driver provides the header information and the packet address to the qemu process, qemu sends the system call of the asynchronous IO, and the system call transfers the request to the network device (such as the network card) through the driver; when the network card receives After the data, the driver will send status information to qemu, and qemu will notify the corresponding virtual machine based on the header information.
  • the invention provides a network interface adapter registration method, which utilizes the hardware features of the current VMDq network card to realize independent management and operation of a single queue of the network interface adapter, thereby reducing the mutual influence between the queues.
  • FIG. 2 is a schematic diagram of a network interface adapter registration method according to an embodiment of the present invention. As shown in FIG. 2, the network interface adapter registration method in this embodiment is as follows.
  • the server driver device registers the network interface adapter (referred to as the network card) to the server core as a physical network device.
  • the network interface adapter referred to as the network card
  • the server core is a server operating system kernel, such as a linux kernel.
  • the aforementioned network card is a hardware multi-queue network card.
  • the above network card may be a VMDq network card, an intelligent network interface card (iNIC) network card, and/or an SR-IOV network card.
  • VMDq belongs to the first generation hardware virtualization technology in Intel virtual network virtualization
  • SR-IOV belongs to the second generation hardware virtualization technology in Intel network virtualization.
  • the foregoing physical network device may be a physical device (PF) network device for managing and maintaining the entire network card.
  • PF physical device
  • input and output (Input Output, 10 for short) resources For example, apply for input and output (Input Output, 10 for short) resources, establish link connection relationships, and so on.
  • the driving device registers part or all of the hardware queue transceiver group of the network interface adapter with the server core as a plurality of independent virtual network devices.
  • the physical network device is configured to manage the network card and all the virtual network devices, where the virtual network is used.
  • the device is used to receive or send data from an application or chip within the server.
  • the above virtual network device may be a virtual device (VF) network device, which can send and receive data, and complete its own traffic statistics and network link state monitoring.
  • the main function of the VF-like network device in this embodiment is to use the queue for data transmission, and also involves some management operations (such as responding to the management operation of the PF).
  • the foregoing virtual network device has its own hardware transceiver queue group,
  • MAC address IP address
  • VLAN ID data transceiving process interface
  • management tool interface such as ethtool interface
  • the network interface adapter registration method in this embodiment registers the network card as a physical network device by using the driving device, and registers part/all hardware queue transceiver groups of the network interface adapter as a virtual network device to the server core.
  • the physical network device manages multiple virtual network devices independently of each other, thereby solving the problem that the single hardware queue of the network interface adapter cannot be managed and directly operated in the prior art.
  • the single physical queue in the foregoing method presents a network device in the server, and the network device can directly be used by the application or the virtual machine, no longer needs the qemu service process, reduces the burden of the VMM, and presents a network device at the same time. , no need for special front and rear drive, simplify data transmission and reception process, achieve zero copy of data.
  • the above method can also shield the physical network card hardware differences and uniformly present the network device interface.
  • the difference between the VMDq network card, the SR-I0V network card, and the traditional single-queue network card is shielded.
  • Applications can be migrated between multiple network devices, which enables hot migration.
  • FIG. 3 is a schematic diagram of a mapping of a virtual network device according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a method for registering a network interface adapter according to an embodiment of the present invention
  • the server driver device registers the network card with the server core as a physical network device.
  • the above network card can be a VMDq network card.
  • the server core in this embodiment may be a kernel of a physical machine operating system, such as a Linux kernel.
  • the driving device registers all the hardware queues of the network card with the server core as independent virtual network devices.
  • the physical network device is used to manage the network card and all the virtual network devices, and the virtual network device is used to receive or send the server. Application or chip data.
  • the number of the foregoing virtual network devices is the same as the number of the hardware queue transceiver groups supporting the VM Dq function in the network card, and only one of the foregoing physical network devices. That is to say, there may be some NIC queues in the server that do not support the VMDq function.
  • each of the above virtual network devices has the function of a traditional network card, and each virtual network device can be independently configured and managed. For example: From the user's point of view, after the virtual network device is turned on, configure IP for it, change/set the MAC address, and possibly configure a VLAN ID, then send data to it, and exchange data through the device.
  • the ethtool management tool displays the hardware information, driver version, and firmware version of the NIC.
  • management and configuration mainly refer to the operation of the network device by using the ifconfig command and the ethtool command.
  • the driving device adds the MAC address of the virtual network device to the MAC address filtering list of the hardware queue corresponding to the network card.
  • the driving device adds the VLAN ID of the virtual network device to the VLAN ID filtering list of the hardware queue corresponding to the network card.
  • the MAC address of the virtual network device can be added to the MAC address filtering list corresponding to the network card.
  • the MAC address filtering list of this site is consistent with the existing MAC address filtering list, which is not described in detail in this embodiment.
  • the corresponding virtual network device is selected according to the data feature value (such as the VLAN ID), and then the data in the corresponding queue is sent through the virtual network device.
  • the data feature value such as the VLAN ID
  • the data packet contains a destination MAC address information, and the MAC address is compared with the MAC address filtering list.
  • the discovery is consistent with the MAC address in the MAC address filtering list, and the data packet can be distributed to the hardware receiving queue corresponding to the virtual network device according to the destination MAC address or the VLAN ID in the data packet.
  • the above network interface adapter registration method further includes the following step 304, which is not shown in FIG.
  • the driving device sets a soft switch in the server kernel for performing data interaction between multiple virtual machines in the server. At this point, the data between the virtual machines on the same server no longer takes the network card.
  • the memory area that both the virtual machine and the DomO can access is used as the skb data transmission. Save, you can achieve zero copy of the data; that is, open a soft switch in the DomO, when the data exchange between multiple virtual machines on the DomO host, the soft switch can be processed, no need to transfer data to Physical network devices transmit and receive, which in turn improves network efficiency.
  • the physical network card (such as the VMDq NIC) at the lowest level is registered to the server core as a PF-like network device, that is, a physical network device.
  • This physical network device manages all queues in the NIC.
  • a plurality of virtual VF network devices that is, virtual network devices, are registered with the server kernel, and the private data of the virtual network devices depends on "PF", but each virtual network The device corresponds to a specific hardware transceiver queue group.
  • the above virtual network device has its own independent MAC address, IP address, VLAN Group, etc. It has a complete data transmission and reception process, and can complete its own traffic statistics and network link status monitoring.
  • "VF” also has some management tool interfaces, such as the ethtool interface. At this time, the user can view the running status of the network, the drive information of the network device, and the hardware information through the management tool interface.
  • the physical network card at the lowest layer has a plurality of hardware transceiver queues, and the driving device registers a network device (net_device) of the PF class with the server core, and a private data area of the network device of the class PF (as shown in FIG. 3).
  • the private data is abstracted for each hardware queue, and the PF-like network devices manage these hardware queues in a unified manner.
  • the driving device registers each VMDq hardware queue group with a virtual network device (that is, a network device of a VF type) to the server core.
  • a virtual network device that is, a network device of a VF type
  • the VF private data area has only one queue group abstract description, and the abstraction is not re-pairing the hardware.
  • the queue is abstracted, but instead maps directly to the abstraction of the network device of class PF. Queues in each virtual network device Abstract mapping class The only queue abstraction in a PF's network device, from the perspective of a virtual network device, just as if it had a separate queue.
  • a virtual network device For a virtual network device, it has its own MAC address, IP address, and VLAN ID, and has its own network device operation interface and ethtool interface.
  • the driver When the VF is opened, the driver adds the MAC address of the virtual network device to the MAC address filtering list of the physical network device, so that when the network data is sent to the MAC address of the virtual network device, the physical network device directly The data is distributed to the receiving queue corresponding to this VF, so the VF has the same function as the traditional network card.
  • the above virtual network device can be directly used in the host of the server, or directly By bridging or otherwise using the virtual machine, it can also be aggregated by techniques such as bond to increase the bandwidth and then be used by a specific application or virtual machine.
  • FIG. 5 is a schematic flowchart of a network interface adapter registration method according to another embodiment of the present invention
  • FIG. 6 is a schematic diagram of mapping of a virtual network device according to an embodiment of the present invention. As shown in FIG. 6, the network interface adapter registration method in this embodiment is described below.
  • the server's drive device registers all VM Dq hardware queues of the network interface adapter with the server core to register the virtual network device.
  • the virtual network device in this step has a MAC address, an IP address, a VLAN ID, a data transceiving process interface, and a management tool interface.
  • the driving device selects one of the virtual network devices to manage all virtual network devices.
  • a virtual network device of the virtual network device selected by the driving device manages common resources of all the virtual network devices, such as 10 information related to a Peripheral Component Interconnect Express (PCIe).
  • PCIe Peripheral Component Interconnect Express
  • the network card in this embodiment may be a hardware multi-queue network card, such as a VMDq network card, an iNIC network card, or the like.
  • each queue transceiver group can be regarded as an independent traditional single-queue network card. They share the same physical port and connect to the external physical switch.
  • These single queue groups are respectively registered as a VF-like network device, that is, a virtual network device.
  • the network device has an independent MAC address, an IP address, and a VLAN group, which can independently perform data transmission and reception, and has its own independent traffic statistics and status monitoring. The structure is shown in Figure 6.
  • each queue is registered as a virtual network device.
  • the network device private data area has a queue abstraction that abstractly describes the queue corresponding to the network device.
  • the drive device selects one of the virtual network devices (such as the shaded virtual network device in Figure 6) to manage all of the virtual network devices.
  • the queue mentioned in this section refers to the queue that supports the VMDq function.
  • some of the queues in some hardware do not necessarily support VMDq. That is, the virtual network device has its own independent MAC address, IP address and VLAN ID, and has independent data transceiving functions and management links.
  • each virtual network device has independent data links and management links, the operation does not affect other virtual network devices, but all network devices share one physical port, so a virtual network device with "privilege" is needed to maintain the overall link.
  • the virtual network device registered in queue 0 is used to undertake this work.
  • the above network interface adapter registration method further includes the steps not shown in the following figure
  • the driving device adds the MAC address of the virtual network device to the MAC address filtering list corresponding to the network adapter.
  • the driving device adds the VLAN ID of the virtual network device to the VLAN ID filtering list corresponding to the network card.
  • the VMDq network card is registered as a plurality of virtual network devices having independent network functions, and each virtual network device corresponds to only one queue receiving and dispatching group. Further, a privileged virtual network device exists in the virtual network device. The privileged virtual network device manages and maintains the network card. If a virtual network device/queue fails, the privileged virtual network device maintains the entire network card.
  • the above virtual network device can be directly used in the host of the server, or can be directly used by the virtual machine through bridging or other methods, or can be aggregated by technologies such as bond to increase bandwidth and then used by a specific application or virtual machine. .
  • FIG. 7 is a schematic flowchart of a network interface adapter registration method according to another embodiment of the present invention. As shown in FIG. 7, the network interface adapter registration method in this embodiment is as follows.
  • the server driving device registers the network card with the server core as a physical network device. 702.
  • the driving device registers part of the hardware queue transceiver group of the network card with the server core as multiple independent virtual network devices; the physical network device is used to manage all virtual network devices, and the virtual network device is used to receive or send the server application or Chip data.
  • the server core described above may be a physical machine operating system.
  • the driving device registers another group of virtual network devices of the network card with the other hardware queues of the network card. That is, the driving device sends the other hardware queues of the network card to the server.
  • the core registers another set of multiple virtual network devices that are independent of each other.
  • the physical network device is also used to manage another set of virtual network devices, and the other set of virtual network devices are used to receive or transmit data of applications or chips in the server.
  • the virtual network device in step 702 and the other virtual network device in step 703 are consistent at the user level, except that the process of forming the virtual network device is different.
  • the abstraction of the hardware queue is completed by the physical network device, and the virtual network device only performs a mapping.
  • the hardware queue is abstracted, but the user sees All are abstracted results.
  • the driving device selects any one of the virtual network devices as the class "PF" to manage the common resources of all the virtual network devices. However, if there is a physical network device, there is no need to set up a virtual network device of the class "PF".
  • the network interface adapter registration method of the embodiment solves the problem that the single hardware queue of the network interface adapter cannot be managed and directly operated in the prior art.
  • the network interface adapter registration method in this embodiment is mainly applied to a data center, and a server of a large network site has a plurality of heterogeneous network cards such as a traditional single-queue network card, a VMDq network card, and an SR-IOV network card, and different types of networks.
  • a server of a large network site has a plurality of heterogeneous network cards such as a traditional single-queue network card, a VMDq network card, and an SR-IOV network card, and different types of networks.
  • the driving device directly registers the physical queue of the VMDq network card into a virtual network device, and presents a unified network device interface upward, shielding the difference of the underlying hardware from the driver level, providing a unified interface and device type upward, and realizing Undifferentiated resource management and distribution of a large number of heterogeneous network cards.
  • the drive device in the present invention is a device driver within the server, and may also be part of the server operating system software, which can be implemented by software programming.
  • the present invention further provides a driving device.
  • the driving device in this embodiment includes: a first registration unit 81 and a second registration unit 82;
  • the first registration unit 81 is configured to register the network interface adapter with the server core as a physical network device; the second registration unit 82 is configured to register some or all of the hardware queue transceiver groups of the network interface adapter to the server core as Independent virtual network devices;
  • the physical network device is configured to manage the network interface adapter and all virtual network devices, and the virtual network device is configured to receive or send data of an application or a chip in the server.
  • the network card may be a hardware multi-queue network card, and the network card includes: a virtual machine device queue VMDq network card, and an iNIC network card.
  • the aforementioned virtual network device has a MAC address, an IP address, a VLAN ID address, a data transceiving process interface, and a management tool interface.
  • the driving device in this embodiment further includes: an adding unit 83; the adding unit is configured to add a MAC address of the virtual network device to a MAC address filtering list corresponding to the network adapter. Or, for adding the VLAN ID of the virtual network device to the VLAN ID filtering list corresponding to the network adapter.
  • the above driving device further includes: a setting unit (not shown), wherein the setting unit is configured to set a soft switch in the server kernel for performing data interaction between multiple virtual machines in the server .
  • the second registration unit of the driving device directly registers the physical queue of the VMDq network card into a virtual network device, and presents a unified network device interface upward, shielding the difference of the underlying hardware from the driver level, and providing a unified interface upwards and
  • the device type implements resource management and allocation of a large number of heterogeneous network cards without differentiation.
  • the present invention further provides a driving device, as shown in FIG. 9, the driving device in this embodiment includes: a registration unit 91, a selection unit 92;
  • the registration unit 91 is configured to register all the hardware queue transceiver groups of the network interface adapters into the server cores as separate virtual network devices.
  • the selecting unit 92 is configured to select the virtual network.
  • the network card may be a hardware multi-queue network card.
  • the network card includes: a virtual machine device queue VMDq network card, and an iNIC network card.
  • the aforementioned virtual network device has a MAC address, an IP address, a VLAN ID address, a data transceiving process interface, and an ethtool management tool interface.
  • the present invention provides a server, comprising: the drive device according to any of the embodiments of the present invention.
  • a server comprising: the drive device according to any of the embodiments of the present invention.
  • the driving device For a specific implementation of the driving device, reference may be made to other device or method embodiments of the present invention, and details are not described herein again.
  • the server provided by the embodiment of the present invention is applied to the driving device provided by the embodiment of the present invention.
  • the difference between the underlying hardware is shielded, and a unified interface and device type are provided upwards to implement resource management and allocation of a large number of heterogeneous network cards without differentiation.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the above method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

本发明提供一种网络接口适配器注册方法及驱动设备、服务器,其中,所述方法包括:服务器的驱动设备将网络接口适配器向服务器内核注册为物理网络设备;以及所述驱动设备将所述网络接口适配器的部分或全部硬件队列收发组向所述服务器内核注册虚拟网络设备;所述物理网络设备用于管理网络接口适配器及所有的虚拟网络设备,所述虚拟网络设备用于接收或发送服务器内应用或芯片的数据。上述方法解决了现有技术中无法对网络接口适配器的单一硬件队列进行管理和直接操作的问题。

Description

网络接口适配器注册方法及驱动设备、 服务器 技术领域
本发明涉及通信技术, 尤其涉及一种网络接口适配器注册方法及驱动 设备、 服务器。 背景技术
在虚拟化技术中, 首先出现了软件虚拟化技术, 但是由于软件虚拟化 辅助虚拟化, 从而大大提升虚拟化性能。 在虚拟化领域, 中央处理器 ( Central Processing Unit, 简称 CPU )及内存虚拟化已经相对成熟, 相 对而言, 输入输出端口 (input/output, 简称 I/O )虚拟化和网络虚拟化起 步相对较晚, 目前还不是艮成熟。
在网络领域, 已经由传统的单队列网络接口适配器(简称网卡)经过 多队列网卡发展为现在的支持硬件虚拟化的多队列网卡。 多队列网卡有多 个收发队列, 能够同时进行数据收发, 提升了网络的性能。 为了更好的支 持虚拟化技术, 芯片厂商将虚拟机管理器程序(Virtual Machine Monitor, 简称 VMM ) 分发数据包的功能转移到芯片上, 于是出现了支持虚拟化的 多队列网卡。
某些芯片厂商有自己的网络虚拟化技术如虚拟机设备队列 (Virtual Machine Device Queue, 简称 VMDq ) 和单才艮输入 /输出虚拟化 ( Single Root lOV, 简称 SR-IOV ) 。 其中, VMDq网卡包含多个硬件队列, 网卡 将收到的数据包根据介质访问控制层 (Medium Access Control , 简称 MAC ) 地址或者虚拟局域网身份标识 ( Virtual Local Area Network
IDentity, 简称 VLAN ID ) 将数据包分发到不同的硬件队列中。 当虚拟机 需要通过网卡发送数据到网络中时, 根据数据特征值 (如源 MAC地址、 源 VLAN ID或者对应的哈希值等) 选择一个硬件队列进行数据发送。
当前, 在 Linux Kernel Mainline中, VMDq网卡驱动设备向内核注册 一个网络设备( net_device ) , 对其所有硬件队列进行统一管理。 在注册 的网络设备中, 每个硬件队列对应一个抽象, 这个抽象对该硬件队列进行 管理, 同时保存有数据包的描述信息 (如数据包的发送时间戳、 数据包协 议等)。特别地,在 VMM层,存在一个软交换机(如 L2 Software Switch ) , 该交换机实现网络设备中硬件队列抽象与应用的映射, 这样应用就能够接 收到来自同一局域网中其他物理机的数据。 例如, 应用发送数据时, 首先 将数据发给软交换机, 由软交换机选择物理队列进行发送。 交换机实现映射, 使得应用无法对单一硬件队列进行管理和直接操作; 进 一步地, 若其中一个硬件队列出现错误, 可能导致整个网卡复位, 影响其 他应用业务。 发明内容
有鉴于此, 针对现有技术中的缺陷, 本发明提供一种网络接口适配器注 册方法及驱动设备、 服务器, 用于解决现有技术中无法对网络接口适配器 的单一硬件队列进行管理和直接操作的问题。
一方面, 本发明提供的网络接口适配器注册方法, 包括:
服务器的驱动设备将网络接口适配器向服务器内核注册为物理网络 设备; 以及
所述驱动设备将所述网络接口适配器的部分或全部硬件队列收发组 向所述服务器内核注册为各自独立的虚拟网络设备;
其中, 所述物理网络设备用于管理所述网络接口适配器及所有的虚拟 网络设备, 所述虚拟网络设备用于接收或发送服务器内应用或芯片的数 据。
另一方面, 本发明提供的网络接口适配器注册方法, 包括:
服务器的驱动设备将网络接口适配器的全部硬件队列收发组向所述 服务器内核注册为各自独立的虚拟网络设备;
所述驱动设备选取所述虚拟网络设备中的其中一个虚拟网络设备管 理所述其他的虚拟网络设备。
第三方面, 本发明提供的驱动设备, 包括:
第一注册单元, 用于将网络接口适配器向服务器内核注册为物理网络 设备;
第二注册单元, 用于将所述网络接口适配器的部分或全部硬件队列收 发组向所述服务器内核注册为各自独立的虚拟网络设备;
其中, 所述物理网络设备用于管理所述网络接口适配器及所有的虚拟 网络设备, 所述虚拟网络设备用于接收或发送服务器内应用或芯片的数 据。
第四方面, 本发明提供的驱动设备, 包括:
注册单元, 用于将网络接口适配器的全部硬件队列收发组向所述服务 器内核注册为各自独立的虚拟网络设备;
选取单元, 用于选取所述虚拟网络设备中的其中一个虚拟网络设备管 理所述其他的虚拟网络设备。
第五方面, 本发明提供的服务器, 包括: 本发明任一所述的驱动设备。 由上述技术方案可知, 本发明实施例的网络接口适配器注册方法及驱 动设备、 服务器, 通过驱动设备将网络接口适配器注册为物理网络设备, 以及将网络接口适配器的部分 /全部硬件队列收发组向服务器内核注册为 各自独立的虚拟网络设备, 实现了物理网络设备管理用于接收或发送服务 器内应用或芯片的数据的虚拟网络设备, 进而解决了现有技术中无法对网 络接口适配器的单一硬件队列进行管理和直接操作的问题。 附图说明
为了更清楚地说明本发明的技术方案, 下面将对实施例中所需要使用的 附图作一简单地介绍, 显而易见地: 下面附图只是本发明的一些实施例的附 图, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可 以根据这些附图获得同样能实现本发明技术方案的其它附图。
图 1为 KVM策略中网络设备中数据收发的示意图;
图 2为本发明一实施例提供的网络接口适配器注册方法的流程示意 图;
图 3为本发明一实施例提供的虚拟网络设备的映射的示意图; 图 4为本发明一实施例提供的网络接口适配器注册方法的流程示意图; 图 5为本发明一实施例提供的网络接口适配器注册方法的流程示意 图;
图 6为本发明一实施例提供的虚拟网络设备的映射的示意图;
图 7为本发明一实施例提供的网络接口适配器注册方法的流程示意 图;
图 8A为本发明一实施例提供的驱动设备的结构示意图;
图 8 B为本发明另一实施例提供的驱动设备的结构示意图;
图 9为本发明另一实施例提供的驱动设备的结构示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合本发明实 施例中的附图, 对本发明的技术方案进行清楚、 完整地描述。 显然, 下述 的各个实施例都只是本发明一部分的实施例。 基于本发明下述的各个实施 例, 本领域普通技术人员即使没有作出创造性劳动, 也可以通过等效变换 部分甚至全部的技术特征, 而获得能够解决本发明技术问题, 实现本发明 技术效果的其它实施例, 而这些变换而来的各个实施例显然并不脱离本发 明所公开的范围。
为描述方便, 本发明中将网络适配器简称为网卡, 硬件队列简称为队 歹1。
当前, 为解决单一队列无法管理和操作的问题, 在 KVM策略中, 如 图 1所示,将 VMDq网卡队列进行单独管理, 同时尝试与传统的单队列网 卡进行兼容。 VM Dq驱动将传统网卡的队列或者 VM Dq网卡的一个收发队 列组在操作系统 DomO (内核) 中注册一个 Vqueue, 用于屏蔽传统网卡 与 VMDq网卡的硬件差异。
同时, KVM需要在 DomO开启一个 qemu进程, 这个进程是一个后 端服务程序, 主要负责虚拟机与网卡驱动的交互工作。 在虚拟机端, 需要 有一个前端网卡驱动。 在数据接收链路中, 虚拟机前端驱动向 qemu进程 提供头信息和数据包地址, qemu会发送异步 IO的系统调用, 系统调用通 过驱动将请求转给网络设备(如网卡);当网卡收到数据后,驱动会向 qemu 发送状态信息, qemu会根据头信息通知对应的虚拟机。
上述技术虽在某种程度上屏蔽 VMDq与传统网卡差异,但并不能屏蔽 与 SR-IOV网卡差异。 上述数据收发可以实现数据零拷贝, 但是整体流程 复杂且为异步, 不利于数据量较大的业务场景, 同时后端服务本身成为一 个瓶颈。 进一步地, 上述技术使用的是前后端模式, 需额外驱动, 同时存 在单一对应关系, 不便于热迁移。 也就是说, 当服务器中存在多种不同类 型的网卡, 虚拟机使用某一种网卡时, 必须使用特定的驱动, 此时, 无法 实现服务器中虚拟机的热迁移。
本发明提供一种网络接口适配器注册方法,其利用了当前 VMDq网卡 的硬件特点, 实现对网络接口适配器的单一队列进行独立管理和操作, 减 少了队列间的相互影响。
图 2示出了本发明一实施例提供的网络接口适配器注册方法的流程示 意图, 如图 2所示, 本实施例中的网络接口适配器注册方法如下文所述。
201、 服务器的驱动设备将网络接口适配器 (简称网卡) 向服务器内 核注册为物理网络设备。
在本实施例中, 上述的服务器内核为服务器操作系统内核, 如 linux 内核等。前述的网卡为硬件多队列网卡。举例来说,上述的网卡可为 VMDq 网卡、 智能网络接口卡 ( Intelligent Network Interface Card , 简称 iNIC ) 网卡和 /或 SR-IOV网卡。 应了解的是, VMDq属于 intel (因特尔) 网络虚 拟化中的第一代硬件虚拟技术, SR-IOV属于 intel网络虚拟化中的第二代 硬件虚拟技术。
在本实施例中,前述的物理网络设备可以是一个类物理功能( physical function , 简称 PF ) 的网络设备, 用来管理和维护整个网卡。 例如, 为网 卡申请输入输出 (Input Output, 简称 10 ) 资源、 建立链路连接关系等。
202、 驱动设备将网络接口适配器的部分或全部硬件队列收发组向服 务器内核注册为多个各自独立的虚拟网络设备; 其中, 物理网络设备用于 管理网卡及所有的虚拟网络设备, 所述虚拟网络设备用于接收或发送服务 器内应用或芯片的数据。
上述的虚拟网络设备可以是一个类虚拟功能 (virtual function , 简称 VF )的网络设备, 可以收发数据, 以及完成自己的流量统计和网络链接状 态监控等。 本实施例中的类 VF的网络设备主要功能是负责使用队列进行 数据传输, 同时涉及到一些管理操作 (如响应 PF的管理操作) 等。 在本实施例中, 上述的虚拟网络设备具有自己的硬件收发队列组, 有
MAC地址、 IP地址、 VLAN ID、 数据收发流程接口, 以及管理工具接口 (如 ethtool接口) 等。
由上述实施例可知, 本实施例的网络接口适配器注册方法, 通过驱动 设备将网卡注册为物理网络设备,以及将网络接口适配器的部分 /全部硬件 队列收发组向服务器内核注册为虚拟网络设备, 实现了物理网络设备管理 相互独立的多个虚拟网络设备, 进而解决了现有技术中无法对网络接口适 配器的单一硬件队列进行管理和直接操作的问题。
进一步地, 上述方法中的单个物理队列在服务器中呈现出一个网络设 备, 该网络设备直接可以给应用或者虚拟机使用, 不再需要 qemu服务进 程, 减轻 VMM负担, 同时呈现出的是一个网络设备, 不再需要特殊的前 后端驱动, 简化数据收发流程, 实现数据零拷贝。
当然, 上述方法还可以屏蔽掉物理网卡硬件差异性, 向上统一呈现网 络设备接口, 对服务器而言, 即屏蔽掉 VMDq网卡, SR-I0V网卡, 传统 单队列网卡等异构网卡的差异性, 使应用能在多个网络设备之间迁移, 即 可以实现热迁移。
结合图 3和图 4所示, 图 3示出了本发明一实施例提供的虚拟网络设 备的映射的示意图, 图 4示出了本发明一实施例提供的网络接口适配器注 册方法的流程示意图;
301、 服务器的驱动设备将网卡向服务器内核注册为物理网络设备。 举例来说, 上述的网卡可为 VMDq网卡。 另外, 本实施例中的服务器 内核可为物理机操作系统的内核, 如 linux内核等。
302、 驱动设备将网卡的全部硬件队列收发组向服务器内核注册为各 自独立的虚拟网络设备; 其中, 物理网络设备用于管理网卡及所有的虚拟 网络设备, 虚拟网络设备用于接收或发送服务器内应用或芯片的数据。
在实际应用中,上述虚拟网络设备的数量与网卡中支持 VM Dq功能的 硬件队列收发组的数量一致, 上述的物理网络设备只有一个。 也就是说, 月良务器内可能存在一些网卡的队列不支持 VMDq功能。
当然, 理想状态下, 月良务器内只有 VMDq网卡时, VMDq网卡的硬件 队列收发组的数量与虚拟网络设备的数量是一致的。 上述每一虚拟网络设备均具有传统网卡的功能, 每个虚拟网络设备均 能进行独立的配置和管理。 举例来说: 从用户角度来看, 在虚拟网络设备 打开后,为其配置 IP,改变 /设置 MAC地址,可能还会配置一个 VLAN ID , 然后向其发送数据, 通过该设备进行数据交换, 通过 ethtool管理工具查 看网卡的硬件信息,驱动版本,固件版本等信息。在其他实施例中,在 linux 下,管理和配置主要指通过 ifconfig命令和 ethtool命令对网络设备进行操 作。
303、 驱动设备将虚拟网络设备的 MAC地址添加到与网卡对应硬件 队列的 MAC地址过滤列表中。
或者, 驱动设备将所述虚拟网络设备的 VLAN ID添加到与网卡对应 硬件队列的 VLAN ID过滤列表中。
可以理解的是, 在虚拟网络设备打开时, 可将虚拟网络设备的 MAC 地址添加到与网卡对应的 MAC地址过滤列表中。
该处的 MAC地址过滤列表与现有的 MAC地址过滤列表一致, 本实 施例中不对其进行详细说明。
若服务器中的虚拟机使用上述一个虚拟网络设备发送数据, 则根据数 据特征值(如 VLAN ID )等选择对应的虚拟网络设备, 进而, 通过虚拟网 络设备将对应的队列中的数据进行发送。 在接收数据时, 由于虚拟网络设 备具有 MAC地址或者 VLAN地址, 当物理网络设备接收到数据包时, 数 据包里面包含一个目的 MAC地址的信息, 此时把这个 MAC地址与 MAC 地址过滤列表进行对比, 发现跟 MAC地址过滤列表中的 MAC地址一致, 可根据数据包中的目的 MAC地址或者 VLAN ID可将数据包分发到虚拟网 络设备对应的硬件接收队列。 由此, 在上述数据的接收和发送, 不再需要 现有技术中的软交换机来实现队列选择与映射。
进一步地, 上述的网络接口适配器注册方法还包括如下的图 4中未示 出的步骤 304。
304、 驱动设备在服务器内核中设置一软交换机, 用于使服务器内的 多个虚拟机进行数据交互。 此时, 同一台服务器上虚拟机之间数据不再走 网卡。
也就是说,将虚拟机与 DomO都能访问的内存区作为 skb数据传输内 存,可以实现数据的零拷贝;即在 DomO中开启一个软交换机,当在 DomO 主机上多个虚拟机之间进行数据交换时, 可以由软交换机去进行处理, 而 不再需要将数据转给物理网络设备进行发送和接收, 进而提高网络效率。
如图 3所示, 将位于最底层的物理网卡(如 VMDq网卡)向服务器内 核注册为一个类 PF的网络设备即物理网络设备, 这个物理网络设备管理 网卡中所有队列。 当 "PF" 注册成功后, 根据网卡的 VMDq队列数, 向 服务器内核注册多个虚拟的类 VF的网络设备即虚拟网络设备, 这些虚拟 网络设备私有数据依赖于 "PF" , 但每个虚拟网络设备对应于一个具体的 硬件收发队列组。上述的虚拟网络设备有自己独立的 MAC地址, IP地址, VLAN Group等, 拥有完整的数据收发流程, 能够完成自己的流量统计和 网络链接状态监控。 "VF" 还拥有一些管理工具接口, 如 ethtool接口, 此时用户可以通过管理工具接口查看网络的运行状态, 网络设备的驱动信 息、 硬件信息等。
另外, 在图 3中, 位于最底层的物理网卡具有多个硬件收发队列, 驱 动设备向服务器内核注册一个类 PF的网络设备(net_device ) , 类 PF 的网络设备的私有数据区 (如图 3中的 private data )对每一个硬件队列 进行抽象, 类 PF的网络设备对这些硬件队列进行统一管理。
在 PF注册成功之后, 驱动设备将每一 VMDq硬件队列组向服务器内 核注册一个虚拟网络设备(即类 VF的网络设备) , 这个 VF私有数据区 只有一个队列组抽象描述, 这个抽象不是重新对硬件队列进行抽象, 而是 将直接映射到类 PF的网络设备的抽象中去。 每个虚拟网络设备中的队列 抽象映射类 PF的网络设备中唯一的队列抽象, 从虚拟网络设备角度看, 就像他自己拥有一个独立的队列一样。
对于虚拟网络设备, 它有自己的 MAC地址, IP地址和 VLAN ID, 有 自己的网络设备操作接口和 ethtool接口。
VF打开时,驱动程序将该虚拟网络设备的 MAC地址添加到物理网络 设备的 MAC地址过滤列表中去, 这样当有网络数据发送到这个虚拟网络 设备的 MAC地址时, 物理网络设备就会直接将数据分发到这个 VF对应 的接收队列, 于是 VF就拥有了和传统网卡一样的功能。
上述的虚拟网络设备可以直接在服务器的主机中使用, 也可以直接通 过桥接或者其他方式给虚拟机使用, 亦可以通过 bond等技术对其进行聚 合等以增加带宽然后供特定的应用或者虚拟机使用。
在另一应用场景中, 图 5示出了本发明另一实施例提供的网络接口适 配器注册方法的流程示意图,图 6为本发明一实施例提供的虚拟网络设备的 映射的示意图, 结合图 5和图 6所示, 本实施例中的网络接口适配器注册 方法 ¾口下文所述。
501、 服务器的驱动设备将网络接口适配器的全部 VM Dq硬件队列收 发组向服务器内核注册虚拟网络设备。
该步骤中的虚拟网络设备具有 MAC地址、 IP地址、 VLAN ID、 数据 收发流程接口, 以及管理工具接口。
502、 驱动设备选取虚拟网络设备中的其中一个虚拟网络设备管理所 有的虚拟网络设备。
具体地, 上述驱动设备选取的虚拟网络设备的一个虚拟网络设备管理 所有虚拟网络设备的公共资源, 如高速外围组件互联(Peripheral Component Interconnect Express, 简称 PCIe )相关的 10信息等。
本实施例中的网卡可为硬件多队列网卡, 如 VMDq网卡、 iNIC网卡 等。
当前, 网卡多队列收发组之间相互独立, 因此可以将每一个队列收发 组分别看成独立的传统单队列网卡, 他们共享同一个物理端口连接到外部 物理交换机。 这些单队列组分别被注册为一个类 VF的网络设备即虚拟网 络设备, 网络设备有独立的 MAC地址, IP地址和 VLAN Group, 能够独 立完成数据收发, 有自己独立的流量统计和状态监控, 层次结构如图 6所 示。
在图 6中, 将每一个队列注册成一个虚拟网络设备, 网络设备私有数 据区有一个队列抽象, 抽象描述网络设备对应的队列。 驱动设备选取虚拟 网络设备中的其中一个虚拟网络设备(如图 6中阴影的虚拟网络设备)管 理所有的虚拟网络设备。
对于注册的虚拟网络设备, 拥有与传统单队列网卡完全相同的功能和 结构。 需要注意的是, 该处提及的队列是指支持 VMDq功能的队列, 实际 中某些硬件中的部分队列并不一定都支持 VMDq。 也就是,虚拟网络设备有自己独立的 MAC地址, IP地址和 VLAN ID, 拥有独立的数据收发功能和管理链路。
由于各虚拟网络设备具有独立的数据链路和管理链路, 操作不会影响 其他虚拟网络设备, 但是所有网络设备共享一个物理端口, 所以需要一个 有 "特权" 的虚拟网络设备来维护整体链路, 通常选用队列 0注册的虚拟 网络设备来承担这个工作。
优选地, 上述网络接口适配器注册方法还包括如下图中未示出的步骤
503。
503、 驱动设备将虚拟网络设备的 MAC地址添加到与网络适配器对 应的 MAC地址过滤列表中。
或者, 驱动设备将所述虚拟网络设备的 VLAN ID添加到与网卡对应 的 VLAN ID过滤列表中。
上述网络接口适配器注册方法中将 VMDq网卡注册成为多个有独立 网络功能的虚拟网络设备, 每个虚拟网络设备对应唯——个队列收发组, 进一步地, 虚拟网络设备中存在特权虚拟网络设备, 特权虚拟网络设备对 网卡进行管理和维护, 若一个虚拟网络设备 /队列出错, 特权虚拟网络设备 对整个网卡进行维护。
上述的虚拟网络设备可以直接在服务器的主机中使用, 也可以直接通 过桥接或者其他方式给虚拟机使用, 亦可以通过 bond等技术对其进行聚 合等以增加带宽然后供特定的应用或者虚拟机使用。
在再一应用场景中, 图 7示出了本发明另一实施例提供的网络接口适 配器注册方法的流程示意图, 如图 7所示, 本实施例中的网络接口适配器 注册方法如下文所述。
701、 服务器的驱动设备将网卡向服务器内核注册为物理网络设备。 702、 驱动设备将网卡的部分硬件队列收发组向服务器内核注册为多 个相互独立的虚拟网络设备; 物理网络设备用于管理所有的虚拟网络设 备, 虚拟网络设备用于接收或发送服务器内应用或芯片的数据。
在本实施例中, 上述的服务器内核可为物理机操作系统。
703、 驱动设备将网卡的其他硬件队列收发组向服务器内核注册另一 组虚拟网络设备。 即, 驱动设备将网卡的其他硬件队列收发组向服务器内 核注册另一组相互独立的多个虚拟网络设备。
当然, 该处物理网络设备也用于管理另一组虚拟网络设备, 该另一组 虚拟网络设备用于接收或发送服务器内应用或芯片的数据。
本实施例中步骤 702中的虚拟网络设备和步骤 703中的另一虚拟网络 设备在用户层面是一致的, 区别仅在于, 上述虚拟网络设备的形成过程是 不同。 对于步骤 702中的虚拟网络设备, 对硬件队列的抽象是由物理网络 设备完成, 虚拟网络设备只是做一次映射, 对于步骤 703中的虚拟网络设 备, 是去对硬件队列进行抽象, 但用户看到的都是抽象后的结果。
需要说明的是, 在所有的虚拟网络设备没有管理的物理网络设备时, 此时驱动设备选取虚拟网络设备中的任一个作为类 "PF" , 以管理所有虚 拟网络设备的公共资源。 但是, 若存在物理网络设备, 则不需要再设置一 个类 "PF" 的虚拟网络设备。
由上述实施例可知, 本实施例的网络接口适配器注册方法, 解决了现 有技术中无法对网络接口适配器的单一硬件队列进行管理和直接操作的 问题。
另外, 本实施例中的网络接口适配器注册方法主要应用于数据中心, 大型网络站点的服务器中存在传统单队列网卡, VMDq网卡和 SR-IOV网 卡等多种异构网卡情况下, 不同类型的网络设备的能力、 结构、 技术等在 实现上存在差异, 无法实现虚拟机无修改即直接进行热迁移。
本发明中釆用驱动设备将 VMDq网卡的物理队列直接注册成虚拟网 络设备, 向上呈现出统一的网络设备接口, 从驱动层面屏蔽了底层硬件的 差异, 向上提供统一的接口和设备类型, 实现了大量异构网卡的无差异化 的进行资源管理和分配。
本发明中的驱动设备为服务器内的设备驱动程序, 也可属于服务器操 作系统软件的一部分, 其可以通过软件编程来实现。
根据本发明的另一方面, 本发明还提供一种驱动设备, 如图 8A所示, 本实施例中的驱动设备包括: 第一注册单元 81、 第二注册单元 82;
其中, 第一注册单元 81用于将网络接口适配器向服务器内核注册为 物理网络设备; 第二注册单元 82用于将所述网络接口适配器的部分或全 部硬件队列收发组向所述服务器内核注册为各自独立的虚拟网络设备; 其中, 物理网络设备用于管理所述网络接口适配器及所有的虚拟网络 设备, 所述虚拟网络设备用于接收或发送服务器内应用或芯片的数据。
在本实施例中, 上述网卡可为硬件多队列网卡, 网卡包括: 虚拟机设 备队列 VMDq网卡、 iNIC网卡。
前述的虚拟网络设备具有 MAC地址、 IP地址、 VLAN ID地址、 数据 收发流程接口, 以及管理工具接口。
进一步地, 如图 8B所示, 本实施例中的驱动设备还包括: 添加单元 83; 该添加单元用于将所述虚拟网络设备的 MAC地址添加到与所述网络 适配器对应的 MAC地址过滤列表中, 或者, 用于将所述虚拟网络设备的 VLAN ID添加到与所述网络适配器对应的 VLAN ID过滤列表中。
另外, 上述的驱动设备还包括: 设置单元(图中未示出) , 该设置单 元用于在所述服务器内核中设置一软交换机, 用于使所述服务器内的多个 虚拟机进行数据交互。
本发明中釆用驱动设备的第二注册单元将 VMDq网卡的物理队列直 接注册成虚拟网络设备, 向上呈现出统一的网络设备接口, 从驱动层面屏 蔽了底层硬件的差异, 向上提供统一的接口和设备类型, 实现了大量异构 网卡的无差异化的进行资源管理和分配。
根据本发明的另一方面, 本发明还提供一种驱动设备, 如图 9所示, 本实施例中的驱动设备包括: 注册单元 91、 选取单元 92;
注册单元 91用于将网络接口适配器的全部硬件队列收发组向所述服 务器内核注册为各自独立的虚拟网络设备; 选取单元 92用于选取所述虚 特别地, 上述的网卡可为硬件多队列网卡, 网卡包括: 虚拟机设备队 列 VMDq网卡、 iNIC网卡。
前述的虚拟网络设备具有 MAC地址、 IP地址、 VLAN ID地址、 数据 收发流程接口, 以及 ethtool管理工具接口。
根据本发明的另一方面, 本发明还提供一种服务器, 其包括: 本发明 任意实施例所述的驱动设备。 该驱动设备的具体实现方式可以参考本发明 其它装置或方法实施例, 在此不再赘述。 本领域普通技术人员应理解的是 本发明实施例提供的服务器因为应用了本发明实施例提供的驱动设备, 所 屏蔽了底层硬件的差异, 向上提供统一的接口和设备类型, 实现了大量异 构网卡的无差异化的进行资源管理和分配。
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分 步骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算 机可读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步 骤; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存 储程序代码的介质。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非 对其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的 普通技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进 行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或 者替换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的范 围。

Claims

权 利 要 求 书
1、 一种网络接口适配器注册方法, 其特征在于, 包括:
服务器的驱动设备将网络接口适配器向服务器内核注册为物理网络 设备; 以及
所述驱动设备将所述网络接口适配器的部分或全部硬件队列收发组 向所述服务器内核注册为各自独立的虚拟网络设备;
其中, 所述物理网络设备用于管理所述网络接口适配器及所有的虚拟 网络设备, 所述虚拟网络设备用于接收或发送服务器内应用或芯片的数 据。
2、 根据权利要求 1所述的方法, 其特征在于, 所述网络接口适配器 为硬件多队列网络接口适配器, 所述网络接口适配器包括: 虚拟机设备队 列 VMDq网络接口适配器、 智能网络接口卡 iNIC网络接口适配器。
3、 根据权利要求 1所述的方法, 其特征在于, 所述虚拟网络设备具 有 MAC地址、 IP地址、 VLAN ID、 数据收发流程接口, 以及管理工具接 口。
4、 根据权利要求 1所述的方法, 其特征在于, 还包括:
所述驱动设备将所述虚拟网络设备的 MAC地址添加到与所述网络适 配器对应的 MAC地址过滤列表中, 或者
所述驱动设备将所述虚拟网络设备的 VLAN ID添加到与所述网络适 配器对应的 VLAN ID过滤列表中。
5、 根据权利要求 1所述的方法, 其特征在于, 还包括:
所述驱动设备在所述服务器内核中设置一软交换机, 用于使所述服务 器内的多个虚拟机进行数据交互。
6、 根据权利要求 1所述的方法, 其特征在于, 在所述驱动设备将所 述网络接口适配器的部分硬件队列收发组向所述服务器内核注册虚拟网 络设备之后, 还包括:
所述驱动设备将所述网络接口适配器的其他硬件队列收发组向服务 器内核注册为另一组相互独立的虚拟网络设备。
7、 一种网络接口适配器注册方法, 其特征在于, 包括:
服务器的驱动设备将网络接口适配器的全部硬件队列收发组向所述 服务器内核注册为各自独立的虚拟网络设备;
所述驱动设备选取所述虚拟网络设备中的其中一个虚拟网络设备管 理所述所有虚拟网络设备的公共资源。
8、 根据权利要求 7所述的方法, 其特征在于, 所述网络接口适配器 为硬件多队列网络接口适配器, 所述网络接口适配器包括: 虚拟机设备队 列 VMDq网络接口适配器、 iNIC网络接口适配器。
9、 根据权利要求 7所述的方法, 其特征在于, 所述虚拟网络设备具 有 MAC地址、 IP地址、 VLAN ID、 数据收发流程接口, 以及管理工具接 口。
10、 根据权利要求 7所述的方法, 其特征在于, 还包括:
所述驱动设备将所述虚拟网络设备的 MAC地址添加到与所述网络适 配器对应的 MAC地址过滤列表中, 或者
所述驱动设备将所述虚拟网络设备的 VLAN ID添加到与所述网络适 配器对应的 VLAN ID过滤列表中。
1 1、 一种驱动设备, 其特征在于, 包括:
第一注册单元, 用于将网络接口适配器向服务器内核注册为物理网络 设备;
第二注册单元, 用于将所述网络接口适配器的部分或全部硬件队列收 发组向所述服务器内核注册为各自独立的虚拟网络设备;
其中, 所述物理网络设备用于管理所述网络接口适配器及所有的虚拟 网络设备, 所述虚拟网络设备用于接收或发送服务器内应用或芯片的数 据。
12、 根据权利要求 1 1所述的驱动设备, 其特征在于, 所述网络接口 适配器为硬件多队列网络接口适配器, 所述网络接口适配器包括: 虚拟机 设备队列 VMDq网络接口适配器、 iNIC网络接口适配器。
13、 根据权利要求 1 1所述的驱动设备, 其特征在于, 所述虚拟网络 设备具有 MAC地址、 IP地址、 VLAN ID地址、 数据收发流程接口, 以及 管理工具接口。
14、 根据权利要求 1 1所述的驱动设备, 其特征在于, 还包括: 添加单元, 用于将所述虚拟网络设备的 MAC地址添加到与所述网络 适配器对应的 MAC地址过滤列表中, 或者
用于将所述虚拟网络设备的 VLAN ID添加到与所述网络适配器对应 的 VLAN ID过滤列表中。
15、 根据权利要求 1 1至 14任一所述的驱动设备, 其特征在于, 还包 括:
设置单元, 用于在所述服务器内核中设置一软交换机, 用于使所述服 务器内的多个虚拟机进行数据交互。
16、 一种驱动设备, 其特征在于, 包括:
注册单元, 用于将网络接口适配器的全部硬件队列收发组向所述服务 器内核注册为各自独立的虚拟网络设备;
选取单元, 用于选取所述虚拟网络设备中的其中一个虚拟网络设备管 理所述所有的虚拟网络设备的公共资源。
17、 一种服务器, 其特征在于, 包括: 如上权利要求 1 1至 15任一所 述的驱动设备, 或者包括如上权利要求 16所述的驱动设备。
PCT/CN2013/073952 2012-08-07 2013-04-09 网络接口适配器注册方法及驱动设备、服务器 WO2014023110A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/584,597 US20150113114A1 (en) 2012-08-07 2014-12-29 Network interface adapter registration method, driver, and server

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210278136.X 2012-08-07
CN201210278136.XA CN102790777B (zh) 2012-08-07 2012-08-07 网络接口适配器注册方法及驱动设备、服务器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/584,597 Continuation US20150113114A1 (en) 2012-08-07 2014-12-29 Network interface adapter registration method, driver, and server

Publications (1)

Publication Number Publication Date
WO2014023110A1 true WO2014023110A1 (zh) 2014-02-13

Family

ID=47156077

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073952 WO2014023110A1 (zh) 2012-08-07 2013-04-09 网络接口适配器注册方法及驱动设备、服务器

Country Status (3)

Country Link
US (1) US20150113114A1 (zh)
CN (1) CN102790777B (zh)
WO (1) WO2014023110A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790777B (zh) * 2012-08-07 2016-06-15 华为技术有限公司 网络接口适配器注册方法及驱动设备、服务器
CN103164255B (zh) * 2013-03-04 2016-08-03 华为技术有限公司 虚拟机网络通信实现方法和虚拟机监控器以及物理主机
CN103353848B (zh) * 2013-06-28 2017-04-26 华为技术有限公司 多队列或设备的选择方法和计算节点
CN103473136B (zh) * 2013-09-02 2017-06-13 华为技术有限公司 一种虚拟机的资源配置方法和通信设备
CN104219093B (zh) * 2014-08-30 2017-09-12 杭州华为数字技术有限公司 网卡功能配置方法和相关设备
US11151446B2 (en) * 2015-10-28 2021-10-19 Google Llc Stream-based accelerator processing of computational graphs
JP6513835B2 (ja) 2016-11-09 2019-05-15 ホアウェイ・テクノロジーズ・カンパニー・リミテッド クラウドコンピューティングシステムにおけるパケット処理方法、ホスト、およびシステム
EP3525423B1 (en) 2016-11-09 2021-04-07 Huawei Technologies Co., Ltd. Packet processing method in cloud computing system, host, and system
CN106789152A (zh) * 2016-11-17 2017-05-31 东软集团股份有限公司 基于多队列网卡的处理器扩展方法及装置
US10243840B2 (en) * 2017-03-01 2019-03-26 Juniper Networks, Inc. Network interface card switching for virtual networks
US10644948B1 (en) 2017-08-29 2020-05-05 Juniper Networks, Inc. Hypervisor detection of virtual machine and network interface compatibility
CN113438184B (zh) * 2021-06-25 2022-09-06 北京汇钧科技有限公司 网卡的队列管理方法、装置及电子设备
CN113312155B (zh) * 2021-07-29 2022-02-01 阿里云计算有限公司 虚拟机创建方法、装置、设备、系统及计算机程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090292858A1 (en) * 2008-05-23 2009-11-26 Vmware, Inc. Distributed Virtual Switch for Virtualized Computer Systems
US20120002535A1 (en) * 2010-06-30 2012-01-05 Oracle America, Inc. Method and system for distributing network traffic among multiple direct hardware access datapaths
CN102591715A (zh) * 2012-01-05 2012-07-18 北京航空航天大学 一种使用多队列技术的虚拟机网络性能优化的实现方法
CN102594660A (zh) * 2012-01-19 2012-07-18 华为技术有限公司 一种虚拟接口交换方法、装置及系统
CN102790777A (zh) * 2012-08-07 2012-11-21 华为技术有限公司 网络接口适配器注册方法及驱动设备、服务器

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050220128A1 (en) * 2004-04-05 2005-10-06 Ammasso, Inc. System and method for work request queuing for intelligent adapter
US7870301B2 (en) * 2005-02-25 2011-01-11 International Business Machines Corporation System and method for modification of virtual adapter resources in a logically partitioned data processing system
US20060294517A1 (en) * 2005-06-28 2006-12-28 Zimmer Vincent J Network interface sharing among multiple virtual machines
US8635388B2 (en) * 2006-03-31 2014-01-21 Broadcom Corporation Method and system for an OS virtualization-aware network interface card
US20110035494A1 (en) * 2008-04-15 2011-02-10 Blade Network Technologies Network virtualization for a virtualized server data center environment
CN101409673B (zh) * 2008-11-12 2013-07-03 北京恒光创新科技股份有限公司 一种网络适配器数据传输方法、网络适配器及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090292858A1 (en) * 2008-05-23 2009-11-26 Vmware, Inc. Distributed Virtual Switch for Virtualized Computer Systems
US20120002535A1 (en) * 2010-06-30 2012-01-05 Oracle America, Inc. Method and system for distributing network traffic among multiple direct hardware access datapaths
CN102591715A (zh) * 2012-01-05 2012-07-18 北京航空航天大学 一种使用多队列技术的虚拟机网络性能优化的实现方法
CN102594660A (zh) * 2012-01-19 2012-07-18 华为技术有限公司 一种虚拟接口交换方法、装置及系统
CN102790777A (zh) * 2012-08-07 2012-11-21 华为技术有限公司 网络接口适配器注册方法及驱动设备、服务器

Also Published As

Publication number Publication date
CN102790777A (zh) 2012-11-21
CN102790777B (zh) 2016-06-15
US20150113114A1 (en) 2015-04-23

Similar Documents

Publication Publication Date Title
WO2014023110A1 (zh) 网络接口适配器注册方法及驱动设备、服务器
CN107278362B (zh) 云计算系统中报文处理的方法、主机和系统
US7782869B1 (en) Network traffic control for virtual device interfaces
US8677023B2 (en) High availability and I/O aggregation for server environments
CN103905426B (zh) 用于使PCIe构造上的主机到主机消息收发安全和分离的方法和装置
US8271694B2 (en) Method and apparatus for using a single multi-function adapter with different operating systems
US9031081B2 (en) Method and system for switching in a virtualized platform
US9727386B2 (en) Method and apparatus for network resource virtual partitioning
US9176767B2 (en) Network interface card device pass-through with multiple nested hypervisors
WO2014063463A1 (zh) 一种物理网卡管理方法、装置及物理主机
EP2597842B1 (en) Providing network capability over a converged interconnect fabric
US9813283B2 (en) Efficient data transfer between servers and remote peripherals
CN108964959A (zh) 一种用于虚拟化平台的网卡直通系统及数据包监管方法
WO2014206105A1 (zh) 虚拟交换方法、相关装置和计算机系统
JP2007158870A (ja) 仮想計算機システム及びそのネットワーク通信方法
WO2014022168A1 (en) System and method for virtual ethernet interface binding
WO2011162880A2 (en) Methods and systems to permit multiple virtual machines to separately configure and access a physical resource
US9787608B2 (en) Unified fabric port
US11048535B2 (en) Method and apparatus for transmitting data packet based on virtual machine
WO2020134153A1 (zh) 一种分流方法、系统和处理设备
WO2016000186A1 (zh) 一种链路聚合方法及设备
US11575620B2 (en) Queue-to-port allocation
CN107683593A (zh) 网络线卡(lc)与主机操作系统(os)集成
Tripathi et al. Crossbow Virtual Wire: Network in a Box.
Cui et al. Virtual TCP offload: optimizing ethernet overlay performance on advanced interconnects

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

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

Country of ref document: EP

Kind code of ref document: A1