-
Notifications
You must be signed in to change notification settings - Fork 81
Docker
The Docker images are built with DPDK, but the --enable-dpdk-packet
flag is not set, so you don't need to actually use DPDK with these images.
Without DPDK:
docker run -it fastclick-dpdk:generic -e "FromDevice(eth0) -> Discard;"
With DPDK, you need to bind the hugepages, assuming they're mounted on /mnt/huge:
sudo docker run -v /mnt/huge:/dev/hugepages -it --privileged --network host fastclick-dpdk:generic --dpdk -- -e "FromDPDKDevice(0) -> Discard;"
There are ways to avoid --network-host, for instance using VFIO. But for testing purpose it's easier to just use the host interface.
Alternatively, you can also use --no-huge instead of binding hugepages, and use a generic driver. That will decrease performance but will enable using DPDK without any hastle.
docker runfastclick-dpdk:generic --dpdk --no-huge --vdev=eth_af_packet0,iface=eth0,blocksz=4096,framesz=2048,framecnt=512,qpairs=1,qdisc_bypass=0 -- -e "FromDPDKDevice(0) -> Discard;"
You might also use AF_XDP which will come with a lower performance cost, check the DPDK page.
DPDK and FastClick both target high performance, therefore compiling with the right architecture is important to take advantage of AVX and latest instructions. We provide an image built for every x86_64 CPUs. You should therefore use the right image builded for the correct architecture, or build it yourself.
In short, use the image fastclick-dpdk-$(gcc -march=native -E -v - </dev/null 2>&1 | grep cc1)
There are currently 2 arguments:
- machine : Target architecture, see above. It is "generic" which is the lowest DPDK supports (something with SSE 4.2).
- source : if "1" keep the source of DPDK and FastClick in the container, default 0
docker build --build-arg machine=generic --build-arg source=0 -t fastclick-dpdk .