中文
注册

通过DEB包安装KAE

DEB软件包包括hisi_hpre,hisi_sec2,hisi_rde,hisi_zip、libkaezip、libkae、uacce和libwd,其中uacce和libwd是必选安装项,其他软件包需要根据实际使用的模块和算法不同选择性安装,也可全部安装。当前只有KAE1.0支持DEB包方式安装,KAE2.0不支持此安装方式。

前提条件

安装步骤

hisi_hpre,hisi_sec2,hisi_rde,hisi_zip驱动软件包依赖于uacce软件包;libkae、libkaezip引擎软件包依赖libwd软件包。

  • 如果仅加速RSA和DH算法建议只需要安装uacce、hisi_hpre、libwd、libkae软件包。
  • 如果仅加速AES/MD5/SM3/SM4国密算法建议只需要安装uacce、hisi_sec2、libwd、libkae软件包。
  1. 使用SSH远程登录工具,以root账号进入Linux操作系统命令行界面
  2. 将KAE DEB软件包拷贝到自定义路径下。
  3. 安装加速驱动软件包。
    • 方式一:通过dpkg -i *.deb安装所有KAE DEB软件包。
      1
      dpkg -i *.deb 
      
    • 方式二:如果需要单独安装软件包,请参考以下安装uacce-1.3.1软件包示例进行安装。
      1
      2
      dpkg -i uacce-1.3.1-1.ubuntu18.04.arm64.deb 
      uacce modules installed
      

      依次安装hisi_hpre,hisi_sec2,hisi_rde驱动软件包和libwd,libkae引擎软件包。安装libkae引擎软件包时需要先安装libwd软件包。

  4. 查看DEB软件是否已正常安装到系统内。
    1. 查看uacce是否已安装。
      1
      dpkg -L uacce 
      

      回显结果如下。

      1
      2
      3
      4
      5
      6
      7
      /.
      /lib
      /lib/modules
      /lib/modules/4.15.0-70-generic
      /lib/modules/4.15.0-70-generic/extra
      /lib/modules/4.15.0-70-generic/extra/uacce.ko
      /lib/modules/4.15.0-70-generic/extra/hisi_qm.ko
      
    2. 查看hisi_sec2、hisi_hpre、hisi_rde是否已安装。
      1
      dpkg -L hisi-sec2 hisi-hpre hisi-rde 
      

      回显结果如下。

       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
      /. 
      /lib 
      /lib/modules 
      /lib/modules/4.15.0-70-generic 
      /lib/modules/4.15.0-70-generic/extra 
      /lib/modules/4.15.0-70-generic/extra/hisi_sec2.ko 
      /etc 
      /etc/modprobe.d 
      /etc/modprobe.d/hisi_sec2.conf 
       
      /. 
      /lib 
      /lib/modules 
      /lib/modules/4.15.0-70-generic 
      /lib/modules/4.15.0-70-generic/extra 
      /lib/modules/4.15.0-70-generic/extra/hisi_hpre.ko 
      /etc 
      /etc/modprobe.d 
      /etc/modprobe.d/hisi_hpre.conf 
       
      /. 
      /lib 
      /lib/modules 
      /lib/modules/4.15.0-70-generic 
      /lib/modules/4.15.0-70-generic/extra 
      /lib/modules/4.15.0-70-generic/extra/hisi_rde.ko 
      /etc 
      /etc/modprobe.d 
      /etc/modprobe.d/hisi_rde.conf 
      
    3. 查看安装目录下是否生成对应模块。
      1
      ls -al /lib/modules/`uname -r`/extra
      

      回显结果如下。

      1
      2
      3
      4
      5
      6
      7
      8
      total 348 
      drwxr-xr-x 2 root root  4096 Apr 15 17:12 . 
      drwxr-xr-x 6 root root  4096 Apr 15 17:12 .. 
      -rw-r--r-- 1 root root 49080 Apr 15 09:15 hisi_hpre.ko 
      -rw-r--r-- 1 root root 85728 Apr 15 09:15 hisi_qm.ko 
      -rw-r--r-- 1 root root 59720 Apr 15 09:15 hisi_rde.ko 
      -rw-r--r-- 1 root root 65536 Apr 15 09:15 hisi_sec2.ko 
      -rw-r--r-- 1 root root 40408 Apr 15 09:15 uacce.ko 
      
    4. “/etc/modprobe.d/”目录下查看是否生成对应的配置文件。
      1
      ls -al /etc/modprobe.d/
      

      回显结果如下。

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      total 52
      drwxr-xr-x  2 root root 4096 Apr 15 17:12 .
      drwxr-xr-x 94 root root 4096 Apr 15 09:15 ..
      -rw-r--r--  1 root root  325 Jan 28  2018 blacklist-ath_pci.conf
      -rw-r--r--  1 root root 1667 Nov 13  2018 blacklist.conf
      -rw-r--r--  1 root root  210 Jan 28  2018 blacklist-firewire.conf
      -rw-r--r--  1 root root  697 Jan 28  2018 blacklist-framebuffer.conf
      -rw-r--r--  1 root root  583 Jan 28  2018 blacklist-rare-network.conf
      -rw-r--r--  1 root root   45 Apr 15 09:15 hisi_hpre.conf
      -rw-r--r--  1 root root   44 Apr 15 09:15 hisi_rde.conf
      -rw-r--r--  1 root root   61 Apr 15 09:15 hisi_sec2.conf
      -rw-r--r--  1 root root  347 Jan 28  2018 iwlwifi.conf
      -rw-r--r--  1 root root  379 Jul  2  2018 mdadm.conf
      
  5. 加载加速器驱动到内核。
    • 方式一:重启系统加载。
    • 方式二:通过命令行手动依次加载,并查看是否加载成功。
      1. 查询已载入内核的驱动模块。
        1
        lsmod | grep uacce
        

        若没有任何回显内容则执行5.b~5.e将相应的模块加载到内核。

      2. 加载uacce驱动。
        1
        modprobe uacce
        
      3. 加载hisi_sec2驱动,将根据“/etc/modprobe.d/hisi_sec2.conf”下的配置文件加载到内核。
        1
        modprobe hisi_sec2
        
      4. 加载hisi_hpre驱动,将根据“/etc/modprobe.d/hisi_hpre.conf”下的配置文件加载到内核。
        1
        modprobe hisi_hpre
        
      5. 加载hisi_rde驱动,将根据“/etc/modprobe.d/hisi_rde.conf”下的配置文件加载到内核。
        1
        modprobe hisi_rde
        
      6. 再次查询已载入内核的驱动模块。
        1
        2
        lsmod | grep uacce
        lsmod | grep hisi_qm
        
        两次查询分别显示如下信息则表示加载成功。
        1
        uacce                  28672  1 hisi_qm
        
        1
        2
        hisi_qm               65536  4 hisi_sec2,hisi_hpre,hisi_rde
        uacce                  28672  1 hisi_qm 
        

安装后检查

  1. 查看KAE DEB软件包。
    1
    dpkg -s uacce hisi-sec2 hisi-hpre hisi-rde 
    
    查询结果如下显示。
     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
    Package: uacce
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Unified/User-space-access-intended Accelerator Framework.
    URL: https://support.huawei.com 
     
    Package: hisi-sec2
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Huawei Hisilicon SEC Accelerator Driver.
    URL: https://support.huawei.com
     
    Package: hisi-hpre
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Huawei Hisilicon HPRE Accelerator Driver.
    URL: https://support.huawei.com
     
    Package: hisi-rde
    Status: install ok installed
    Priority: optional
    Section: utils
    Installed-Size: 512
    Maintainer: HiSilicon Tech. Co., Ltd.
    Architecture: arm64
    Version: 1.3.1
    Description: This package contains the Huawei Hisilicon RDE Accelerator Driver.
    URL: https://support.huawei.com 
    
  2. 查看“/sys/”目录下对应的加速器设备。
    1
    ls -al /sys/class/uacce/ 
    
    查询结果如下显示。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    total 0
    drwxr-xr-x  2 root root 0 Apr    15 17:42 .
    drwxr-xr-x 65 root root 0 Apr    15 16:49 ..
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_hpre-0 -> ../../devices/pci0000:78/0000:78:00.0/0000:79:00.0/uacce/hisi_hpre-0
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_hpre-1 -> ../../devices/pci0000:b8/0000:b8:00.0/0000:b9:00.0/uacce/hisi_hpre-1
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_rde-4 -> ../../devices/pci0000:78/0000:78:01.0/uacce/hisi_rde-4
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_rde-5 -> ../../devices/pci0000:b8/0000:b8:01.0/uacce/hisi_rde-5
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_sec2-2 -> ../../devices/pci0000:74/0000:74:01.0/0000:76:00.0/uacce/hisi_sec2-2
    lrwxrwxrwx  1 root root 0 Apr    15 17:42 hisi_sec2-3 -> ../../devices/pci0000:b4/0000:b4:01.0/0000:b6:00.0/uacce/hisi_sec2-3
    
  3. 查看基于OpenSSL的KAE引擎是否生效。

    以验证RSA性能为例,验证步骤请参见测试同步RSA性能,通过RSA性能命令可以看到指定KAE引擎之后,RSA的性能得到明显提升。

    另外,除上述方法,在执行RSA性能命令过程中,可以在新的终端上同时查看hisi_hpre设备的硬件队列资源情况如下,相同的,SM3/SM4算法可以查看hisi_sec2的硬件队列消耗情况。
    cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances

    显示结果从256变为255,说明RSA算法消耗了HPRE加速器一个硬件单元队列,说明KAE引擎已生效。

搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词