mbox series

[v3,0/3] force IOVA to a particular mode

Message ID 1538599994-23331-1-git-send-email-eric.zhang@windriver.com (mailing list archive)
Headers
Series force IOVA to a particular mode |

Message

eric zhang Oct. 3, 2018, 8:53 p.m. UTC
  This patchset introduces an EAL command line option "--iova-mode"
to give the user a facility to force IOVA mode to a special value.

Auto detection of the IOVA mode, based on probing the bus and IOMMU
configuration, may not report the desired addressing mode when virtual
devices that are not directly attached to the bus are present.
The EAL command line option "--iova-mode" can be used to select either
physical addressing('pa') or virtual addressing('va'). 

------
v3:
* document --iova-mode EAL option
* change default iova mode to RTE_IOVA_DC

v2:
* use eal option instead of compilation option to configure IOVA
* apply http://patchwork.dpdk.org/patch/25192/


Santosh Shukla (1):
  eal: add eal option to configure iova mode

eric zhang (2):
  eal: force IOVA to particular mode
  doc:document --iova-mode EAL flag

 doc/guides/prog_guide/env_abstraction_layer.rst |  8 +++++++
 doc/guides/testpmd_app_ug/run_app.rst           |  4 ++++
 lib/librte_eal/bsdapp/eal/eal.c                 | 11 +++++++--
 lib/librte_eal/common/eal_common_options.c      | 30 +++++++++++++++++++++++++
 lib/librte_eal/common/eal_internal_cfg.h        |  1 +
 lib/librte_eal/common/eal_options.h             |  2 ++
 lib/librte_eal/linuxapp/eal/eal.c               | 27 +++++++++++++---------
 7 files changed, 71 insertions(+), 12 deletions(-)
  

Comments

Anatoly Burakov Oct. 4, 2018, 9:19 a.m. UTC | #1
On 03-Oct-18 9:53 PM, eric zhang wrote:
> This patchset introduces an EAL command line option "--iova-mode"
> to give the user a facility to force IOVA mode to a special value.
> 
> Auto detection of the IOVA mode, based on probing the bus and IOMMU
> configuration, may not report the desired addressing mode when virtual
> devices that are not directly attached to the bus are present.
> The EAL command line option "--iova-mode" can be used to select either
> physical addressing('pa') or virtual addressing('va').
> 
> ------
> v3:
> * document --iova-mode EAL option
> * change default iova mode to RTE_IOVA_DC
> 
> v2:
> * use eal option instead of compilation option to configure IOVA
> * apply http://patchwork.dpdk.org/patch/25192/
> 
> 
> Santosh Shukla (1):
>    eal: add eal option to configure iova mode
> 
> eric zhang (2):
>    eal: force IOVA to particular mode
>    doc:document --iova-mode EAL flag
> 
>   doc/guides/prog_guide/env_abstraction_layer.rst |  8 +++++++
>   doc/guides/testpmd_app_ug/run_app.rst           |  4 ++++
>   lib/librte_eal/bsdapp/eal/eal.c                 | 11 +++++++--
>   lib/librte_eal/common/eal_common_options.c      | 30 +++++++++++++++++++++++++
>   lib/librte_eal/common/eal_internal_cfg.h        |  1 +
>   lib/librte_eal/common/eal_options.h             |  2 ++
>   lib/librte_eal/linuxapp/eal/eal.c               | 27 +++++++++++++---------
>   7 files changed, 71 insertions(+), 12 deletions(-)
> 

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
Thomas Monjalon Oct. 11, 2018, 10:08 a.m. UTC | #2
+Cc more maintainers in order to collect more reviews

04/10/2018 11:19, Burakov, Anatoly:
> On 03-Oct-18 9:53 PM, eric zhang wrote:
> > This patchset introduces an EAL command line option "--iova-mode"
> > to give the user a facility to force IOVA mode to a special value.
> > 
> > Auto detection of the IOVA mode, based on probing the bus and IOMMU
> > configuration, may not report the desired addressing mode when virtual
> > devices that are not directly attached to the bus are present.
> > The EAL command line option "--iova-mode" can be used to select either
> > physical addressing('pa') or virtual addressing('va').
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
Thomas Monjalon Oct. 28, 2018, 11:04 p.m. UTC | #3
11/10/2018 12:08, Thomas Monjalon:
> +Cc more maintainers in order to collect more reviews
> 
> 04/10/2018 11:19, Burakov, Anatoly:
> > On 03-Oct-18 9:53 PM, eric zhang wrote:
> > > This patchset introduces an EAL command line option "--iova-mode"
> > > to give the user a facility to force IOVA mode to a special value.
> > > 
> > > Auto detection of the IOVA mode, based on probing the bus and IOMMU
> > > configuration, may not report the desired addressing mode when virtual
> > > devices that are not directly attached to the bus are present.
> > > The EAL command line option "--iova-mode" can be used to select either
> > > physical addressing('pa') or virtual addressing('va').
> > 
> > Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Rebased and applied, thanks
  
Alejandro Lucero Oct. 30, 2018, 12:02 p.m. UTC | #4
On Sun, Oct 28, 2018 at 11:04 PM Thomas Monjalon <thomas@monjalon.net>
wrote:

> 11/10/2018 12:08, Thomas Monjalon:
> > +Cc more maintainers in order to collect more reviews
> >
> > 04/10/2018 11:19, Burakov, Anatoly:
> > > On 03-Oct-18 9:53 PM, eric zhang wrote:
> > > > This patchset introduces an EAL command line option "--iova-mode"
> > > > to give the user a facility to force IOVA mode to a special value.
> > > >
> > > > Auto detection of the IOVA mode, based on probing the bus and IOMMU
> > > > configuration, may not report the desired addressing mode when
> virtual
> > > > devices that are not directly attached to the bus are present.
> > > > The EAL command line option "--iova-mode" can be used to select
> either
> > > > physical addressing('pa') or virtual addressing('va').
> > >
> > > Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
>
> Rebased and applied, thanks
>
>
>
Could not this lead to a problem if a device can not wok with the mode set?
For example, IOVA mode set to VA and IOMMU hw with less bits than those
required for the virtual addresses?

IMO any device should be attached to a bus, and a bus should have a
function for setting IOVA mode and the --iova-mode option just allowed with
supported IOVA modes within the bus.
  
Anatoly Burakov Oct. 30, 2018, 1:47 p.m. UTC | #5
On 30-Oct-18 12:02 PM, Alejandro Lucero wrote:
> 
> 
> On Sun, Oct 28, 2018 at 11:04 PM Thomas Monjalon <thomas@monjalon.net 
> <mailto:thomas@monjalon.net>> wrote:
> 
>     11/10/2018 12:08, Thomas Monjalon:
>      > +Cc more maintainers in order to collect more reviews
>      >
>      > 04/10/2018 11:19, Burakov, Anatoly:
>      > > On 03-Oct-18 9:53 PM, eric zhang wrote:
>      > > > This patchset introduces an EAL command line option "--iova-mode"
>      > > > to give the user a facility to force IOVA mode to a special
>     value.
>      > > >
>      > > > Auto detection of the IOVA mode, based on probing the bus and
>     IOMMU
>      > > > configuration, may not report the desired addressing mode
>     when virtual
>      > > > devices that are not directly attached to the bus are present.
>      > > > The EAL command line option "--iova-mode" can be used to
>     select either
>      > > > physical addressing('pa') or virtual addressing('va').
>      > >
>      > > Acked-by: Anatoly Burakov <anatoly.burakov@intel.com
>     <mailto:anatoly.burakov@intel.com>>
> 
>     Rebased and applied, thanks
> 
> 
> 
> Could not this lead to a problem if a device can not wok with the mode set?
> For example, IOVA mode set to VA and IOMMU hw with less bits than those 
> required for the virtual addresses?
> 
> IMO any device should be attached to a bus, and a bus should have a 
> function for setting IOVA mode and the --iova-mode option just allowed 
> with supported IOVA modes within the bus.

I don't think it should work that way. It should warn the user that an 
incompatible IOVA mode was selected, but the user has specified an IOVA 
mode for a reason - it probably implies he really means it, so let him :)
  
Alejandro Lucero Oct. 30, 2018, 2:03 p.m. UTC | #6
On Tue, Oct 30, 2018 at 1:48 PM Burakov, Anatoly <anatoly.burakov@intel.com>
wrote:

> On 30-Oct-18 12:02 PM, Alejandro Lucero wrote:
> >
> >
> > On Sun, Oct 28, 2018 at 11:04 PM Thomas Monjalon <thomas@monjalon.net
> > <mailto:thomas@monjalon.net>> wrote:
> >
> >     11/10/2018 12:08, Thomas Monjalon:
> >      > +Cc more maintainers in order to collect more reviews
> >      >
> >      > 04/10/2018 11:19, Burakov, Anatoly:
> >      > > On 03-Oct-18 9:53 PM, eric zhang wrote:
> >      > > > This patchset introduces an EAL command line option
> "--iova-mode"
> >      > > > to give the user a facility to force IOVA mode to a special
> >     value.
> >      > > >
> >      > > > Auto detection of the IOVA mode, based on probing the bus and
> >     IOMMU
> >      > > > configuration, may not report the desired addressing mode
> >     when virtual
> >      > > > devices that are not directly attached to the bus are present.
> >      > > > The EAL command line option "--iova-mode" can be used to
> >     select either
> >      > > > physical addressing('pa') or virtual addressing('va').
> >      > >
> >      > > Acked-by: Anatoly Burakov <anatoly.burakov@intel.com
> >     <mailto:anatoly.burakov@intel.com>>
> >
> >     Rebased and applied, thanks
> >
> >
> >
> > Could not this lead to a problem if a device can not wok with the mode
> set?
> > For example, IOVA mode set to VA and IOMMU hw with less bits than those
> > required for the virtual addresses?
> >
> > IMO any device should be attached to a bus, and a bus should have a
> > function for setting IOVA mode and the --iova-mode option just allowed
> > with supported IOVA modes within the bus.
>
> I don't think it should work that way. It should warn the user that an
> incompatible IOVA mode was selected, but the user has specified an IOVA
> mode for a reason - it probably implies he really means it, so let him :)
>
>
Yes, that's true, but setting IOVA VA when a device has problems with it,
it is a bad idea and it could lead to a system crash.
My concern is not with the user knowing what he is doing but with the user
that "uhmm, what is this for, let's try this option".


> --
> Thanks,
> Anatoly
>