Emulated switch with hot-plugging

Provided are systems and methods for hot-plugging emulated peripheral devices (e.g., endpoints) into host devices that either have a hypervisor that does not support virtualized peripheral device or that do not include a hypervisor. In various implementations, a configurable peripheral device can emulate a switch that includes upstream ports and downstream ports. When a new endpoint device is requested, the configurable peripheral device can, using an emulation configuration for the new endpoint device, generate an emulation for the new endpoint device. The configurable peripheral device can connect the endpoint device to a downstream port, and then trigger a hot-plug mechanism, through which the host device can add the new endpoint device to the known hardware of the host device.

BACKGROUND

Peripheral devices can be used to add functionality to, or extend the capabilities of, a computing system. For example, peripheral devices can be added to a computing system to give the computing system output functionality, including the ability to display using monitors or print using printers. Other examples of peripheral devices include input devices (e.g., keyboards, mice, touchpads, etc.) storage devices, network interfaces, and so on. Because the peripheral devices attached to a computing system can be added or changed, peripheral devices provide a great deal of flexibility in constructing computing systems.

In some cases, a peripheral device can be “hot-plugged” or “hot-swapped” into or out of a host system. To hot-plug or hot-swap a component means to physically insert or physically remove the component from a host system while the host system is powered on, and possibly while the host system is in active operation. Without hardware and/or software support for hot-plugging, the host system would need to be powered off before a component can be added or removed.

DETAILED DESCRIPTION

Peripheral devices can add functionality to, or extend the capabilities of, a computing system. Examples of peripheral devices include input devices (e.g., keyboards, mice, touchpads, etc.) storage devices, network interfaces, and so on. Because the peripheral devices attached to a computing system can be added or changed, peripheral devices provide a great deal of flexibility in constructing computing systems.

Peripheral devices can be connected internally or externally and can communicate with the computing system—which can be referred to as the host system or host device—using a bus or bus complex. A bus can connect multiple peripheral devices to the host system. A bus complex can include multiple buses, connected together using switches and/or bridges. A peripheral device that does not include switching or bridging capability can also be referred to as an endpoint device. A host device and peripheral devices can intercommunicate across a bus complex using a bus protocol, which can define the transactions that can be transmitted on a bus. Examples of bus protocols include the Peripheral Component Interconnect (PCI) family of bus protocols (e.g., PCI, PCI-eXtended (PCI-X), PCI Express (PCIe), PCI derivatives such as Accelerated Graphics Port (AGP), etc.), among others.

Peripheral device can be “hot-plugged” or “hot-swapped” into or out of a host system. To hot-plug or hot-swap a component can include physically inserting or physically removing the component from a host system while the host system is powered on, and possibly while the host system is in active operation. Without hardware and/or software support for hot-plugging, the host system would need to be powered off before a component can be added or removed.

Various hot-plug mechanisms exist. For example, the Peripheral Component Interconnect Express (PCIe) specification provides for hot-plug of PCIe-compatible components into a PCIe slot. A computing system that supports PCIe hot-plug includes hardware support, in the form of PCIe slots capable of accepting a device while the computing system is power on, detecting insertion or removal of a device, sending a signal to the operating system to indicate insertion or removal of a device, and/or providing power to a device when the device has been inserted. In some cases, the Basic Input/Output System (BIOS) of the computing system may also need to support hot-plug, for example by being able to dynamically modify power requirements when devices are added or removed. A computing system that supports PCIe hot-plug also includes software support. Specifically, the operating system may be configured with procedures for adding or removing a hot-plugged device, including, for example, conducting device discovery and configuring a new device. Configuration of the new device can include assigning memory addresses to the new device and possibly reorganizing memory assigned to other devices.

Examples of other types of devices that can be hot-plugged include Universal Serial Bus (USB) devices, Institute of Electrical and Electronics Engineers (IEEE) 1394 (known as Firewire) devices, and others.

In some cases, a computing system can be configured to execute virtual machines. A virtual machine is an emulated computer system running on the hardware of a physical computer system. A virtual machine may also be referred to as a guest or guest machine, and the physical computer system on which a virtual machine is running may be referred to as a host, host machine, or host device. A virtual machine can include a particular emulated hardware configuration, including a particular processor, amount of memory, and/or available peripheral devices, which may be the same as or different from the hardware of underlying physical computer system. From the perspective of software executing in the virtual machine, the hardware of the virtual machine is indistinguishable from physical hardware, even though some of the virtual hardware may not have a physical corollary.

A virtual machine can execute operating system, which may be different than the operating system running on the underlying physical computer system. The virtual machine's operating system may also be referred to as the guest operating system, and the operating system executing on the host device may be referred to as the host operating system. The guest operating system can provide a platform for user applications that can executing within only within the virtual machines, and which have access only to the resources provided by the virtual machine. The virtual machine may make some or all of the resources of the physical computer system available to a virtual operating system and applications. Alternatively or additionally, the virtual machine may present emulated physical resources to the operating system or applications. The physical computer system may be able to host multiple virtual machines, with the virtual machines sharing the physical computer system's hardware resources.

In some cases, software called a hypervisor or virtual machine manager manages the virtual machines, including, for example, managing launching new virtual machines, removing virtual machines, controlling virtual machines' access to the physical hardware resources of the host device, and/or emulating hardware resources that may not have a physical equivalent, among other things. In some cases, the hypervisor is a component of the host operating system.

Virtual machines can enable multiple users to make use of the system host system at the same time, or can enable one user to use one physical system as several distinct systems. Similar to physical computing systems, virtual machines can operate in isolation from one another, so that the operations of one virtual machine do not affect the operations of another.

Also similar to physical machines, a virtual machine's hardware configuration is determine when the virtual machine is brought up. Sometimes, the operator of a virtual machine may want to change the hardware of the virtual machine, for example by adding a peripheral device. For example, a virtual machine operator may want to have multiple network interfaces to isolate network traffic types and/or to separate virtual machines having a network interface from virtual machines that do not have a network interface. In these and other examples, the virtual machine operator may want to dynamically add or remove network interfaces as usage of a virtual machine changes or network conditions change. Alternatively or additionally, the virtual machine operator may want to move an existing network interface to another virtual machine, for example to preserve the configuration of the network interface when the virtual machine to which the network interface was connected goes down.

In some implementations, a peripheral device that includes virtualization can enable a host system to dynamically add peripheral devices to a virtual machine. For example, a PCI device that includes Single Root-Input/Output Virtualization (SR-IOV) can include a physical function and multiple virtual functions, where each virtual function corresponds to the physical function. The physical function can include hardware and software for, for example, a network interface, a storage device, graphics processing unit, or some other peripheral device functionality. In this example, when a virtual machine requests that the PCI device be added to the virtual machine, the hypervisor can attach an available virtual function to the virtual machine. The hypervisor can further provide the virtual machine access to the virtual function, for example using a passthrough mechanism. The virtual machine can then use the virtual function to use the physical functionality of the PCI device.

In some cases, however, a host system's hypervisor may not support virtualized peripheral devices, and thus may not be able to make use of virtual functions when a virtual machine requests a new peripheral device. In some cases, a host system may not have a hypervisor at all, such as is the case with so-called “bare metal” systems, where a virtual machine has been installed directly on the hardware of the host system, rather than within the host operating system.

Host devices—both those that have hypervisors and those that do not—may support “hot-plugging” or “hot-swapping” of peripheral devices. To hot-plug or hot-swap a component means to physically insert or physically remove the component from a host system while the host system is powered on, and possibly while the host system is in active operation. Without hardware and/or software support for hot-plugging, the host system would need to be powered off before a component can be added or removed.

In various implementations, a configurable peripheral device can be configured to emulate the components of a switch, including upstream ports and downstream ports. The emulated switch, in this context, can be used to attach the configurable peripheral device to a bus complex of a host device. When a virtual machine executing on the host device requests that a new peripheral device be added to the virtual machine, the configurable peripheral device can generate a new, emulated endpoint that includes the functionality of the new peripheral device. The configurable peripheral device can add the new endpoint to a downstream port of the emulated switch. The configurable device can further use a hot-plug feature of the host device to cause the new endpoint to be hot-plugged to the virtual machine.

The configurable peripheral device can thus enable hot-plugging of devices in a system that has a hypervisor that does not support virtual devices or in a system that does not include a hypervisor. Additionally, because the hot-plugged devices are emulated by the configurable device, physical devices need not be added to the system. The configurable device can, furthermore, be configured to increase or decrease the number of slots available for hot-plugging, and be configured to simultaneously support a wide array of emulated devices.

FIGS. 1A-1Billustrate an example of a system100that includes a configurable peripheral device110. In this example, the configurable peripheral device110has been configured as a virtualized peripheral device, and thus can be used to dynamically add peripheral devices (which are virtual, in this example) to virtual machines112a-112cexecuting on a host device120. In various implementations, the system100can include additional peripheral devices, including other configurable peripheral devices.

The configurable peripheral device110is a device that, in various implementations, can emulate the functionality of a variety of different peripheral devices. As discussed further below, the configurable peripheral device110can include integrated circuits configured to emulate particular hardware functionality, such as a network interface, a storage device, a graphics processing unit, or some other functionality. To enable the configurable peripheral device110to emulate different peripheral devices, the configurable peripheral device110can include emulation configurations for the different devices, stored in a memory. In various implementations, the configurable peripheral device110can include firmware that can select an emulation configuration, and can configure the configurable peripheral device110according to the emulation configuration. In some implementations, the firmware may determine the configuration of the configurable peripheral device110. In some implementations, the host device120may provide instructions for determining the configuration of the configurable peripheral device110.

In the example ofFIGS. 1A-1B, the configurable peripheral device110has been configured to include at least one physical function114and a number of virtual functions112a-112dthat correspond to the physical function114. A virtual function is hardware and/or software that enable the configurable peripheral device110to present the physical function114to the host device120as multiple, distinct devices that each have the functionality of the physical function114. The configurable peripheral device110can manage sharing of the physical function114by the virtual functions112a-112d. For example, the configurable peripheral device110can manage switching between the contexts of the virtual functions112a-112d, scheduling transactions coming from each of the virtual functions112a-112d, and ensuring transaction response from the physical function114are routed to the correct virtual functions112a-112d.

The configurable peripheral device110can have a fixed number of virtual functions for a particular physical function. In the illustrated example, the configurable peripheral device110has four virtual functions112a-112dthat correspond to the physical function114. In other examples, the configurable peripheral device110can have fewer or more virtual functions for a particular physical function114. In some implementations, the number of virtual functions112a-112dfor the physical function114can be increased or decreased by rebooting the configurable peripheral device110and reconfiguring the emulation.

A physical function can include hardware and software to support particular peripheral device functionality (e.g., a network interface, a storage device, a graphics processing unit, or some other functionality), though in the illustrated example, the physical function114is being emulated by the configurable peripheral device110. Because the physical function114is emulated, in some implementations, the configurable peripheral device110may not have hardware specific to the physical function114, or may have some hardware and software to enable the configurable peripheral device110to emulate various different peripheral devices. In some implementations, the configurable peripheral device110can include hardware processors that can assist in emulating the functionality of particular peripheral devices. In some implementations, the configurable peripheral device110can be configured to have multiple physical functions, each having corresponding virtual functions. In some examples, the configurable peripheral device110can be emulating SR-IOV.

The host device120of the example system100can be a computing system such as a server. The host device120can include hardware128, such as one or more integrated circuits configured as processors and/or memory, integrated circuits that include the firmware for the BIOS, electrical traces that form a processor bus, circuits that drive an internal clock, systems that control power, and so on. The hardware128can also include a root complex104, which can enable the host device120to communicate with a bus complex. Various peripheral devices, including the configurable peripheral device110, can be connected to the bus complex, and can be considered part of the hardware of the host device120. In some cases, the configurable peripheral device110can be connected to a switch or bridge in the bus complex, or can be connected directly to a port of the root complex104. In some examples, the root complex104can include multiple ports, each of which can be connected to a different bus complex.

In some examples, the host device120can be configured for use by multiple different users or operators, or for different uses by the same operator. In these examples, the host device120can include a hypervisor124that can execute and manage multiple virtual machines122a-122c. In the illustrated example, the hypervisor124supports virtualized peripheral devices. When the host device120conducts device discovery on the configurable peripheral device110, the host device120can identify the virtual functions112a-112dconfigured for the physical function114of the configurable peripheral device110. The host device120can then add the virtual functions112a-112dto the hypervisor124, and the hypervisor124can treat the virtual functions112a-112das multiple distinct, physical devices. In some cases, the hypervisor124need not be aware that the virtual functions112a-112dare virtual, and thus may not need to manage sharing of the physical function114.

A management task of the hypervisor124can include assigning hardware resources, such as the virtual functions112a-112d, to the virtual machines122a-122c. In some cases, the hypervisor124can be configured to give a virtual machine122a-122cexclusive use of a hardware resource. For example, in the example illustrated inFIG. 1A, a first virtual function, Virtual Function 0112a, has been assigned to a first virtual machine122awhile a second and third virtual functions, Virtual Function 1112band Virtual Function 2112c, have both been assigned to a second virtual machine122b. A fourth virtual function, Virtual Function 3112d, remains unassigned. In this example, the first virtual machine112ahas exclusive use of Virtual Function 0112aand the second virtual machine122bhas exclusive use of Virtual Function 1112band Virtual Function 2112c. By giving the virtual machines122a-122bexclusive use of the virtual functions, the hypervisor124need not manage sharing of the resource by the virtual machines122a-122b.

From the point of view of the virtual machines122a-122b, the virtual functions112a-112dassigned to each virtual machine122a-122bappear no different than physical peripheral devices. For example, each virtual function112a-112dcan have a distinct address space, which can include configuration registers. As a further example, each virtual function112a-112dcan be configured independently, though because the virtual functions112a-112dcorrespond to the same physical function114, some configurations may need to remain common, and thus may have restrictions on being altered.

FIG. 1Billustrates an example where the hypervisor124has brought up a new virtual machine122c. When the new virtual machine122ccomes up (e.g., before or shortly after the operating system boots) or a period of time after the new virtual machine122chas come up, the new virtual machine122cmay request attachment of a peripheral device that corresponds to the physical function114of the configurable peripheral device110. For example, the physical function114can be a network interface, and the new virtual machine122cmay request addition of a network interface to the virtual peripherals of the new virtual machine122c. This request can be received by the hypervisor124.

In the illustrated example, the hypervisor124can determine that Virtual Function 3112dis not assigned to any virtual machine. The hypervisor124can internally associate Virtual Function 3112dwith the new virtual machine122c, and can then “hot-plug” Virtual Function 3112dinto the new virtual machine122c, as indicated by the dashed arrow150.

Hot-plugging into the new virtual machine122ccan include triggering a hot-plug mechanism in the virtual hardware and/or software of the new virtual machine122c. For example, the hypervisor124can send a signal that is equivalent to power signal to the virtual hardware, to indicate that a new (virtual) device is receiving power from the virtual hardware. In this example, the virtual BIOS can add Virtual Function 3112dto the inventory of virtual hardware of the new virtual machine122c. As another example, the hypervisor124can send a signal that is equivalent to an interrupt to the guest operating system. In this example, the interrupt can trigger a hot-plug procedure in the guest operating system. The hot-plug procedure can include, for example, conducting device discovery and configuring Virtual Function 3112d. Device discovery can include sending requests for information about the new, virtual peripheral device to Virtual Function 3112d. Configuring Virtual Function 3112dcan include sending configuration transactions to the virtual function, where the configuration transactions can include reading device identifiers and assigning address spaces, among other things. In some cases, the guest operating system can also launch or enable a device driver for Virtual Function 3112d.

Once the hot-plug procedure completes, the guest operating system and applications of the new virtual machine122ccan use Virtual Function 3112das though having exclusive use of a particular peripheral device whose functionality corresponds to the physical function114. The configurable peripheral device110can manage the actual sharing of the physical function114.

The new virtual machine122cmay be shut down or removed at some later point in time. When this occurs, in some cases, the hypervisor124can execute a hot-plug removal procedure. The hot-plug removal procedure can include, for example, sending a signal to the virtual hardware of the new virtual machine122cto indicate that Virtual Function 3112dis no longer receiving power, and/or sending an interrupt to the guest operating system to indicate that the guest operating system should remove any address spaces assigned to Virtual Function 3112dand/or conduct other operations to remove Virtual Function 3112dfrom among available virtual devices.

In some cases, the new virtual machine122cmay not shut down gracefully, or may not initiate a hot-plug removal procedure for some other reason. In these cases, the hypervisor124can internally disassociate Virtual Function 3112dfrom any virtual machine. In some cases, the hypervisor124can also send transactions to Virtual Function 3112dto make the virtual function ready for use by another virtual machine.

In some cases, a hypervisor may not support virtualized peripheral devices, or a system may not have a hypervisor. The latter is the case in a “bare metal” system, in which lacks any virtual environments and instead uses only applications installed directly on the physical hardware of the system. A bare metal system can also be referred to as a dedicated computing system, where the physical resources of the computing system have been assigned to only one user or operator. Bare metal systems can occur frequently in cloud computing. For example, in a data center that is providing a computing cloud, applications can be launched on a dedicated computing system at any time, and the computing system stays up should the application be shut down or moved to another computing system. Bare metal systems can be implemented without a hypervisor. Removing the hypervisor can remove some operating overhead, and thus possibly speed up the operation of the system.

When a computing system does not have a hypervisor, or the hypervisor does not support virtualized peripheral devices, then, in various implementations, a configurable peripheral device can be used to enable peripheral devices to be dynamically added or removed from the system.FIGS. 2A-2Billustrate an example of a system200that includes a configurable peripheral device210. In this example, the configurable peripheral device210has been configured to emulate a switch, and can further emulate a number of endpoints, where each endpoint can represent a distinct, emulated peripheral device. In various implementations, the system200can include additional peripheral devices, including other configurable peripheral devices.

In the example ofFIGS. 2A-2B, the configurable peripheral device210has been configured as a switch component of a bus complex and a number of emulated endpoints212a-212c. A switch, in this context, is a device that enables multiple peripheral devices (also referred to as endpoints), bridges, and/or other switches to be added to a bus complex. Switches can be used when a bus has been designed for point-to-point communication between no more than two devices connected to the bus. Switches can include internal bridging capabilities and an internal bus complex. In the example ofFIGS. 2A-2B, the switch components are being emulated by the configurable peripheral device210.

In the illustrated example, the emulated switch components of the configurable peripheral device210include an upstream bridge216, multiple downstream bridges218a-218d, and a bus, identified as Bus 2230a, that connect the bridges. The upstream bridge216can connect the configurable peripheral device210to the root complex204of the host device220, or to a bus that is in the direction of the root complex204(e.g., in the “upstream” direction). In some cases, the upstream bridge216can include a port that connects the upstream bridge216to the bus complex. The upstream bridge216can also include a port that connects the upstream bridge216Bus 2230a.

In the example ofFIG. 2A, Downstream Bridge 0218ais connected to a first emulated endpoint, Emulated Endpoint 0212a, Downstream Bridge 1218bis connected to a second emulated endpoint, Emulated Endpoint 1212b, and Downstream Bridge 2218cis connected to a third emulated endpoint, Emulated Endpoint 2212c. A fourth downstream bridge, Downstream Bridge 3212d, remains unconnected in the downstream direction (e.g., away from the host device220). The busses that connect each of the emulated endpoints212a-212cto a corresponding downstream bridges218a-218ccan each have distinct identifier (Bus 3230b, Bus 4230c, and Bus 5230d, in the illustrated example), which can be used by the system200to identify the emulated endpoints212a-212c. For example, a bus number in combination with a device number and a function number can be used to individually identify the upstream bridge216, each of the downstream bridges218a-218d, and each of the emulated endpoints212a-212c.

Each of the downstream bridges218a-218dcan include an upstream port to connect the downstream bridges218a-218din the upstream direction to the upstream bridge216. Each downstream bridges218a-218dcan also include a downstream port to connect each downstream bridge218a-218dto a corresponding emulated endpoint212a-212c. In the illustrated example, the downstream port of Downstream Bridge 3218dcan be configured as an endpoint and/or as an open slot, so that enumeration of Downstream Bridge 3218ddoes not result in an error.

The emulated endpoints212a-212dcan each emulate a different peripheral device. The peripheral devices can be the same, or the peripheral devices can be different. For example, Emulated Endpoint 0212acan be a storage device and Emulated Endpoint 1212band Emulated Endpoint 2212ccan both be network interfaces. As discussed further below, the configurable peripheral device210can dynamically generate the emulated endpoints212a-212d, and thus can attach different endpoints, with different functionality, at each downstream bridges218a-218d.

In the illustrated example, the configurable peripheral device210includes four downstream bridges218a-218d, and thus can support up to four emulated endpoints. In other examples, the configurable peripheral device210can include fewer or more downstream bridges to support correspondingly fewer or more emulated endpoints. To modify the number of downstream bridges, the configurable peripheral device210can be rebooted and reconfigured with fewer or more downstream bridges.

The host device220of the example system200can be a computing system such as a server. The host device220can include hardware228, such as one or more integrated circuits configured as processors and/or memory, integrated circuits that include the firmware for the BIOS, electrical traces that form a processor bus, circuits that drive an internal clock, systems that control power, and so on. The hardware228can also include a root complex204, which can enable the host device220to communicate with a bus complex. Various peripheral devices, including the configurable peripheral device210, can be connected to the bus complex, and can be considered part of the hardware of the host device220. In some cases, the configurable peripheral device210can be connected to a switch or bridge in the bus complex, or can be connected directly to a port of the root complex204. In some examples, the root complex204can include multiple ports, each of which can be connected to a different bus complex.

In some examples, the host device220can be a “bare metal” system, which includes an operating system226but does not include a hypervisor. As noted above, the host device220may be assigned to only one operator, and thus might not be executing any virtual machines. Instead, the host device220may be executing an application222on behalf of a user. The application222may be executing in a closed environment that restricts or controls the application's access to the operating system226and hardware228. For example, it may be possible to restart the application222without rebooting the host device220, or it may be possible to move the application222to another host device without having to restart the application222.

In a bare metal example, the host device220is dedicated to only one user and all of the hardware resources are assigned to the application222being run by the user. In the illustrated example, each of the emulated endpoints212a-212care thus available for exclusive use by the application222. For example, the application222may have access to device drivers214a-214cthat each correspond to an emulated endpoint212a-212c. The device drivers214a-214ccan enable the application222to send transactions to the emulated endpoints212a-212cand receive responses.

In other examples, the host device220may include a hypervisor, for example as part of the operating system226, but the hypervisor may not be capable of supporting virtual functions. In these examples, the hypervisor may be able to assign different emulated endpoints212a-212cto different virtual machines. Alternatively or additionally, the hypervisor may manage sharing of the emulated endpoints212a-212cbetween different virtual machines.

In some examples, the operating system226in both a bare metal system and a system that includes a hypervisor can include a hot-plug driver240. The hot-plug driver240can enable hot-plugging of hardware components (such as peripheral devices) into or out of the host device220. For example, a network interface card can be physical added to the hardware228of the host device220, for example to an empty slot in the bus complex. In this example, addition of the network interface card can trigger a signal to the operating system226, such as an interrupt. The signal can be received by the hot-plug driver240, which can execute steps to add the network interface to the known hardware of the host device220and steps to configure the network interface. The hot-plug driver240can also execute steps to remove a device that is unplugged from the host device220while the host device220is powered on.

In some cases, the host device220can also include hardware support for hot-plugging. For example, the host device220can include slots in the bus complex that can receive, detect, and power on hot-plugged devices. As another example, the BIOS and/or power system included with the motherboard may have functionality for adding a new device to the host device220while the host device220is in operation.

In various implementations, the configurable peripheral device210can emulate hot-plugging of an endpoint into one of the downstream bridges218a-218d.FIG. 2Billustrates an example where a new emulated endpoint, Emulated Endpoint 3212d, has been added to the configurable peripheral device210. Added, in this context, means that the configurable peripheral device210has added Emulated Endpoint 3212das another device being emulated by the configurable peripheral device210. To emulate Emulated Endpoint 3212d, the configurable peripheral device210may have used an emulation configuration stored in on the configurable peripheral device210, as discussed further below. The configurable peripheral device210can further have added a new bus, Bus 6230c, to emulate the connection between Emulated Endpoint 3212dand the available downstream bridge, Downstream Bridge 3218d. In some cases, the configurable peripheral device210may also have reconfigured the downstream port of Downstream Bridge 3218dto include make Emulated Endpoint 3212dvisible to the host device220. Once the configurable peripheral device210has added Emulated Endpoint 3212dto the devices being emulated by the configurable peripheral device210, the configurable peripheral device210can trigger a hot-plug procedure.

In various implementations, the configurable peripheral device210may add and hot-plug Emulated Endpoint 3212dat the request of the application222executing on the host device220. For example, the user of the application222can request a new endpoint using, for example, a management interface provided by the system200. In this example, the management interface can give the user access to the application222and the ability to control the operation of the application222. In some examples, the management interface is part of a control plane for controlling the system200. In some examples, the management interface can enable the user to reconfigured the hardware228of the host device220, including adding and removing peripheral devices. For example, the user may request addition of a new storage device or removal of an existing network interface. In these and other examples, the physical hardware228of the host device220is not change, and instead the configurable peripheral device210generates, for example, an emulated storage device, and emulates hot-plugging of the new device (or emulates hot-plug removal of an existing emulated device).

Hot-plugging Emulated Endpoint 3212dinto Downstream Bridge 3218dcan include mimicking hot-plugging a physical device into host device220. For example, in some cases, after a device has been added to a slot, a hot-plug service or driver can be informed by physically pressing a button associated with the slot, which can cause a status for the slot to be updated and an interrupt to be sent to the root complex204, which can forward the interrupt to the hot-plug driver240. In this example, the button can be released once an LED indicates that link training is complete and that the new device is properly connected to the host device220. The operating system226can then initiate a routine to configure the new device. This routine can include sending reading registers emulated by Downstream Bridge 3218dto determine information about Emulated Endpoint 3212d. The routine can further include assigning any necessary resources, such as address spaces, to the new device.

In a similar fashion and in various implementations, the configurable peripheral device210can mimic the steps used to hot-plug a physical device. For example, once the configurable peripheral device210has started emulating Emulated Endpoint 3212d, the configurable peripheral device210can emulate pressing of the physical button by changing a status for the downstream port of Downstream Bridge 3218dand sending the same interrupt to the root complex204, indicated by the dashed arrow250. No physical device, however, needs to be added to the configurable peripheral device210, and no physical button needs to be pressed. The configurable peripheral device210can further mimic link training or ignore link training, and send a signal to the operating system226to start configuration of Emulated Endpoint 3212d. The operating system226can proceed with configuration as if configuring a physical device.

The application's user may at some later point determine that Emulated Endpoint 3212dcan be removed from the system200. For example, the application222may be experiencing lower usage and may no longer need a storage volume or network interface. Alternatively or additionally, the user of the application222may have reallocated resources or processes to another computing device. As another example, the application222may be being shut down and is releasing the resources assigned to it. In these and other examples, application's user may notify the configurable peripheral device210that Emulated Endpoint 3212dcan be removed. For example, the user can be provided with a management interface that enables the user to control the operation of the application222and/or modify the hardware228of the host device220.

Hot-plug removal of Emulated Endpoint 3212dcan mimic removal of a physical device. For example, in some cases, removing of a physical device can be initiated by pressing a physical button associated with the slot into which the physical device is inserted. Pressing of the button can modify a status of the slot and send an interrupt to the root complex204, which can pass the interrupt to the hot-plug driver240. The operating system226can initiate a routine to remove the physical device, including, for example, de-assigning resources assigned to the device. The button can be released once an LED indicates that the physical device can be safely removed.

In various implementations, the configurable peripheral device210can mimic the hot-plug removal procedure used to remove a physical device. For example, the configurable peripheral device210can mimic pressing of a physical button by changing the status of the downstream port of Downstream Bridge 3218dand sending the same interrupt to the root complex204complex that indicates a device is being removed. No physical button, however, needs to be pressed. In some implementations, the configurable peripheral device210can further wait a period of time to mimic link disconnect steps executed by the hardware, or can ignore link disconnect steps. The configurable peripheral device210can then shut down, remove, delete, and/or de-allocate Emulated Endpoint 3212d, after which Emulated Endpoint 3212dis removed from the devices being emulated by the configurable peripheral device210.

The example ofFIGS. 2A-2Billustrates an emulated switch with a flat hierarchy, in which the upstream bridge216is directly connected to each of the downstream bridges218a-218d, and the downstream bridges218a-218dare directly connected to emulated endpoint devices212a-212d. In other examples, the emulated switch can be configured with a cascaded hierarchy. In a cascaded hierarchy, the downstream bridges218a-218dcan be connected to other emulated switches and bridges. For example, a downstream bridge218a-218dto an upstream bridge of second emulated switch structure, where the second emulated bridge structure includes additional downstream bridges. A cascaded hierarchy is one method in which the configurable peripheral device210can provide a larger number of downstream bridges.

In various implementations, the switch structure emulated by the configurable peripheral device can emulate switch features, such as peer-to-peer transactions. In a peer-to-peer transaction, an endpoint (e.g., Emulated Endpoint 0212a) can generate a transaction that is addressed to another endpoint (e.g., Emulated Endpoint 3212d). In this example, without peer-to-peer support in the emulated switch, the transaction traverses up to root complex204and is then directed back through the emulated switch to Emulated Endpoint 3212d. With peer-to-peer support, the transaction is directed directly from Downstream Bridge 0218ato Downstream Bridge 3218d, without first going up to the root complex204.

Another switch feature that can be emulated by the emulated switch is access control services. Access control services can provide the host device220with control over peer-to-peer transactions, among other things. For example, through the access control services, the operating system226can enable or disable the emulated switch's ability to execute peer-to-peer transactions.

FIG. 3illustrates an example of a configurable peripheral device300that is capable of emulating various peripheral devices. In various implementations, the configurable peripheral device300can be used to emulate the virtual functions and physical function example illustrated inFIGS. 1A-1Bor to emulate the switch components and endpoints illustratedFIGS. 2A-2B. In various implementations, the configurable peripheral device300can also be used to replace one or more of the endpoints and/or root complexes illustrated inFIG. 5.

The configurable peripheral device300ofFIG. 3can implement any bus protocol, such as the PCI family of protocols, ISA, EISA, VESA, Multi-Channel, etc. A bus protocol may provide definitions for configuration registers, including addresses for the configuration registers, that a peripheral device is expected to include. In various implementations, the configurable peripheral device300can emulate at least part of the configuration address space that is defined for a particular bus protocol. In some cases, the configurable peripheral device300can also include configuration registers that are not emulated, such as configuration registers for implementing the basic functionality of the peripheral device (e.g., for setting bus speed, etc.), and/or basic functionality common to all peripheral devices that implement a specific bus protocol. These non-emulated configuration registers may be referred to as “native” configuration registers.

In some implementations, emulation refers to the ability of a program or device to imitate another program or device. For example, the configurable peripheral device300can include an emulated configuration space to emulate the function or functions of different peripheral devices. For example, the configurable peripheral device300can emulate a video card in one context, and a mass storage device in another context. As another example, the configurable peripheral device300can be emulating a function manufactured by one company, and may be able to emulate a peripheral device, manufactured by a different company, that implementations the same function. In some implementations, the configurable peripheral device300can be used to emulate more than one peripheral device. In some implementations, the configurable peripheral device300can emulate an entire peripheral subsystem.

In various implementations, the configurable peripheral device300can include a bus interface core310, a management circuit320, local hardware330, and a memory340. The configurable peripheral device300can be in communication with a computing system over a bus302. The bus302may implement a specific bus protocol.

The bus interface core310can include integrated circuits and/or firmware required by the configurable peripheral device300to communicate with the bus302. For example, the bus interface core310can include a bus interface314for communicating with the bus302. The bus interface314can include a physical connection to the bus302, including circuitry to manage any electrical properties of the link to the bus302. The bus interface314can further include logic for synchronizing to the bus302, decoding incoming transactions and encoding outgoing transactions, and/or detecting and possibly managing errors in incoming or outgoing data, among other operations. This logic can be implemented, for example, using purpose built integrated circuits and/or firmware.

In various implementations, the bus interface core310can also include a native configuration space312. In peripheral devices that do not include an emulated configuration space, the bus interface core310can include all the configuration registers of the peripheral device, as defined, for example, by the bus protocol. In these peripheral devices, the bus interface core310can service all read and write transactions (which may also be referred to as configuration access requests or configuration accesses) to the configuration registers, and provides a response (if necessary) to the bus302. In contrast, in the example configurable peripheral device300, the native configuration space312can include native configuration registers that are a subset of the configuration registers that are defined by the bus protocol. For example, the native configuration registers can be associated with basic functionalities that may be common to all peripheral devices for a given bus protocol (e.g., registers for setting bus speed, for error reporting, for reporting interrupts, etc.), and/or may otherwise be configuration registers that are unnecessary or inconvenient to emulate. In some implementations, the native configuration space312can also be emulated.

In some implementations, the bus interface core310can detect read and write transactions addressed to the native configuration space312. In these implementations, the bus interface core310can service configuration transactions directed to the native configuration space312. In various implementations, when the bus interface314receives a configuration transaction that is addressed to configuration registers that is not within the native configuration space312, the bus interface314can direct the configuration transaction to the management circuit320. In some implementations, the bus interface core310directs all configuration read and write transactions, regardless of where the transactions are addressed to, to the management circuit320, and the management circuit320can determine whether a transaction is for the native configuration space312or for an emulated configuration space.

In various implementations, the management circuit320can provide management of read and write transactions directed to peripheral devices being emulated by the configurable peripheral device300. Read and write transaction directed to the configurable peripheral device300can include, for example, transactions to configuration registers, transactions directed to memory on board the configurable peripheral device300or accessible through the configurable peripheral device300, transactions directed to I/O device(s) accessible through the configurable peripheral device300, and/or messaging transactions (by which a host can send messages to the configurable peripheral device300), among other types of transactions. In various implementations, the management circuit320can be implemented as a circuit on an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA). Alternatively or additionally, in some implementations, the management circuit320can be implemented as a circuit on a System-on-a-Chip (SoC). In some implementations, the management circuit320can be a circuit on a SoC that also includes local processor(s). In some implementations, the management circuit320can be implemented using firmware, where the firmware runs on ASIC and/or FPGA on the configurable peripheral device300.

Upon receiving a transaction, the bus interface core310can log the transaction with the management circuit320. The bus interface core310can continue with other operations, without needing to wait for the logged transaction to complete. Transactions can be read from the transaction log and be serviced by the local hardware330, for example, whenever the local hardware330is free to do so. The local hardware330can remove a transaction from the log when the transaction is read, which may indicate that the transaction has been completed. Alternatively or additionally, the local hardware330can remove the transaction after the transaction has been executed and/or responded to, also signaling completion of the transaction. Alternatively or additionally, the local hardware330may have some other mechanism (e.g. a register or a flag) that indicates to the logging mechanism that a transaction has been serviced or is in the process of being serviced.

The local hardware330can include one or more local processors, one or more local processor cores, a local processor cluster, programmable gate arrays, or integrated circuits configured to process transactions. In implementations that include multiple processors or processor cores, each processor or processor core can independently or cooperatively execute software code. In these implementations, each processor or processor core may be able to service multiple transactions from the management circuit320in parallel. In implementations that include one processor, the processor may be multi-threaded, and may also be able to service multiple transactions in parallel. In various implementations, the local hardware330can also be executing an operating system332. The operating system332can be a commercial operating system, such as Linux, Windows®, iOS®, etc., or may be a proprietary operating system.

In various implementations, the local hardware330, using one or more local processors, can process transactions logged by the management circuit320. For example, the local processor(s) can execute a memory or I/O write, including locating the appropriate address space, reading a value from the appropriate address, and returning the value in a response transaction. For example, when the configurable peripheral device300is emulating a network interface card, the local processor(s) can manage the transmission and receipt of packets. As another example, when the configurable peripheral device300is emulating a storage device, the processor(s) may manage the reading and writing of blocks of data to and from emulated disks. The local hardware330can also include other hardware for executing transactions. For example, the local hardware330may include hardware for routing packets and/or transferring data to and from hard disks. In some implementations, the processor(s) may execute specialized software for executing some types of transactions, such as configuration transactions.

In various implementations, the local hardware330can also include an emulation module336. In various implementations, the emulation module336can be implemented using an integrated circuit configured to execute the emulation module336. For example, an ASIC, FPGA, or SoC can execute firmware that implements the emulation module336. As another example, the local hardware330can include an integrated circuit configured to execute microcode that implements the emulation module336. As another example, the local hardware330can include an ASIC, FPGA, or SoC purpose built to implement the emulation module336.

In various implementations, the emulation module336can receive transactions from the management circuit320, and an service those transactions. Servicing a transaction can include, for example, identifying the transaction's type (e.g., read and/or write), identifying the source of the transaction, identifying the destination for the transaction, executing the transaction, and/or generating a response to the transaction, as needed. For example, a configuration read transaction can include reading a configuration register and responding with the information read from the register. As another example, a configuration write transaction can include updating the contents of the configuration register. In some cases, a configuration write can be responded to with an acknowledgment that the write transaction has completed.

In various implementations, because incoming transactions may require fast response times, the emulation module can be executed in a secure environment or be executed with sufficient privileges such that processing of the transactions cannot be interrupted by the operation of, for example, the operating system332.

In various implementations, the emulation module336can determine whether a configuration transaction is directed to the native configuration space312or to an emulated configuration space342. When a configuration transaction is directed to the native configuration space312, the emulation module336can communicate with the bus interface core310to read or write a native configuration register. When a configuration read is directed to emulated configuration space342, the emulation module336can read a value representing the contents of the configuration register from the emulated configuration space342. When a configuration write is directed to the emulated configuration space342, the emulation module336can write or update data in the emulated configuration space342that represents the contents of the configuration register. In some cases, a configuration transaction can be directed to configuration registers associated with one or more functions, in which case the emulation module336can identify the function and access an emulated configuration register that is specific to that function. In some cases, a configuration transaction may have come from one of multiple sources, such as one of several virtual machines that may be running different operating systems. In these cases, the emulation module336may identify the source, and access the emulated configuration register that may be designated or suitable for that source.

In various implementations, the memory340can provide storage for data that may be operated on by the local hardware330. The memory340can include DRAM, (e.g., SDRAM, DDR-SDRAM), SRAM, flash, or some other memory type, or any combination thereof. In some implementations, the memory340can be implemented as an external memory module, or as an internal memory of the configurable peripheral device300, or a combination of external and internal memory. In various implementations, the memory340can store an emulated configuration space342. The emulated configuration space342can include representations for all or some of the configuration register address spaces defined for any number of peripheral devices. In some implementations, the emulated configuration space342can include configuration space that may affect the operation of a function being emulated by the configurable peripheral device300. In some implementations, the emulated configuration space342excludes native configuration registers that may be basic and/or common to all peripheral devices implementing the bus protocol, or that may be unnecessary or inconvenient to emulate. The emulated configuration registers can include fields that are read only, clear-on-read (or have clear-on-read bits), may be both readable and writeable, may be write-zero-to-clear (or have write-zero-to-clear bits), and/or be write-one-to-set (or have write-on-to-set bits).

The emulated configuration space342can be stored in memory340as a text file, source code, object code, as a script, and/or in some other format that is readable by the emulation module336. In some implementations, the emulated configuration space342may be encrypted. In some implementations, the emulated configuration space342can be modified or replaced. For example, additional emulated configuration registers, or updated versions of the emulated configuration registers, may be provided through a website on the Internet. In these implementations, the additional or updated emulated configuration registers can be downloaded from the Internet and uploaded to the memory340. In some implementations, the memory340may store multiple emulated configuration spaces342, or multiple versions of the same emulated configuration space342.

FIG. 4illustrates an example of a PCIe implementation of a configurable peripheral device. The configurable PCIe device400ofFIG. 4can be connected to bus that implements the PCIe protocol. Additionally, the configurable PCIe device400can emulate various different peripheral devices. The configurable PCIe device400can include a PCIe core410, a management circuit420, local hardware430, and a memory440. The configurable PCIe device400may communicate with a computing system through a bus402. The bus402may implement the PCIe protocol.

In various implementations, the PCIe core410can include at least some of the functionality required to support communications with a PCIe bus. The PCIe core410can include a bus interface414. In various implementations, the bus interface414can implement network protocol layers414a-414dthat manage incoming and outgoing transactions. For outbound transactions, the transport layer414acan form a packet with information provided by a transaction initiator, which may be, for example, the PCIe core410, the management circuit420, or the local hardware430. The data link layer414bcan add additional information to the packet, such as, for example, packet header information and/or error checking information that can be used by the recipient of the transaction to validate the integrity of the packet. The media access layer414ccan provide addressing information such as physical address of the source and destination of the transaction. The physical layer414dcan encode the packet into electrical signals and transmit the packet onto the bus402. For incoming transactions, the physical layer414dcan accept a packet from the bus402and decode the packet. The media access layer414ccan process the source and destination address of the transaction. The data link layer414bcan parse the packet header information and check for errors. The transport layer414acan convert the information contained in the packet into a format that can be processed by the PCIe core410and/or the local hardware430.

In various implementations, the PCIe core410can also include a native configuration space412. The native configuration space412can include configuration registers that are associated with basic functionality, and/or that may be common to all PCIe-based peripheral devices, and/or that may be unnecessary or inconvenient to emulate. Examples of such registers include a Type 0/1 common register header416, Advanced Error Reporting capability registers412a, Message Signaled Interrupts extended (MSI-X) capability registers412b, and power budgeting capability registers412c, among others. In various implementations, other configuration register space can be found, for example, in the emulated configuration space442. In some implementations, the native configuration space412can also be emulated. In some implementations, all PCI configuration registers for a PCIe-based peripheral device can be emulated.

In various implementations, the PCIe core410can detect read and write transactions addressed to the native configuration space412. In these implementations, the PCIe core410can service configuration transactions directed to the native configuration space412. When the PCIe core410receives a configuration transaction that is addressed to a configuration space that is not within the native configuration space412, the PCIe core410can direct the configuration transaction to the management circuit420. In other implementations, the PCIe core410directs all configuration read and write transactions to the management circuit420, regardless of whether they are addressed to the native configuration space412or the emulated configuration space442.

In various implementations, the management circuit420can provide management of read and write transactions directed a device being emulated by the configurable PCIe device400, including memory, I/O, configuration, and messaging transactions, among others. In various implementations, the management circuit420can be implemented as a circuit on an ASIC or an FPGA. Alternatively or additionally, in some implementations, the management circuit420can be implemented as a circuit on a SoC. In some implementations, the management circuit420can be implemented using firmware, where the firmware runs on ASIC and/or FPGA on the configurable PCIe device400.

In some implementations, the management circuit420may provide transaction logging. Logged transactions are temporarily stored for later executing by the local hardware430. Upon receiving a transaction, the PCIe core410may log the transaction with the management circuit420. The PCIe core410may then continue with other operations. Transactions may be read from the log and be serviced by the local hardware430. The local hardware430may remove a transaction from the log when the transaction is read, or may remove the transaction after the transaction has been executed and responded to, or otherwise indicate in the log that the transaction has been serviced or is in the process of being serviced.

In various implementations, the local hardware430can include one or more processors, one or more processor cores, a processor cluster, programmable gate arrays, or control logic circuitry adapted to process configuration transactions. In some implementations, the local hardware430can run an operating system432. The operating system432can provide a user mode432aand a privileged mode432b. The user mode432acan execute, for example, user applications that have been loaded into the configurable PCIe device400. The privileged mode432bcan execute system functions.

In various implementations, the local hardware430, using one or more local processors, can process transactions logged by the management circuit420. For example, the local processor(s) can execute a memory or I/O write, including locating the appropriate address space, reading a value from the appropriate address, and returning the value in a response transaction. The local hardware430can also include other hardware for executing transactions. In some implementations, the processor(s) can execute specialized software for executing some types of transactions, such as configuration transactions.

In various implementations, the local hardware430can also include a secure mode434of operation (e.g., ARM secure mode, or something similar). A program or software running in secure mode434can be isolated from other programs executing on the local hardware430. For example, the operating system432and/or applications running on top of the operating system432may not be able to access modules running within the secure mode434. Conversely, in some implementations, programs running within the secure mode434may not be able to influence processes running outside of the secure mode434. Thus, the secure mode434may provide an environment in which a program can execute without intervention or interference from other programs that may be executing on the local hardware430. In various examples, programs executing in the secure mode434can be highly optimized, and/or may have higher priority than other programs. In some implementations, the secure mode434can be implemented as a section of hardware and/or software that is logically and/or physically isolated within the local hardware430.

In some implementations, an emulation module436can be implemented as integrated circuit in the local hardware430, and/or as emulation software being executed in the secure mode434. The emulation software can be referred to as ConfigSpace Emulation Software (CSES). In various implementations, the emulation module436can receive transactions, including configuration transactions, from the management circuit420, and can service those transactions. For example, servicing a configuration read transaction can include reading a configuration register from an emulated configuration space, and responding with the information read from the register. As another example, servicing a configuration write register can include updating the contents of the configuration register in the emulated configuration space. In some cases, a configuration write can be responded to with an acknowledgment that the write transaction completed.

In some implementations, the emulation module436can receive some or all configuration transactions directed to the peripheral device. In some implementations, the emulation module436can determine whether a configuration transaction is directed to the native configuration space412or the emulated configuration space442. When a configuration transaction is directed to the native configuration space412, the emulation module436can communicate with the PCIe core410to read or write the native configuration register. In some implementations, management circuit can handle native configuration register accesses without involving emulation module436. When a configuration read is directed to the emulated configuration space442, the emulation module436can read a value representing the contents of the configuration register from the emulated configuration space442. When a configuration write is directed to the emulated configuration space442, the emulation module436can write or update data in the emulated configuration space442that represents the configuration register. In some implementations, the emulation module436may itself emulate one or more configuration registers internally. In such implementations, the emulation module436can read or write an internal representation of a configuration register, and may not need to access the emulated configuration space442.

In some implementations, the emulation module436may make use of the PCI interrupt mechanism to process the emulated configuration register accesses. For example, the emulation module436can define the PCIe core 0 interrupt as a secure interrupt, and register a handler to this interrupt. An interrupt handler can be an independent software function that is triggered when an interrupt is received. When the PCIe core 0 interrupt is triggered, the emulation module436can be alerted and can begin servicing transactions from the management circuit420. By defining the PCIe core 0 interrupt as secure, the interrupt may be hidden, or masked from non-secure modules, such as the operating system432. In some implementations, a secure interrupt may also interrupt a non-secure interrupt handler.

In various implementations, the memory440provides storage for data that can be operated on by the local hardware430. The memory440can include DRAM, (e.g., SDRAM, DDR-SDRAM, etc.), SRAM, flash memory, or some other memory type or combinations thereof. In some implementations, the memory440can be implemented as an external memory module, or as an internal memory of the configurable peripheral device300, or a combination of external and internal memory. In various implementations, the memory440can store an emulated configuration space442. The emulated configuration space442can include representations for all or some of the 4 KB configuration address space that is defined for PCIe devices. In some implementations, the emulated configuration space442can include PCIe extended capability registers. For example, the emulated configuration space442may include Advanced Error Reporting capability registers, Virtual Channel capability registers, Device Serial Number registers, and/or Power Budgeting capability registers among others. Alternatively or additionally, the emulated configuration space442can include Single Root-I/O Virtualization (SR-IOV) extended capability registers. In these cases, the emulated configuration space442can include capability registers that allow SR-IOV physical and virtual functions to be controlled. SR-IOV is discussed in further detail below.

In some implementations, the emulated configuration space442can be dynamically replaced and/or modified. For example, PCIe extended capabilities can be added or removed in emulated configuration space442. In other implementations, the configurable PCIe device400can include multiple emulated configuration spaces for emulating different peripheral devices.

In various implementations, the management circuit420can include transaction logging to track incoming transactions. The transaction logging can maintain a log of some or all incoming read and write transactions. In some implementations, the transaction logging can use several registers to log a given transaction. These registers can include an address register, a data register, and a completion register.

The address register can be set when a read or write transaction is transmitted to the transaction logging. The address register can contain information necessary to identify the register that is the target of the inbound transactions. In some cases, the address register may be cleared when read by emulation module436. As an example, the address register can include information such as a valid indicator (that indicates whether the address register is valid), a transaction type, a target register offset, read/write indicator indicating whether the transaction is a read access or a write access, a device function field indicating which physical or virtual function is the target of the access, and a target bus number, among other things. In some implementations, setting the valid indicator may trigger an interrupt or low-latency notification to the emulation module436to request the emulation module436to service the access request.

The data register can store data associated with the transaction. For write transactions, the data register can store the data to be written. For read transactions, the data register can store the data read from the target configuration register by emulation module436.

The completion register can indicate the status of a read or write transaction. The completion register can be written to by the local hardware430when the local hardware430completes a transaction. The values written to the completion register can be used to format a completion response that is sent to the initiator of the transaction (e.g., a root complex). For example, the values in the completion register can be used to generate a completion indication. In various examples, the completion indication can identify the bus number, device number, and/or function number of the peripheral device, and function that accepted and serviced the transaction. In some cases, when the local hardware430writes to the completion register, the pending configuration transaction is considered complete and can be released. In some cases, the completion register may be only written once for each inbound transaction.

As an example, the completion register can include information such as a completion status, a target bus number, a target device number, and a target function number. The completion status can indicate whether the transaction completed successfully, the transaction was invalid (e.g., the target function or target bus number may not exist), the transaction should be retried (e.g., the peripheral device could not accept the transaction, and the transaction should be transmitted again by transaction's initiator), or the transaction was aborted (e.g., the peripheral device accepted, but could not complete the transaction). The target bus number can indicate which bus number to use in the completion identifier (e.g., the target bus number provided in the address register is returned, or a bus number associated with target function is returned). For example, a peripheral device being emulated may reside on bus number 1. An inbound transaction can be Configuration Type 1 configuration transaction, and can be directed to bus number 2. In this case, the local hardware430can return either bus number 1 or 2. The target device number can indicate which target device number to use in the completion identifier (e.g., the target device number provided in the address register is returned, or a target device number associated with the target function is returned). The target function number can indicate which target function number to use in the completion identifier (e.g., the target function number provided in the address register is returned, or a port function number is returned).

FIG. 5illustrates an example of a computing system500that includes multiple peripheral devices. Peripheral devices can include hardware devices and/or devices that include a combination of hardware and software, which can be attached to a computing system to add functionality to the computing system500. Examples of peripheral devices include storage devices, displays, speakers, wired and/or wireless network adapters, adapters to provide additional ports to the system (such as serial and/or parallel ports), bridges, hubs, and/or switches that provide ports for additional peripheral devices, and others. Generally, peripheral devices can be connected and disconnected from the computing system to change the functionality of the system. In some cases, the computing system must be powered down for a peripheral device to be added or removed. In other cases, the peripheral device can be attached or removed while the computer system is powered on (often referred to as “hot-swapping” or “hot-plugging”).

The example ofFIG. 5illustrates a computing system500that includes peripheral devices that implement one or more variations of the Peripheral Component Interconnect (PCI) standard bus protocols. A bus is a communication channel that transfers data within a computing system, or between a computing system and other devices. A standard bus protocol is a data transfer protocol for which a specification has been defined and adopted by various manufacturers. Manufacturers ensure that compliant devices are compatible with computing systems implementing the bus protocol, and vice versa. PCI describes a family of related, standardized bus protocols. PCI includes the original PCI standard, PCI-eXtended (PCI-X), Accelerated Graphics Port (AGP), and PCI Express (PCIe, also referred to as PCI-XP). The term “PCI” or “PCI-based” may be used herein to describe any protocol in the PCI family of bus protocols. The peripheral devices illustrated inFIG. 5can also include peripheral devices that implement bus protocols that are based on a PCI bus protocol, such as Non-Volatile Memory Express (NVMe), a bus protocol used for high-speed storage disks that operates on top of a PCIe bus.

In the example shown inFIG. 5, PCI is provided as an example of a bus protocol that can be implemented by a computing system to connect to peripheral devices. A computing device can use other bus protocols, such as for example, Industry Standard Architecture (ISA), Extended ISA (EISA), Video Electronics Standards Association (VESA), Micro Channel, and any of the Advanced Technology Attachment (ATA) family of protocols, among others. The illustrated example can also be implemented with a combination of standard bus protocols, a combination of proprietary bus protocols, and/or a combination of standard and proprietary bus protocols.

The example computing system500may include one or more processors502, a root complex504, a memory subsystem506, a switch508, a bridge514, and a number of peripheral devices. In this example, the peripheral devices include PCIe endpoints510a-510cand legacy endpoints512a-512c. The processors502may be general purpose computing devices such as are manufactured by Intel®, AMD®, ARM®, Qualcomm®, an others. The processors502are hardware devices that can be implemented using an integrated circuit or a combination of integrated circuits. The processors502are generally capable of executing software code. A processor may include multiple processing cores.

The root complex504may be a hardware device or a hardware and software device that connects the processors502and the memory subsystem506to the peripheral devices. The peripheral devices may be connected directly to the root complex504. For example, the PCIe endpoint510cis connected directly to the root complex504. Alternatively or additionally, the peripheral devices may be connected to the root complex504through a switch508. A bridge514may also be connected to the root complex504. The root complex504may forward transactions to the processors502and direct responses from the processors502back to the peripheral devices. The root complex504may further generate transactions on behalf of the processors502, and forward responses to those transactions back to the processors502. In some cases, the root complex504may also route transactions from one peripheral device to another, and/or between peripheral devices, switches, and bridges. The root complex504may provide services for the computing system500, such as a hot plug controller, a power management controller, an interrupt controller, and/or error detection and reporting. In some implementations, the root complex504may be implemented as part of a host system that includes one or more integrated processors. In some cases, memory may also be integrated into the host system.

The memory subsystem506may provide temporary or long-term storage for data that may be used by the computing system500. The memory subsystem506may include Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), and/or Double Data Rate (DDR), among others. In some cases, the memory subsystem506may also include Read-Only Memory (ROM), such as Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), and/or Flash EEPROM, among others. In some implementations, the root complex504may include a memory controller to manage transactions to and from the memory subsystem506. In other implementations, the processors502may include a memory controller. Alternatively or additionally, the computing system500may include an external memory controller in communication with either the processors502, the root complex504, or both the processors502and the root complex504, and the memory subsystem506.

Peripheral devices are devices that can generate and/or respond to data transactions. For example, peripheral devices may be “requesters” (transaction generators) and/or “completers” (transaction responders). In PCI implementations, peripheral devices may include PCIe endpoints, where “endpoint” describes a peripheral device that is configured to communicate using a PCI protocol. Other peripheral devices may be legacy endpoints, that is, peripheral devices that are configured to communicate using a PCI protocol other than PCIe, such as the original PCI standard or PCI-X. Though not illustrated here, the computing system500may further include peripheral devices that implement another bus standard, such as for example, Small Computer System Interface (SCSI), Serial ATA (SATA), or Parallel ATA (PATA), among others.

The switch508functions as a multi-port connecter between various devices, including the root complex504, peripheral devices, and possibly other switches and bridges. The switch508may route transactions between any of the devices connected to it. For example, the switch508may route transactions between the PCIe endpoints510a-510band the legacy endpoint512a, and between the various endpoints510a-510b,512aand the root complex504. The switch508may also provide arbitration to prioritize incoming and outgoing transactions. Devices connected to the switch508may treat the switch508as another requester and/or completer. Though not illustrated here, switches can also be connected to other switches to further expand the number of peripheral devices that can be connected to the computing system500.

The bridge514may provide connectivity to other busses or switching fabrics. The other busses or switching fabrics may implement a PCI variant or another protocol. For example, in the example ofFIG. 5, the bridge514provides connectivity to a bus implementing the original PCI standard. The bridge514may include mechanisms to translate from one bus protocol, such as the original PCI standard, to another protocol, such as PCIe.

Components in the computing system500may be connected through a shared bus. For example, in the illustrated example, the legacy endpoints512b-512care connected to a shared PCI bus516g. Alternatively or additionally, peripheral devices may be connected to the computing system500in a switching fabric topology. The interconnected devices illustrated inFIG. 5, including the root complex504, the switch508, the bridge514, and the PCIe endpoints510a-510c, form an example of a switching fabric. A switching fabric topology includes point-to-point connections between the devices connected to the fabric, and may include a routing system for passing messages between the devices. In a switching fabric, transactions may be spread across multiple physical links. In the example ofFIG. 5, the switch508is connected to the root complex504with Bus 1516aand the PCIe endpoint510cis connected to the root complex with Bus 6516e. Similarly, the bridge514is connected to the root complex with Bus 7516f. Each of the PCIe endpoints510a-510band the legacy endpoint512aare also connected to the switch508with individual busses516b-516d. The connections between each of the root complex504, the switch508, the bridge514, the PCIe endpoints510a-510cand the legacy endpoint512aare point-to-point because each of the busses516a-516gare not shared with another device. Furthermore, a packet directed from one device to another (for example, from the root complex504to the PCIe endpoint510a) is routed directly to its destination.

In some implementations, the connections between the devices in the computing system500may be numbered. For example, in the illustrated example, the connection between the switch508and the root complex504is labeled Bus 1516a(Bus 0 may be internal to the root complex504). Similarly, each of the busses connecting the PCIe endpoints510a-510band the legacy endpoint512ato the switch508are labeled Bus 3516b, Bus 4516c, and Bus 5516d, respectively (Bus 2 may be internal to the switch508). Furthermore, the connection between the root complex504and the PCIe endpoint510cmay be labeled Bus 6516e, while the connection between the root complex and the bridge514may be labeled Bus 7516f. Finally, the shared bus downstream from the bridge514may be labeled Bus 8516g. In most cases, the numbering of the busses is arbitrary, though bus numbers are generally assigned in a logical fashion. For example, Bus 0 may be located within the root complex504, and the bus label may increment as the distance between the bus and the root complex504increases.

As noted above, peripheral devices may add to and/or modify the functionality of the computing system500. For example, one PCIe endpoint510amay implement a Wi-Fi adapter520. Using the Wi-Fi adapter520, the computing system500may be able to communicate wirelessly with a wireless access point522, and thereby access a network. As another example, another PCIe endpoint510bmay implement a video card. A video card may include a port to connect a monitor524or other display device. As a further example, the computing system500may include a legacy endpoint512athat implements a sound card. A sound card may include a port or jack that accepts a plug for a speaker526or other audio output device.

In some cases, a PCIe endpoint may be a multi-function device, that is, a device that provides the services of multiple devices. For example, the PCIe endpoint510cmay include an Ethernet adapter, and provide a connection to a gateway device528, such as a DSL or cable modem. The PCIe endpoint510cmay also include a storage adapter, and provide a connection to a storage device532. The one PCIe endpoint510cthus may provide access to a network530, as well as access to a storage device532. The hardware and/or software components in the peripheral device that provide the services of, for example, a network interface or a storage controller may be called a “function.” In the context of PCI devices, the terms “function” and “service” may be synonymous, though in other contexts this is not necessarily the case. Types of functions that may be provided by a peripheral device include, for example, mass storage controllers, network controllers, display controllers, multimedia devices, memory controllers, bridges, input devices docking stations, serial bus controllers, wireless controllers, satellite communications controllers, and encryption/decryption controllers, among others. In some implementations, functions can be added to a peripheral device, for example, by connecting daughter cards or external devices to expansion slots or external ports on the peripheral device. In some implementations, a multi-function PCI device may provide up to eight separate functions. In many implementations, the functions provided by a peripheral device may be identified by a function number. For example, Function 0 of the PCIe endpoint510cmay be a mass storage controller, while Function 1 may be a network interface.

When a computing system such as computing system500illustrated inFIG. 5initially powers up, the processors502may be unaware of any peripheral devices that are connected to the system. The processors502may be aware of the root complex504, and possibly also that the root complex504is connected to one or more busses. To learn about the rest of the system, the processors502may execute a process to scan and configure the system. This process may be referred to as an enumeration process. The specific process of scanning for, locating, and identifying peripheral devices may be called discovery or discovering. During an enumeration process, software executing on the processors502may first scan each of the busses516a,516e,516fconnected to the root complex504, and identify the switch508, the PCIe endpoint510c, and the bridge514. Upon discovering the switch508, the processors502may next scan the busses516b-516dconnected to the switch508. The processors502thereby discover the PCIe endpoints510a-510band the legacy endpoint512a. Upon discovering the bridge514, the processors502may also scan Bus 8516g; however, the bridge514may translate the scanning instructions to the protocol implemented by Bus 8516g.

While scanning the busses, or possibly after, the processors502may also transmit configuration transactions to each of the devices it discovers. Configuration may include, for example, assigning one or more address spaces. For example, PCI devices typically include one or more of a memory address space and/or an Input/Output (I/O) address space. Each of these address spaces may be subdivided into multiple blocks. These address spaces and address space blocks may each be assigned a base address, where the base address establishes the region of memory that is assigned to the address space. In some implementations, these base addresses may be stored in configuration registers in a configuration space included in a device. Software executing on the processors502may be responsible for managing all available memory, and, for example, ensuring that no two devices are assigned overlapping memory regions. Alternatively or additionally, memory may be managed by a memory controller.

Configuration may further include programming information, such as a bus number and/or a device number, into configuration registers included in the peripheral devices. During configuration, the processors502may also read information from configuration registers. For example, the PCIe endpoint510cmay include a configuration register that indicates that it has two functions. The PCIe endpoint510cmay further include separate configuration registers for each function. Each function's configuration registers may further include information that indicates the capabilities of each function. For example, a configuration register may indicate that Function 0 is a mass storage controller, and another configuration register may indicate that Function 1 is a network interface. In most implementations, configuration registers are included in the hardware of a device.

In some implementations, the switch508and the bridge514also include a configuration space with configuration registers. In such implementations, the processors502may discover the switch and bridge functionality by reading configuration registers in the switch508and the bridge514. The switch508and the bridge514may also be configured by the processors502, for example with bus and device numbers.

FIG. 6illustrates an example of a process600for adding an emulated peripheral device to a host device. This may be implemented by the configurable peripheral devices described above.

At step602, the process600includes receiving, by configurable peripheral device, a request for a new endpoint device. The request is received from a host device that the configurable peripheral device may be connected to. The configurable peripheral device may have been configured to include an emulated switch, where the emulated switch includes an emulated upstream port and a plurality of emulated downstream ports. An emulated upstream port can enables the emulated switch to be connected to a bus complex of the host device.

At step604, the process600includes selecting an emulation configuration from a plurality of emulation configurations stored on the configurable peripheral device. The selected emulation configuration corresponds to the new endpoint device. For example, the emulation configuration can include an emulated configuration space for the new endpoint device.

At step606, the process600includes generating the new endpoint device using the selected emulation configuration. Generating the new endpoint device can include, for example, assigning integrated circuit components to the new endpoint device, allocating memory space for the new endpoint device, and/or initializing a set of emulated configuration registers for the new endpoint device, among other things.

At step608, the process600includes attaching the new endpoint device to a particular downstream port from the plurality of downstream ports. Attaching adds the new endpoint device to the bus complex emulated by the configurable peripheral device.

At step610, the process600includes initiating a hot-plug procedure to add the new endpoint device to the host device. Initiating the hot-plug procedure includes sending a signal to the host device.

In various implementations, the process600can further include steps executed by the host device to discovery information about the new endpoint device, as part of the hot-plug procedure. These steps can include, for example, receiving a request for information about the new endpoint device. The request may be received from the host device. The steps can further include directing the request to the emulated upstream port, for routing through the emulated bus complex to the particular downstream bridge to which the new endpoint device is attached. The steps can further include receiving a response from the emulated upstream port, where the response was generated by the particular downstream bridge and/or the new endpoint device. The steps can further include transmitting the response to the host device.

In various implementations, the process600can further include steps for configuring the new endpoint device, as part of the hot-plug procedure. These steps can include, for example, receiving a configuration transaction for configuring the new endpoint device. The configuration transaction may be received from the host device. The steps can further include directing the configuration transaction to the emulated upstream port.

In various implementations, the process600can further include steps for directing transactions received by the configurable peripheral device to the new endpoint device, during steady-state operation of the configurable peripheral device. These steps can include, for example, directing a transaction addressed to the new endpoint device to the emulated upstream port. The emulated switch can then direct to the transaction to the new endpoint device. The steps can further include transmitting a response from the new endpoint device to the host device.

In various implementations, the process600can further include steps for removing the new endpoint device using a hot-plug remove procedure. These steps can include, for example, receiving a request to remove the new endpoint device. The request can be received from the host device. The steps can further include detaching the new endpoint device from the particular downstream port to which the new endpoint device is connected. The steps can further include deleting the new endpoint device, where deletion can include freeing hardware, software, and/or memory resources being used by the new endpoint device. The steps can further include initiating a hot-plug procedure to remove the new endpoint device.

FIG. 7illustrates an example of a network device700. Functionality and/or several components of the network device700may be used without limitation with other examples disclosed elsewhere in this disclosure, without limitations. A network device700may facilitate processing of packets and/or forwarding of packets from the network device700to another device. As referred to herein, a “packet” or “network packet” may refer to a variable or fixed unit of data. In some instances, a packet may include a packet header and a packet payload. The packet header may include information associated with the packet, such as the source, destination, quality of service parameters, length, protocol, routing labels, error correction information, etc. In certain implementations, one packet header may indicate information associated with a series of packets, such as a burst transaction. In some implementations, the network device700may be the recipient and/or generator of packets. In some implementations, the network device700may modify the contents of the packet before forwarding the packet to another device. The network device700may be a peripheral device coupled to another computer device, a switch, a router or any other suitable device enabled for receiving and forwarding packets.

In one example, the network device700may include processing logic702, a configuration module704, a management circuit706, a bus interface module708, memory710, and a network interface module712. These modules may be hardware modules, software modules, or a combination of hardware and software. In certain instances, modules may be interchangeably used with components or engines, without deviating from the scope of the disclosure. The network device700may include additional modules, not illustrated here, such as components discussed with respect to the nodes disclosed inFIG. 8. In some implementations, the network device700may include fewer modules. In some implementations, one or more of the modules may be combined into one module. One or more of the modules may be in communication with each other over a communication channel714. The communication channel714may include one or more busses, meshes, matrices, fabrics, a combination of these communication channels, or some other suitable communication channel.

The processing logic702may include application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), systems-on-chip (SoCs), network processing units (NPUs), processors configured to execute instructions or any other circuitry configured to perform logical arithmetic and floating point operations. Examples of processors that may be included in the processing logic702may include processors developed by ARM®, MIPS®, AMD®, Intel®, Qualcomm®, and the like. In certain implementations, processors may include multiple processing cores, wherein each processing core may be configured to execute instructions independently of the other processing cores. Furthermore, in certain implementations, each processor or processing core may implement multiple processing threads executing instructions on the same processor or processing core, while maintaining logical separation between the multiple processing threads. Such processing threads executing on the processor or processing core may be exposed to software as separate logical processors or processing cores. In some implementations, multiple processors, processing cores or processing threads executing on the same core may share certain resources, such as for example busses, level 1 (L1) caches, and/or level 2 (L2) caches. The instructions executed by the processing logic702may be stored on a computer-readable storage medium, for example, in the form of a computer program. The computer-readable storage medium may be non-transitory. In some cases, the computer-readable medium may be part of the memory710.

The memory710may include either volatile or non-volatile, or both volatile and non-volatile types of memory. The memory710may, for example, include random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory, and/or some other suitable storage media. In some cases, some or all of the memory710may be internal to the network device700, while in other cases some or all of the memory710may be external to the network device700. The memory710may store an operating system comprising executable instructions that, when executed by the processing logic702, provides the execution environment for executing instructions providing networking functionality for the network device700. The memory may also store and maintain several data structures and routing tables for facilitating the functionality of the network device700.

In some implementations, the configuration module704may include one or more configuration registers. Configuration registers may control the operations of the network device700. In some implementations, one or more bits in the configuration register can represent certain capabilities of the network device700. Configuration registers may be programmed by instructions executing in the processing logic702, and/or by an external entity, such as a host device, an operating system executing on a host device, and/or a remote device. The configuration module704may further include hardware and/or software that control the operations of the network device700.

In some implementations, the management circuit706may be configured to manage different components of the network device700. In some cases, the management circuit706may configure one or more bits in one or more configuration registers at power up, to enable or disable certain capabilities of the network device700. In certain implementations, the management circuit706may use processing resources from the processing logic702. In other implementations, the management circuit706may have processing logic similar to the processing logic702, but segmented away or implemented on a different power plane than the processing logic702.

The bus interface module708may enable communication with external entities, such as a host device and/or other components in a computing system, over an external communication medium. The bus interface module708may include a physical interface for connecting to a cable, socket, port, or other connection to the external communication medium. The bus interface module708may further include hardware and/or software to manage incoming and outgoing transactions. The bus interface module708may implement a local bus protocol, such as Peripheral Component Interconnect (PCI) based protocols, Non-Volatile Memory Express (NVMe), Advanced Host Controller Interface (AHCI), Small Computer System Interface (SCSI), Serial Attached SCSI (SAS), Serial AT Attachment (SATA), Parallel ATA (PATA), some other standard bus protocol, or a proprietary bus protocol. The bus interface module708may include the physical layer for any of these bus protocols, including a connector, power management, and error handling, among other things. In some implementations, the network device700may include multiple bus interface modules for communicating with multiple external entities. These multiple bus interface modules may implement the same local bus protocol, different local bus protocols, or a combination of the same and different bus protocols.

The network interface module712may include hardware and/or software for communicating with a network. This network interface module712may, for example, include physical connectors or physical ports for wired connection to a network, and/or antennas for wireless communication to a network. The network interface module712may further include hardware and/or software configured to implement a network protocol stack. The network interface module712may communicate with the network using a network protocol, such as for example TCP/IP, Infiniband, RoCE, Institute of Electrical and Electronics Engineers (IEEE) 702.11 wireless protocols, User Datagram Protocol (UDP), Asynchronous Transfer Mode (ATM), token ring, frame relay, High Level Data Link Control (HDLC), Fiber Distributed Data Interface (FDDI), and/or Point-to-Point Protocol (PPP), among others. In some implementations, the network device700may include multiple network interface modules, each configured to communicate with a different network. For example, in these implementations, the network device700may include a network interface module for communicating with a wired Ethernet network, a wireless 702.11 network, a cellular network, an Infiniband network, etc.

The various components and modules of the network device700, described above, may be implemented as discrete components, as a System on a Chip (SoC), as an ASIC, as an NPU, as an FPGA, or any combination thereof. In some examples, the SoC or other component may be communicatively coupled to another computing system to provide various services such as traffic monitoring, traffic shaping, computing, etc. In some examples of the technology, the SoC or other component may include multiple subsystems as disclosed with respect toFIG. 8.

FIG. 8illustrates a network800, illustrating various different types of network devices700ofFIG. 7, such as nodes comprising the network device, switches and routers. In certain examples, the network800may be based on a switched architecture with point-to-point links. As illustrated inFIG. 8, the network800includes a plurality of switches804a-804d, which may be arranged in a network. In some cases, the switches are arranged in a multi-layered network, such as a Clos network. A network device700that filters and forwards packets between local area network (LAN) segments may be referred to as a switch. Switches generally operate at the data link layer (layer 2) and sometimes the network layer (layer 3) of the Open System Interconnect (OSI) Reference Model and may support several packet protocols. Switches804a-804dmay be connected to a plurality of nodes802a-802hand provide multiple paths between any two nodes.

The network800may also include one or more network devices700for connection with other networks808, such as other subnets, LANs, wide area networks (WANs), or the Internet, and may be referred to as routers806. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and use protocols such as internet control message protocol (ICMP) to communicate with each other and configure the best route between any two devices.

In some examples, network(s)800may include any one or a combination of many different types of networks, such as cable networks, the Internet, wireless networks, cellular networks and other private and/or public networks. Interconnected switches804a-804dand router806, if present, may be referred to as a switch fabric, a fabric, a network fabric, or simply a network. In the context of a computer network, terms “fabric” and “network” may be used interchangeably herein.

Nodes802a-802hmay be any combination of host systems, processor nodes, storage subsystems, and I/O chassis that represent user devices, service provider computers or third party computers.

User devices may include computing devices to access an application832(e.g., a web browser or mobile device application). In some aspects, the application832may be hosted, managed, and/or provided by a computing resources service or service provider. The application832may allow the user(s) to interact with the service provider computer(s) to, for example, access web content (e.g., web pages, music, video, etc.). The user device(s) may be a computing device such as for example a mobile phone, a smart phone, a personal digital assistant (PDA), a laptop computer, a netbook computer, a desktop computer, a thin-client device, a tablet computer, an electronic book (e-book) reader, a gaming console, etc. In some examples, the user device(s) may be in communication with the service provider computer(s) via the other network(s)808. Additionally, the user device(s) may be part of the distributed system managed by, controlled by, or otherwise part of the service provider computer(s) (e.g., a console device integrated with the service provider computers).

The node(s) ofFIG. 8may also represent one or more service provider computers. One or more service provider computers may provide a native application that is configured to run on the user devices, which user(s) may interact with. The service provider computer(s) may, in some examples, provide computing resources such as, but not limited to, client entities, low latency data storage, durable data storage, data access, management, virtualization, cloud-based software solutions, electronic content performance management, and so on. The service provider computer(s) may also be operable to provide web hosting, databasing, computer application development and/or implementation platforms, combinations of the foregoing or the like to the user(s). In some embodiments, the service provider computer(s) may be provided as one or more virtual machines implemented in a hosted computing environment. The hosted computing environment may include one or more rapidly provisioned and released computing resources. These computing resources may include computing, networking and/or storage devices. A hosted computing environment may also be referred to as a cloud computing environment. The service provider computer(s) may include one or more servers, perhaps arranged in a cluster, as a server farm, or as individual servers not associated with one another and may host the application832and/or cloud-based software services. These servers may be configured as part of an integrated, distributed computing environment. In some aspects, the service provider computer(s) may, additionally or alternatively, include computing devices such as for example a mobile phone, a smart phone, a personal digital assistant (PDA), a laptop computer, a desktop computer, a netbook computer, a server computer, a thin-client device, a tablet computer, a gaming console, etc. In some instances, the service provider computer(s), may communicate with one or more third party computers.

In one example configuration, the node(s)802a-802hmay include at least one memory818and one or more processing units (or processor(s)820). The processor(s)820may be implemented in hardware, computer-executable instructions, firmware, or combinations thereof. Computer-executable instruction or firmware implementations of the processor(s)820may include computer-executable or machine-executable instructions written in any suitable programming language to perform the various functions described.

In some instances, the hardware processor(s)820may be a single core processor or a multi-core processor. A multi-core processor may include multiple processing units within the same processor. In some embodiments, the multi-core processors may share certain resources, such as buses and second or third level caches. In some instances, each core in a single or multi-core processor may also include multiple executing logical processors (or executing threads). In such a core (e.g., those with multiple logical processors), several stages of the execution pipeline and also lower level caches may also be shared.

The memory818may store program instructions that are loadable and executable on the processor(s)820, as well as data generated during the execution of these programs. Depending on the configuration and type of the node(s)802a-802h, the memory818may be volatile (such as RAM) and/or non-volatile (such as ROM, flash memory, etc.). The memory818may include an operating system828, one or more data stores830, one or more application programs832, one or more drivers834, and/or services for implementing the features disclosed herein.

The operating system828may support nodes802a-802hbasic functions, such as scheduling tasks, executing applications, and/or controller peripheral devices. In some implementations, a service provider computer may host one or more virtual machines. In these implementations, each virtual machine may be configured to execute its own operating system. Examples of operating systems include Unix, Linux, Windows, Mac OS, iOS, Android, and the like. The operating system828may also be a proprietary operating system.

The data stores830may include permanent or transitory data used and/or operated on by the operating system828, application programs832, or drivers834. Examples of such data include web pages, video data, audio data, images, user data, and so on. The information in the data stores830may, in some implementations, be provided over the network(s)808to the nodes802a-802h. In some cases, the data stores830may additionally or alternatively include stored application programs and/or drivers. Alternatively or additionally, the data stores830may store standard and/or proprietary software libraries, and/or standard and/or proprietary application user interface (API) libraries. Information stored in the data stores830may be machine-readable object code, source code, interpreted code, or intermediate code.

The drivers834include programs that may provide communication between components in a node. For example, some drivers834may provide communication between the operating system828and additional storage822, network device824, and/or I/O device826. Alternatively or additionally, some drivers834may provide communication between application programs832and the operating system828, and/or application programs832and peripheral devices accessible to the service provider computer. In many cases, the drivers834may include drivers that provide well-understood functionality (e.g., printer drivers, display drivers, hard disk drivers, Solid State Device drivers). In other cases, the drivers834may provide proprietary or specialized functionality.

The service provider computer(s) or servers may also include additional storage822, which may include removable storage and/or non-removable storage. The additional storage822may include magnetic storage, optical disks, solid state disks, flash memory, and/or tape storage. The additional storage822may be housed in the same chassis as the node(s)802a-802hor may be in an external enclosure. The memory818and/or additional storage822and their associated computer-readable media may provide non-volatile storage of computer-readable instructions, data structures, program modules, and other data for the computing devices. In some implementations, the memory818may include multiple different types of memory, such as SRAM, DRAM, or ROM.

The memory818and the additional storage822, both removable and non-removable, are examples of computer-readable storage media. For example, computer-readable storage media may include volatile or non-volatile, removable or non-removable media implemented in a method or technology for storage of information, the information including, for example, computer-readable instructions, data structures, program modules, or other data. The memory818and the additional storage822are examples of computer storage media. Additional types of computer storage media that may be present in the node(s)802a-802hmay include, but are not limited to, PRAM, SRAM, DRAM, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, DVD or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, solid state drives, or some other medium which can be used to store the desired information and which can be accessed by the node(s)802a-802h. Computer-readable media also includes combinations of any of the above media types, including multiple units of one media type.

The node(s)802a-802hmay also include I/O device(s)826, such as a keyboard, a mouse, a pen, a voice input device, a touch input device, a display, speakers, a printer, and the like. The node(s)802a-802hmay also include one or more communication channels836. A communication channel836may provide a medium over which the various components of the node(s)802a-802hcan communicate. The communication channel or channels836may take the form of a bus, a ring, a switching fabric, or a network.

The node(s)802a-802hmay also contain network device(s)824that allow the node(s)802a-802hto communicate with a stored database, another computing device or server, user terminals and/or other devices on the network(s)800. The network device(s)824ofFIG. 8may include similar components discussed with reference to the network device700ofFIG. 7.

In some implementations, the network device824is a peripheral device, such as a PCI-based device. In these implementations, the network device824includes a PCI interface for communicating with a host device. The term “PCI” or “PCI-based” may be used to describe any protocol in the PCI family of bus protocols, including the original PCI standard, PCI-X, Accelerated Graphics Port (AGP), and PCI-Express (PCIe) or any other improvement or derived protocols that are based on the PCI protocols discussed herein. The PCI-based protocols are standard bus protocols for connecting devices, such as a local peripheral device to a host device. A standard bus protocol is a data transfer protocol for which a specification has been defined and adopted by various manufacturers. Manufacturers ensure that compliant devices are compatible with computing systems implementing the bus protocol, and vice versa. As used herein, PCI-based devices also include devices that communicate using Non-Volatile Memory Express (NVMe). NVMe is a device interface specification for accessing non-volatile storage media attached to a computing system using PCIe. For example, the bus interface module708may implement NVMe, and the network device824may be connected to a computing system using a PCIe interface.

A PCI-based device may include one or more functions. A “function” describes operations that may be provided by the network device824. Examples of functions include mass storage controllers, network controllers, display controllers, memory controllers, serial bus controllers, wireless controllers, and encryption and decryption controllers, among others. In some cases, a PCI-based device may include more than one function. For example, a PCI-based device may provide a mass storage controller and a network adapter. As another example, a PCI-based device may provide two storage controllers, to control two different storage resources. In some implementations, a PCI-based device may have up to eight functions.

In some implementations, the network device824may include single-root I/O virtualization (SR-IOV). SR-IOV is an extended capability that may be included in a PCI-based device. SR-IOV allows a physical resource (e.g., a single network interface controller) to appear as multiple resources (e.g., sixty-four network interface controllers). Thus, a PCI-based device providing a certain functionality (e.g., a network interface controller) may appear to a device making use of the PCI-based device to be multiple devices providing the same functionality. The functions of an SR-IOV-capable storage adapter device may be classified as physical functions (PFs) or virtual functions (VFs). Physical functions are fully featured functions of the device that can be discovered, managed, and manipulated. Physical functions have configuration resources that can be used to configure or control the storage adapter device. Physical functions include the same configuration address space and memory address space that a non-virtualized device would have. A physical function may have a number of virtual functions associated with it. Virtual functions are similar to physical functions, but are light-weight functions that may generally lack configuration resources, and are generally controlled by the configuration of their underlying physical functions. Each of the physical functions and/or virtual functions may be assigned to a respective thread of execution (such as for example, a virtual machine) running on a host device.