如何获取鲲鹏加速引擎队列使用信息?
问题
如何获取鲲鹏加速引擎队列使用信息?
回答
- 创建脚本文件get_kae_queue_info.sh。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#!/bin/bash if [ -f "/etc/modprobe.d/hisi_sec2.conf" ]; then hisi_sec2_queue_str=$(cat /etc/modprobe.d/hisi_sec2.conf | awk '/pf_q_num=/') hisi_sec2_queue=${hisi_sec2_queue_str##*=} hisi_sec2_queue_total=${hisi_sec2_queue%% *} else hisi_sec2_queue_total="NULL" fi ls /sys/class/uacce | grep "hisi_sec2-*" if [ "$?" == "0" ]; then hisi_sec2_queue_space=$(cat /sys/class/uacce/hisi_sec2-*/attrs/available_instances | awk '{printf "%s ",$1}') else hisi_sec2_queue_space="NULL NULL" echo -e "\e[1;31mno hisi_sec2 acclerator device \e[0m" fi if [ -f "/etc/modprobe.d/hisi_hpre.conf" ]; then hisi_hpre_queue_str=$(cat /etc/modprobe.d/hisi_hpre.conf | awk '/pf_q_num=/') hisi_hpre_queue=${hisi_hpre_queue_str##*=} hisi_hpre_queue_total=${hisi_hpre_queue%% *} else hisi_hpre_queue_total="NULL" fi ls /sys/class/uacce | grep "hisi_hpre-*" if [ "$?" == "0" ]; then hisi_hpre_queue_space=$(cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances | awk '{printf "%s ",$1}') else hisi_hpre_queue_space="NULL NULL" echo -e "\e[1;31mno hisi_hpre accelrator device \e[0m" fi if [ -f "/etc/modprobe.d/hisi_zip.conf" ];then hisi_zip_queue_str=$(cat /etc/modprobe.d/hisi_zip.conf | awk '/pf_q_num=/') hisi_zip_queue=${hisi_zip_queue_str##*=} hisi_zip_queue_total=${hisi_zip_queue%% *} else hisi_zip_queue_total="NULL" fi ls /sys/class/uacce | grep "hisi_zip-*" if [ "$?" == "0" ]; then hisi_zip_queue_space=$(cat /sys/class/uacce/hisi_zip-*/attrs/available_instances | awk '{printf "%s ",$1}') else hisi_zip_queue_space="NULL NULL" echo -e "\e[1;31mno hisi_zip accelerator device\e[0m" fi echo $hisi_sec_queue_total echo -e "\e[1;33m get kae queue info \e[0m" echo -e "=================================================================" echo -e "\e[1;33m engines supported alg total left \e[0m" echo -e "-----------------------------------------------------------------" echo "hisi_sec2 AES/MD5/SM3/SM4 $hisi_sec2_queue_total $hisi_sec2_queue_total $hisi_sec2_queue_space " echo "hisi_hpre RSA/DH $hisi_hpre_queue_total $hisi_hpre_queue_total $hisi_hpre_queue_space " echo "hisi_zip zlib/gzip $hisi_zip_queue_total $hisi_zip_queue_total $hisi_zip_queue_space "
- 运行脚本文件。
1
bash get_kae_queue_info.sh
显示的信息:
引擎文件,引擎队列名称,引擎支持的算法,队列总数,剩余队列数
父主题: 软件类