Bug 118 - conflicting information for 'Running DPDK Applications Without Root Privileges'
Summary: conflicting information for 'Running DPDK Applications Without Root Privileges'
Status: CONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: doc (show other bugs)
Version: 18.11
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2018-12-05 06:43 CET by Vipin Varghese
Modified: 2018-12-10 11:35 CET (History)
1 user (show)



Attachments

Description Vipin Varghese 2018-12-05 06:43:23 CET
link 1: http://doc.dpdk.org/guides/freebsd_gsg/build_sample_apps.html?highlight=without%20root
statement: 'with a number of small permission adjustments, it is possible to run these applications as a user other than “root”. '

link 2: http://doc.dpdk.org/guides/linux_gsg/enable_func.html?highlight=without%20root
statement: since version 4.0, the kernel does not allow unprivileged processes to read the physical address information from the pagemaps file, making it impossible for those processes to use HW devices which require physical addresses

Can we either have 1 link for this or update both place with kernel 4.0 issue.
Comment 1 Anatoly Burakov 2018-12-05 11:22:27 CET
Hi Vipin,

It is not possible to run as non-root *and get physical addresses* (starting with kernel 4.0), but it is still possible to run as non-root without getting physical addresses (as in, using VFIO).

By the way, your link 1 refers to FreeBSD guide, not Linuxapp guide.
Comment 2 Vipin Varghese 2018-12-05 12:18:18 CET
Thanks for the update, but I want to run applications without PCI devices.

Usecases are with either '--no-pci' and '--vdev'. I do not have any pcie b:d:f

With respect to documents, my request to have FAQ or limitation page where 
1. Linux non root
2. Bsd non root
3. Steps to run in Linux < 4.0
4. Steps to run for bad
5. Work around for no-pci

Is covered
Comment 3 Anatoly Burakov 2018-12-05 12:40:48 CET
Hi Vipin,

request for documentation is not a bug, and IMO should not be tracked as such.

As for how to run DPDK without PCI devices - this is a known limitation of our IOVA infrastructure. Currently, DPDK will default to attempting to run in IOVA as PA mode unless you have 1) at least one device attached, and 2) all of the devices are attached to VFIO. For --no-pci or --vdev only case, the bus infrastructure will default to IOVA as PA mode, and so will not allow running as root unless you also use --no-huge.

That said, in 18.11, this can be overridden by a "--iova-mode=va" EAL switch - this will force DPDK into IOVA as VA mode.
Comment 4 Vipin Varghese 2018-12-05 14:09:57 CET
Hi Anatoly,

Any information that is in sufficient, not clearly stated or incorrect in documentation is a bug in my humble opinion.

request for documentation is not a bug, and IMO should not be tracked as such.
[vv] Based on the comment shared I made a suggestion to have under one umbrella.

As for how to run DPDK without PCI devices - this is a known limitation of our IOVA infrastructure. 
[vv] In search for answer I tried FAQ, Known Limitations, IOVA and release notes. May be I did not search correctly. Can you share the url which explains the same?

Currently, DPDK will default to attempting to run in IOVA as PA mode unless you have 1) at least one device attached, and 2) all of the devices are attached to VFIO
[vv] I have already raised a Bugzilla where intel supported I210 Gigabit card failed to attach with vfio-pci returning error code '-22'. Hence option running DPDK supported NIC with 1 device under vfio failed for me.

Note: I also did not find the information in documentation.


For --no-pci or --vdev only case, the bus infrastructure will default to IOVA as PA mode, and so will not allow running as root unless you also use --no-huge.
[vv] if option '-w 0000:00:00.0' or '--no-pci' should not rte_eal_init resort to IOVA in VA mode (for SoC I am not familiar hence exclude the discussion). Why does not it work in this fashion? 

Reason: it will helpful to explain the customers with the explanation.

That said, in 18.11, this can be overridden by a "--iova-mode=va" EAL switch - this will force DPDK into IOVA as VA mode. 
[vv] we have requested customer to use 18.11.1 LTS, currently we are using 18.05.

thanks
Comment 5 Vipin Varghese 2018-12-05 14:12:02 CET
If my understanding of documentation section in Bugzilla ("Any information that is in sufficient, not clearly stated or incorrect in documentation is a bug in my humble opinion." ) is incorrect, can the Bugzilla team for DPDK help me with URL or guide for DPDK Bugzilla section 'doc'?
Comment 6 Anatoly Burakov 2018-12-05 14:37:56 CET
Hi Vipin,

May i kindly suggest you use quotation and precede quotes of me with '>' (and maybe put a newline afterwards)? It is very hard to read your response and discern whether you're saying something or just quoting.

> Any information that is in sufficient, not clearly stated or incorrect in
> documentation is a bug in my humble opinion.

Maybe this is something we should raise on the mailing list.

> if option '-w 0000:00:00.0' or '--no-pci' should not rte_eal_init resort to
> IOVA in VA mode (for SoC I am not familiar hence exclude the discussion). Why
> does not it work in this fashion?

It has been my opinion that this should be the case as well, however this is just not how it works currently. There should be patches in 18.11 that will cause IOVA as VA mode automatically *if* you're running as a non-root user, but it will not happen by default if you're running as root even if you don't have any devices attached. In the past, there would have been no recourse for the situation; now, there is --iova-mode switch that you can use to force IOVA mode to be this or that.

> we have requested customer to use 18.11.1 LTS, currently we are using 18.05.

in that case, i am not aware of any solution to this issue. 18.05 does not get these enhancements as far as i'm aware.
Comment 7 Anatoly Burakov 2018-12-10 11:35:30 CET
Hi Vipin,

Can this issue be closed? 18.05 is not supported any more as far as i know, so even if we had a solution, it wouldn't make it upstream. The only solution to this problem is upgrading to 18.11.

Note You need to log in before you can comment on or make changes to this bug.