← Documents Documentation/infiniband/ipoib.rst GitHub 원문 ↗

Linux 6.18.37 · InfiniBand

IP over InfiniBand

IPoIB의 P_Key 자식 인터페이스, datagram·connected 모드, MTU, 오프로드, 인터럽트 완화와 디버깅 인터페이스를 설명합니다.

Source pathDocumentation/infiniband/ipoib.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

ipoib.rst:1-115

IPoIB는 네이티브 InfiniBand 네트워크 인터페이스로서 P_Key별 자식 인터페이스를 제공하고 UD datagram 또는 RC connected 모드로 IP 패킷을 전송합니다. 모드별 MTU와 폴백, 하드웨어 오프로드, RX 인터럽트 완화, debugfs 및 데이터 경로 추적의 성능 차이를 함께 이해해야 합니다.

문서 개요
항목내용
SourceDocumentation/infiniband/ipoib.rst
분량115 source lines
인터페이스 유형`ARPHRD_INFINIBAND`, 20-byte address
전송 모드UD datagram, RC connected
표준RFC 4391, RFC 4392, RFC 4755

원문 분량과 핵심 적용 대상을 요약합니다.

핵심 흐름
P_Key 파티션 인터페이스 구성Datagram/connected 모드와 MTU 선택Datagram 전용 오프로드 확인RX CQ 완화 설정디버그 수준과 성능 영향 점검

문서의 주요 동작 순서를 압축해 보여 줍니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==================
2 IP over InfiniBand
3 ==================
4
5 The ib_ipoib driver is an implementation of the IP over InfiniBand
6 protocol as specified by RFC 4391 and 4392, issued by the IETF ipoib
7 working group. It is a "native" implementation in the sense of
8 setting the interface type to ARPHRD_INFINIBAND and the hardware
9 address length to 20 (earlier proprietary implementations
10 masqueraded to the kernel as ethernet interfaces).
11
12 Partitions and P_Keys
13 =====================
14
15 When the IPoIB driver is loaded, it creates one interface for each
16 port using the P_Key at index 0. To create an interface with a
17 different P_Key, write the desired P_Key into the main interface's
18 /sys/class/net/<intf name>/create_child file. For example::
19
20 echo 0x8001 > /sys/class/net/ib0/create_child
21
22 This will create an interface named ib0.8001 with P_Key 0x8001. To
23 remove a subinterface, use the "delete_child" file::
24
25 echo 0x8001 > /sys/class/net/ib0/delete_child
26
27 The P_Key for any interface is given by the "pkey" file, and the
28 main interface for a subinterface is in "parent."
29
30 Child interface create/delete can also be done using IPoIB's
31 rtnl_link_ops, where children created using either way behave the same.
32
33 Datagram vs Connected modes
34 ===========================
35
36 The IPoIB driver supports two modes of operation: datagram and
37 connected. The mode is set and read through an interface's
38 /sys/class/net/<intf name>/mode file.
39
40 In datagram mode, the IB UD (Unreliable Datagram) transport is used
41 and so the interface MTU has is equal to the IB L2 MTU minus the
42 IPoIB encapsulation header (4 bytes). For example, in a typical IB
43 fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes.
44
45 In connected mode, the IB RC (Reliable Connected) transport is used.
46 Connected mode takes advantage of the connected nature of the IB
47 transport and allows an MTU up to the maximal IP packet size of 64K,
48 which reduces the number of IP packets needed for handling large UDP
49 datagrams, TCP segments, etc and increases the performance for large
50 messages.
51
52 In connected mode, the interface's UD QP is still used for multicast
53 and communication with peers that don't support connected mode. In
54 this case, RX emulation of ICMP PMTU packets is used to cause the
55 networking stack to use the smaller UD MTU for these neighbours.
56
57 Stateless offloads
58 ==================
59
60 If the IB HW supports IPoIB stateless offloads, IPoIB advertises
61 TCP/IP checksum and/or Large Send (LSO) offloading capability to the
62 network stack.
63
64 Large Receive (LRO) offloading is also implemented and may be turned
65 on/off using ethtool calls. Currently LRO is supported only for
66 checksum offload capable devices.
67
68 Stateless offloads are supported only in datagram mode.
69
70 Interrupt moderation
71 ====================
72
73 If the underlying IB device supports CQ event moderation, one can
74 use ethtool to set interrupt mitigation parameters and thus reduce
75 the overhead incurred by handling interrupts. The main code path of
76 IPoIB doesn't use events for TX completion signaling so only RX
77 moderation is supported.
78
79 Debugging Information
80 =====================
81
82 By compiling the IPoIB driver with CONFIG_INFINIBAND_IPOIB_DEBUG set
83 to 'y', tracing messages are compiled into the driver. They are
84 turned on by setting the module parameters debug_level and
85 mcast_debug_level to 1. These parameters can be controlled at
86 runtime through files in /sys/module/ib_ipoib/.
87
88 CONFIG_INFINIBAND_IPOIB_DEBUG also enables files in the debugfs
89 virtual filesystem. By mounting this filesystem, for example with::
90
91 mount -t debugfs none /sys/kernel/debug
92
93 it is possible to get statistics about multicast groups from the
94 files /sys/kernel/debug/ipoib/ib0_mcg and so on.
95
96 The performance impact of this option is negligible, so it
97 is safe to enable this option with debug_level set to 0 for normal
98 operation.
99
100 CONFIG_INFINIBAND_IPOIB_DEBUG_DATA enables even more debug output in
101 the data path when data_debug_level is set to 1. However, even with
102 the output disabled, enabling this configuration option will affect
103 performance, because it adds tests to the fast path.
104
105 References
106 ==========
107
108 Transmission of IP over InfiniBand (IPoIB) (RFC 4391)
109 http://ietf.org/rfc/rfc4391.txt
110
111 IP over InfiniBand (IPoIB) Architecture (RFC 4392)
112 http://ietf.org/rfc/rfc4392.txt
113
114 IP over InfiniBand: Connected Mode (RFC 4755)
115 http://ietf.org/rfc/rfc4755.txt
116

3. 한국어 전문 번역

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

IPoIB 개요와 P_Key 파티션

1-31

`ib_ipoib` 드라이버는 IETF IPoIB 작업 그룹이 발행한 RFC 4391과 RFC 4392에 정의된 IP over InfiniBand 프로토콜의 구현입니다. 인터페이스 유형을 `ARPHRD_INFINIBAND`로 지정하고 하드웨어 주소 길이를 20바이트로 설정하므로, 이더넷 인터페이스로 가장하던 초기 독점 구현과 달리 네이티브 InfiniBand 인터페이스로 동작합니다.

IPoIB 드라이버가 적재되면 각 포트마다 P_Key 인덱스 0을 사용하는 기본 인터페이스 하나가 만들어집니다. 다른 P_Key를 쓰는 자식 인터페이스가 필요하면 기본 인터페이스의 `/sys/class/net/<intf name>/create_child` 파일에 원하는 P_Key를 기록합니다.

echo 0x8001 > /sys/class/net/ib0/create_child
# 결과: ib0.8001, P_Key 0x8001
echo 0x8001 > /sys/class/net/ib0/delete_child

예에서는 P_Key `0x8001`을 갖는 `ib0.8001` 인터페이스가 생성됩니다. 삭제할 때는 같은 값을 `delete_child`에 기록합니다. 임의 인터페이스의 P_Key는 `pkey` 파일에서, 자식 인터페이스의 기본 인터페이스는 `parent` 파일에서 확인할 수 있습니다.

자식 인터페이스 생성과 삭제는 IPoIB의 `rtnl_link_ops`로도 수행할 수 있습니다. sysfs와 rtnetlink 가운데 어느 경로를 사용해도 생성된 자식의 동작은 같습니다.

P_Key 자식 인터페이스 수명 주기
드라이버 적재: 각 포트에 P_Key 인덱스 0 인터페이스 생성`create_child` 또는 `rtnl_link_ops`에 원하는 P_Key 전달`ib0.8001` 같은 자식 인터페이스 생성`pkey`와 `parent`에서 파티션과 부모 확인`delete_child` 또는 `rtnl_link_ops`로 자식 제거

기본 포트 인터페이스에서 별도 파티션 인터페이스를 만들고 확인한 뒤 제거하는 흐름입니다.

IPoIB 파티션 인터페이스
항목경로 또는 값의미
생성`/sys/class/net/ib0/create_child`기록한 P_Key로 자식 생성
삭제`/sys/class/net/ib0/delete_child`기록한 P_Key의 자식 삭제
P_Key 조회`pkey`해당 인터페이스의 P_Key
부모 조회`parent`자식의 기본 인터페이스
대체 제어 경로`rtnl_link_ops`sysfs와 동일한 자식 동작

P_Key 기반 자식 인터페이스를 다루는 파일과 의미를 정리합니다.

==================
IP over InfiniBand
==================

  The ib_ipoib driver is an implementation of the IP over InfiniBand
  protocol as specified by RFC 4391 and 4392, issued by the IETF ipoib
  working group.  It is a "native" implementation in the sense of
  setting the interface type to ARPHRD_INFINIBAND and the hardware
  address length to 20 (earlier proprietary implementations
  masqueraded to the kernel as ethernet interfaces).

Partitions and P_Keys
=====================

  When the IPoIB driver is loaded, it creates one interface for each
  port using the P_Key at index 0.  To create an interface with a
  different P_Key, write the desired P_Key into the main interface's
  /sys/class/net/<intf name>/create_child file.  For example::

    echo 0x8001 > /sys/class/net/ib0/create_child

  This will create an interface named ib0.8001 with P_Key 0x8001.  To
  remove a subinterface, use the "delete_child" file::

    echo 0x8001 > /sys/class/net/ib0/delete_child

  The P_Key for any interface is given by the "pkey" file, and the
  main interface for a subinterface is in "parent."

  Child interface create/delete can also be done using IPoIB's
  rtnl_link_ops, where children created using either way behave the same.

Datagram 모드와 Connected 모드

32-56

IPoIB는 datagram과 connected 두 동작 모드를 지원합니다. 현재 모드를 읽거나 바꾸려면 인터페이스의 `/sys/class/net/<intf name>/mode` 파일을 사용합니다.

Datagram 모드는 IB UD(Unreliable Datagram) 전송을 사용합니다. 인터페이스 MTU는 IB 계층 2 MTU에서 4바이트 IPoIB 캡슐화 헤더를 뺀 값입니다. 따라서 일반적인 2K MTU 패브릭에서는 `2048 - 4 = 2044`바이트가 IPoIB MTU가 됩니다.

Connected 모드는 IB RC(Reliable Connected) 전송을 사용합니다. 연결형 IB 전송의 특성을 활용해 MTU를 최대 IP 패킷 크기인 64K까지 늘릴 수 있으므로 큰 UDP 데이터그램과 TCP 세그먼트를 처리할 때 필요한 IP 패킷 수를 줄이고 대형 메시지 성능을 높입니다.

Connected 모드에서도 멀티캐스트와 connected 모드를 지원하지 않는 피어와의 통신에는 인터페이스의 UD QP를 계속 사용합니다. 이때 수신 경로는 ICMP PMTU 패킷을 에뮬레이션해 네트워크 스택이 해당 이웃에는 더 작은 UD MTU를 사용하도록 만듭니다.

IPoIB 전송 모드 비교
항목DatagramConnected
IB 전송UD (Unreliable Datagram)RC (Reliable Connected)
MTUIB L2 MTU - 4바이트최대 IP 패킷 크기 64K
2K 패브릭 예2044바이트연결 피어에 더 큰 MTU 가능
멀티캐스트UD QPUD QP로 폴백
비지원 피어기본 동작UD QP와 ICMP PMTU 에뮬레이션
주요 이점호환성과 단순성대형 메시지의 패킷 수 감소

전송 방식, MTU, 적용 경로의 차이를 한눈에 비교합니다.

Connected 모드의 전송 선택
IP 패킷의 대상 확인멀티캐스트이면 UD QP 사용피어가 connected 모드를 지원하지 않아도 UD QP 사용그 밖의 연결 피어에는 RC 전송과 큰 MTU 사용UD 경로 수신 시 ICMP PMTU 에뮬레이션으로 작은 MTU 유도

대상과 기능 지원 여부에 따라 RC 또는 UD 경로가 선택됩니다.


Datagram vs Connected modes
===========================

  The IPoIB driver supports two modes of operation: datagram and
  connected.  The mode is set and read through an interface's
  /sys/class/net/<intf name>/mode file.

  In datagram mode, the IB UD (Unreliable Datagram) transport is used
  and so the interface MTU has is equal to the IB L2 MTU minus the
  IPoIB encapsulation header (4 bytes).  For example, in a typical IB
  fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes.

  In connected mode, the IB RC (Reliable Connected) transport is used.
  Connected mode takes advantage of the connected nature of the IB
  transport and allows an MTU up to the maximal IP packet size of 64K,
  which reduces the number of IP packets needed for handling large UDP
  datagrams, TCP segments, etc and increases the performance for large
  messages.

  In connected mode, the interface's UD QP is still used for multicast
  and communication with peers that don't support connected mode. In
  this case, RX emulation of ICMP PMTU packets is used to cause the
  networking stack to use the smaller UD MTU for these neighbours.

상태 비저장 오프로드와 인터럽트 완화

57-78

IB 하드웨어가 IPoIB 상태 비저장 오프로드를 지원하면 드라이버는 TCP/IP 체크섬 및 또는 LSO(Large Send Offload) 기능을 네트워크 스택에 알립니다.

LRO(Large Receive Offload)도 구현되어 있으며 `ethtool` 호출로 켜고 끌 수 있습니다. 현재 LRO는 체크섬 오프로드가 가능한 장치에서만 지원됩니다. 체크섬, LSO, LRO를 포함한 상태 비저장 오프로드는 datagram 모드에서만 지원됩니다.

하위 IB 장치가 CQ 이벤트 완화를 지원하면 `ethtool`로 인터럽트 완화 매개변수를 설정해 인터럽트 처리 비용을 줄일 수 있습니다. IPoIB 주 경로는 송신 완료 신호에 이벤트를 사용하지 않으므로 완화는 수신 경로에만 적용됩니다.

IPoIB 오프로드와 완화 지원
기능제어 또는 조건적용 범위
TCP/IP 체크섬IB 하드웨어 지원Datagram 모드
LSOIB 하드웨어 지원Datagram 모드
LRO`ethtool`, 체크섬 오프로드 가능 장치Datagram 모드
CQ 이벤트 완화`ethtool`, 하위 장치 지원RX만 지원
TX 완료 완화주 경로가 완료 이벤트를 사용하지 않음지원하지 않음

기능별 전제 조건과 적용 범위를 정리합니다.

Stateless offloads
==================

  If the IB HW supports IPoIB stateless offloads, IPoIB advertises
  TCP/IP checksum and/or Large Send (LSO) offloading capability to the
  network stack.

  Large Receive (LRO) offloading is also implemented and may be turned
  on/off using ethtool calls.  Currently LRO is supported only for
  checksum offload capable devices.

  Stateless offloads are supported only in datagram mode.

Interrupt moderation
====================

  If the underlying IB device supports CQ event moderation, one can
  use ethtool to set interrupt mitigation parameters and thus reduce
  the overhead incurred by handling interrupts.  The main code path of
  IPoIB doesn't use events for TX completion signaling so only RX
  moderation is supported.

디버깅 구성과 런타임 인터페이스

79-104

`CONFIG_INFINIBAND_IPOIB_DEBUG=y`로 드라이버를 빌드하면 추적 메시지가 포함됩니다. 모듈 매개변수 `debug_level`과 `mcast_debug_level`을 1로 설정하면 메시지가 활성화되며, 실행 중에는 `/sys/module/ib_ipoib/` 아래 파일로 제어할 수 있습니다.

이 구성은 debugfs 파일도 활성화합니다. 예를 들어 `mount -t debugfs none /sys/kernel/debug`로 debugfs를 마운트한 뒤 `/sys/kernel/debug/ipoib/ib0_mcg` 같은 파일에서 멀티캐스트 그룹 통계를 확인할 수 있습니다.

`CONFIG_INFINIBAND_IPOIB_DEBUG` 자체의 성능 영향은 미미하므로 정상 운용에서는 `debug_level=0`으로 두고 빌드 옵션을 켜도 안전합니다.

`CONFIG_INFINIBAND_IPOIB_DEBUG_DATA`는 `data_debug_level=1`일 때 데이터 경로의 더 자세한 출력을 활성화합니다. 그러나 출력을 꺼도 빠른 경로에 조건 검사가 추가되므로 이 구성 옵션을 켜는 것만으로 성능이 저하될 수 있습니다.

IPoIB 디버그 선택지
항목활성화 방법효과와 주의점
일반 추적`CONFIG_INFINIBAND_IPOIB_DEBUG=y`추적 메시지와 debugfs 파일 포함
일반 메시지`debug_level=1`일반 추적 출력
멀티캐스트 메시지`mcast_debug_level=1`멀티캐스트 추적 출력
멀티캐스트 통계`/sys/kernel/debug/ipoib/ib0_mcg`debugfs 마운트 필요
데이터 경로 추적`CONFIG_INFINIBAND_IPOIB_DEBUG_DATA`, `data_debug_level=1`빠른 경로 검사로 성능 영향

빌드 옵션, 런타임 매개변수, 성능 영향을 구분합니다.

IPoIB 디버깅 준비
필요한 `CONFIG_INFINIBAND_IPOIB_DEBUG*` 옵션으로 빌드`/sys/module/ib_ipoib/`에서 런타임 레벨 설정필요하면 debugfs를 `/sys/kernel/debug`에 마운트`ib0_mcg`에서 멀티캐스트 통계 확인정상 운용에서는 일반 레벨 0, 데이터 경로 옵션의 성능 영향 검토

일반 추적 또는 데이터 경로 추적을 사용할 때의 순서입니다.

Debugging Information
=====================

  By compiling the IPoIB driver with CONFIG_INFINIBAND_IPOIB_DEBUG set
  to 'y', tracing messages are compiled into the driver.  They are
  turned on by setting the module parameters debug_level and
  mcast_debug_level to 1.  These parameters can be controlled at
  runtime through files in /sys/module/ib_ipoib/.

  CONFIG_INFINIBAND_IPOIB_DEBUG also enables files in the debugfs
  virtual filesystem.  By mounting this filesystem, for example with::

    mount -t debugfs none /sys/kernel/debug

  it is possible to get statistics about multicast groups from the
  files /sys/kernel/debug/ipoib/ib0_mcg and so on.

  The performance impact of this option is negligible, so it
  is safe to enable this option with debug_level set to 0 for normal
  operation.

  CONFIG_INFINIBAND_IPOIB_DEBUG_DATA enables even more debug output in
  the data path when data_debug_level is set to 1.  However, even with
  the output disabled, enabling this configuration option will affect
  performance, because it adds tests to the fast path.

IPoIB 표준 참고 문서

105-115

IPoIB의 기본 전송과 주소 해석은 RFC 4391, 전체 아키텍처는 RFC 4392, connected 모드는 RFC 4755에서 정의합니다.

IPoIB RFC 참고 문서
RFC제목주소
RFC 4391Transmission of IP over InfiniBand (IPoIB)`http://ietf.org/rfc/rfc4391.txt`
RFC 4392IP over InfiniBand (IPoIB) Architecture`http://ietf.org/rfc/rfc4392.txt`
RFC 4755IP over InfiniBand: Connected Mode`http://ietf.org/rfc/rfc4755.txt`

문서에서 직접 제시하는 세 표준과 원문 위치입니다.

References
==========

  Transmission of IP over InfiniBand (IPoIB) (RFC 4391)
    http://ietf.org/rfc/rfc4391.txt

  IP over InfiniBand (IPoIB) Architecture (RFC 4392)
    http://ietf.org/rfc/rfc4392.txt

  IP over InfiniBand: Connected Mode (RFC 4755)
    http://ietf.org/rfc/rfc4755.txt