Repository navigation
Expand file tree
/
Copy pathwd_environment_variable
More file actions
69 lines (50 loc) · 2.35 KB
/
Copy pathwd_environment_variable
File metadata and controls
69 lines (50 loc) · 2.35 KB
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
Define WD related environment variables
=======================================
-v0.1 2021.3.29 Sherlock Init
-v0.2 2021.4. 1 Barry, Sherlock Remove driver, sched, async polling env
Currently WD lib offers init related APIs to init accelerator resources in
one process. User should call libwd and libwd_comp/libwd_crypto APIs to do
this. WD lib could help to do this by parsing a set of WD configurations
set by user. This document defines this set of WD environment variables to
offer process level WD configures.
1. WD environment variables define
==================================
WD_COMP_CTX_NUM
-----------------
Define the algorithm ctx number. For example:
WD_COMP_CTX_NUM=sync-comp:10@0,async-decomp:20@1 means 10 sync ctxs are used
for compression in node0, and 20 async ctxs are used for decompression in
node1.
currently, we only have:
<sync-comp|sync-decomp|async-comp|async-decomp>:<num>@<node>
WD_<alg>_CTX_NUM
-----------------
Define the algorithm ctx number. For example:
WD_<alg>_CTX_NUM=sync:10@0,async:20@1 means 10 sync ctxs are used
in node0, and 20 async ctxs are used in node1.
alg above could be CIPHER, AEAD, DIGEST, DH, RSA, ECC.
WD_<alg>_ASYNC_POLL_NUM
-----------------------
Define the async polling thread numbers in NUMA node. For example:
WD_<alg>_ASYNC_POLL_NUM=2@0,4@2 means to configure 2 async polling threads in
node0, and 4 polling threads in node2.
WD_<alg>_EPOLL_EN
Define if wd_do_<alg>_sync enable wd_ctx_wait in WD. WD_<alg>_EPOLL_EN=1
means enable wd_ctx_wait in WD, driver will wait to receive the package until
hardware is done with package, otherwise driver will try to receive the package
directly after the package is sent.
2. User model
=============
(to do: ...)
3. Introduce environment variable policies for wd_<alg>_init2
=============================================================
Here we take WD_COMP_CTX_NUM as an example, three policies are customized:
1.If a node is enabled, all nodes share the same configuration.
user input: sync-comp:5@0,sync-decomp:3@2
real set: sync-comp:5@0,sync-comp:5@2,sync-decomp:0@2,sync-decomp:3@2
2.If there are same type configurations, use the maximum ctx number.
user input: sync-comp:5@0,sync-comp:3@2
real set: sync-comp:5@0,sync-comp:5@2
3.If the number of queues is 0, ignore this configuration.
user input: sync-comp:0@0,sync-comp:3@2
real set: sync-comp:3@2