← Documents Documentation/ABI/testing/debugfs-hisi-sec GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

HiSilicon SEC debugfs ABI

HiSilicon SEC의 register read-clear, function QoS, Queue Manager selector·interrupt·error·state·stop timeout, SEC request DFX counters와 capability registers debugfs ABI를 설명합니다.

Source pathDocumentation/ABI/testing/debugfs-hisi-sec
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

SEC controller와 QM selectors

debugfs-hisi-sec:1-47

PF에서 SEC·QM register read-clear와 function QM·queue를 선택하고 PF·VF function별 QoS와 QM register dump를 제공합니다.

QM interrupts, errors, status

debugfs-hisi-sec:49-85

PF와 VF에서 task completion invalid IRQ, async·abnormal events, queue allocation·mailbox errors와 QM work·stop status를 보고합니다.

QM register changes와 stop timeout

debugfs-hisi-sec:87-114

QM register 변화와 busy·idle state를 표시하고 stop queue failure 시 wait time 및 non-zero failure state를 제공합니다.

SEC request DFX counters

debugfs-hisi-sec:116-159

SEC register 변화와 sent·received·busy, BD type error, invalid, completed-but-error requests를 계수합니다.

QM·SEC capability registers

debugfs-hisi-sec:161-166

PF와 VF에서 QM·SEC capability bit registers를 dump해 device specification 조회와 fault locating을 지원합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/kernel/debug/hisi_sec2/<bdf>/clear_enable
2 Date: Oct 2019
3 Contact: linux-crypto@vger.kernel.org
4 Description: Enabling/disabling of clear action after reading
5 the SEC debug registers.
6 0: disable, 1: enable.
7 Only available for PF, and take no other effect on SEC.
8
9 What: /sys/kernel/debug/hisi_sec2/<bdf>/current_qm
10 Date: Oct 2019
11 Contact: linux-crypto@vger.kernel.org
12 Description: One SEC controller has one PF and multiple VFs, each function
13 has a QM. This file can be used to select the QM which below
14 qm refers to.
15 Only available for PF.
16
17 What: /sys/kernel/debug/hisi_sec2/<bdf>/alg_qos
18 Date: Jun 2021
19 Contact: linux-crypto@vger.kernel.org
20 Description: The <bdf> is related the function for PF and VF.
21 SEC driver supports to configure each function's QoS, the driver
22 supports to write <bdf> value to alg_qos in the host. Such as
23 "echo <bdf> value > alg_qos". The qos value is 1~1000, means
24 1/1000~1000/1000 of total QoS. The driver reading alg_qos to
25 get related QoS in the host and VM, Such as "cat alg_qos".
26
27 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_regs
28 Date: Oct 2019
29 Contact: linux-crypto@vger.kernel.org
30 Description: Dump of QM related debug registers.
31 Available for PF and VF in host. VF in guest currently only
32 has one debug register.
33
34 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/current_q
35 Date: Oct 2019
36 Contact: linux-crypto@vger.kernel.org
37 Description: One QM of SEC may contain multiple queues. Select specific
38 queue to show its debug registers in above 'regs'.
39 Only available for PF.
40
41 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/clear_enable
42 Date: Oct 2019
43 Contact: linux-crypto@vger.kernel.org
44 Description: Enabling/disabling of clear action after reading
45 the SEC's QM debug registers.
46 0: disable, 1: enable.
47 Only available for PF, and take no other effect on SEC.
48
49 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/err_irq
50 Date: Apr 2020
51 Contact: linux-crypto@vger.kernel.org
52 Description: Dump the number of invalid interrupts for
53 QM task completion.
54 Available for both PF and VF, and take no other effect on SEC.
55
56 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/aeq_irq
57 Date: Apr 2020
58 Contact: linux-crypto@vger.kernel.org
59 Description: Dump the number of QM async event queue interrupts.
60 Available for both PF and VF, and take no other effect on SEC.
61
62 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/abnormal_irq
63 Date: Apr 2020
64 Contact: linux-crypto@vger.kernel.org
65 Description: Dump the number of interrupts for QM abnormal event.
66 Available for both PF and VF, and take no other effect on SEC.
67
68 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/create_qp_err
69 Date: Apr 2020
70 Contact: linux-crypto@vger.kernel.org
71 Description: Dump the number of queue allocation errors.
72 Available for both PF and VF, and take no other effect on SEC.
73
74 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/mb_err
75 Date: Apr 2020
76 Contact: linux-crypto@vger.kernel.org
77 Description: Dump the number of failed QM mailbox commands.
78 Available for both PF and VF, and take no other effect on SEC.
79
80 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/status
81 Date: Apr 2020
82 Contact: linux-crypto@vger.kernel.org
83 Description: Dump the status of the QM.
84 Two states: work, stop.
85 Available for both PF and VF, and take no other effect on SEC.
86
87 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/diff_regs
88 Date: Mar 2022
89 Contact: linux-crypto@vger.kernel.org
90 Description: QM debug registers(regs) read hardware register value. This
91 node is used to show the change of the qm register values. This
92 node can be help users to check the change of register values.
93
94 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_state
95 Date: Jan 2024
96 Contact: linux-crypto@vger.kernel.org
97 Description: Dump the state of the device.
98 0: busy, 1: idle.
99 Only available for PF, and take no other effect on SEC.
100
101 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_timeout
102 Date: Feb 2024
103 Contact: linux-crypto@vger.kernel.org
104 Description: Set the wait time when stop queue fails. Available for both PF
105 and VF, and take no other effect on SEC.
106 0: not wait(default), others value: wait dev_timeout * 20 microsecond.
107
108 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_state
109 Date: Feb 2024
110 Contact: linux-crypto@vger.kernel.org
111 Description: Dump the stop queue status of the QM. The default value is 0,
112 if dev_timeout is set, when stop queue fails, the dev_state
113 will return non-zero value. Available for both PF and VF,
114 and take no other effect on SEC.
115
116 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/diff_regs
117 Date: Mar 2022
118 Contact: linux-crypto@vger.kernel.org
119 Description: SEC debug registers(regs) read hardware register value. This
120 node is used to show the change of the register values. This
121 node can be help users to check the change of register values.
122
123 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_cnt
124 Date: Apr 2020
125 Contact: linux-crypto@vger.kernel.org
126 Description: Dump the total number of sent requests.
127 Available for both PF and VF, and take no other effect on SEC.
128
129 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/recv_cnt
130 Date: Apr 2020
131 Contact: linux-crypto@vger.kernel.org
132 Description: Dump the total number of received requests.
133 Available for both PF and VF, and take no other effect on SEC.
134
135 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_busy_cnt
136 Date: Apr 2020
137 Contact: linux-crypto@vger.kernel.org
138 Description: Dump the total number of requests sent with returning busy.
139 Available for both PF and VF, and take no other effect on SEC.
140
141 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/err_bd_cnt
142 Date: Apr 2020
143 Contact: linux-crypto@vger.kernel.org
144 Description: Dump the total number of BD type error requests
145 to be received.
146 Available for both PF and VF, and take no other effect on SEC.
147
148 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/invalid_req_cnt
149 Date: Apr 2020
150 Contact: linux-crypto@vger.kernel.org
151 Description: Dump the total number of invalid requests being received.
152 Available for both PF and VF, and take no other effect on SEC.
153
154 What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/done_flag_cnt
155 Date: Apr 2020
156 Contact: linux-crypto@vger.kernel.org
157 Description: Dump the total number of completed but marked error requests
158 to be received.
159 Available for both PF and VF, and take no other effect on SEC.
160
161 What: /sys/kernel/debug/hisi_sec2/<bdf>/cap_regs
162 Date: Oct 2024
163 Contact: linux-crypto@vger.kernel.org
164 Description: Dump the values of the qm and sec capability bit registers and
165 support the query of device specifications to facilitate fault locating.
166 Available for both PF and VF, and take no other effect on SEC.
167

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

SEC controller, function QM, QoS

1-32

이 문서의 모든 항목 담당자는 linux-crypto@vger.kernel.org입니다.

WhatDate설명범위
/sys/kernel/debug/hisi_sec2/<bdf>/clear_enable2019년 10월SEC debug registers를 읽은 뒤 clear할지 enable 또는 disable합니다. 0은 disable, 1은 enable이며 SEC 동작에 다른 영향을 주지 않습니다.PF only
/sys/kernel/debug/hisi_sec2/<bdf>/current_qm2019년 10월SEC controller 하나에는 PF 하나와 여러 VFs가 있고 각 function은 QM을 가집니다. 아래 qm nodes가 참조할 QM을 선택합니다.PF only
/sys/kernel/debug/hisi_sec2/<bdf>/alg_qos2021년 6월PF 또는 VF function을 나타내는 <bdf>의 QoS를 구성합니다. 값 1..1000은 total QoS의 1/1000..1000/1000을 뜻합니다. Host와 VM에서 읽어 관련 QoS를 확인합니다.PF and VF function
/sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_regs2019년 10월QM 관련 debug registers를 dump합니다.Host의 PF와 VF. Guest VF는 현재 debug register 하나만 제공
echo <bdf> value > alg_qos
cat alg_qos

QM queue selector와 read-clear

34-47
WhatDate설명범위
/sys/kernel/debug/hisi_sec2/<bdf>/qm/current_q2019년 10월SEC QM에 여러 queues가 있을 때 위 qm_regs에 표시할 특정 queue를 선택합니다.PF only
/sys/kernel/debug/hisi_sec2/<bdf>/qm/clear_enable2019년 10월SEC QM debug registers를 읽은 뒤 clear할지 제어합니다. 0은 disable, 1은 enable이며 SEC 동작에 다른 영향을 주지 않습니다.PF only
SEC QM과 queue register 선택
current_qmSelected PF or VF QMqm subtree
qm/current_qSelected queueqm/qm_regs
clear_enable = 1Read registersCounters cleared

PF의 current_qm이 function별 QM을 고르고 qm/current_q가 그 QM 안의 queue를 골라 qm_regs dump 대상을 결정한다.

QM IRQ·error counters와 status

49-85

아래 항목은 PF와 VF 모두에서 사용할 수 있고 SEC 동작에 다른 영향을 주지 않습니다.

WhatDate설명
/sys/kernel/debug/hisi_sec2/<bdf>/qm/err_irq2020년 4월QM task completion의 invalid interrupt 수를 dump합니다.
/sys/kernel/debug/hisi_sec2/<bdf>/qm/aeq_irq2020년 4월QM async event queue interrupt 수를 dump합니다.
/sys/kernel/debug/hisi_sec2/<bdf>/qm/abnormal_irq2020년 4월QM abnormal event interrupt 수를 dump합니다.
/sys/kernel/debug/hisi_sec2/<bdf>/qm/create_qp_err2020년 4월Queue allocation error 수를 dump합니다.
/sys/kernel/debug/hisi_sec2/<bdf>/qm/mb_err2020년 4월실패한 QM mailbox command 수를 dump합니다.
/sys/kernel/debug/hisi_sec2/<bdf>/qm/status2020년 4월QM status를 dump합니다. 가능한 state는 work와 stop입니다.

QM register changes와 stop-queue state

87-114
WhatDate설명범위
/sys/kernel/debug/hisi_sec2/<bdf>/qm/diff_regs2022년 3월QM debug registers의 hardware register values를 읽어 QM register 값의 변화를 표시하고 확인하도록 돕습니다.문서에 PF/VF 제한 미기재
/sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_state2024년 1월Device state를 dump합니다. 0은 busy, 1은 idle이며 SEC 동작에 다른 영향을 주지 않습니다.PF only
/sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_timeout2024년 2월Stop queue가 실패했을 때 기다릴 시간을 설정합니다. 0은 기다리지 않는 기본값이고 그 밖의 값은 dev_timeout × 20 microseconds만큼 기다립니다. SEC 동작에 다른 영향을 주지 않습니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_state2024년 2월QM stop-queue status를 dump합니다. 기본값은 0입니다. dev_timeout이 설정된 상태에서 stop queue가 실패하면 non-zero를 반환하며 SEC 동작에 다른 영향을 주지 않습니다.PF and VF
SEC QM stop timeout과 failure state
Stop queue requestSuccessdev_state = 0
Stop queue failuredev_timeout = 0No wait
Stop queue failuredev_timeout > 0Wait dev_timeout × 20 µsStill faileddev_state ≠ 0

Stop queue 실패 시 dev_timeout이 지정되면 20 µs 단위로 기다리고 최종 실패를 dev_state의 non-zero 값으로 보고한다.

SEC DFX registers와 request counters

116-159
WhatDate설명범위
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/diff_regs2022년 3월SEC debug registers의 hardware register values를 읽어 register 값의 변화를 표시하고 확인하도록 돕습니다.문서에 PF/VF 제한 미기재
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_cnt2020년 4월보낸 request 총수를 dump합니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/recv_cnt2020년 4월받은 request 총수를 dump합니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_busy_cnt2020년 4월전송했지만 busy를 반환한 request 총수를 dump합니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/err_bd_cnt2020년 4월수신한 BD type error request 총수를 dump합니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/invalid_req_cnt2020년 4월수신한 invalid request 총수를 dump합니다.PF and VF
/sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/done_flag_cnt2020년 4월완료되었지만 error로 표시된 수신 request 총수를 dump합니다.PF and VF

PF·VF 공통 counters는 SEC 동작에 다른 영향을 주지 않습니다.

SEC request DFX 결과 분류
Request sentsend_cntResponse receivedrecv_cnt
Send returns busysend_busy_cnt
BD type error receivederr_bd_cnt
Invalid request receivedinvalid_req_cnt
Completed but marked errordone_flag_cnt

기본 send·receive 흐름과 busy, BD type error, invalid request, done-but-error 결과를 별도 counters가 기록한다.

QM·SEC capability bit registers

161-166
항목내용
What/sys/kernel/debug/hisi_sec2/<bdf>/cap_regs
Date2024년 10월
Contactlinux-crypto@vger.kernel.org
DescriptionQM과 SEC capability bit register 값을 dump하고 device specification 조회를 지원해 fault locating을 쉽게 합니다.
범위PF와 VF 모두에서 사용 가능하며 SEC 동작에 다른 영향을 주지 않음