Skip to content

Commit 65a019d

Browse files
dzkdljdavejiang
authored andcommitted
dsactl: creation of dsactl tool and libdsactl
Configuration and management tool for Data Stream Accelerator device through the Linux kernel driver. Signed-off-by: Jing Lin <[email protected]> Signed-off-by: Dave Jiang <[email protected]>
1 parent b8a6ffe commit 65a019d

File tree

109 files changed

+11249
-5564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+11249
-5564
lines changed

.gitignore

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@ Makefile.in
1313
/libtool
1414
/stamp-h1
1515
*.1
16-
Documentation/daxctl/asciidoc.conf
17-
Documentation/dsactl/asciidoc.conf
18-
Documentation/daxctl/asciidoctor-extensions.rb
19-
Documentation/dsactl/asciidoctor-extensions.rb
16+
Documentation/accfg/asciidoc.conf
17+
Documentation/accfg/asciidoctor-extensions.rb
2018
.dirstamp
21-
daxctl/daxctl
22-
daxctl/lib/libdaxctl.la
23-
daxctl/lib/libdaxctl.lo
24-
daxctl/lib/libdaxctl.pc
2519
*.a
26-
dsactl/lib/libdsactl.pc
27-
dsactl/dsactl
20+
accfg/lib/libaccfg.pc
21+
accfg/accfg
22+
accfg/accel-config
2823
rhel/
29-
sles/dsactl.spec
24+
sles/accfg.spec
25+
test/dsa_test
26+
test/libaccfg
3027
util/log.lo
3128
util/sysfs.lo
3229
version.m4
@@ -42,3 +39,9 @@ tags
4239
*.?~
4340
m4
4441
log
42+
*.log
43+
*.trs
44+
*.la
45+
*.lo
46+
*.pc
47+
config.h

Documentation/accfg/Makefile.am

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#SPDX-License-Identifier: GPL-2.0
2+
#Copyright(c) 2015-2019 Intel Corporation. All rights reserved
3+
4+
if USE_ASCIIDOCTOR
5+
6+
do_subst = sed -e 's,@Utility@,Dsactl,g' -e's,@utility@,accfg,g'
7+
CONFFILE = asciidoctor-extensions.rb
8+
asciidoctor-extensions.rb: ../asciidoctor-extensions.rb.in
9+
$(AM_V_GEN) $(do_subst) < $< > $@
10+
11+
else
12+
13+
do_subst = sed -e 's,UTILITY,accfg,g'
14+
CONFFILE = asciidoc.conf
15+
asciidoc.conf: ../asciidoc.conf.in
16+
$(AM_V_GEN) $(do_subst) < $< > $@
17+
18+
endif
19+
20+
man1_MANS = \
21+
accel-config.1 \
22+
accel-config-list.1 \
23+
accel-config-load-config.1 \
24+
accel-config-save-config.1 \
25+
accel-config-config-device.1 \
26+
accel-config-config-engine.1 \
27+
accel-config-config-group.1 \
28+
accel-config-config-wq.1 \
29+
accel-config-disable-device.1 \
30+
accel-config-disable-wq.1 \
31+
accel-config-enable-wq.1 \
32+
accel-config-enable-device.1 \
33+
accel-config-remove-mdev.1 \
34+
accel-config-create-mdev.1
35+
36+
EXTRA_DIST = \
37+
$(man1_MANS) \
38+
accel-config.txt \
39+
accel-config-list.txt \
40+
accel-config-load-config.txt \
41+
accel-config-save-config.txt \
42+
accel-config-config-device.txt \
43+
accel-config-config-engine.txt \
44+
accel-config-config-group.txt \
45+
accel-config-config-wq.txt \
46+
accel-config-disable-device.txt \
47+
accel-config-disable-wq.txt \
48+
accel-config-enable-wq.txt \
49+
accel-config-enable-device.txt \
50+
accel-config-remove-mdev.txt \
51+
accel-config-create-mdev.txt
52+
53+
CLEANFILES = $(man1_MANS)
54+
55+
XML_DEPS = \
56+
../../version.m4 \
57+
Makefile \
58+
$(CONFFILE) \
59+
../copyright.txt
60+
61+
RM ?= rm -f
62+
63+
if USE_ASCIIDOCTOR
64+
65+
%.1: %.txt $(XML_DEPS)
66+
$(AM_V_GEN)$(RM) $@+ $@ && \
67+
$(ASCIIDOC) -b manpage -d manpage -acompat-mode \
68+
-I. -rasciidoctor-extensions \
69+
-amansource=accfg -amanmanual="accfg Manual" \
70+
-aaccfg_version=$(VERSION) -o $@+ $< && \
71+
mv $@+ $@
72+
73+
else
74+
75+
%.xml: %.txt $(XML_DEPS)
76+
$(AM_V_GEN)$(RM) $@+ $@ && \
77+
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
78+
--unsafe -aaccfg_version=$(VERSION) -o $@+ $< && \
79+
mv $@+ $@
80+
81+
%.1: %.xml $(XML_DEPS)
82+
$(AM_V_GEN)$(RM) $@ && \
83+
$(XMLTO) -o . -m ../manpage-normal.xsl man $<
84+
85+
endif
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-config-device(1)
4+
=============================
5+
6+
NAME
7+
----
8+
accel-config-config-device - configure the individual attributes of the device
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config config-device <device name> [<options>]'
14+
15+
EXAMPLE
16+
-------
17+
accel-config config-device dsa0 --token-limit=1
18+
19+
OPTIONS
20+
-------
21+
-l::
22+
--token-limit=::
23+
This specifies the maximum number of bandwidth tokens that may be
24+
in use at one time by operations that access low bandwidth memory.
25+
This number of bandwidth tokens is shared by all descriptors accessing
26+
low bandwidth memory across the entire device. token_limit should be
27+
more than 0.
28+
29+
include::../copyright.txt[]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-config-engine(1)
4+
=============================
5+
6+
NAME
7+
----
8+
accel-config-config-engine - configure individual attributes of an engine
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config config-engine <device name>/<engine name> [<options>]'
14+
15+
EXAMPLE
16+
-------
17+
accel-config config-engine dsa0/engine1.2 --group-id=0
18+
19+
OPTIONS
20+
-------
21+
-g::
22+
--group-id=::
23+
specify the group-id for this engine, group-id should be between 0
24+
and the maximum number of groups per device shown in max_groups
25+
attribute under a device. A value of -1 disassociates the engine
26+
from any group.
27+
28+
include::../copyright.txt[]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-config-group(1)
4+
============================
5+
6+
NAME
7+
----
8+
accel-config-config-group - configure individual attributes of a group
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config config-group <device name>/<group name> [<options>]'
14+
15+
EXAMPLE
16+
-------
17+
accel-config config-group dsa0/group0.0 --tokens-reserved=1
18+
19+
OPTIONS
20+
-------
21+
-r::
22+
--tokens-reserved=::
23+
specify the number of badwdith tokens reserved for the use of engines
24+
in the group. The limit of this value must be:
25+
- The sum of all tokens-reserved for all groups must be less than or
26+
equal to total badwidth tokens from group capability field of the
27+
device.
28+
29+
-t::
30+
--tokens-allowed=::
31+
specify the maxinum number of bandwidth tokens that may be in use at
32+
one time by all engines in the group. This value can be used to
33+
limit the maximum bandwidth used by engines in the group. The limit
34+
of this value must be:
35+
- greater than 0
36+
- greater than or equal to the tokens-reserved value for this group.
37+
- less than or equal to the sum of tokens reserved field and the
38+
non-reserved bandwidth tokens (total bandwidth tokens - total
39+
tokens-reserved for all groups).
40+
41+
-l::
42+
--use-token-limit=::
43+
toggle the enabling of token limt usage. use-token-limit should be
44+
either 0 or 1.
45+
46+
-a::
47+
--traffic-class-a=::
48+
specify traffic class A for this group, it should be larger
49+
than 0 and less than 8.
50+
51+
-b::
52+
--traffic-class-b=::
53+
specify traffic class B for this group, it should be larger
54+
than 0 and less than 8.
55+
56+
include::../copyright.txt[]
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-config-wq(1)
4+
=========================
5+
6+
NAME
7+
----
8+
accel-config-config-wq - configure individual attributes of a work queue
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config config-wq <device name>/<wq name> [<options>]'
14+
15+
EXAMPLE
16+
-------
17+
accel-config config-devie dsa0/wq0.0 --wq-size=16
18+
19+
OPTIONS
20+
--------
21+
-g::
22+
--group-id=::
23+
specify the group id used by work queue, group id should be between 0
24+
and the maximum number of groups per device. A group id of -1
25+
disassociates the work queue from a group.
26+
27+
-s::
28+
--wq-size=::
29+
specify work queue size used by a work queue. The wq-size should be
30+
between 0 and the maximum workqueue size exposed by the device in
31+
the max_work_queue_size attribute under device.
32+
33+
-p::
34+
--priority::
35+
specify the priority of this work queue relative to other work queues
36+
in the same group. This field ranges from 1 to 15 where the larger
37+
value means higher priority. For example, if wq1 has a priority of
38+
6 and wq2 has priority of 2, wq1 will issue 3 times as many
39+
descriptors to the engine compare to wq2.
40+
41+
-b::
42+
--block-on-fault::
43+
toggle block on fault enable for the work queue. block-on-fault
44+
should be either 0 or 1. If block on fault is disabled, if a
45+
page fault occurs on a source or destination memory access,
46+
the operation stops and the page fault is reported to the software.
47+
48+
-t::
49+
--threshold::
50+
configure the threshold for the wq. The set up threshold value should be
51+
larger than 0 and only for "shared" wq, and note that the configured
52+
threshold value should be at least 1 less than the configured wq-size
53+
value. The reason is threshold is set for unprivileged users, and need
54+
to reserve at least 1 space for the privileged user for commands.
55+
56+
-y::
57+
--type::
58+
configure the type for the wq. The wq type can be "kernel" for kernel
59+
user case to request wq, "mdev" for mediated device driver use case to
60+
request wq or "user" for regular character device driver use case to wq.
61+
62+
-m::
63+
--mode::
64+
configure the mode for the wq. The wq mode can be set as "dedicated" or
65+
"shared".
66+
67+
include::../copyright.txt[]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-create-mdev(1)
4+
===========================
5+
6+
NAME
7+
----
8+
accel-config-create-mdev - create mdev to a specified workqueue by generating a
9+
random uuid and writing to workqueue sysfs. The workqueue has to be enabled
10+
before running this command and it has to be configured as "mdev" type. If the
11+
workqueue type is shared, this command can be issued multiple times. If the
12+
workqueue is dedicated, only one uuid is allowed to be created. If this command
13+
is issued to a dedicated wq with uuid already existing, it will trigger
14+
operation not permitted error.
15+
16+
SYNOPSIS
17+
--------
18+
[verse]
19+
'accel-config create-mdev' <device name>/<workqueue name>
20+
21+
EXAMPLE
22+
-------
23+
accel-config create-mdev dsa0/wq0.0
24+
25+
include::../copyright.txt[]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-disable-device(1)
4+
==============================
5+
6+
NAME
7+
----
8+
accel-config-disable-device - disables an accfg device
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config disable-device' <device>
14+
15+
EXAMPLE
16+
-------
17+
accel-config disable-device dsa0
18+
19+
OPTIONS
20+
-------
21+
-f::
22+
--force::
23+
Force the disable of device even when there are clients using the
24+
device.
25+
26+
include::../copyright.txt[]
27+
28+
SEE ALSO
29+
--------
30+
linkaccel-config:accel-config-enable-device[1]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
accel-config-disable-wq(1)
4+
==========================
5+
6+
NAME
7+
----
8+
accel-config-disable-wq - disables an accelerator device work queue
9+
10+
SYNOPSIS
11+
--------
12+
[verse]
13+
'accel-config disable-wq' <device name>/<work queue>
14+
15+
EXAMPLE
16+
-------
17+
accel-config disable-wq dsa0/wq0.0
18+
19+
include::../copyright.txt[]
20+
21+
OPTIONS
22+
-------
23+
-f::
24+
--force::
25+
Force the disabling of the wq even if there are clients using the wq.
26+
27+
SEE ALSO
28+
--------
29+
linkaccel-config:accel-config-enable-wq[1]

0 commit comments

Comments
 (0)