From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from haggis.mythic-beasts.com (haggis.mythic-beasts.com [93.93.131.56]) by dpdk.org (Postfix) with ESMTP id CCA542C1A for ; Thu, 7 Jul 2016 17:47:28 +0200 (CEST) Received: from [81.107.239.51] (port=49052 helo=[10.2.7.117]) by haggis.mythic-beasts.com with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1bLBWS-0006LS-5r for users@dpdk.org; Thu, 07 Jul 2016 16:47:28 +0100 From: Jez Higgins Organization: Jez UK Ltd, 34 Forest Road, Moseley, Birmingham, B13 9DH. Registered in England & Wales, number 03071591 To: users@dpdk.org Message-ID: <577E798F.9070700@jezuk.co.uk> Date: Thu, 7 Jul 2016 16:47:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BlackCat-Spam-Score: -28 X-Mythic-Debug: Threshold = On = X-Spam-Status: No, score=-2.9 Subject: [dpdk-users] Running DPDK as non-root X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 15:47:28 -0000 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