From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id A2D2F2C8 for ; Tue, 24 Apr 2018 04:24:55 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id z9so10922532pfe.6 for ; Mon, 23 Apr 2018 19:24: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=yXRpD++ShHcgkJ3B4Ptg4CNNMR6d/cOVvJKMFo2IxYY=; b=dbCnm/6VVpp507mLTQFotbsjMkrO9GFfA7zvqINpznLM06/GNhdcFrgkx5hrMMCoBf sHM3Xn411XEwTbjig6tE33ykyM1LRIlm1tLfUr9vDM2Xsb2l5O7JDDQb9Hzmg3dpa50R nylK9hzWwZo+21RoZpvOJTfG+clUBnzxsgO4a0syMAGtCpFmLz2xErNedR0Xhqu2beWi frEGoACjBymTe3WYLectzv7rIWPRez0uI74+287s9EZxI1q7pU4b45lS8WyyTbtKZ3va +3dEfoKQbH4fgq27Wmj4DnKiTiDpyXC1Yn5GZMZ33FKBaG3vBI0E7CgmGfA3ix03piYd uCEA== 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=yXRpD++ShHcgkJ3B4Ptg4CNNMR6d/cOVvJKMFo2IxYY=; b=KeHFE28fgKAxTxNFhP7yuey0j8NhSDGjC2V9m3qazQkUEXTMViomUJoTM1XN58JnLD Av+p9Tmb+p1eKAH6j+0ScT+336RZ7HiimKo/6lPBw0uoJwLxZdIPk98rvphgtcjRCfol iyhwoUpd4jdxBNX4HpHR7D3Zltd1c9CHeELqLqXOPE8nnGIhPqSM93bd2LHE1mzQh8fb e4BcNOrk5vIUuYi/Z1OcG0/EOvB1xE85ceZ++rjPIhzHi32/6sRWsaL5L+32JLvE/fA/ cyk0ipUFpq/dlulpy0LHkVU+h/MfP2FhFfcethGoTadlPxmPO81yIQTS4FQzRry3ObRu lo1Q== X-Gm-Message-State: ALQs6tB6W7LdOErwvkrZ3x8+FAeDcFsvDL55tXVc94gc3Wh96Y3EDlG6 IAtYo+CoXvN1ml0UnHomIbpKcTi19bwK7Zgzn34U6w== X-Google-Smtp-Source: AIpwx49pcR5BwhcYYswp1upXOt/Lj7M7VkISCbZU0K6w4nfxwBE1i0HiISPD8Az3BWoyL7bSZT87tfANOFMclQKYRUk= X-Received: by 2002:a17:902:7841:: with SMTP id e1-v6mr23312181pln.197.1524536694846; Mon, 23 Apr 2018 19:24:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.148.69 with HTTP; Mon, 23 Apr 2018 19:24:54 -0700 (PDT) In-Reply-To: References: <20180423112457.GM4957@6wind.com> From: Tao Peng Date: Tue, 24 Apr 2018 10:24:54 +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: Tue, 24 Apr 2018 02:24:56 -0000 *And when I run testpmd , I get the same error:* $./testpmd -c 0xff00 -n 4 -- --rxq=2 --txq=2 -i 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 And, when I use 'sudo', the error will disappeared. $sudo ./testpmd -c 0xff00 -n 4 -- --rxq=2 --txq=2 -i EAL: Detected 64 lcore(s) EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... 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: MPS is enabled PMD: net_mlx5: port 1 MAC address is 24:8a:07:b7:4e:3e 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: MPS is enabled PMD: net_mlx5: port 1 MAC address is 24:8a:07:b7:4e:3e 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: MPS is enabled PMD: net_mlx5: port 1 MAC address is 24:8a:07:b7:62:0a 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: MPS is enabled 2018-04-23 22:45 GMT+08:00 Tao Peng : > 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 >> > >