요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
QM interrupts, errors, status
debugfs-hisi-sec:49-85PF와 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-114QM register 변화와 busy·idle state를 표시하고 stop queue failure 시 wait time 및 non-zero failure state를 제공합니다.
SEC request DFX counters
debugfs-hisi-sec:116-159SEC register 변화와 sent·received·busy, BD type error, invalid, completed-but-error requests를 계수합니다.
QM·SEC capability registers
debugfs-hisi-sec:161-166PF와 VF에서 QM·SEC capability bit registers를 dump해 device specification 조회와 fault locating을 지원합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/kernel/debug/hisi_sec2/<bdf>/clear_enable
Date: Oct 2019
Contact: linux-crypto@vger.kernel.org
Description: Enabling/disabling of clear action after reading
the SEC debug registers.
0: disable, 1: enable.
Only available for PF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/current_qm
Date: Oct 2019
Contact: linux-crypto@vger.kernel.org
Description: One SEC controller has one PF and multiple VFs, each function
has a QM. This file can be used to select the QM which below
qm refers to.
Only available for PF.
What: /sys/kernel/debug/hisi_sec2/<bdf>/alg_qos
Date: Jun 2021
Contact: linux-crypto@vger.kernel.org
Description: The <bdf> is related the function for PF and VF.
SEC driver supports to configure each function's QoS, the driver
supports to write <bdf> value to alg_qos in the host. Such as
"echo <bdf> value > alg_qos". The qos value is 1~1000, means
1/1000~1000/1000 of total QoS. The driver reading alg_qos to
get related QoS in the host and VM, Such as "cat alg_qos".
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_regs
Date: Oct 2019
Contact: linux-crypto@vger.kernel.org
Description: Dump of QM related debug registers.
Available for PF and VF in host. VF in guest currently only
has one debug register.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/current_q
Date: Oct 2019
Contact: linux-crypto@vger.kernel.org
Description: One QM of SEC may contain multiple queues. Select specific
queue to show its debug registers in above 'regs'.
Only available for PF.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/clear_enable
Date: Oct 2019
Contact: linux-crypto@vger.kernel.org
Description: Enabling/disabling of clear action after reading
the SEC's QM debug registers.
0: disable, 1: enable.
Only available for PF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/err_irq
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the number of invalid interrupts for
QM task completion.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/aeq_irq
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the number of QM async event queue interrupts.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/abnormal_irq
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the number of interrupts for QM abnormal event.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/create_qp_err
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the number of queue allocation errors.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/mb_err
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the number of failed QM mailbox commands.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/status
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the status of the QM.
Two states: work, stop.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/diff_regs
Date: Mar 2022
Contact: linux-crypto@vger.kernel.org
Description: QM debug registers(regs) read hardware register value. This
node is used to show the change of the qm register values. This
node can be help users to check the change of register values.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_state
Date: Jan 2024
Contact: linux-crypto@vger.kernel.org
Description: Dump the state of the device.
0: busy, 1: idle.
Only available for PF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_timeout
Date: Feb 2024
Contact: linux-crypto@vger.kernel.org
Description: Set the wait time when stop queue fails. Available for both PF
and VF, and take no other effect on SEC.
0: not wait(default), others value: wait dev_timeout * 20 microsecond.
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_state
Date: Feb 2024
Contact: linux-crypto@vger.kernel.org
Description: Dump the stop queue status of the QM. The default value is 0,
if dev_timeout is set, when stop queue fails, the dev_state
will return non-zero value. Available for both PF and VF,
and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/diff_regs
Date: Mar 2022
Contact: linux-crypto@vger.kernel.org
Description: SEC debug registers(regs) read hardware register value. This
node is used to show the change of the register values. This
node can be help users to check the change of register values.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of sent requests.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/recv_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of received requests.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_busy_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of requests sent with returning busy.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/err_bd_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of BD type error requests
to be received.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/invalid_req_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of invalid requests being received.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/done_flag_cnt
Date: Apr 2020
Contact: linux-crypto@vger.kernel.org
Description: Dump the total number of completed but marked error requests
to be received.
Available for both PF and VF, and take no other effect on SEC.
What: /sys/kernel/debug/hisi_sec2/<bdf>/cap_regs
Date: Oct 2024
Contact: linux-crypto@vger.kernel.org
Description: Dump the values of the qm and sec capability bit registers and
support the query of device specifications to facilitate fault locating.
Available for both PF and VF, and take no other effect on SEC.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
SEC controller, function QM, QoS
1-32이 문서의 모든 항목 담당자는 linux-crypto@vger.kernel.org입니다.
| What | Date | 설명 | 범위 |
|---|---|---|---|
| /sys/kernel/debug/hisi_sec2/<bdf>/clear_enable | 2019년 10월 | SEC debug registers를 읽은 뒤 clear할지 enable 또는 disable합니다. 0은 disable, 1은 enable이며 SEC 동작에 다른 영향을 주지 않습니다. | PF only |
| /sys/kernel/debug/hisi_sec2/<bdf>/current_qm | 2019년 10월 | SEC controller 하나에는 PF 하나와 여러 VFs가 있고 각 function은 QM을 가집니다. 아래 qm nodes가 참조할 QM을 선택합니다. | PF only |
| /sys/kernel/debug/hisi_sec2/<bdf>/alg_qos | 2021년 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_regs | 2019년 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| What | Date | 설명 | 범위 |
|---|---|---|---|
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/current_q | 2019년 10월 | SEC QM에 여러 queues가 있을 때 위 qm_regs에 표시할 특정 queue를 선택합니다. | PF only |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/clear_enable | 2019년 10월 | SEC QM debug registers를 읽은 뒤 clear할지 제어합니다. 0은 disable, 1은 enable이며 SEC 동작에 다른 영향을 주지 않습니다. | PF only |
PF의 current_qm이 function별 QM을 고르고 qm/current_q가 그 QM 안의 queue를 골라 qm_regs dump 대상을 결정한다.
QM IRQ·error counters와 status
49-85아래 항목은 PF와 VF 모두에서 사용할 수 있고 SEC 동작에 다른 영향을 주지 않습니다.
| What | Date | 설명 |
|---|---|---|
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/err_irq | 2020년 4월 | QM task completion의 invalid interrupt 수를 dump합니다. |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/aeq_irq | 2020년 4월 | QM async event queue interrupt 수를 dump합니다. |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/abnormal_irq | 2020년 4월 | QM abnormal event interrupt 수를 dump합니다. |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/create_qp_err | 2020년 4월 | Queue allocation error 수를 dump합니다. |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/mb_err | 2020년 4월 | 실패한 QM mailbox command 수를 dump합니다. |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/status | 2020년 4월 | QM status를 dump합니다. 가능한 state는 work와 stop입니다. |
QM register changes와 stop-queue state
87-114| What | Date | 설명 | 범위 |
|---|---|---|---|
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/diff_regs | 2022년 3월 | QM debug registers의 hardware register values를 읽어 QM register 값의 변화를 표시하고 확인하도록 돕습니다. | 문서에 PF/VF 제한 미기재 |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_state | 2024년 1월 | Device state를 dump합니다. 0은 busy, 1은 idle이며 SEC 동작에 다른 영향을 주지 않습니다. | PF only |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_timeout | 2024년 2월 | Stop queue가 실패했을 때 기다릴 시간을 설정합니다. 0은 기다리지 않는 기본값이고 그 밖의 값은 dev_timeout × 20 microseconds만큼 기다립니다. SEC 동작에 다른 영향을 주지 않습니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/qm/dev_state | 2024년 2월 | QM stop-queue status를 dump합니다. 기본값은 0입니다. dev_timeout이 설정된 상태에서 stop queue가 실패하면 non-zero를 반환하며 SEC 동작에 다른 영향을 주지 않습니다. | PF and VF |
Stop queue 실패 시 dev_timeout이 지정되면 20 µs 단위로 기다리고 최종 실패를 dev_state의 non-zero 값으로 보고한다.
SEC DFX registers와 request counters
116-159| What | Date | 설명 | 범위 |
|---|---|---|---|
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/diff_regs | 2022년 3월 | SEC debug registers의 hardware register values를 읽어 register 값의 변화를 표시하고 확인하도록 돕습니다. | 문서에 PF/VF 제한 미기재 |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_cnt | 2020년 4월 | 보낸 request 총수를 dump합니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/recv_cnt | 2020년 4월 | 받은 request 총수를 dump합니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_busy_cnt | 2020년 4월 | 전송했지만 busy를 반환한 request 총수를 dump합니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/err_bd_cnt | 2020년 4월 | 수신한 BD type error request 총수를 dump합니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/invalid_req_cnt | 2020년 4월 | 수신한 invalid request 총수를 dump합니다. | PF and VF |
| /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/done_flag_cnt | 2020년 4월 | 완료되었지만 error로 표시된 수신 request 총수를 dump합니다. | PF and VF |
PF·VF 공통 counters는 SEC 동작에 다른 영향을 주지 않습니다.
기본 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 |
| Date | 2024년 10월 |
| Contact | linux-crypto@vger.kernel.org |
| Description | QM과 SEC capability bit register 값을 dump하고 device specification 조회를 지원해 fault locating을 쉽게 합니다. |
| 범위 | PF와 VF 모두에서 사용 가능하며 SEC 동작에 다른 영향을 주지 않음 |
SEC controller와 QM selectors
debugfs-hisi-sec:1-47PF에서 SEC·QM register read-clear와 function QM·queue를 선택하고 PF·VF function별 QoS와 QM register dump를 제공합니다.