2021年4月5日星期一

Running DPDK in docker container without privileged

I tried run docker container with --cap-add=NET_ADMIN --cap-add=SYS_RESOURCE --cap-add=SYS_ADMIN, without privileged, but DPDK applications still can not run, what capabilities of docker should be passed to container? dpdk-stable-18.11.11, docker client and server engine 19.03.11, Linux version 5.4.0-70-generic

sudo docker run --name="sysadmin" --cap-add=NET_ADMIN --cap-add=SYS_RESOURCE --cap-add=SYS_ADMIN --v /mnt/huge:/mnt/huge -it centos:latest

[root]# ./my_basicfwd -l 1 -- -p 1
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: cannot open VFIO container, error 2 (No such file or directory)
EAL: VFIO support could not be initialized
EAL: Failed to get current mempolicy: Operation not permitted. Assuming MPOL_DEFAULT.
EAL: set_mempolicy failed: Operation not permitted
EAL: set_mempolicy failed: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
EAL: Error - exiting with code: 1
Cause: Error with EAL initialization

Thanks a lot.

tried this: sudo docker run --name="sysadmin" --cap-add=NET_ADMIN --cap-add=SYS_RESOURCE --cap-add=SYS_ADMIN --cap-add=SYS_NICE --device=/dev/uio0:/dev/uio0 -v --bind /sys/devices/pci0000:00/0000:00:1c.4/0000:04:10.1/uio/uio0 -v /mnt/huge:/mnt/huge -it centos:latest , but
"EAL: Cannot open /sys/class/uio/uio0/device/config: Read-only file system
EAL: Requested device 0000:04:10.1 cannot be used"

https://stackoverflow.com/questions/66904937/running-dpdk-in-docker-container-without-privileged April 01, 2021 at 08:55PM

没有评论:

发表评论