11. Cavium OCTEON TX Crypto Poll Mode Driver¶
The OCTEON TX crypto poll mode driver provides support for offloading cryptographic operations to cryptographic accelerator units on OCTEON TX ® family of processors (CN8XXX). The OCTEON TX crypto poll mode driver enqueues the crypto request to this accelerator and dequeues the response once the operation is completed.
11.1. Supported Symmetric Crypto Algorithms¶
11.1.1. Cipher Algorithms¶
RTE_CRYPTO_CIPHER_NULLRTE_CRYPTO_CIPHER_3DES_CBCRTE_CRYPTO_CIPHER_3DES_ECBRTE_CRYPTO_CIPHER_AES_CBCRTE_CRYPTO_CIPHER_AES_CTRRTE_CRYPTO_CIPHER_AES_XTSRTE_CRYPTO_CIPHER_DES_CBCRTE_CRYPTO_CIPHER_KASUMI_F8RTE_CRYPTO_CIPHER_SNOW3G_UEA2RTE_CRYPTO_CIPHER_ZUC_EEA3
11.1.2. Hash Algorithms¶
RTE_CRYPTO_AUTH_NULLRTE_CRYPTO_AUTH_AES_GMACRTE_CRYPTO_AUTH_KASUMI_F9RTE_CRYPTO_AUTH_MD5RTE_CRYPTO_AUTH_MD5_HMACRTE_CRYPTO_AUTH_SHA1RTE_CRYPTO_AUTH_SHA1_HMACRTE_CRYPTO_AUTH_SHA224RTE_CRYPTO_AUTH_SHA224_HMACRTE_CRYPTO_AUTH_SHA256RTE_CRYPTO_AUTH_SHA256_HMACRTE_CRYPTO_AUTH_SHA384RTE_CRYPTO_AUTH_SHA384_HMACRTE_CRYPTO_AUTH_SHA512RTE_CRYPTO_AUTH_SHA512_HMACRTE_CRYPTO_AUTH_SNOW3G_UIA2RTE_CRYPTO_AUTH_ZUC_EIA3
11.1.3. AEAD Algorithms¶
RTE_CRYPTO_AEAD_AES_GCM
11.2. Supported Asymmetric Crypto Algorithms¶
RTE_CRYPTO_ASYM_XFORM_RSARTE_CRYPTO_ASYM_XFORM_MODEX
11.3. Compilation¶
The OCTEON TX crypto poll mode driver can be compiled either natively on OCTEON TX ® board or cross-compiled on an x86 based platform.
Refer OCTEON TX Board Support Package for details about setting up the platform and building DPDK applications.
Note
OCTEON TX crypto PF driver needs microcode to be available at /lib/firmware/ directory. Refer SDK documents for further information.
SDK and related information can be obtained from: Cavium support site.
11.4. Execution¶
The number of crypto VFs to be enabled can be controlled by setting sysfs entry, sriov_numvfs, for the corresponding PF driver.
echo <num_vfs> > /sys/bus/pci/devices/<dev_bus_id>/sriov_numvfs
The device bus ID, dev_bus_id, to be used in the above step can be found out by using dpdk-devbind.py script. The OCTEON TX crypto PF device need to be identified and the corresponding device number can be used to tune various PF properties.
Once the required VFs are enabled, dpdk-devbind.py script can be used to identify the VFs. To be accessible from DPDK, VFs need to be bound to vfio-pci driver:
cd <dpdk directory>
./usertools/dpdk-devbind.py -u <vf device no>
./usertools/dpdk-devbind.py -b vfio-pci <vf device no>
Appropriate huge page need to be setup in order to run the DPDK example applications.
echo 8 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
Example applications can now be executed with crypto operations offloaded to OCTEON TX crypto PMD.
./build/ipsec-secgw --log-level=8 -c 0xff -- -P -p 0x3 -u 0x2 --config
"(1,0,0),(0,0,0)" -f ep1.cfg
11.5. Testing¶
The symmetric crypto operations on OCTEON TX crypto PMD may be verified by running the test application:
./dpdk-test
RTE>>cryptodev_octeontx_autotest
The asymmetric crypto operations on OCTEON TX crypto PMD may be verified by running the test application:
./dpdk-test
RTE>>cryptodev_octeontx_asym_autotest