요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0+
=============================
Flexcan CAN Controller driver
=============================
Authors: Marc Kleine-Budde <mkl@pengutronix.de>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>
On/off RTR frames reception
===========================
For most flexcan IP cores the driver supports 2 RX modes:
- FIFO
- mailbox
The older flexcan cores (integrated into the i.MX25, i.MX28, i.MX35
and i.MX53 SOCs) only receive RTR frames if the controller is
configured for RX-FIFO mode.
The RX FIFO mode uses a hardware FIFO with a depth of 6 CAN frames,
while the mailbox mode uses a software FIFO with a depth of up to 62
CAN frames. With the help of the bigger buffer, the mailbox mode
performs better under high system load situations.
As reception of RTR frames is part of the CAN standard, all flexcan
cores come up in a mode where RTR reception is possible.
With the "rx-rtr" private flag the ability to receive RTR frames can
be waived at the expense of losing the ability to receive RTR
messages. This trade off is beneficial in certain use cases.
"rx-rtr" on
Receive RTR frames. (default)
The CAN controller can and will receive RTR frames.
On some IP cores the controller cannot receive RTR frames in the
more performant "RX mailbox" mode and will use "RX FIFO" mode
instead.
"rx-rtr" off
Waive ability to receive RTR frames. (not supported on all IP cores)
This mode activates the "RX mailbox mode" for better performance, on
some IP cores RTR frames cannot be received anymore.
The setting can only be changed if the interface is down::
ip link set dev can0 down
ethtool --set-priv-flags can0 rx-rtr {off|on}
ip link set dev can0 up
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
FlexCAN RX mode와 legacy core
1-25FlexCAN CAN controller driver
저자: Marc Kleine-Budde `<mkl@pengutronix.de>`, Dario Binacchi `<dario.binacchi@amarulasolutions.com>`
RTR frame 수신 켜기와 끄기
대부분의 FlexCAN IP core에서 driver는 두 가지 RX mode를 지원합니다.
- FIFO
- mailbox
i.MX25, i.MX28, i.MX35, i.MX53 SoC에 통합된 구형 FlexCAN core는 controller를 RX-FIFO mode로 구성해야만 RTR frame을 수신합니다.
RX FIFO mode는 깊이 6 CAN frame인 hardware FIFO를 사용합니다. Mailbox mode는 최대 62 CAN frame 깊이의 software FIFO를 사용합니다. 더 큰 buffer 덕분에 mailbox mode는 system load가 높을 때 더 좋은 성능을 냅니다.
.. SPDX-License-Identifier: GPL-2.0+
=============================
Flexcan CAN Controller driver
=============================
Authors: Marc Kleine-Budde <mkl@pengutronix.de>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>
On/off RTR frames reception
===========================
For most flexcan IP cores the driver supports 2 RX modes:
- FIFO
- mailbox
The older flexcan cores (integrated into the i.MX25, i.MX28, i.MX35
and i.MX53 SOCs) only receive RTR frames if the controller is
configured for RX-FIFO mode.
The RX FIFO mode uses a hardware FIFO with a depth of 6 CAN frames,
while the mailbox mode uses a software FIFO with a depth of up to 62
CAN frames. With the help of the bigger buffer, the mailbox mode
performs better under high system load situations.
rx-rtr private flag의 trade-off
26-48RTR frame 수신은 CAN 표준의 일부이므로 모든 FlexCAN core는 기본적으로 RTR를 받을 수 있는 mode로 시작합니다.
`rx-rtr` private flag를 끄면 RTR message 수신 능력을 포기하는 대신 일부 환경에서 더 나은 성능을 얻을 수 있습니다. 이 trade-off가 유리한 use case가 있습니다.
`rx-rtr` on
RTR frame을 수신하며 기본값입니다. CAN controller는 RTR frame을 받을 수 있고 실제로 수신합니다. 일부 IP core는 더 빠른 RX mailbox mode에서 RTR를 받을 수 없으므로 대신 RX FIFO mode를 사용합니다.
`rx-rtr` off
RTR frame 수신 능력을 포기합니다. 모든 IP core에서 지원되는 것은 아닙니다. 일부 core에서는 더 나은 성능을 위해 RX mailbox mode를 활성화하며, 그 결과 RTR frame을 더 이상 받을 수 없습니다.
As reception of RTR frames is part of the CAN standard, all flexcan
cores come up in a mode where RTR reception is possible.
With the "rx-rtr" private flag the ability to receive RTR frames can
be waived at the expense of losing the ability to receive RTR
messages. This trade off is beneficial in certain use cases.
"rx-rtr" on
Receive RTR frames. (default)
The CAN controller can and will receive RTR frames.
On some IP cores the controller cannot receive RTR frames in the
more performant "RX mailbox" mode and will use "RX FIFO" mode
instead.
"rx-rtr" off
Waive ability to receive RTR frames. (not supported on all IP cores)
This mode activates the "RX mailbox mode" for better performance, on
some IP cores RTR frames cannot be received anymore.
Interface가 내려간 상태에서 flag 변경
49-54이 설정은 interface가 내려가 있을 때만 바꿀 수 있습니다.
ip link set dev can0 down
ethtool --set-priv-flags can0 rx-rtr {off|on}
ip link set dev can0 up
The setting can only be changed if the interface is down::
ip link set dev can0 down
ethtool --set-priv-flags can0 rx-rtr {off|on}
ip link set dev can0 up
요약·해설
flexcan.rst:1-54FlexCAN driver는 RX FIFO와 mailbox mode를 지원합니다. 구형 i.MX core에서 RTR 수신을 유지하면 깊이 6의 hardware FIFO를 써야 하지만, `rx-rtr`을 끄면 RTR를 포기하고 최대 62 frame의 mailbox software FIFO로 고부하 성능을 높일 수 있습니다.
RTR 호환성과 queue 깊이·성능의 trade-off입니다.
Private flag가 일부 IP core의 RX mode를 결정합니다.
Interface가 내려간 동안에만 private flag를 바꿉니다.