From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f48.google.com (mail-pg0-f48.google.com [74.125.83.48]) by dpdk.org (Postfix) with ESMTP id 22E942BC9 for ; Mon, 23 Apr 2018 16:45:55 +0200 (CEST) Received: by mail-pg0-f48.google.com with SMTP id e9so8556301pgr.7 for ; Mon, 23 Apr 2018 07:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wNyky062kGBD34/G0JwiP0ITXnWinRxTIEO4UFjtzRQ=; b=ZRWw6Kkg+TzJCebAAvBE3t8Kat3HyKtDIKv7o8EY4U6vFdvXysR12QBwf8hitCLiES TnpYBxz7dGMmk2ccsWsj5w6OyKc9tVPqFJN8gSIQ4E8I7LXxNK1d+wi0YzjnGfLxYKf3 ZOvh1IiszJngjx8uohufFp0i/G18nG8rjBZrErIdQQ0avB5R4MVlcLzB+OAsB1/VWQfU xGR3BFh2I1MXYWunC/eXJC7UOs7fHUqVVAxq5FfTkkI/fW8ha5tFniVcMVsQ0I6/ory4 BCWbQvQj9VcCFSoTd0H+kVHEE5ONXXRE9sBZ6+r1byydYdGqx2pqshyN8qDkJ3MfYZVq ExCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wNyky062kGBD34/G0JwiP0ITXnWinRxTIEO4UFjtzRQ=; b=Ges+Su6dIpCB+lXZXR0+/H41HkSRKylss6Ro1uDnDFiWHMtCI3JJyi7jirEijS4frQ 0xFmypvtJ/rg4a2A0Re0fslnpWfBsb8MkN3q36acALQxQ4K8WP5c85ib7N8CSECKXPaD 0ZKahHflegrksOptYYPGghaSOzJ/1XS2ZMfyiCbhtImbO0uE2XerOYWvvspR7ucatt5a LXWw1cjpoAjrIWzT+fN0QjtCNVJ0TLk/T3wwFGaldc0APw3oVRcMHBN4DyH6hzkEED7G c8O0R4SCZ/gre1FRjG3u2HV652plDV4k7QfjLAHguwp50+qw9Nq5CgzMbr/AZ8XWDDkN qC8g== X-Gm-Message-State: ALQs6tBi4XV/zG5yK6e3wGJEJBVGT6xuSXYROARCEuYPbJuOeMU2bLKK +g7THUyZyYdUemUu2dmViq9lWHSJR7efuchPGY68Xw== X-Google-Smtp-Source: AIpwx48rLBimwLtIJUIJSdHwcrdA0riZC2P8eFkB7xJdO7HRC/SMDyc66zZkQPfE731Q9PkO7BXLmXeSWyuV5csbIDc= X-Received: by 10.101.100.75 with SMTP id s11mr17121021pgv.360.1524494754545; Mon, 23 Apr 2018 07:45:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.148.69 with HTTP; Mon, 23 Apr 2018 07:45:53 -0700 (PDT) In-Reply-To: <20180423112457.GM4957@6wind.com> References: <20180423112457.GM4957@6wind.com> From: Tao Peng Date: Mon, 23 Apr 2018 22:45:53 +0800 Message-ID: To: Adrien Mazarguil Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] net_mlx5: priv allocation failure X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 14:45:56 -0000 thanks for your reply. :) I try to 'setcap' for ./build/l2fwd, but, I get the same error. :( 1. sudo setcap cap_net_admin,cap_net_raw,cap_ipc_lock=ep ./build/l2fwd 2. $getcap ./build/l2fwd ./build/l2fwd = cap_net_admin,cap_net_raw,cap_ipc_lock+ep 3. $./build/l2fwd -c 0x1 -n 4 -- -p 0x1 EAL: Detected 64 lcore(s) EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... EAL: WARNING: Master core has no memory on local socket! EAL: PCI device 0000:01:00.0 on NUMA socket 0 EAL: probe driver: 15b3:1015 net_mlx5 PMD: net_mlx5: PCI information matches, using device "mlx5_0" (SR-IOV: false, MPS: true) PMD: net_mlx5: 1 port(s) detected PMD: net_mlx5: priv allocation failure EAL: Requested device 0000:01:00.0 cannot be used EAL: PCI device 0000:01:00.1 on NUMA socket 0 EAL: probe driver: 15b3:1015 net_mlx5 PMD: net_mlx5: PCI information matches, using device "mlx5_1" (SR-IOV: false, MPS: true) PMD: net_mlx5: 1 port(s) detected PMD: net_mlx5: priv allocation failure EAL: Requested device 0000:01:00.1 cannot be used EAL: PCI device 0000:02:00.0 on NUMA socket 0 EAL: probe driver: 8086:1521 net_e1000_igb EAL: PCI device 0000:02:00.1 on NUMA socket 0 EAL: probe driver: 8086:1521 net_e1000_igb EAL: PCI device 0000:81:00.0 on NUMA socket -1 EAL: probe driver: 15b3:1015 net_mlx5 PMD: net_mlx5: PCI information matches, using device "mlx5_2" (SR-IOV: false, MPS: true) PMD: net_mlx5: 1 port(s) detected PMD: net_mlx5: priv allocation failure EAL: Requested device 0000:81:00.0 cannot be used EAL: PCI device 0000:81:00.1 on NUMA socket -1 EAL: probe driver: 15b3:1015 net_mlx5 PMD: net_mlx5: PCI information matches, using device "mlx5_3" (SR-IOV: false, MPS: true) PMD: net_mlx5: 1 port(s) detected PMD: net_mlx5: priv allocation failure EAL: Requested device 0000:81:00.1 cannot be used EAL: PCI device 0000:82:00.0 on NUMA socket -1 EAL: probe driver: 8086:10fb net_ixgbe EAL: PCI device 0000:82:00.1 on NUMA socket -1 EAL: probe driver: 8086:10fb net_ixgbe MAC updating enabled MEMPOOL: Cannot allocate tailq entry! EAL: Error - exiting with code: 1 Cause: Cannot init mbuf pool 2018-04-23 19:24 GMT+08:00 Adrien Mazarguil : > On Mon, Apr 23, 2018 at 06:03:49PM +0800, Tao Peng wrote: > > Hi , > > > > When I run the dpdk l2fwd , I encountered some errors, please help, > thanks! > > :) > > > > $./build/l2fwd -c 0x1 -n 4 -- -p 0x1 > > Can you confirm this problem only occurs when attempting to run l2fwd as an > unprivileged user? > > I just want to make sure, because it's is currently undocumented, untested > and therefore unsupported. This being said, please see below. > > > EAL: Detected 64 lcore(s) > > > > EAL: No free hugepages reported in hugepages-1048576kB > > > > EAL: Probing VFIO support... > > > > EAL: WARNING: Master core has no memory on local socket! > > > > EAL: PCI device 0000:01:00.0 on NUMA socket 0 > > > > EAL: probe driver: 15b3:1015 net_mlx5 > > > > PMD: net_mlx5: PCI information matches, using device "mlx5_0" (SR-IOV: > > false, MPS: true) > > > > PMD: net_mlx5: 1 port(s) detected > > > > PMD: net_mlx5: priv allocation failure > > > > EAL: Requested device 0000:01:00.0 cannot be used > > > > EAL: PCI device 0000:01:00.1 on NUMA socket 0 > > > > EAL: probe driver: 15b3:1015 net_mlx5 > > > > PMD: net_mlx5: PCI information matches, using device "mlx5_1" (SR-IOV: > > false, MPS: true) > > > > PMD: net_mlx5: 1 port(s) detected > > > > PMD: net_mlx5: priv allocation failure > > > > EAL: Requested device 0000:01:00.1 cannot be used > > > > EAL: PCI device 0000:02:00.0 on NUMA socket 0 > > > > EAL: probe driver: 8086:1521 net_e1000_igb > > > > EAL: PCI device 0000:02:00.1 on NUMA socket 0 > > > > EAL: probe driver: 8086:1521 net_e1000_igb > > > > EAL: PCI device 0000:81:00.0 on NUMA socket -1 > > > > EAL: probe driver: 15b3:1015 net_mlx5 > > > > PMD: net_mlx5: PCI information matches, using device "mlx5_2" (SR-IOV: > > false, MPS: true) > > > > PMD: net_mlx5: 1 port(s) detected > > > > PMD: net_mlx5: priv allocation failure > > > > EAL: Requested device 0000:81:00.0 cannot be used > > > > EAL: PCI device 0000:81:00.1 on NUMA socket -1 > > > > EAL: probe driver: 15b3:1015 net_mlx5 > > > > PMD: net_mlx5: PCI information matches, using device "mlx5_3" (SR-IOV: > > false, MPS: true) > > > > PMD: net_mlx5: 1 port(s) detected > > > > PMD: net_mlx5: priv allocation failure > > > > EAL: Requested device 0000:81:00.1 cannot be used > > > > EAL: PCI device 0000:82:00.0 on NUMA socket -1 > > > > EAL: probe driver: 8086:10fb net_ixgbe > > > > EAL: PCI device 0000:82:00.1 on NUMA socket -1 > > > > EAL: probe driver: 8086:10fb net_ixgbe > > > > MAC updating enabled > > > > MEMPOOL: Cannot allocate tailq entry! > > > > EAL: Error - exiting with code: 1 > > > > Cause: Cannot init mbuf pool > > > > > > *Hugepage info:* > > > > $cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages > > 8192 > > > > $cat /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages > > 5120 > > > > > > But , If I run in the below command, it will run successful. > > > > $*sudo* ./build/l2fwd -c 0x1 -n 4 -- -p 0x1 > > > > But, I dont want to run l2fwd in sudo mode. > > A few extra capabilities are necessary in order to start a DPDK application > as an unprivileged user (as opposed to starting it as root before dropping > unwanted privileges). > > Both mlx4 and mlx5 PMDs require CAP_NET_ADMIN, CAP_NET_RAW and CAP_IPC_LOCK > respectively to fiddle with their associated kernel netdevice, create > queues > for any kind of traffic and lock memory (the last one is not necessarily > needed when running with --no-huge). > > If acceptable for your application, then you may try something like: > > root# setcap cap_net_admin,cap_net_raw,cap_ipc_lock=ep ./build/l2fwd > > user$ ./build/l2fwd [...] > > Note the described approach adds capabilities through extended device > attributes on the file system (those are rarely preserved when copying > files). While finer grained than "chmod +s", you still need to carefully > consider the security implications, trust the program and its users. > > Have a look at man capabilities(7). > > -- > Adrien Mazarguil > 6WIND >