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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
===============================================
UADK Acceleration for Compression
===============================================
UADK is a framework for applications to access hardware accelerators in a
unified, secure, and efficient way. UADK is comprised of UACCE, libwd and many
other algorithm libraries.
See `Compressor UADK Support`_.
UADK in the Software Stack
==========================
UADK is a general-purpose user space accelerator framework that uses Shared
Virtual Addressing (SVA) to provide a unified programming interface for
hardware acceleration of cryptographic and compression algorithms.
UADK includes Unified/User-space-access-intended Accelerator Framework (UACCE),
which enables hardware accelerators that support SVA to adapt to UADK.
Currently, HiSilicon Kunpeng hardware accelerators have been registered with
UACCE. Through the UADK framework, users can run cryptographic and compression
algorithms using hardware accelerators instead of CPUs, freeing up CPU computing
power and improving computing performance.
A user can access the hardware accelerators by performing user-mode operations on
the character devices, or the use of UADK can be done via frameworks that have
been enabled by others including UADK support (for example, OpenSSL* libcrypto*,
DPDK, and the Linux* Kernel Crypto Framework).
See `OpenSSL UADK Engine`_.
UADK Environment Setup
======================
UADK consists of UACCE, vendor drivers, and an algorithm layer. UADK requires
the hardware accelerator to support SVA, and the operating system to support
IOMMU and SVA. Hardware accelerators are registered as different character
devices with UACCE by kernel-mode drivers.
::
+----------------------------------+
| apps |
+----+------------------------+----+
| |
| |
+-------+--------+ +-------+-------+
| scheduler | | alg libraries |
+-------+--------+ +-------+-------+
| |
| |
| |
| +--------+------+
| | vendor drivers|
| +-+-------------+
| |
| |
+--+------------------+--+
| libwd |
User +----+-------------+-----+
--------------------------------------------------
Kernel +--+-----+ +------+
| uacce | | smmu |
+---+----+ +------+
|
+---+------------------+
| vendor kernel driver |
+----------------------+
--------------------------------------------------
+----------------------+
| HW Accelerators |
+----------------------+
Configuration
=============
#. Kernel Requirement
Users must ensure that UACCE is supported by the Linux kernel release in use,
which should be 5.9 or later with SVA (Shared Virtual Addressing) enabled.
UACCE may be built as a loadable module or built into the kernel. Here's an
example to build UACCE with hardware accelerators for the HiSilicon Kunpeng
platform.
.. prompt:: bash $
CONFIG_IOMMU_SVA_LIB=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_ARM_SMMU_V3_SVA=y
CONFIG_PCI_PASID=y
CONFIG_UACCE=y
CONFIG_CRYPTO_DEV_HISI_QM=y
CONFIG_CRYPTO_DEV_HISI_ZIP=y
Make sure all these above kernel configurations are selected.
#. UADK enablement
If the architecture is ``aarch64``, it will automatically download the UADK
source code to build the static library. When building on other CPU
architectures, the user may enable UADK by adding ``-DWITH_UADK=true`` to the
compilation command line options. Note that UADK may not be compatible with all
architectures.
#. Manually Building UADK
As implied in the above paragraph, if the architecture is ``aarch64``, the UADK
is enabled automatically and there is no need to build it manually. However,
below we provide the procedure for manually building UADK so that developers
can study how it is built.
.. prompt:: bash $
git clone https://github.com/Linaro/uadk.git
cd uadk
mkdir build
./autogen.sh
./configure --prefix=$PWD/build
make
make install
.. note:: Without ``--prefix``, UADK will be installed under
``/usr/local/lib`` by default. If you get the error:
``cannot find -lnuma``, install the ``libnuma-dev`` package.
#. Configure
Edit the Ceph configuration file (usually ``ceph.conf``) to enable UADK
support for *zlib* compression::
uadk_compressor_enabled=true
The default value in `global.yaml.in` for `uadk_compressor_enabled` is
``false``.
.. _Compressor UADK Support: https://github.com/ceph/ceph/pull/58336
.. _OpenSSL UADK Engine: https://github.com/Linaro/uadk_engine
|