alibaba / tengine

A distribution of Nginx with some advanced features
https://tengine.taobao.org
BSD 2-Clause "Simplified" License
12.65k stars 2.52k forks source link

qat fw_counter计数不增长,停留在0值。 #1928

Open lastpepole opened 2 months ago

lastpepole commented 2 months ago

Ⅰ. Issue Description

QAT_Engine-1.5.0 ,QAT驱动:QAT.L.4.23.0-00001,OpenSSL 1.1.1w qat fw_counter计数不增长,停留在0值。

Ⅱ. Describe what happened

qat fw_counter计数不增长,停留在0值。

Ⅲ. Describe what you expected to happen

cat /sys/kernel/debug/qat_dh895xcc_0000\:60\:00.0/fw_counters 计数为0,没有出现任何增长。 +------------------------------------------------+ | FW Statistics for Qat Device | +------------------------------------------------+ | Firmware Requests [AE 0]: 0 | | Firmware Responses[AE 0]: 0 | | RAS Events [AE 0]: 0 |

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

  1. If applicable, add nginx debug log doc.

Ⅵ. Environment:

openssl.cnf cat /usr/local/openssl/ssl/openssl.cnf openssl_conf = openssl_def [openssl_def] engines = engine_section

[engine_section] qatengine = qatengine_section

[qatengine_section] engine_id = qatengine dynamic_path = /usr/local/openssl/lib/engines-1.1/qatengine.so default_algorithms = ALL

lianglli commented 2 months ago

QAT驱动计数fw_counter 不是tengine负责写入

lianglli commented 2 months ago

https://tengine.taobao.org/document_cn/tengine_qat_ssl_cn.html

有按照文档编译和配置么

lastpepole commented 2 months ago

https://tengine.taobao.org/document_cn/tengine_qat_ssl_cn.html

有按照文档编译和配置么

参照上述配置的,没看到啥异常。 执行/usr/local/openssl/bin/openssl engine -t -vvvv qatengine 命令也能验证qat配置正确。

如果fw_counter没有计数,那怎么验证tengine使用了qat来做异步卸载ssl呢? nginx上通过pstack命令查看worker进程实时堆栈,有如下信息:

0 0x00007fe0dbaae6fd in read () from /lib64/libpthread.so.0

1 0x000000000054e56e in sock_read ()

2 0x000000000054cf9a in bread_conv ()

3 0x000000000054bc65 in BIO_read ()

4 0x00000000004e9aa7 in ssl3_read_n ()

5 0x00000000004ee1e7 in ssl3_get_record ()

6 0x00000000004ebb44 in ssl3_read_bytes ()

7 0x00000000004f27e0 in ssl3_read ()

8 0x000000000054516c in async_start_func ()

9 0x00007fe0db06c010 in ?? () from /lib64/libc.so.6

10 0x0000000000000000 in ?? ()

@lianglli 能否说明tengine已经在使用qat进行卸载ssl了呢?

lastpepole commented 2 months ago

QAT驱动计数fw_counter 不是tengine负责写入

QAT_Engine-1.5.0 ,QAT驱动:QAT.L.4.23.0-00001,OpenSSL 1.1.1w 可拿这些版本验证下tengine是否适配支持。

lianglli commented 2 months ago

看下 《Ice Lake SSL/TLS加速实践》 https://openanolis.cn/sig/crypto/doc/390714951012679780