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
410 stars 128 forks source link

cpa.h: No such file or directory #156

Open sarvij10 opened 4 years ago

sarvij10 commented 4 years ago

Hi,

I have the C62X QAT coprocessor on my server -

$ lspci | grep -i "quick" da:00.0 Co-processor: Intel Corporation C62x Chipset QuickAssist Technology (rev 04) db:00.0 Co-processor: Intel Corporation C62x Chipset QuickAssist Technology (rev 04) dc:00.0 Co-processor: Intel Corporation C62x Chipset QuickAssist Technology (rev 04) $

I am following the instructions at https://github.com/intel/QAT_Engine to try and build and use QAT but I'm running into issues.

I have two questions -

1) How can I obtain the USDM driver code? It doesn't seem to be present in the QAT_Engine github repo. Can you please point me to the right person/entity/process?

2) Where can I find the cpa.h file? It isn't present in the QAT_Engine repo. I tried building the qat_contig_mem driver. I ran into an error when trying to build it -

./arch/x86/include/asm/uaccess.h: In function ‘set_fs’: ./arch/x86/include/asm/uaccess.h:32:9: error: dereferencing pointer to incomplete type ‘struct task_struct’ current->thread.addr_limit = fs; ^~

Commenting out the line in the qat_contig_mem/qat_contig_mem.c file -

+//#include <asm/uaccess.h>

allowed me to proceed with the make, and finally the contig_mem driver loaded -

$ lsmod | grep contig qat_contig_mem 16384 0 $

Next, I attempted to build the QAT engine as described in the QAT_Engine repo README, but I run into this error -

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.tools -I/usr/local/ssl//include -I/home/neustar/vijay/qat/QAT_Engine//quickassist/include -I/home/neustar/vijay/qat/QAT_Engine//quickassist/include/lac -I/home/neustar/vijay/qat/QAT_Engine//quickassist/lookaside/access_layer/include -I/include -I//include -fPIC -Wall -Wformat -Wformat-security -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -DOPENSSL_ENABLE_QAT_UPSTREAM_DRIVER -DUSE_QAT_CONTIG_MEM -Iqat_contig_mem -DOPENSSL_QAT_OFFLOAD -DOPENSSL_ENABLE_QAT_RSA -DOPENSSL_ENABLE_QAT_CIPHERS -DOPENSSL_ENABLE_QAT_ECDH -DOPENSSL_ENABLE_QAT_ECDSA -DOPENSSL_ENABLE_QAT_DSA -DOPENSSL_ENABLE_QAT_DH -DOPENSSL_ENABLE_QAT_PRF -DOPENSSL_DISABLE_QAT_HKDF -DOPENSSL_ENABLE_QAT_ECX -DOPENSSL_DISABLE_VAES_GCM -DOPENSSL_DISABLE_MULTIBUFF_RSA -g -O2 -MT e_qat.lo -MD -MP -MF .deps/e_qat.Tpo -c e_qat.c -fPIC -DPIC -o .libs/e_qat.o In file included from e_qat.c:86:0: e_qat.h:55:12: fatal error: cpa.h: No such file or directory

include "cpa.h"

        ^~~~~~~

compilation terminated. Makefile:739: recipe for target 'e_qat.lo' failed

This has been referenced in an older github issue at https://github.com/intel/QAT_Engine/issues/27 , but no resolution was mentioned in that ticket.

Because of the two aforementioned issues (usdm and cpa.h and associated sources not available), I'm stuck and can't really proceed with QAT.

Can someone help me with this at the earliest? TIA!

Yogaraj-Alamenda commented 4 years ago

Hello @sarvij10

From the error logs, Looks like QAT driver dir is not pointing to the correct path.

  1. Could you please check latest QAT driver is downloaded and installed as per the instructions from the link and the correct path is provided using the option "--with-qat_dir" in the QAT Engine configuration.

  2. USDM driver is present within the QAT driver and USDM build is part of driver installation not in the QAT Engine. You will have to install latest driver and OpenSSL (1.1.1g) successfully then provide the corresponding path in the configuration instructions to build QAT Engine successfully. The default is to use USDM mem driver unless --enable-qat_contig_mem is provided which uses qat_contig_mem driver from the QAT Engine.

The step by step by process is all documented in the QAT Engine Readme installation-instructions

sarvij10 commented 4 years ago

Thanks @Yogaraj-Alamenda ! I was context switched on to other things but will pick up this task using your instructions and let you know how it goes.

Enjolras666 commented 2 years ago

find cpa.h file ,(find / -name cpa.h) .It exists in driver's directory,so config it with the option (--with-qat_hw_dir=/path/your driver's) path