Introduction

I have created a subtarget and associated packages for the Intel Atom C2xxx family on the Supermicro A1SRi-2X58F motherboards. In my case, I am using the C2558 on the A1SRi-2558F. This board and processor, while it's possible to create a generic x86_64 build, remains largely unsupported by any distro in terms of the more advanced features of the platform, notably the crypto hardware acceleration and Intel Quick Assist.

I created this as a subtarget, since it is a x86_64 derivative and as such needs to inherit from the x86 target. As a result, having it install via a feed is unfortunately not possible. However, the installation is relatively simple and requires only three patches: one trivial patch to target/linux/x86/Makefile to have it read the subtarget folder, and another two patches respectively to package/kernel/linux/modules/crypto.mk and package/kernel/linux/modules/hwmon.mk to install definitions for crypto acceleration kmods and cpu thermal sensor kmods. Some minor compilation option changes are required to openssl, however these are supplied by an overridden openssl package in the accompanying package feed, and so this installs transparently.

Intel Quick Assist technology is provided via an accompanying package feed. The README.md file in the repository contains full instructions on how to install the subtarget and packages.

Features

For Chaos Calmer 15.05. I'll get around to putting up a branch for the trunk once I've ported it to trunk,

New crypto kernel modules for menuconfig

  • aes_x86_64

  • aesni (hardware acceleration)

  • crct10dif-pclmul (hardware acceleration)

  • crc32c-intel (hardware acceleration)

  • crc32-pclmul (hardware acceleration)

  • sha512 (required for Intel QAT)

  • icp_qa_al (QAT driver - hardware acceleration)

  • icp_qat_netkey (QAT kernel crypto shim hardware acceleration)

  • icp_perf_aead (QAT crypto benchmark)

Updated and patched kernel modules

  • Ugraded kernel igb ethernet drivers to 5.3.5.3

  • Added support for Intel Core and Atom CPU temperature sensor

  • Patched bonding driver for bonding multiple internet links together

Kernel configuration changes (based off x86_64)

  • Set processor family to Intel Atom CONFIG_MATOM

  • Enabled symmetric multiprocessing CONFIG_SMP

  • Enabled multi-core scheduler support CONFIG_SCHED_MC

  • Enabled unloading of kernel modules CONFIG_MODULE_UNLOAD

  • Enabled Intel low power subsystem support CONFIGX_X86_INTEL_LPSS

  • Supported processor vendors - disabled AMD CONFIG_CPU_SUP_AMD

  • Removed AMD MCE feature CONFIG_X86_MCE_AMD

  • Removed IBM Calgary IOMMU feature CONFIG_CALGARY_IOMMU

  • Added /dev/cpu/cpuid support CONFIG_X86_CPUID

  • Enabled sparse memory virtual memmap CONFIG_SPARSEMEM_VMEMMAP

  • Increased CONFIG_DEFAULT_MMAP_MIN_ADDR to default of 65536

  • Enabled x86 architectural random number generator (Bull Mountain) CONFIG_ARCH_RANDOM

  • Enabled CPU idle driver for Intel processors (CONFIG_INTEL_IDLE)

  • Enabled Intel TCO watchdog timer CONFIG_ITCO_WDT

  • Enabled CONFIG_CEPH to fix broken kmod-dns-resolver package

  • Enabled CONFIG_ZLIB to fix broken kmod-crypto-pcompress

  • Enabled CONFIG_FB_VESA and CONFIG_FB_EFI to fix broken kmod-fb- modules

  • Enabled CONFIG_GPIO_LIB and CONFIG_HWMON to fix broken kmod-gpiofan package

Intel Quick Assist Drivers

Intel QAT drivers have been ported to OpenWrt from the Intel supplied source code. These consist of the QAT driver icp_qa_al.ko, the QAT netkey shim icp_qat_netkey.ko which supplies transparent acceleration to kernel cryptoapi functions and icp_perf_aead.ko which is a kernel module to allow benchmarking.

The QAT drivers are managed by a combination of an init script in /etc/init.d/qat and a binary /usr/sbin/adf_ctl and configured from /etc/c2xxx_qa_dev0.conf. I suggest you read both the init script and the config file. There is one cryptographic accelerator and no compression accelerator.

If you have problems with the driver or would like to understand how it works, you can compile it with debug mode set on. Just choose the debug option in the menuconfig Configuration settings for the module.

The in-kernel crypto acceleration is supplied with the module icp_qat_netkey which requires no parameters. The QAT driver must be loaded first and requires aes, sha256 and sha512 modules to be loaded. These will be modprobed by the init script.

Below is the kernel log output when the QAT drivers start up. You should see this in your dmesg output.

[   52.335051] Loading SAL Module ...
[   54.344053] Reading config file.
[   54.348009] Starting acceleration device icp_dev0.
[   54.361673] adf 0000:00:0b.0: irq 40 for MSI/MSI-X
[   54.361681] adf 0000:00:0b.0: irq 41 for MSI/MSI-X
[   54.361688] adf 0000:00:0b.0: irq 42 for MSI/MSI-X
[   54.361695] adf 0000:00:0b.0: irq 43 for MSI/MSI-X
[   54.361702] adf 0000:00:0b.0: irq 44 for MSI/MSI-X
[   54.361708] adf 0000:00:0b.0: irq 45 for MSI/MSI-X
[   54.361714] adf 0000:00:0b.0: irq 46 for MSI/MSI-X
[   54.361720] adf 0000:00:0b.0: irq 47 for MSI/MSI-X
[   54.361726] adf 0000:00:0b.0: irq 48 for MSI/MSI-X
[   54.514068] Started AE 0
[   54.553657] Quick Assist icp_authenc_aes_cbc_hmac_sha1 loaded
[   54.559846] Quick Assist icp_authenc_aes_cbc_hmac_md5 loaded
[   54.565870] Quick Assist icp_authenc_aes_cbc_hmac_sha256 loaded
[   54.572162] Quick Assist icp_authenc_aes_cbc_hmac_sha512 loaded
[   54.578465] Quick Assist icp_authenc_des3_cbc_hmac_sha1 loaded
[   54.584746] Quick Assist icp_authenc_des3_cbc_hmac_md5 loaded
[   54.590919] Quick Assist icp_authenc_des3_cbc_hmac_sha256 loaded
[   54.597408] Quick Assist icp_authenc_des3_cbc_hmac_sha512 loaded

Sample benchmarks of in-kernel crypto performance are as follows. A kernel module is provided for you to perform these benchmarks yourself.


AEAD givencrypt performance: alg authenc(hmac(sha256),cbc(aes)) - keysize(128)
-----------------------------------------------
Number threads:                        4
Number of requests per thread:         5000000
Pkt Size:                              1024
Total number of Cycles:                99565573056
CPU frequency:                         2399 MHz
Throughput:                            3947 Mbps
-----------------------------------------------

AEAD decrypt performance: alg authenc(hmac(sha256),cbc(aes)) - keysize(128)
-----------------------------------------------
Number threads:                        4
Number of requests per thread:         5000000
Pkt Size:                              1024
Total number of Cycles:                122767195704
CPU frequency:                         2399 MHz
Throughput:                            3201 Mbps
-----------------------------------------------

AEAD givencrypt performance: alg authenc(hmac(sha512),cbc(aes)) - keysize(256)
-----------------------------------------------
Number threads:                        4
Number of requests per thread:         5000000
Pkt Size:                              1024
Total number of Cycles:                134201517384
CPU frequency:                         2399 MHz
Throughput:                            2928 Mbps
-----------------------------------------------

AEAD decrypt performance: alg authenc(hmac(sha512),cbc(aes)) - keysize(256)
-----------------------------------------------
Number threads:                        4
Number of requests per thread:         5000000
Pkt Size:                              1024
Total number of Cycles:                160328867088
CPU frequency:                         2399 MHz
Throughput:                            2451 Mbps
-----------------------------------------------

(Last edited by dl12345 on 8 Sep 2016, 00:51)