[lxc-users] Question on using /dev/uio0 inside containers

Anjali Kulkarni anjali at juniper.net
Mon Jul 7 18:25:01 UTC 2014


Also that worked. Thanks..

On 7/7/14 11:20 AM, "Anjali Kulkarni" <anjali at juniper.net> wrote:

>Thanks Stephane for your response!
>Just to be clear, if I use option 3, I use the host's device info, that is
>the device has foll. Major/minor nos 249, 0 as obtained below on host:
>
>ls -l /dev/uio0
>crw------- 1 root root 249, 0 Jul  6 13:59 /dev/uio0
>
>
>Hence, I add an entry in my config file like:
>
>lxc.cgroup.devices.allow = c 249:0 rwm
>
>And as you suggested:
>
>lxc.mount.entry = /dev/uio0 dev/uio0 none bind,create=file
>
>?
>Anjali
>
>On 7/7/14 8:22 AM, "Stéphane Graber" <stgraber at ubuntu.com> wrote:
>
>>On Mon, Jul 07, 2014 at 02:59:44PM +0000, Anjali Kulkarni wrote:
>>> Hi,
>>> 
>>> I am a newbie to using containers, and I am trying to run a DPDK
>>>enabled app inside a system container (which I created using
>>>lxc-create). While, lxc-execute works to run the dpdk app, the system
>>>container does not, giving me the following error:
>>> 
>>> EAL: Cannot open /dev/uio0: No such file or directory
>>> EAL: Error - exiting with code: 1
>>> 
>>> Where, one 10G ethernet device on host has been assigned to the uio_igb
>>>driver on the host, and hence is visible from host:
>>> root:/# ls /dev/uio0
>>> /dev/uio0
>>> 
>>> But /dev/uio0 is not visible in the container.
>>> 
>>> I was reading about autodev and how using autodev hook you can do an
>>>mknod to create the devs, but I am not sure what is the right approach
>>>here.  If I look in the dev of the rootfs of the container, I see some
>>>dev are already created/shared with the host. I want to do something
>>>similar for /dev/uio0. Can I just share/mount the /dev/uio0 from host
>>>onto container or use autodev?
>>> I just want the container to be able to use the /dev/uio0 just as if on
>>>host - what's the right way to approach/make this work?
>>
>>There are a few ways to do what you want, in any case, make sure you
>>have this node listed in your cgroup.device's configuration so once it's
>>there you can actually access it.
>>
>>I can thnk of three ways to have it available from inside the container:
>> - Just mknod it by hand and use it
>> - Use the lxc-device tool to add it once the container is started
>> - Add this to your container's config:
>>   "lxc.mount.entry = /dev/uio0 dev/uio0 none bind,create=file"
>>
>>The last two options expect LXC 1.0 or higher.
>>
>>> 
>>> Thanks
>>> Anjali
>>> 
>>> 
>>
>>> _______________________________________________
>>> lxc-users mailing list
>>> lxc-users at lists.linuxcontainers.org
>>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>>
>>-- 
>>Stéphane Graber
>>Ubuntu developer
>>http://www.ubuntu.com
>
>_______________________________________________
>lxc-users mailing list
>lxc-users at lists.linuxcontainers.org
>http://lists.linuxcontainers.org/listinfo/lxc-users



More information about the lxc-users mailing list