Using physical and virtual functions associated with a NIC to access an external storage through network fabric driver
Some embodiments provide a method of providing distributed storage services to a host computer from a network interface card (NIC) of the host computer. At the NIC, the method accesses a set of one or more external storages operating outside of the host computer through a shared port of the NIC that is not only used to access the set of external storages but also for forwarding packets not related to an external storage. In some embodiments, the method accesses the external storage set by using a network fabric storage driver that employs a network fabric storage protocol to access the external storage set. The method presents the external storage as a local storage of the host computer to a set of programs executing on the host computer. In some embodiments, the method presents the local storage by using a storage emulation layer on the NIC to create a local storage construct that presents the set of external storages as a local storage of the host computer.
1 . A method for providing a virtual machine (VM), executing a workload and instantiated on a virtualization layer of a host computer, access to an external storage through a network interface card (NIC) connected to a bus of the host computer, the method comprising:
assigning, by the virtualization layer having a first network fabric storage driver, a physical function (PF) of the NIC to the VM, wherein the physical function is exposed to the VM as a network interface through which packets relating to storage access operations initiated by the VM in connection with executing the workload, are to be transmitted and received; and
configuring a second network fabric storage driver on the VM to use the PF to bypass the first network fabric storage driver and exchange the packets relating to the storage access operations with the external storage through the NIC.
2 . The method of claim 1 , wherein the storage access operations comprise read operations for reading data from the external storage and write operations for writing data to the external storage.
3 . The method of claim 1 , wherein each of the first and second network fabric storage drivers is an NVMe (non-volatile memory access) over fabric (NVMeOF) driver.
4 . The method of claim 1 , wherein the bus is a PCIe (peripheral component interconnect express) bus, and the PF is directly accessible to the VM via the PCIe bus.
5 . The method of claim 4 , wherein the PF is executed by at least one processing unit of the host computer.
6 . The method of claim 5 , further comprising defining a virtual function (VF) to associate with the PF and to execute with at least one processing unit of the NIC.
7 . The method of claim 6 , wherein defining the VF comprises:
configuring the VF to pass a first plurality of storage-access packets to a virtual switch along a slow packet-processing path when the VF does not have forwarding rules for processing the first plurality of packets;
configuring the VF to pass a second plurality of storage-access packets to a port of the NIC along a fast packet-processing path when the VF has forwarding rules for processing the second plurality of packets.
8 . The method of claim 7 , wherein the virtual switch provides forwarding rules to the VF after processing packets along the slow path.
9 . The method of claim 7 , wherein the VF uses a network accelerator that facilitates the forwarding of the packets related to the external storage.
10 . The method of claim 9 , wherein configuring the VF comprises configuring the VF to use a hardware offload unit of the NIC to perform the fast path packet processing.
11 . A non-transitory machine readable medium storing a program for providing a virtual machine (VM), executing a workload and instantiated on a virtualization layer of a host computer, access to an external storage through a network interface card (NIC) connected to a bus of the host computer, the program for execution by at least one processing unit of the host computer, the program comprising sets of instructions for:
assigning, by the virtualization layer having a first network fabric storage driver, a physical function (PF) of the NIC to the VM, wherein the physical function is exposed to the VM as a network interface through which packets relating to storage access operations initiated by the VM in connection with executing the workload, are to be transmitted and received; and
configuring a second network fabric storage driver on the VM to use the PF to bypass the first network fabric storage driver and exchange the packets relating to the storage access operations with the external storage through the NIC.
12 . The non-transitory machine readable medium of claim 11 , wherein the storage access operations comprise read operations for reading data from the external storage and write operations for writing data to the external storage.
13 . The non-transitory machine readable medium of claim 11 , wherein each of the first and second network fabric storage drivers is an NVMe (non-volatile memory access) over fabric (NVMeOF) driver.
14 . The non-transitory machine readable medium of claim 11 , wherein the bus is a PCIe (peripheral component interconnect express) bus, and the PF is directly accessible to the VM via the PCIe bus.
15 . The non-transitory machine readable medium of claim 11 , wherein the PF is executed by at least one processing unit of the host computer.
16 . The non-transitory machine readable medium of claim 15 , wherein a virtual function (VF) is associated with the PF and executes on the NIC.
17 . The non-transitory machine readable medium of claim 16 , wherein the VF passes a first plurality of storage-access packets to a virtual switch along a slow packet-processing path when the VF does not have forwarding rules for processing the first plurality of packets, and passes a second plurality of storage-access packets to a port of the NIC along a fast packet-processing path when the VF has forwarding rules for processing the second plurality of packets.
18 . The non-transitory machine readable medium of claim 17 , wherein the virtual switch provides forwarding rules to the VF after processing packets along the slow path.
19 . The non-transitory machine readable medium of claim 17 , wherein the VF uses a network accelerator that facilitates the forwarding of the packets related to the external storage.
20 . The non-transitory machine readable medium of claim 19 , wherein the VF uses a hardware offload unit of the NIC to perform the fast path packet processing.
21 . A computer system comprising at least one processor, a non-transitory computer readable medium, and a network interface card (NIC) connected to a bus of the computer system, wherein the at least one processor is configured to execute a program stored in the non-transitory computer readable medium to provide a virtual machine (VM), that is executing a workload and instantiated on a virtualization layer of the computer system, access to an external storage through the NIC, the program comprising sets of instructions for:
assigning, by the virtualization layer having a first network fabric storage driver, a physical function (PF) of the NIC to the VM, wherein the physical function is exposed to the VM as a network interface through which packets relating to storage access operations initiated by the VM in connection with executing the workload, are to be transmitted and received; and
configuring a second network fabric storage driver on the VM to use the PF to bypass the first network fabric storage driver and exchange the packets relating to the storage access operations with the external storage through the NIC.