DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide
@ 2020-03-02 23:08 Thomas Monjalon
  2020-05-14  8:23 ` Raslan Darawsheh
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2020-03-02 23:08 UTC (permalink / raw)
  To: dev
  Cc: adrianc, moshele, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, John McNamara, Marko Kovacevic

If running DPDK as non-root, some extra capabilities may be required.
The Mellanox devices, using a bifurcated model with Linux drivers,
have some specific requirements summarized in mlx5 PMD guide.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/nics/mlx5.rst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index afd11cd830..7650e57dd0 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -359,6 +359,32 @@ Run-time configuration
 
 - **ethtool** operations on related kernel interfaces also affect the PMD.
 
+Run as non-root
+^^^^^^^^^^^^^^^
+
+In order to run as a non-root user,
+some capabilities must be granted to the application::
+
+   setcap cap_sys_admin,cap_net_admin,cap_net_raw,cap_ipc_lock+ep <dpdk-app>
+
+Below are the reasons of the need for each capability:
+
+``cap_sys_admin``
+   When using physical addresses (PA mode), with Linux >= 4.0,
+   for access to ``/proc/self/pagemap``.
+
+``cap_net_admin``
+   For MTU and link state modifications.
+
+``cap_net_raw``
+   For raw ethernet queue allocation through kernel driver.
+
+``cap_ipc_lock``
+   For DMA memory pinning.
+
+Driver options
+^^^^^^^^^^^^^^
+
 - ``rxq_cqe_comp_en`` parameter [int]
 
   A nonzero value enables the compression of CQE on RX side. This feature
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide
  2020-03-02 23:08 [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide Thomas Monjalon
@ 2020-05-14  8:23 ` Raslan Darawsheh
  2020-05-14 17:29   ` Moshe Levi
  0 siblings, 1 reply; 4+ messages in thread
From: Raslan Darawsheh @ 2020-05-14  8:23 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Adrian Chiris, Moshe Levi, Matan Azrad, Shahaf Shuler,
	Slava Ovsiienko, John McNamara, Marko Kovacevic

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Tuesday, March 3, 2020 1:09 AM
> To: dev@dpdk.org
> Cc: Adrian Chiris <adrianc@mellanox.com>; Moshe Levi
> <moshele@mellanox.com>; Matan Azrad <matan@mellanox.com>; Shahaf
> Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; John McNamara
> <john.mcnamara@intel.com>; Marko Kovacevic
> <marko.kovacevic@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5
> guide
> 
> If running DPDK as non-root, some extra capabilities may be required.
> The Mellanox devices, using a bifurcated model with Linux drivers,
> have some specific requirements summarized in mlx5 PMD guide.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Raslan Darwsheh <rasland@mellanox.com>
> ---
>  doc/guides/nics/mlx5.rst | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
> index afd11cd830..7650e57dd0 100644
> --- a/doc/guides/nics/mlx5.rst
> +++ b/doc/guides/nics/mlx5.rst
> @@ -359,6 +359,32 @@ Run-time configuration
> 
>  - **ethtool** operations on related kernel interfaces also affect the PMD.
> 
> +Run as non-root
> +^^^^^^^^^^^^^^^
> +
> +In order to run as a non-root user,
> +some capabilities must be granted to the application::
> +
> +   setcap cap_sys_admin,cap_net_admin,cap_net_raw,cap_ipc_lock+ep
> <dpdk-app>
> +
> +Below are the reasons of the need for each capability:
> +
> +``cap_sys_admin``
> +   When using physical addresses (PA mode), with Linux >= 4.0,
> +   for access to ``/proc/self/pagemap``.
> +
> +``cap_net_admin``
> +   For MTU and link state modifications.
> +
> +``cap_net_raw``
> +   For raw ethernet queue allocation through kernel driver.
> +
> +``cap_ipc_lock``
> +   For DMA memory pinning.
> +
> +Driver options
> +^^^^^^^^^^^^^^
> +
>  - ``rxq_cqe_comp_en`` parameter [int]
> 
>    A nonzero value enables the compression of CQE on RX side. This feature
> --
> 2.25.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide
  2020-05-14  8:23 ` Raslan Darawsheh
@ 2020-05-14 17:29   ` Moshe Levi
  2020-05-19  9:05     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Moshe Levi @ 2020-05-14 17:29 UTC (permalink / raw)
  To: Raslan Darawsheh, Thomas Monjalon, dev
  Cc: Adrian Chiris, Matan Azrad, Shahaf Shuler, Slava Ovsiienko,
	John McNamara, Marko Kovacevic

Hi Raslan, 
PSB

> -----Original Message-----
> From: Raslan Darawsheh <rasland@mellanox.com>
> Sent: Thursday, May 14, 2020 11:24 AM
> To: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org
> Cc: Adrian Chiris <adrianc@mellanox.com>; Moshe Levi
> <moshele@mellanox.com>; Matan Azrad <matan@mellanox.com>; Shahaf
> Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; John McNamara
> <john.mcnamara@intel.com>; Marko Kovacevic
> <marko.kovacevic@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5
> guide
> 
> Hi,
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > Sent: Tuesday, March 3, 2020 1:09 AM
> > To: dev@dpdk.org
> > Cc: Adrian Chiris <adrianc@mellanox.com>; Moshe Levi
> > <moshele@mellanox.com>; Matan Azrad <matan@mellanox.com>; Shahaf
> > Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> > <viacheslavo@mellanox.com>; John McNamara
> <john.mcnamara@intel.com>;
> > Marko Kovacevic <marko.kovacevic@intel.com>
> > Subject: [dpdk-dev] [PATCH] doc: add required Linux capabilities in
> > mlx5 guide
> >
> > If running DPDK as non-root, some extra capabilities may be required.
> > The Mellanox devices, using a bifurcated model with Linux drivers,
> > have some specific requirements summarized in mlx5 PMD guide.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: Raslan Darwsheh <rasland@mellanox.com>
> > ---
> >  doc/guides/nics/mlx5.rst | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> >
> > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index
> > afd11cd830..7650e57dd0 100644
> > --- a/doc/guides/nics/mlx5.rst
> > +++ b/doc/guides/nics/mlx5.rst
> > @@ -359,6 +359,32 @@ Run-time configuration
> >
> >  - **ethtool** operations on related kernel interfaces also affect the PMD.
> >
> > +Run as non-root
> > +^^^^^^^^^^^^^^^
> > +
> > +In order to run as a non-root user,
> > +some capabilities must be granted to the application::
> > +
> > +   setcap cap_sys_admin,cap_net_admin,cap_net_raw,cap_ipc_lock+ep
> > <dpdk-app>
> > +
> > +Below are the reasons of the need for each capability:
> > +
> > +``cap_sys_admin``
> > +   When using physical addresses (PA mode), with Linux >= 4.0,
> > +   for access to ``/proc/self/pagemap``.
> > +
> > +``cap_net_admin``
> > +   For MTU and link state modifications
It more than that like change mac address . maybe better to write for interface configuration 
You can see the full list in [1] look for CAP_NET_ADMIN
[1] - http://man7.org/linux/man-pages/man7/capabilities.7.html
.
> > +
> > +``cap_net_raw``
> > +   For raw ethernet queue allocation through kernel driver.
Maybe can you add a note that for containers the net_raw is enabled by default see [1] and you don't need to specify it. 
 [1] - https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities 
> > +
> > +``cap_ipc_lock``
> > +   For DMA memory pinning.
> > +
> > +Driver options
> > +^^^^^^^^^^^^^^
> > +
> >  - ``rxq_cqe_comp_en`` parameter [int]
> >
> >    A nonzero value enables the compression of CQE on RX side. This
> > feature
> > --
> > 2.25.1
> 
> 
> Patch applied to next-net-mlx,
> 
> Kindest regards,
> Raslan Darawsheh

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

* Re: [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide
  2020-05-14 17:29   ` Moshe Levi
@ 2020-05-19  9:05     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-05-19  9:05 UTC (permalink / raw)
  To: Raslan Darawsheh, Moshe Levi
  Cc: dev, Adrian Chiris, Matan Azrad, Shahaf Shuler, Slava Ovsiienko,
	John McNamara, Marko Kovacevic

14/05/2020 19:29, Moshe Levi:
> > From: Thomas Monjalon
> > > +``cap_net_admin``
> > > +   For MTU and link state modifications
> 
> It more than that like change mac address . maybe better to write for interface configuration 
> You can see the full list in [1] look for CAP_NET_ADMIN
> [1] - http://man7.org/linux/man-pages/man7/capabilities.7.html

Changed to "For device configuration." while merging in master.


> > > +``cap_net_raw``
> > > +   For raw ethernet queue allocation through kernel driver.
> Maybe can you add a note that for containers the net_raw is enabled by default see [1] and you don't need to specify it. 
>  [1] - https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

It would require a separate patch please.



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

end of thread, other threads:[~2020-05-19  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 23:08 [dpdk-dev] [PATCH] doc: add required Linux capabilities in mlx5 guide Thomas Monjalon
2020-05-14  8:23 ` Raslan Darawsheh
2020-05-14 17:29   ` Moshe Levi
2020-05-19  9:05     ` Thomas Monjalon

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