Hi,

This is possible, with few permission for few filesystem as non-root user.
See section 4.3.
http://dpdk.org/doc/guides-1.8/freebsd_gsg/build_sample_apps.html



-----Original Message-----
From: users [mailto:[email protected]] On Behalf Of Jez Higgins
Sent: Thursday, July 07, 2016 9:17 PM
To: users at dpdk.org
Subject: [dpdk-users] Running DPDK as non-root

Hello,

Is it possible to run applications that use DPDK on Linux as anything other 
than root?  I think the answer is no, but I wonder if anyone has worked it out.

5.2 of the getting started guide says

  with a number of small permission adjustments it is possible to run these 
applications as a user other than ?root?

but this seems insufficient.  I have changed the permissions on the hugepages 
mountpoint (in my case /dev/hugepages), on /dev/uio0, on 
/sys/class/uio/uio0/device/config, and on
/sys/class/uio/uio0/device/resource*

Making these changes is sufficient initialise the application.  However, a 
non-root user does not seem to be able to read /proc/self/pagemap.
More specifically, a non-root user can open and read /proc/self/pagemap, but 
only ever reads zeros.  This means the mapping the hugepages virtual to 
physical addresses isn't correct, and so actually allocating even reasonably 
small amounts of memory (for example the log buffer) is liable to fail.

Apparently, access to /proc/self/pagemap is controlled by the CAP_SYS_ADMIN 
capability.  However, if I use setcap to enable that capability, I can't even 
open it, never mind read it.

I bodged around this by setting my default hugepage size to 1GB, rather than 
2MB.  The virtual to physical mapping is still wrong, but I can at least get 
DPDK to initialise.  I doubt it's correct though.

At that point, if I try to initialise a port with rte_eth_dev_start it fails.  
I'm running in a vm, so using the vmxnet3 driver.  It's failing to activate the 
device down in vmxnet3_dev_start.

If I run as root, however, everything fires up and runs correctly.

Is it possible to get DPDK up and running as non-root - if so, can anyone guide 
me to what I'm missing? Or should I be giving this up as a bad job?

Thanks in advance,
Jez

Reply via email to