PCIe peripheral sharing
A peripheral proxy subsystem provides routing mechanisms to allow multiple hosts to communicate with multiple functions, physical and virtual, of a single root I/O virtualization (SR-IOV) peripheral, which may include a physical function and a plurality of virtual functions associated with the physical function. The peripheral proxy subsystem, which may be embodied as a controller, includes a first endpoint interface; a second endpoint interface; and a single root controller interface configured to couple to the SR-IOV peripheral. The controller is configured to be able to present through the single root controller interface: a first subset of the plurality of virtual functions through a first cloned instance of the physical function at the first endpoint interface; and a second subset of the plurality of virtual functions through a second cloned instance of the physical function at the second endpoint interface.
1 . A controller comprising:
a first endpoint interface;
a second endpoint interface; and
a single root controller interface configured to couple to a peripheral device that includes a physical function and a plurality of virtual functions associated with the physical function;
wherein the controller is configured to present through the single root controller interface:
a first subset of the plurality of virtual functions through a first cloned instance of the physical function at the first endpoint interface; and
a second subset of the plurality of virtual functions through a second cloned instance of the physical function at the second endpoint interface,
the controller including virtual map logic configured to:
receive, a transaction from a virtual function of the plurality of virtual functions, the transaction including a request identification and a memory address of a first host associated with the first endpoint interface; and
convert the request identification to a virtual identification uniquely associated with the virtual function.
2 . The controller of claim 1 , wherein the first subset of the plurality of virtual functions and the second subset of the plurality of virtual functions are nonoverlapping.
3 . The controller of claim 1 , wherein the controller further comprises:
a set of control modules including a physical function control module for the physical function, and a plurality of virtual function control modules for the plurality of virtual functions, respectively.
4 . The controller of claim 1 , wherein the controller further includes a virtualization unit configured to:
translate the memory address into an internal address for the first endpoint interface.
5 . The controller of claim 4 , wherein the controller further includes an outbound translation unit coupled to the first endpoint interface and configured to translate the internal address for use by the first host.
6 . A controller comprising:
a single root controller interface configured to couple to a peripheral device that includes a physical function and a plurality of virtual functions associated with the physical function;
wherein the controller is configured to present through the single root controller interface:
a first subset of the plurality of virtual functions through a first cloned instance of the physical function at the first endpoint interface;
a second subset of the plurality of virtual functions through a second cloned instance of the physical function at the second endpoint interface;
a first routing mechanism configured to:
present each virtual function of the first subset of the plurality of virtual functions through the first cloned instance of the physical function at the first endpoint interface; and
present each virtual function of the second subset of the plurality of virtual functions through the second cloned instance of the physical function at the second endpoint interface; and
a second routing mechanism configured to:
transfer operations from a first host associated with the first endpoint interface to each virtual function of the first subset of the plurality of virtual functions; and
transfer operations from a second host associated with the second endpoint interface to each virtual function of the second subset of the plurality of virtual functions.
7 . The controller of claim 1 , wherein:
wherein the controller is configured to present through the single root controller interface:
another virtual function of the peripheral device to a virtual function of the first endpoint interface.
8 . A controller comprising:
a single root controller interface configured to couple to a peripheral device that includes a physical function and a plurality of virtual functions;
a first endpoint interface including a first cloned instance of the physical function and multiple virtual functions;
a second endpoint interface including a second cloned instance of the physical function; and
a virtualization unit configured to:
assign a first subset of virtual functions of the plurality of virtual functions to the first endpoint interface for use by a first external device when coupled to the first endpoint interface and to assign a second subset of virtual functions of the plurality of virtual functions to the second endpoint interface for use by a second external device when coupled to the second endpoint interface, wherein the first and second subsets of virtual functions are mutually exclusive;
allow identification of the peripheral device by the first and second external devices when coupled to the first and second endpoints, respectively; and
map through the single root controller interface:
the first subset of virtual functions to the first cloned instance of the physical function, and the second subset of virtual functions to the second cloned instance of the physical function.
9 . The controller of claim 8 , wherein the virtualization unit comprises a policy manager configured to store configuration allocation information for the physical function and the plurality of virtual functions.
10 . The controller of claim 8 , wherein the first endpoint interface includes a set of multiple physical functions, and the virtualization unit is further configured to map through the single root controller interface:
a third subset of virtual functions of the plurality of virtual functions to one of the multiple physical functions of the first endpoint interface.
11 . The controller of claim 8 , wherein the virtualization unit is further configured to map through the single root controller interface:
a third subset of virtual functions of the plurality of virtual functions to one of the multiple virtual functions of the first endpoint interface.
12 . A method comprising:
determining, by a controller, that a peripheral device is coupled to a root controller interface of the controller, wherein the peripheral device has a physical function and a plurality of virtual functions associated with the physical function;
creating a first set of address translation entries to map a first subset of the plurality of virtual functions to a first cloned instance of the physical function at a first endpoint interface of the controller;
presenting, at the first endpoint interface, the first subset of the plurality of virtual functions, using the first set of address translation entries and a first translation unit associated with the first endpoint interface;
creating a second set of address translation entries to map a second subset of the plurality of virtual functions to a second cloned instance of the physical function at a second endpoint interface of the controller; and
presenting, at the second endpoint interface, the second subset of the plurality of virtual functions, using the second set of address translation entries and a second translation unit associated with the second endpoint interface.
13 . The method of claim 12 , further comprising:
receiving, by virtual map logic of the controller, a transaction from a virtual function of the plurality of virtual functions, the transaction including a request identification and a memory address of a first host associated with the first endpoint interface;
converting, by the virtual map logic, the request identification to a virtual identification uniquely associated with the virtual function;
translating, by a virtualization unit of the controller, the memory address to an internal address for the first endpoint interface; and
translating, by an outbound translation unit coupled to the first endpoint interface, the internal address for use by the first host.
14 . The method of claim 12 , further comprising:
transferring operations, through the controller, from a first host associated with the first endpoint interface to each virtual function of the first subset of the plurality of virtual functions; and
transferring operations, through the controller, from a second host associated with the second endpoint interface to each virtual function of the second subset of the plurality of virtual functions.
15 . The method of claim 12 , further comprising:
presenting another virtual function of the peripheral device to a virtual function of the first endpoint interface.