DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] net_mlx5: priv allocation failure
@ 2018-04-23 10:03 Tao Peng
  2018-04-23 11:24 ` Adrien Mazarguil
  0 siblings, 1 reply; 5+ messages in thread
From: Tao Peng @ 2018-04-23 10:03 UTC (permalink / raw)
  To: users

Hi ,

When I run the dpdk l2fwd , I encountered some errors, please help, thanks!
:)

$./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


*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.

Thanks!

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

* Re: [dpdk-users] net_mlx5: priv allocation failure
  2018-04-23 10:03 [dpdk-users] net_mlx5: priv allocation failure Tao Peng
@ 2018-04-23 11:24 ` Adrien Mazarguil
  2018-04-23 14:45   ` Tao Peng
  0 siblings, 1 reply; 5+ messages in thread
From: Adrien Mazarguil @ 2018-04-23 11:24 UTC (permalink / raw)
  To: Tao Peng; +Cc: users

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

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

* Re: [dpdk-users] net_mlx5: priv allocation failure
  2018-04-23 11:24 ` Adrien Mazarguil
@ 2018-04-23 14:45   ` Tao Peng
  2018-04-24  2:24     ` Tao Peng
  0 siblings, 1 reply; 5+ messages in thread
From: Tao Peng @ 2018-04-23 14:45 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: users

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 <adrien.mazarguil@6wind.com>:

> 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
>

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

* Re: [dpdk-users] net_mlx5: priv allocation failure
  2018-04-23 14:45   ` Tao Peng
@ 2018-04-24  2:24     ` Tao Peng
  2018-05-18 13:50       ` Adrien Mazarguil
  0 siblings, 1 reply; 5+ messages in thread
From: Tao Peng @ 2018-04-24  2:24 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: users

*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 <dev.pengtao@gmail.com>:

> 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 <adrien.mazarguil@6wind.com>:
>
>> 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
>>
>
>

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

* Re: [dpdk-users] net_mlx5: priv allocation failure
  2018-04-24  2:24     ` Tao Peng
@ 2018-05-18 13:50       ` Adrien Mazarguil
  0 siblings, 0 replies; 5+ messages in thread
From: Adrien Mazarguil @ 2018-05-18 13:50 UTC (permalink / raw)
  To: Tao Peng; +Cc: users

On Tue, Apr 24, 2018 at 10:24:54AM +0800, Tao Peng wrote:
> *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
<snip>
> 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
<snip>

You need to investigate "EAL: WARNING: Master core has no memory on local
socket!"

Hugepage memory files are possibly owned by root at this point. Those are
not cleaned up when DPDK applications exit. It's done on purpose to minimize
memory fragmentation over start/stop cycles.

Have a look at /dev/hugepage/rtemap_* files, e.g.:

 # ls -l /dev/hugepages/
 [...]
 -rw------- 1 root root 2097152 May 14 10:13 rtemap_976
 -rw------- 1 root root 2097152 May 14 10:13 rtemap_977
 -rw------- 1 root root 2097152 May 14 10:13 rtemap_978
 [...]

This means a mere user can't use them. In which case you need to chown/chmod
or remove them altogether.

Have you tried --no-huge?

-- 
Adrien Mazarguil
6WIND

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

end of thread, other threads:[~2018-05-18 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 10:03 [dpdk-users] net_mlx5: priv allocation failure Tao Peng
2018-04-23 11:24 ` Adrien Mazarguil
2018-04-23 14:45   ` Tao Peng
2018-04-24  2:24     ` Tao Peng
2018-05-18 13:50       ` Adrien Mazarguil

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).