Fact that you can open vfio container doesn't actually mean that you can use 
vfio-pci module on specific PCI device.

vfio-pci module can be used in 2 cases:
 - when /sys/bus/pci/devices/<PCI ADDRESS>/iommu_group exists
 - when /sys/module/vfio/parameters/enable_unsafe_noiommu_mode is set to Y 
(introduced in kernel 4.4)

That code needs to be fixed, but I don't think your fix is the right one....


> On 29 Dec 2018, at 04:46, Yu, Ping <ping...@intel.com> wrote:
> 
> I submitted a patch to fix it. 
>  
> https://gerrit.fd.io/r/16640 <https://gerrit.fd.io/r/16640>
>  
> Ping
>   <>
>  <>From: Yu, Ping 
> Sent: Saturday, December 29, 2018 10:43 AM
> To: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
> Cc: Yu, Ping <ping...@intel.com <mailto:ping...@intel.com>>
> Subject: found some issue in pci vfio
>  
> Hello, all
>  
> Recently I met some issue in vfio, and below is some root cause:
>  
> Before running vpp, I will use “dpdk-devbind.py” to bind the NIC to vfio-pci, 
> and then use “uio-driver auto” configure, and it once worked well, but it has 
> problem recently, so I took a look at this to resolve the problem.
> I found that vpp has some problem to “auto” detect the uio-driver to be vfio, 
> and the bug info is below:
> 1)      vlib_pci_bind_to_uio is dependent vlib_pci_get_device_info to tell 
> iommu_group
> 2)      vlib_pci_get_device_info will check whether lvm->container_fd == -1
>  
> In my case, lvm->container_fd is initialized to be “-1”, and there is no 
> chance to modify it, so in the eye of vlib_pci_bind_to_uio, iommu_group is 
> -1, then it will try to enable noiommu mode. If some kernel enabled NOIOMMU, 
> then vfio can continue work with noiommu mode, but if not, then this device 
> will be rejected due to “no VFIO” support.  (pci.c # 411. )
>  
> The solution is to drop “auto” mode, and explicitly configure “vfio-pci” in 
> the configuration, but I hope the default “auto” mode can be smarter.
>  
> Ping
>  
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#11792): https://lists.fd.io/g/vpp-dev/message/11792 
> <https://lists.fd.io/g/vpp-dev/message/11792>
> Mute This Topic: https://lists.fd.io/mt/28877871/675642 
> <https://lists.fd.io/mt/28877871/675642>
> Group Owner: vpp-dev+ow...@lists.fd.io <mailto:vpp-dev+ow...@lists.fd.io>
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub 
> <https://lists.fd.io/g/vpp-dev/unsub>  [dmar...@me.com 
> <mailto:dmar...@me.com>]
> -=-=-=-=-=-=-=-=-=-=-=-

-- 
Damjan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11802): https://lists.fd.io/g/vpp-dev/message/11802
Mute This Topic: https://lists.fd.io/mt/28877871/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to