WANG Cheng D
2014-Jan-16 08:55 UTC
Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers
Dear Daniel, The thirty-party PCIe card is based on the Xilinx’ FPGA which is off the shelf, the main features are as follows: 1) x8 Gen3, 8Gb/s per lane/direction 2) MSI and legacy interrupt support 3) Scatter-gather packet DMA engine provide by Northwest Logic We hope multiple Linux Containers to access the PCIe card in time division mode, for example, during slot 1, lxc1 read/write the PCIe card; during slot 2, lxc2 read/write the PCIe card. Taking reading operation (data flows from PCIe card to host memory) as example, in native mode, the PCIe driver should tell PCIe card the host memory address where to store the incoming data from PCIe card. With this address, the PCIe card will transmit the data to host memory itself. In container case, the problem is how application running in the container knows the expected host memory address. I wonder if we can have a process running in the which solely operates the PCIe card, all the containers will send/receive data to this process via socket. With my warmest regards, Cheng Wang -----Original Message----- From: Daniel P. Berrange [mailto:berrange@redhat.com] Sent: 2014年1月15日 18:46 To: WANG Cheng D Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers On Wed, Jan 15, 2014 at 12:58:54AM +0000, WANG Cheng D wrote:> Dear all, > > I have a thirty-party PCIe card in my host which can work properly in native mode. > > I wonder if this card can be shared by multiple containers. > > As far as the network interface is concerned, too many efforts have > been made for it. Two dedicated cgroup resource schedulers/subsystem > (net_cls, net_prio) have been provided at the kernel level, and > libvirt has also done a lot of work on virtual networking to enable > network interface sharing between containers. > > As it's difficult for me to implement all these things that have been > done for network interface, I should find other way to enable sharing > of this card. > > Do you have any idea?You don't mention what kind of PCI card it is and how you want the guest to use it. It may or may not be possible to share it depending on the answer to those questions. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Daniel P. Berrange
2014-Jan-16 10:34 UTC
Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers
On Thu, Jan 16, 2014 at 08:55:53AM +0000, WANG Cheng D wrote:> Dear Daniel, > > The thirty-party PCIe card is based on the Xilinx’ FPGA which is off the shelf, the main features are as follows: > 1) x8 Gen3, 8Gb/s per lane/direction > 2) MSI and legacy interrupt support > 3) Scatter-gather packet DMA engine provide by Northwest Logic > We hope multiple Linux Containers to access the PCIe card in time division mode, for example, during slot 1, lxc1 read/write the PCIe card; during slot 2, lxc2 read/write the PCIe card. > Taking reading operation (data flows from PCIe card to host memory) as example, in native mode, the PCIe driver should tell PCIe card the host memory address where to store the incoming data from PCIe card. With this address, the PCIe card will transmit the data to host memory itself. > In container case, the problem is how application running in the container knows the expected host memory address. > I wonder if we can have a process running in the which solely operates the PCIe card, all the containers will send/receive data to this process via socket.Ok, so from the LXC driver POV I guess this card is accessed via some special device node with ioctls or something ? If so then you can just expose the device node to as many containers as you like at the same time without restrictions. http://libvirt.org/formatdomain.html#elementsHostDevCaps Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
WANG Cheng D
2014-Jan-20 08:37 UTC
Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers
Dear Daniel, Thank you for the information. I think I should study more about libvirt's Node Device functions. Have a nice day. Cheng -----Original Message----- From: Daniel P. Berrange [mailto:berrange@redhat.com] Sent: 2014年1月16日 18:34 To: WANG Cheng D Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers On Thu, Jan 16, 2014 at 08:55:53AM +0000, WANG Cheng D wrote:> Dear Daniel, > > The thirty-party PCIe card is based on the Xilinx’ FPGA which is off the shelf, the main features are as follows: > 1) x8 Gen3, 8Gb/s per lane/direction > 2) MSI and legacy interrupt support > 3) Scatter-gather packet DMA engine provide by Northwest Logic We hope > multiple Linux Containers to access the PCIe card in time division mode, for example, during slot 1, lxc1 read/write the PCIe card; during slot 2, lxc2 read/write the PCIe card. > Taking reading operation (data flows from PCIe card to host memory) as example, in native mode, the PCIe driver should tell PCIe card the host memory address where to store the incoming data from PCIe card. With this address, the PCIe card will transmit the data to host memory itself. > In container case, the problem is how application running in the container knows the expected host memory address. > I wonder if we can have a process running in the which solely operates the PCIe card, all the containers will send/receive data to this process via socket.Ok, so from the LXC driver POV I guess this card is accessed via some special device node with ioctls or something ? If so then you can just expose the device node to as many containers as you like at the same time without restrictions. http://libvirt.org/formatdomain.html#elementsHostDevCaps Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
WANG Cheng D
2014-Jan-23 08:54 UTC
Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers
Dear Daniel, I found that lxc driver doesn't support hostdev with type of 'pci'. As you mentioned before, I tried to expose the device node (the PCIe card) to the container, my XML is as follow: <devices> <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address bus='0x01' slot='0x00' function='0x0'/> </source> </hostdev> </devices> When I started the container, I got the error message: Error: failed to start domain Error: unsupported configuration: Unsupported hostdev type pci. I want to confirm if the element hostdev of PCIe device is not supported by lxc driver currently. Have a nice day, Cheng Wang -----Original Message----- From: Daniel P. Berrange [mailto:berrange@redhat.com] Sent: 2014年1月16日 18:34 To: WANG Cheng D Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers On Thu, Jan 16, 2014 at 08:55:53AM +0000, WANG Cheng D wrote:> Dear Daniel, > > The thirty-party PCIe card is based on the Xilinx’ FPGA which is off the shelf, the main features are as follows: > 1) x8 Gen3, 8Gb/s per lane/direction > 2) MSI and legacy interrupt support > 3) Scatter-gather packet DMA engine provide by Northwest Logic We hope > multiple Linux Containers to access the PCIe card in time division mode, for example, during slot 1, lxc1 read/write the PCIe card; during slot 2, lxc2 read/write the PCIe card. > Taking reading operation (data flows from PCIe card to host memory) as example, in native mode, the PCIe driver should tell PCIe card the host memory address where to store the incoming data from PCIe card. With this address, the PCIe card will transmit the data to host memory itself. > In container case, the problem is how application running in the container knows the expected host memory address. > I wonder if we can have a process running in the which solely operates the PCIe card, all the containers will send/receive data to this process via socket.Ok, so from the LXC driver POV I guess this card is accessed via some special device node with ioctls or something ? If so then you can just expose the device node to as many containers as you like at the same time without restrictions. http://libvirt.org/formatdomain.html#elementsHostDevCaps Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Reasonably Related Threads
- Re: If it's possible for a third-party PCIe card to be shared by multiple containers
- Re: If it's possible for a third-party PCIe card to be shared by multiple containers
- If it's possible for a third-party PCIe card to be shared by multiple containers
- Re: If it's possible for a third-party PCIe card to be shared by multiple containers
- [Bug 102236] New: Pcie link speed is gen2 instead of gen3