pinggit / dpdk-contrail-book

contrail dpdk day one book
9 stars 3 forks source link

verify UIO/vfio #9

Closed pinggit closed 4 years ago

pinggit commented 4 years ago

is it better to add some verification when introducing the user space device enablers (UIO, VFIO) in lab environment, during the introduction?

e.g. in my 3.2 dpdk setup I see these 3 modules:

$ lsmod | grep uio
igb_uio                13269  2
uio                    15264  5 igb_uio

[2020-07-04 10:08:29]root@bcomp80:~
$ modinfo igb_uio
filename:       /lib/modules/3.13.0-128-generic/updates/dkms/igb_uio.ko
author:         Intel Corporation
license:        GPL
description:    UIO driver for Intel IGB PCI cards
srcversion:     47AE41AD0F20FAA13A85D76
depends:        uio
vermagic:       3.13.0-128-generic SMP mod_unload modversions
parm:           intr_mode:igb_uio interrupt mode (default=msix):
    msix       Use MSIX interrupt
    legacy     Use Legacy interrupt

 (charp)

[2020-07-04 10:08:41]root@bcomp80:~
$ modinfo uio
filename:       /lib/modules/3.13.0-128-generic/kernel/drivers/uio/uio.ko
license:        GPL v2
srcversion:     F2BB0E0CDBACF3823EE4A01
depends:
intree:         Y
vermagic:       3.13.0-128-generic SMP mod_unload modversions
signer:         Magrathea: Glacier signing key
sig_key:        82:AB:A0:E9:DB:7A:B1:F5:32:99:A7:95:40:28:D1:C1:D6:6A:6C:F2
sig_hashalgo:   sha512
[2020-07-04 10:08:43]root@bcomp80:~

$ modinfo uio_pci_generic
filename:       /lib/modules/3.13.0-128-generic/kernel/drivers/uio/uio_pci_generic.ko
description:    Generic UIO driver for PCI 2.3 devices
author:         Michael S. Tsirkin <mst@redhat.com>
license:        GPL v2
version:        0.01.0
srcversion:     448EA5C99FCBA3D83818F14
depends:        uio
intree:         Y
vermagic:       3.13.0-128-generic SMP mod_unload modversions
signer:         Magrathea: Glacier signing key
sig_key:        82:AB:A0:E9:DB:7A:B1:F5:32:99:A7:95:40:28:D1:C1:D6:6A:6C:F2
sig_hashalgo:   sha512

but for uvio I don't see them in my setup.

ldurandadomia commented 4 years ago

Yes, it could be added. 3 kinds of user space device enabler:

$ modinfo vfio
filename:       /lib/modules/3.10.0-957.27.2.el7.x86_64/kernel/drivers/vfio/vfio.ko.xz
softdep:        post: vfio_iommu_type1 vfio_iommu_spapr_tce
alias:          devname:vfio/vfio
alias:          char-major-10-196
description:    VFIO - User Level meta-driver
author:         Alex Williamson <alex.williamson@redhat.com>
license:        GPL v2
version:        0.3
retpoline:      Y
rhelversion:    7.6
srcversion:     48DE15C4FEF5F1FF8F201F9
depends:
intree:         Y
vermagic:       3.10.0-957.27.2.el7.x86_64 SMP mod_unload modversions
signer:         Red Hat Enterprise Linux kernel signing key
sig_key:        02:60:F6:8D:30:20:8B:E9:28:FE:9C:75:44:84:8F:14:9A:EE:72:DC
sig_hashalgo:   sha256
parm:           enable_unsafe_noiommu_mode:Enable UNSAFE, no-IOMMU mode.  This mode provides no device isolation, no DMA translation, no host kernel protection, cannot be used for device assignment to virtual machines, requires RAWIO permissions, and will taint the kernel.  If you do not know what this is for, step away. (default: false) (bool)
ldurandadomia commented 4 years ago

If not properly loaded, with modprob or insmod, VFIO module is not seen with lsmod.

pinggit commented 4 years ago

thanks @ldurandadomia . it looks like in my setup vfio is there but NOT loaded.


$ cat /proc/modules | grep vfio
[2020-07-16 06:18:17]root@bcomp80:~

$ cat /proc/modules | grep igb
igb_uio 13269 2 - Live 0xffffffffa032d000 (OX)
uio 15264 5 igb_uio, Live 0xffffffffa0214000

$ modinfo vfio
filename:       /lib/modules/3.13.0-128-generic/kernel/drivers/vfio/vfio.ko
description:    VFIO - User Level meta-driver
author:         Alex Williamson <alex.williamson@redhat.com>
license:        GPL v2
version:        0.3
srcversion:     E63540AA2623C270D5BEE03
depends:
intree:         Y
vermagic:       3.13.0-128-generic SMP mod_unload modversions
signer:         Magrathea: Glacier signing key
sig_key:        82:AB:A0:E9:DB:7A:B1:F5:32:99:A7:95:40:28:D1:C1:D6:6A:6C:F2
sig_hashalgo:   sha512