intel / QAT_Engine

Intel QuickAssist Technology( QAT) OpenSSL Engine (an OpenSSL Plug-In Engine) which provides cryptographic acceleration for both hardware and optimized software using Intel QuickAssist Technology enabled Intel platforms. https://developer.intel.com/quickassist
BSD 3-Clause "New" or "Revised" License
404 stars 127 forks source link

Unknown symbol qdm_iommu_unmap #76

Open utocen opened 6 years ago

utocen commented 6 years ago

Hi, as per the getting started guide and the SR-IOV KVM guide, I have built QAT 1.7 successfully on Centos 7. However, after what appeared to be successful installation, when it comes to loading of the driver and qat_service it gives this message:

Jul 12 00:02:48 localhost systemd: Reloading. Jul 12 00:02:48 localhost kernel: QAT: Stopping all acceleration devices. Jul 12 00:02:51 localhost kernel: QAT: invalid header 0x666f6d Jul 12 00:02:51 localhost kernel: QAT: map SUOF failed Jul 12 00:02:51 localhost kernel: c3xxx 0000:01:00.0: Failed to map FW Jul 12 00:02:51 localhost kernel: c3xxx 0000:01:00.0: Failed to load acceleration FW Jul 12 00:02:51 localhost kernel: c3xxx 0000:01:00.0: Resetting device qat_dev0 Jul 12 00:02:51 localhost kernel: c3xxx 0000:01:00.0: Function level reset Jul 12 00:02:51 localhost kernel: c3xxx: probe of 0000:01:00.0 failed with error -14 Jul 12 00:02:52 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0) Jul 12 00:02:52 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0) Jul 12 00:02:52 localhost kernel: QAT: Stopping all acceleration devices. Jul 12 00:03:16 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0) Jul 12 00:03:16 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0) Jul 12 00:03:28 localhost systemd: Starting Cleanup of Temporary Directories... Jul 12 00:03:28 localhost systemd: Started Cleanup of Temporary Directories. Jul 12 00:03:34 localhost kernel: nvme nvme0: async event result 00020001 Jul 12 00:03:51 localhost kernel: usdm_drv: module_layout: kernel tainted. Jul 12 00:03:51 localhost kernel: Disabling lock debugging due to kernel taint Jul 12 00:03:51 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0) Jul 12 00:03:51 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0)

service qat_service start gives this:

Jul 11 22:51:31 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0) Jul 11 22:51:31 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0) Jul 11 22:51:31 localhost qat_service: Stopping all devices. Jul 11 22:51:31 localhost kernel: QAT: Stopping all acceleration devices. Jul 11 22:51:31 localhost qat_service: Starting all devices. Jul 11 22:51:31 localhost qat_service: Checking status of all devices. Jul 11 22:51:31 localhost qat_service: There is 0 QAT acceleration device(s) in the system:

any pointers much appreciated.

stevelinsell commented 6 years ago

Hi @utocen,

In the directory where you built the QAT Driver can you type:

nm intel_qat.ko | grep qdm_iommu

You should get something like:

000000000001b0b0 T qdm_iommu_map
000000000001b110 T qdm_iommu_unmap

If you get the above as expected then it probably means that the kernel module that is getting loaded and run is not the one residing in your build folder, it could instead be the default driver that comes with your linux kernel. If that is the case then you will need to blacklist the default driver so it is not loaded at boot time. There are some details in Appendix A of the Getting Started Guide although that is aimed at a more serious issue where the system stops booting, but the principle is the same.

Let me know how you get on,

Steve.

utocen commented 6 years ago

thanks for the quick response @stevelinsell

nm gives this:

[root@kvm1 build]# nm intel_qat.ko | grep qdm_iommu
0000000076ba941b A __crc_qdm_iommu_map
000000002a3c2db6 A __crc_qdm_iommu_unmap
0000000000000170 r __kcrctab_qdm_iommu_map
0000000000000178 r __kcrctab_qdm_iommu_unmap
000000000000036f r __kstrtab_qdm_iommu_map
000000000000035f r __kstrtab_qdm_iommu_unmap
00000000000002e0 r __ksymtab_qdm_iommu_map
00000000000002f0 r __ksymtab_qdm_iommu_unmap
0000000000016200 T qdm_iommu_map
0000000000016260 T qdm_iommu_unmap

Prior to the above, I had also blacklisted intel_qat and all its dependencies:

[root@kvm1 ~]# cat /etc/modprobe.d/my-blacklist.conf
# my
blacklist intel_qat
blacklist qat_c3xxx
blacklist qat_c3xxxvf
blacklist dh_generic
blacklist rsa_generic
blacklist authenc

Rebooting, rebuilding QAT1.7 and then reinstalling failed again.

# lsmod | grep qa
qat_c3xxxvf            13272  0
qat_c3xxx              13426  0
intel_qat             141755  2 qat_c3xxxvf,qat_c3xxx
dh_generic             13286  1 intel_qat
rsa_generic            18819  1 intel_qat
authenc                17776  1 intel_qat
[root@kvm1 QAT1.7.Upstream.L.1.0.3_42]#
[root@kvm1 QAT1.7.Upstream.L.1.0.3_42]# service qat_service start
modprobe: ERROR: could not insert 'usdm_drv': Unknown symbol in module, or unknown parameter (see dmesg)
Stopping all devices.
Starting all devices.
Checking status of all devices.
There is 0 QAT acceleration device(s) in the system:
[root@kvm1 QAT1.7.Upstream.L.1.0.3_42]#
[root@kvm1 QAT1.7.Upstream.L.1.0.3_42]# tail -20 /var/log/messages
Jul 12 10:09:44 localhost kernel: QAT: Stopping all acceleration devices.
Jul 12 10:10:01 localhost systemd: Started Session 2 of user root.
Jul 12 10:10:01 localhost systemd: Starting Session 2 of user root.
Jul 12 10:16:11 localhost chronyd[659]: Selected source 45.76.113.31
Jul 12 10:16:37 localhost NetworkManager[733]: <info>  [1531356397.2023] manager: kernel firmware directory '/lib/firmware' changed
Jul 12 10:16:44 localhost systemd: Reloading.
Jul 12 10:16:44 localhost kernel: QAT: Stopping all acceleration devices.
Jul 12 10:16:47 localhost kernel: QAT: invalid header 0x666f6d
Jul 12 10:16:47 localhost kernel: QAT: map SUOF failed
Jul 12 10:16:47 localhost kernel: c3xxx 0000:01:00.0: Failed to map FW
Jul 12 10:16:47 localhost kernel: c3xxx 0000:01:00.0: Failed to load acceleration FW
Jul 12 10:16:47 localhost kernel: c3xxx 0000:01:00.0: Resetting device qat_dev0
Jul 12 10:16:47 localhost kernel: c3xxx 0000:01:00.0: Function level reset
Jul 12 10:16:48 localhost kernel: c3xxx: probe of 0000:01:00.0 failed with error -14
Jul 12 10:16:48 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0)
Jul 12 10:16:48 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0)
Jul 12 10:16:48 localhost kernel: QAT: Stopping all acceleration devices.
Jul 12 10:18:23 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_unmap (err 0)
Jul 12 10:18:23 localhost kernel: usdm_drv: Unknown symbol qdm_iommu_map (err 0)
Jul 12 10:18:23 localhost kernel: QAT: Stopping all acceleration devices.
[root@kvm1 QAT1.7.Upstream.L.1.0.3_42]#

thanks.

mythi commented 6 years ago

For what is worth, I ran into a similar problem, although I wasn't using installer.sh.

  1. If I build usdm_drv against my distros QAT drivers, I need to disable IOMMU from the top-level makefile (remove ICP_QDM_IOMMU=1 from cmn_ko target) and then build: make cmn_ko.

  2. If I wanted to use QAT1.7 drivers, I first had to: cd qat && make modules && cd - and then make cmn_ko