[dpdk-dev] [PATCH 0/4] virtio support for container

Tan, Jianfeng jianfeng.tan at intel.com
Thu Jan 14 12:41:32 CET 2016


Hi Amit,

On 1/14/2016 5:34 PM, Amit Tomer wrote:
> Hello,
>
>> Can you send out how you start this l2fwd program?
> This is how, I run l2fwd program.
>
> CMD ["/usr/src/dpdk/examples/l2fwd/build/l2fwd", "-c", "0x3", "-n",
> "4","--no-pci",
> ,"--no-huge","--vdev=eth_cvio0,queue_num=256,rx=1,tx=1,cq=0,path=/usr/src/dpdk/usvhost",
> "--", "-p", "0x1"]

In this way, you can only get 64M memory. I believe it's too small to 
create a l2fwd_pktmbuf_pool in l2fwd.

> I tried passing "-m 1024" to it but It causes l2fwd killed even before
> it could connect to usvhost socket.

In my patch, when --no-huge is specified, I change previous anonymous 
mmap into file-baked memory in /dev/shm. And usually, Docker mounts a 
64MB-size tmpfs there, so you cannot use -m 1024. If you want to do 
that, use -v to substitute the 64MB tmpfs with a bigger tmpfs.


>
> Do I need to create Hugepages from Inside Docker container to make use
> of Hugepages?

Not necessary. But if you want to use hugepages inside Docker, use -v 
option to map a hugetlbfs into containers.

Most importantly, you indeed uncover a bug here. Current implementation 
cannot work with tmpfs, because it lacks ftruncate() between open() and 
mmap(). It turns out that although mmap() succeeds, the memory cannot be 
touched. However, this is not a problem for hugetlbfs. I don't why they 
differ like that way. In all, if you want to use no-huge, please add 
ftruncate(), I'll fix this in next version.

Thanks,
Jianfeng

>
> Thanks,
> Amit.



More information about the dev mailing list