From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 9E41F231E for ; Mon, 23 Apr 2018 13:25:13 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id z73-v6so40226030wrb.0 for ; Mon, 23 Apr 2018 04:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KJSHaHIwHv5G0IrtB5+DntSm4DA60J3mOmG+tLyyVEc=; b=2P2pvnQyV+48RR7BDjLNbhiB8V8cWlJJVchNULEWtNEPlqR1L8n9n2exojWLhTdgYd Uosq7PdUWK9WBWxl0EzL+djwaq01ahnm1/SUAchtPvjUfFOuLM2HRQaTFEIDxwsqHaVZ Vf8se5WUmw2Fu2JYDbld4UqoyxeZ4AAvY3pwnlv/mFPJ3gfsA0Q8jfP2r3GZlLkmLQpc ui+imJ/cCrvm90UJYNdpweHO70mkPJ/R8ReLMnIbovEvB3AXzLm6JdtFyyWRWvUTNphc BF9KhystscJQcKvKXUIo0JKVNxBNloY5RktzcvRnLHxF5OZ+esDv+ePPF17tPgF/qK+w oHlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KJSHaHIwHv5G0IrtB5+DntSm4DA60J3mOmG+tLyyVEc=; b=Yd0SZnb26/5ry0B8hUNFikbQY6ekcLnrBs4p/++h/Rrv1T4FVKPE4IWPXG53MtQv01 UwtuhO1Sv3DTe1kEAQ1aRRnvPWIJoekkgl9RF5M81M4ypQI8M5ZTLBMpct0kH5zGyHiL BnSY1n75m1I5LP0KwQeBSJsY9Xam8ffMr9LXli77ODyv81mvXEgYkCQbe8DK5nv6XS8h LwBLpif8U+p7G6XF9eTmZiZWR28uHM1z112oiXCPJi893i8rMeG/VcZ5/Jtn5/lJatBA yerTq6/niK9ubTrTkmvWI2pzRBlCnAyUUQRGuzv5R3Io/f5odot2FAsvAAZvJPhsuLwy sYLw== X-Gm-Message-State: ALQs6tDlE/UmaxL5Wz2WbTADOTEIbSjz5wMhqxh32lk81ok1Rg2RTLGS YE1fv2LKXPZBO+cL2By+LlZvIg== X-Google-Smtp-Source: AIpwx485t86auFKNXWAqHfnHr8Xqu0L1K4ojivC003C2hvH1/bMzHI3fZ7kExlkfyOfgaFrVUnqD1A== X-Received: by 2002:adf:9986:: with SMTP id y6-v6mr16841171wrb.40.1524482712370; Mon, 23 Apr 2018 04:25:12 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c14sm8886832wmi.28.2018.04.23.04.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 04:25:11 -0700 (PDT) Date: Mon, 23 Apr 2018 13:24:57 +0200 From: Adrien Mazarguil To: Tao Peng Cc: users@dpdk.org Message-ID: <20180423112457.GM4957@6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 11:25:13 -0000 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