← Documents Documentation/networking/device_drivers/can/freescale/flexcan.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

FlexCAN CAN Controller driver

FlexCAN의 RX FIFO·mailbox mode와 RTR 수신을 성능과 맞바꾸는 rx-rtr private flag를 설명합니다.

Source pathDocumentation/networking/device_drivers/can/freescale/flexcan.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

flexcan.rst:1-54

FlexCAN driver는 RX FIFO와 mailbox mode를 지원합니다. 구형 i.MX core에서 RTR 수신을 유지하면 깊이 6의 hardware FIFO를 써야 하지만, `rx-rtr`을 끄면 RTR를 포기하고 최대 62 frame의 mailbox software FIFO로 고부하 성능을 높일 수 있습니다.

FlexCAN RX mode 비교
ModeQueueRTR특징
RX FIFOHardware FIFO 6 frame구형 core에서 가능기본 호환성
RX mailboxSoftware FIFO 최대 62 frame일부 core에서 불가고부하 성능 우수

RTR 호환성과 queue 깊이·성능의 trade-off입니다.

rx-rtr 선택
`rx-rtr on`RTR 수신 유지필요 시 RX FIFO mode
`rx-rtr off`RTR 수신 포기RX mailbox mode더 큰 buffer

Private flag가 일부 IP core의 RX mode를 결정합니다.

rx-rtr 변경 절차
`can0 down``ethtool --set-priv-flags can0 rx-rtr {off|on}``can0 up`

Interface가 내려간 동안에만 private flag를 바꿉니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0+
2
3 =============================
4 Flexcan CAN Controller driver
5 =============================
6
7 Authors: Marc Kleine-Budde <[email protected]>,
8 Dario Binacchi <[email protected]>
9
10 On/off RTR frames reception
11 ===========================
12
13 For most flexcan IP cores the driver supports 2 RX modes:
14
15 - FIFO
16 - mailbox
17
18 The older flexcan cores (integrated into the i.MX25, i.MX28, i.MX35
19 and i.MX53 SOCs) only receive RTR frames if the controller is
20 configured for RX-FIFO mode.
21
22 The RX FIFO mode uses a hardware FIFO with a depth of 6 CAN frames,
23 while the mailbox mode uses a software FIFO with a depth of up to 62
24 CAN frames. With the help of the bigger buffer, the mailbox mode
25 performs better under high system load situations.
26
27 As reception of RTR frames is part of the CAN standard, all flexcan
28 cores come up in a mode where RTR reception is possible.
29
30 With the "rx-rtr" private flag the ability to receive RTR frames can
31 be waived at the expense of losing the ability to receive RTR
32 messages. This trade off is beneficial in certain use cases.
33
34 "rx-rtr" on
35 Receive RTR frames. (default)
36
37 The CAN controller can and will receive RTR frames.
38
39 On some IP cores the controller cannot receive RTR frames in the
40 more performant "RX mailbox" mode and will use "RX FIFO" mode
41 instead.
42
43 "rx-rtr" off
44
45 Waive ability to receive RTR frames. (not supported on all IP cores)
46
47 This mode activates the "RX mailbox mode" for better performance, on
48 some IP cores RTR frames cannot be received anymore.
49
50 The setting can only be changed if the interface is down::
51
52 ip link set dev can0 down
53 ethtool --set-priv-flags can0 rx-rtr {off|on}
54 ip link set dev can0 up
55

3. 한국어 전문 번역

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

FlexCAN RX mode와 legacy core

1-25

FlexCAN CAN controller driver

저자: Marc Kleine-Budde `<[email protected]>`, Dario Binacchi `<[email protected]>`

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 <[email protected]>,
Dario Binacchi <[email protected]>

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-48

RTR 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