DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Running DPDK as non-root
@ 2016-07-07 15:47 Jez Higgins
  2016-07-07 16:17 ` Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jez Higgins @ 2016-07-07 15:47 UTC (permalink / raw)
  To: users

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [dpdk-users] Running DPDK as non-root
@ 2016-08-19 18:16 John Ousterhout
  2016-08-19 18:39 ` Wiles, Keith
  2016-08-25 13:56 ` Vincent JARDIN
  0 siblings, 2 replies; 11+ messages in thread
From: John Ousterhout @ 2016-08-19 18:16 UTC (permalink / raw)
  To: users

I'm trying to run a DPDK application as a normal user without root
privilege, and saw the instructions here:

http://dpdk.org/doc/guides/linux_gsg/enable_func.html

However, when I try this I get the following log messages:

EAL: Detected 8 lcore(s)
EAL: Probing VFIO support...
EAL: Cannot open /proc/self/pagemap: Operation not permitted. virt2phys
address translation will not work
PANIC in rte_eal_init():
Cannot init memory

I tried to change the permissions on /proc/self/pagemap, but that is
disallowed, even if I try it as root.

Any suggestions on how to get around this problem?

Thanks in advance for the help.

-John-

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-08-25 13:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07 15:47 [dpdk-users] Running DPDK as non-root Jez Higgins
2016-07-07 16:17 ` Thomas Monjalon
2016-07-07 18:37   ` Wiles, Keith
2016-07-08  2:29     ` Tan, Jianfeng
2016-07-12 17:09   ` Adrien Mazarguil
2016-07-08  3:55 ` Singh, Satish 1. (Nokia - IN/Bangalore)
2016-07-08  5:01 ` Singh, Satish 1. (Nokia - IN/Bangalore)
2016-07-11 10:41 ` Jez Higgins
2016-08-19 18:16 John Ousterhout
2016-08-19 18:39 ` Wiles, Keith
2016-08-25 13:56 ` Vincent JARDIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).