[v2,0/3] Improve automatic selection of IOVA mode
mbox series

Message ID 1560505157-9769-1-git-send-email-david.marchand@redhat.com
Headers show
Series
  • Improve automatic selection of IOVA mode
Related show

Message

David Marchand June 14, 2019, 9:39 a.m. UTC
In SPDK, not all drivers are registered with DPDK at start up time.
Previously, that meant DPDK always chose to set itself up in IOVA_PA
mode. Instead, when the correct iova choice is unclear based on the
devices and drivers known to DPDK at start up time, use other heuristics
(such as whether /proc/self/pagemap is accessible) to make a better
choice.

This enables SPDK to run as an unprivileged user again without requiring
users to explicitly set the iova mode on the command line.


Changelog since v1:
- I took over the series following experiments and discussions with Ben
  and others, squashed Ben patches as two patches focusing on the main
  issues,
- introduced a fix on KNI,
- on the EAL bits,

  - added log on which IOVA mode has been selected,
  - updated BSD EAL,
  - in Linux EAL, moved KNI special case after IOVA selection,
  - in Linux EAL, added check on forced mode wrt physical addresses
    availability,

- on the PCI bus driver bits,

  - enforced the checks in the common code of the PCI bus,
  - added debug logs to track why a iova mode has been chosen per device,
  - added BSD part,
  - in Linux part, checked that VFIO is enabled,
  - in Linux part, defaulted to DC if a driver supports both PA and VA,

Comments

Thomas Monjalon June 27, 2019, 5:05 p.m. UTC | #1
Help in review would be much appreciated here, thanks.

14/06/2019 11:39, David Marchand:
> In SPDK, not all drivers are registered with DPDK at start up time.
> Previously, that meant DPDK always chose to set itself up in IOVA_PA
> mode. Instead, when the correct iova choice is unclear based on the
> devices and drivers known to DPDK at start up time, use other heuristics
> (such as whether /proc/self/pagemap is accessible) to make a better
> choice.
> 
> This enables SPDK to run as an unprivileged user again without requiring
> users to explicitly set the iova mode on the command line.
> 
> 
> Changelog since v1:
> - I took over the series following experiments and discussions with Ben
>   and others, squashed Ben patches as two patches focusing on the main
>   issues,
> - introduced a fix on KNI,
> - on the EAL bits,
> 
>   - added log on which IOVA mode has been selected,
>   - updated BSD EAL,
>   - in Linux EAL, moved KNI special case after IOVA selection,
>   - in Linux EAL, added check on forced mode wrt physical addresses
>     availability,
> 
> - on the PCI bus driver bits,
> 
>   - enforced the checks in the common code of the PCI bus,
>   - added debug logs to track why a iova mode has been chosen per device,
>   - added BSD part,
>   - in Linux part, checked that VFIO is enabled,
>   - in Linux part, defaulted to DC if a driver supports both PA and VA,
Thomas Monjalon July 2, 2019, 2:18 p.m. UTC | #2
No review at all? I can merge then?

27/06/2019 19:05, Thomas Monjalon:
> Help in review would be much appreciated here, thanks.
> 
> 14/06/2019 11:39, David Marchand:
> > In SPDK, not all drivers are registered with DPDK at start up time.
> > Previously, that meant DPDK always chose to set itself up in IOVA_PA
> > mode. Instead, when the correct iova choice is unclear based on the
> > devices and drivers known to DPDK at start up time, use other heuristics
> > (such as whether /proc/self/pagemap is accessible) to make a better
> > choice.
> > 
> > This enables SPDK to run as an unprivileged user again without requiring
> > users to explicitly set the iova mode on the command line.
> > 
> > 
> > Changelog since v1:
> > - I took over the series following experiments and discussions with Ben
> >   and others, squashed Ben patches as two patches focusing on the main
> >   issues,
> > - introduced a fix on KNI,
> > - on the EAL bits,
> > 
> >   - added log on which IOVA mode has been selected,
> >   - updated BSD EAL,
> >   - in Linux EAL, moved KNI special case after IOVA selection,
> >   - in Linux EAL, added check on forced mode wrt physical addresses
> >     availability,
> > 
> > - on the PCI bus driver bits,
> > 
> >   - enforced the checks in the common code of the PCI bus,
> >   - added debug logs to track why a iova mode has been chosen per device,
> >   - added BSD part,
> >   - in Linux part, checked that VFIO is enabled,
> >   - in Linux part, defaulted to DC if a driver supports both PA and VA,
> 
> 
> 
>
Thomas Monjalon July 5, 2019, 2:57 p.m. UTC | #3
14/06/2019 11:39, David Marchand:
> In SPDK, not all drivers are registered with DPDK at start up time.
> Previously, that meant DPDK always chose to set itself up in IOVA_PA
> mode. Instead, when the correct iova choice is unclear based on the
> devices and drivers known to DPDK at start up time, use other heuristics
> (such as whether /proc/self/pagemap is accessible) to make a better
> choice.
> 
> This enables SPDK to run as an unprivileged user again without requiring
> users to explicitly set the iova mode on the command line.

Applied, thanks