Wind River Support Network

HomeDefectsLIN7-1903
Not to be fixed

LIN7-1903 : intel-x86-64: qat openssl testing failed ---> ioctl QAT_MEM_MALLOC(131040): Inappropriate ioctl for device

Created: Nov 20, 2014    Updated: Apr 19, 2018
Resolved Date: Apr 17, 2018
Found In Version: 7.0
Severity: Standard
Applicable for: Wind River Linux 7
Component/s: BSP

Description

root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# ./runtest.sh 
######################################################### 
           Start qat_openssl testing      
######################################################### 
<<start sample code for user space>>
********************
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# cp /etc/dh895xcc_qa_dev0.conf-openssl-proc /etc/dh895xcc_qa_dev0.conf

root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# systemctl restart qat_service
[ 1074.825322] Stopping all acceleration devices.
[ 1074.944655] Stopped AE 0
[ 1074.944726] Stopped AE 1
[ 1074.944794] Stopped AE 2
[ 1074.944861] Stopped AE 3
[ 1074.944928] Stopped AE 4
[ 1074.944997] Stopped AE 5
[ 1074.945065] Stopped AE 6
[ 1074.945132] Stopped AE 7
[ 1074.945199] Stopped AE 8
[ 1074.945267] Stopped AE 9
[ 1074.945335] Stopped AE 10
[ 1074.945408] Stopped AE 11
[ 1076.077861] Stopped AE 0
[ 1076.077933] Stopped AE 1
[ 1076.078000] Stopped AE 2
[ 1076.078067] Stopped AE 3
[ 1076.078134] Stopped AE 4
[ 1076.078201] Stopped AE 5
[ 1076.078269] Stopped AE 6
[ 1076.078336] Stopped AE 7
[ 1076.078403] Stopped AE 8
[ 1076.078470] Stopped AE 9
[ 1076.078538] Stopped AE 10
[ 1076.078609] Stopped AE 11
[ 1079.289272] Reading config file.
[ 1079.291774] Starting acceleration device icp_dev0.
[ 1079.291942] Resetting device icp_dev0
[ 1079.393519] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0x3c (was 0x100, writing 0x10b)
[ 1079.393533] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0x20 (was 0x4, writing 0xd0000004)
[ 1079.393539] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0x18 (was 0x4, writing 0xd0040004)
[ 1079.393546] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0x10 (was 0xc, writing 0xebe0000c)
[ 1079.393552] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0xc (was 0x0, writing 0x10)
[ 1079.393558] qat_1_6_adf 0000:02:00.0: restoring config space at offset 0x4 (was 0x100000, writing 0x100006)
[ 1079.393585] qat_1_6_adf 0000:02:00.0: BAR 7: set to [mem 0xd0080000-0xd009ffff 64bit] (PCI address [0xd0080000-0xd009ffff])
[ 1079.393594] qat_1_6_adf 0000:02:00.0: BAR 9: set to [mem 0xd00a0000-0xd00bffff 64bit] (PCI address [0xd00a0000-0xd00bffff])
[ 1079.424971] qat_1_6_adf 0000:02:00.0: irq 90 for MSI/MSI-X
[ 1079.425932] qat_1_6_adf 0000:02:00.0: irq 91 for MSI/MSI-X
[ 1079.426698] qat_1_6_adf 0000:02:00.0: irq 92 for MSI/MSI-X
[ 1079.427461] qat_1_6_adf 0000:02:00.0: irq 93 for MSI/MSI-X
[ 1079.428220] qat_1_6_adf 0000:02:00.0: irq 94 for MSI/MSI-X
[ 1079.428988] qat_1_6_adf 0000:02:00.0: irq 95 for MSI/MSI-X
[ 1079.429760] qat_1_6_adf 0000:02:00.0: irq 96 for MSI/MSI-X
[ 1079.430529] qat_1_6_adf 0000:02:00.0: irq 97 for MSI/MSI-X
[ 1079.431313] qat_1_6_adf 0000:02:00.0: irq 98 for MSI/MSI-X
[ 1079.432079] qat_1_6_adf 0000:02:00.0: irq 99 for MSI/MSI-X
[ 1079.432862] qat_1_6_adf 0000:02:00.0: irq 100 for MSI/MSI-X
[ 1079.433636] qat_1_6_adf 0000:02:00.0: irq 101 for MSI/MSI-X
[ 1079.434408] qat_1_6_adf 0000:02:00.0: irq 102 for MSI/MSI-X
[ 1079.435203] qat_1_6_adf 0000:02:00.0: irq 103 for MSI/MSI-X
[ 1079.436002] qat_1_6_adf 0000:02:00.0: irq 104 for MSI/MSI-X
[ 1079.436805] qat_1_6_adf 0000:02:00.0: irq 105 for MSI/MSI-X
[ 1079.437624] qat_1_6_adf 0000:02:00.0: irq 106 for MSI/MSI-X
[ 1079.438412] qat_1_6_adf 0000:02:00.0: irq 107 for MSI/MSI-X
[ 1079.439225] qat_1_6_adf 0000:02:00.0: irq 108 for MSI/MSI-X
[ 1079.440026] qat_1_6_adf 0000:02:00.0: irq 109 for MSI/MSI-X
[ 1079.440837] qat_1_6_adf 0000:02:00.0: irq 110 for MSI/MSI-X
[ 1079.441637] qat_1_6_adf 0000:02:00.0: irq 111 for MSI/MSI-X
[ 1079.442452] qat_1_6_adf 0000:02:00.0: irq 112 for MSI/MSI-X
[ 1079.443237] qat_1_6_adf 0000:02:00.0: irq 113 for MSI/MSI-X
[ 1079.444051] qat_1_6_adf 0000:02:00.0: irq 114 for MSI/MSI-X
[ 1079.444862] qat_1_6_adf 0000:02:00.0: irq 115 for MSI/MSI-X
[ 1079.445669] qat_1_6_adf 0000:02:00.0: irq 116 for MSI/MSI-X
[ 1079.446476] qat_1_6_adf 0000:02:00.0: irq 117 for MSI/MSI-X
[ 1079.447267] qat_1_6_adf 0000:02:00.0: irq 118 for MSI/MSI-X
[ 1079.448079] qat_1_6_adf 0000:02:00.0: irq 119 for MSI/MSI-X
[ 1079.448892] qat_1_6_adf 0000:02:00.0: irq 120 for MSI/MSI-X
[ 1079.449693] qat_1_6_adf 0000:02:00.0: irq 121 for MSI/MSI-X
[ 1079.450508] qat_1_6_adf 0000:02:00.0: irq 122 for MSI/MSI-X
[ 1080.056191] Started AE 0
[ 1080.056259] Started AE 1
[ 1080.056325] Started AE 2
[ 1080.056391] Started AE 3
[ 1080.056456] Started AE 4
[ 1080.056523] Started AE 5
[ 1080.056597] Started AE 6
[ 1080.056663] Started AE 7
[ 1080.056730] Started AE 8
[ 1080.056795] Started AE 9
[ 1080.056860] Started AE 10
[ 1080.056930] Started AE 11
[ 1080.418435] Reading config file.
[ 1080.419324] Starting acceleration device icp_dev1.
[ 1080.419499] Resetting device icp_dev1
[ 1080.521754] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0x3c (was 0x100, writing 0x10b)
[ 1080.521768] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0x20 (was 0x4, writing 0xec000004)
[ 1080.521776] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0x18 (was 0x4, writing 0xec040004)
[ 1080.521782] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0x10 (was 0xc, writing 0xfbe0000c)
[ 1080.521788] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0xc (was 0x0, writing 0x10)
[ 1080.521794] qat_1_6_adf 0000:82:00.0: restoring config space at offset 0x4 (was 0x100000, writing 0x100006)
[ 1080.521823] qat_1_6_adf 0000:82:00.0: BAR 7: set to [mem 0xec080000-0xec09ffff 64bit] (PCI address [0xec080000-0xec09ffff])
[ 1080.521832] qat_1_6_adf 0000:82:00.0: BAR 9: set to [mem 0xec0a0000-0xec0bffff 64bit] (PCI address [0xec0a0000-0xec0bffff])
[ 1080.555726] qat_1_6_adf 0000:82:00.0: irq 123 for MSI/MSI-X
[ 1080.556483] qat_1_6_adf 0000:82:00.0: irq 124 for MSI/MSI-X
[ 1080.557264] qat_1_6_adf 0000:82:00.0: irq 125 for MSI/MSI-X
[ 1080.558042] qat_1_6_adf 0000:82:00.0: irq 126 for MSI/MSI-X
[ 1080.558807] qat_1_6_adf 0000:82:00.0: irq 127 for MSI/MSI-X
[ 1080.559571] qat_1_6_adf 0000:82:00.0: irq 128 for MSI/MSI-X
[ 1080.560335] qat_1_6_adf 0000:82:00.0: irq 129 for MSI/MSI-X
[ 1080.561136] qat_1_6_adf 0000:82:00.0: irq 130 for MSI/MSI-X
[ 1080.561902] qat_1_6_adf 0000:82:00.0: irq 131 for MSI/MSI-X
[ 1080.562677] qat_1_6_adf 0000:82:00.0: irq 132 for MSI/MSI-X
[ 1080.563426] qat_1_6_adf 0000:82:00.0: irq 133 for MSI/MSI-X
[ 1080.564203] qat_1_6_adf 0000:82:00.0: irq 134 for MSI/MSI-X
[ 1080.564971] qat_1_6_adf 0000:82:00.0: irq 135 for MSI/MSI-X
[ 1080.565737] qat_1_6_adf 0000:82:00.0: irq 136 for MSI/MSI-X
[ 1080.566493] qat_1_6_adf 0000:82:00.0: irq 137 for MSI/MSI-X
[ 1080.567271] qat_1_6_adf 0000:82:00.0: irq 138 for MSI/MSI-X
[ 1080.568039] qat_1_6_adf 0000:82:00.0: irq 139 for MSI/MSI-X
[ 1080.568815] qat_1_6_adf 0000:82:00.0: irq 140 for MSI/MSI-X
[ 1080.569570] qat_1_6_adf 0000:82:00.0: irq 141 for MSI/MSI-X
[ 1080.570342] qat_1_6_adf 0000:82:00.0: irq 142 for MSI/MSI-X
[ 1080.571113] qat_1_6_adf 0000:82:00.0: irq 143 for MSI/MSI-X
[ 1080.571884] qat_1_6_adf 0000:82:00.0: irq 144 for MSI/MSI-X
[ 1080.572656] qat_1_6_adf 0000:82:00.0: irq 145 for MSI/MSI-X
[ 1080.573422] qat_1_6_adf 0000:82:00.0: irq 146 for MSI/MSI-X
[ 1080.574193] qat_1_6_adf 0000:82:00.0: irq 147 for MSI/MSI-X
[ 1080.574968] qat_1_6_adf 0000:82:00.0: irq 148 for MSI/MSI-X
[ 1080.575732] qat_1_6_adf 0000:82:00.0: irq 149 for MSI/MSI-X
[ 1080.576494] qat_1_6_adf 0000:82:00.0: irq 150 for MSI/MSI-X
[ 1080.577263] qat_1_6_adf 0000:82:00.0: irq 151 for MSI/MSI-X
[ 1080.578036] qat_1_6_adf 0000:82:00.0: irq 152 for MSI/MSI-X
[ 1080.578804] qat_1_6_adf 0000:82:00.0: irq 153 for MSI/MSI-X
[ 1080.579568] qat_1_6_adf 0000:82:00.0: irq 154 for MSI/MSI-X
[ 1080.580344] qat_1_6_adf 0000:82:00.0: irq 155 for MSI/MSI-X
[ 1081.348779] Started AE 0
[ 1081.348846] Started AE 1
[ 1081.348908] Started AE 2
[ 1081.348970] Started AE 3
[ 1081.349032] Started AE 4
[ 1081.349094] Started AE 5
[ 1081.349156] Started AE 6
[ 1081.349217] Started AE 7
[ 1081.349280] Started AE 8
[ 1081.349341] Started AE 9
[ 1081.349404] Started AE 10
[ 1081.349469] Started AE 11
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# systemctl status -l qat_service
? qat_service.service - SYSV: modprobe the QAT icp_qa_al.ko, which loads dependant modules, before calling the user space utility to pass configuration parameters
   Loaded: loaded (/etc/init.d/qat_service)
   Active: active (exited) since Thu 2014-11-20 09:18:47 UTC; 1s ago
  Process: 1581 ExecStop=/etc/init.d/qat_service stop (code=exited, status=0/SUCCESS)
  Process: 1584 ExecStart=/etc/init.d/qat_service start (code=exited, status=0/SUCCESS)

Nov 20 09:18:42 intel_shumway-2 qat_service[1584]: modprobe: FATAL: Module zlib not found.
Nov 20 09:18:46 intel_shumway-2 qat_service[1584]: Processing file: /etc/dh895xcc_qa_dev0.conf
Nov 20 09:18:46 intel_shumway-2 qat_service[1584]: Processing file: /etc/dh895xcc_qa_dev1.conf
Nov 20 09:18:47 intel_shumway-2 qat_service[1584]: There is 2 acceleration device(s) in the system:
Nov 20 09:18:47 intel_shumway-2 qat_service[1584]: icp_dev0 - type=dh895xcc, inst_id=0, node_id=0,  bdf=02:00:0, #accel=6, #engines=12, state=up
Nov 20 09:18:47 intel_shumway-2 qat_service[1584]: icp_dev1 - type=dh895xcc, inst_id=1, node_id=1,  bdf=82:00:0, #accel=6, #engines=12, state=up
Nov 20 09:18:47 intel_shumway-2 systemd[1]: Started SYSV: modprobe the QAT icp_qa_al.ko, which loads dependant modules, before calling the user space utility to pass configuration parameters.
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# dmesg | grep "get dynamic major"
[ 1084.863807] qat_mem_module_init: get dynamic major 243
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# mknod /dev/qat_mem c 245 0

<<end sample code for user space>>
********************
<<start openssl function test>>
********************
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# /opt/openssl-qat/bin/openssl engine
(rsax) RSAX engine support
(rdrand) Intel RDRAND engine
(dynamic) Dynamic engine loading support
(4758cca) IBM 4758 CCA hardware engine support
(aep) Aep hardware engine support
(atalla) Atalla hardware engine support
(cswift) CryptoSwift hardware engine support
(chil) CHIL hardware engine support
(nuron) Nuron hardware engine support
(sureware) SureWare hardware engine support
(ubsec) UBSEC hardware engine support
(qat) Reference implementation of QAT crypto engine
(gost) Reference implementation of GOST engine
<<end openssl function test>>
********************
<<start cryptographic engine test>>
********************
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# /opt/openssl-qat/bin/openssl speed -engine qat -evp aes-128-cbc -elapsed -asynch -batch 150 -num_ctx 2
engine "qat" set.
You have chosen to measure elapsed time instead of user CPU time.
Doing aes-128-cbc for 3s on 16 size blocks: ioctl QAT_MEM_MALLOC(131040): Inappropriate ioctl for device
crypto_alloc_from_slab error, create_slab failed - memory allocation error
[speed_main] --- Failed to initialise cipher with EVP_DecryptInit_ex/EVP_EncryptInit_ex

<<end cryptographic engine test>>
********************
<<start check testcase call trace>>
********************
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# dmesg |grep -B10 -A50 'Call Trace' ||exit 0

<<end check testcase call trace>>
********************
<<start check kmemleak>>
********************
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# cat /sys/kernel/debug/kmemleak |grep -B10 -A50 'kmemleak_alloc' ||exit 0

<<end check kmemleak>>
********************

Project Configure Line:
# Generated by wrlinux configure at Thu Nov 20 15:41:50 CST 2014
/buildarea2/lyang0/wrlinux-7/wrlinux/configure --enable-board=intel-x86-64 --enable-kernel=preempt-rt --enable-rootfs=glibc-std --enable-parallel-pkgbuilds=30 --enable-jobs=30 --with-layer=/buildarea2/lyang0/wrlinux-newnew/wr-testing/bts-dev,wr-dpdk,wr-qat --with-template=feature/bts --enable-reconfig=yes --with-rcpl-version=0

Kernel Boot Parameter:
root@intel_shumway-2:/opt/wr-test/testcases/bts/qat_openssl# cat /proc/cmdline
console=ttyS0,115200 root=/dev/nfs nfsroot=128.224.165.20:/export/pxeboot/vlm-boards/22025/rootfs rw ip=dhcp pnpacip=off intel_iommu=off

Kernel source top 10 commits:
Yang Shi 45827c8 rt: cpufreq: check whether cpufreq_rwsem is locked before trying to acquire it Wed Nov 19 11:17:12 2014 -0800
Rabin Vincent b693368 tracing/syscalls: Ignore numbers outside NR_syscalls' range Wed Nov 19 10:50:55 2014 -0800
He Zhe 17919d7 x86, kgdb: correct kgdb_arch_remove_breakpoint Wed Nov 19 02:07:22 2014 -0800
Shan Hai 66130b0 fs/jffs2: fix a locking order bug in garbage collect path Tue Nov 18 17:46:20 2014 -0800
Bin Jiang 8a3a362 MIPS: get_user: fix compile problem Tue Nov 18 01:26:53 2014 -0800
Eric W. Biederman e9b0a83 mnt: Prevent pivot_root from creating a loop in the mount tree Fri Nov 14 00:33:05 2014 -0800
fupan li d344160 set DMA_API_DEBUG feature depending on !PREEMPT_RT_FULL Fri Nov 14 00:20:02 2014 -0800
yadi.hu@windriver.com 28101b0 Fix build error Thu Nov 13 21:47:26 2014 -0800
yadi.hu@windriver.com e8d31d3 drm/i915:Fix a type cast error Thu Nov 13 20:56:39 2014 -0800
yadi.hu@windriver.com 6cba364 mpt2sas: Fix a warning '_ctl_mutex' defined but not used Thu Nov 13 20:56:31 2014 -0800


############################################################### 
Test Results:
*1 sample code for user space(do_prepare_for_testcase)   PASS  
*2 openssl function test(do_test1)                   PASS  
*3 cryptographic engine test(do_test2)               FAIL  
ERROR CMD OR INFO IS :
		/opt/openssl-qat/bin/openssl speed -engine qat -evp aes-128-cbc -elapsed -asynch -batch 150 -num_ctx 2
*4 check testcase call trace(do_check_call_trace)    PASS  
*5 check kmemleak(do_check_kmemleak)                 PASS  
############################################################### 
Excution Time: 71 seconds
WRL Test Completed Unsuccessfully

Steps to Reproduce

check the description 
Live chat
Online