← Documents Documentation/ABI/testing/sysfs-class-net-cdc_ncm GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

CDC NCM network sysfs ABI

CDC NCM interface의 NTB TX padding·NDP quirk·RX/TX size·aggregation timer와 read-only IN/OUT alignment parameter를 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-class-net-cdc_ncm
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

TX padding and NDP layout

sysfs-class-net-cdc_ncm:1-39

min_tx_pkt threshold에 따른 tx_max padding과 payload 뒤 NDP를 배치하는 temporary quirk를 설명합니다.

NTB sizes and aggregation timer

sysfs-class-net-cdc_ncm:41-87

Device-dependent RX·TX maximum과 0 또는 5~4000000 µs aggregation timer, GetNtbParameters 출처를 제공합니다.

Read-only IN parameters

sysfs-class-net-cdc_ncm:89-127

지원 NTB format bit와 IN maximum size·divisor·remainder·alignment modulus를 정의합니다.

Read-only OUT parameters

sysfs-class-net-cdc_ncm:129-168

OUT maximum size·alignment field와 단일 NTB의 maximum datagram 수를 정의합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/net/<iface>/cdc_ncm/min_tx_pkt
2 Date: May 2014
3 KernelVersion: 3.16
4 Contact: Bjørn Mork <bjorn@mork.no>
5 Description:
6 The driver will pad NCM Transfer Blocks (NTBs) longer
7 than this to tx_max, allowing the device to receive
8 tx_max sized frames with no terminating short
9 packet. NTBs shorter than this limit are transmitted
10 as-is, without any padding, and are terminated with a
11 short USB packet.
12
13 Padding to tx_max allows the driver to transmit NTBs
14 back-to-back without any interleaving short USB
15 packets. This reduces the number of short packet
16 interrupts in the device, and represents a tradeoff
17 between USB bus bandwidth and device DMA optimization.
18
19 Set to 0 to pad all frames. Set greater than tx_max to
20 disable all padding.
21
22 What: /sys/class/net/<iface>/cdc_ncm/ndp_to_end
23 Date: Dec 2015
24 KernelVersion: 4.5
25 Contact: Bjørn Mork <bjorn@mork.no>
26 Description:
27 Boolean attribute showing the status of the "NDP to
28 end" quirk. Defaults to 'N', except for devices
29 already known to need it enabled.
30
31 The "NDP to end" quirk makes the driver place the NDP
32 (the packet index table) after the payload. The NCM
33 specification does not mandate this, but some devices
34 are known to be more restrictive. Write 'Y' to this
35 attribute for temporary testing of a suspect device
36 failing to work with the default driver settings.
37
38 A device entry should be added to the driver if this
39 quirk is found to be required.
40
41 What: /sys/class/net/<iface>/cdc_ncm/rx_max
42 Date: May 2014
43 KernelVersion: 3.16
44 Contact: Bjørn Mork <bjorn@mork.no>
45 Description:
46 The maximum NTB size for RX. Cannot exceed the
47 maximum value supported by the device. Must allow at
48 least one max sized datagram plus headers.
49
50 The actual limits are device dependent. See
51 dwNtbInMaxSize.
52
53 Note: Some devices will silently ignore changes to
54 this value, resulting in oversized NTBs and
55 corresponding framing errors.
56
57 What: /sys/class/net/<iface>/cdc_ncm/tx_max
58 Date: May 2014
59 KernelVersion: 3.16
60 Contact: Bjørn Mork <bjorn@mork.no>
61 Description:
62 The maximum NTB size for TX. Cannot exceed the
63 maximum value supported by the device. Must allow at
64 least one max sized datagram plus headers.
65
66 The actual limits are device dependent. See
67 dwNtbOutMaxSize.
68
69 What: /sys/class/net/<iface>/cdc_ncm/tx_timer_usecs
70 Date: May 2014
71 KernelVersion: 3.16
72 Contact: Bjørn Mork <bjorn@mork.no>
73 Description:
74 Datagram aggregation timeout in µs. The driver will
75 wait up to 3 times this timeout for more datagrams to
76 aggregate before transmitting an NTB frame.
77
78 Valid range: 5 to 4000000
79
80 Set to 0 to disable aggregation.
81
82 The following read-only attributes all represent fields of the
83 structure defined in section 6.2.1 "GetNtbParameters" of "Universal
84 Serial Bus Communications Class Subclass Specifications for Network
85 Control Model Devices" (CDC NCM), Revision 1.0 (Errata 1), November
86 24, 2010 from USB Implementers Forum, Inc. The descriptions are
87 quoted from table 6-3 of CDC NCM: "NTB Parameter Structure".
88
89 What: /sys/class/net/<iface>/cdc_ncm/bmNtbFormatsSupported
90 Date: May 2014
91 KernelVersion: 3.16
92 Contact: Bjørn Mork <bjorn@mork.no>
93 Description:
94 - Bit 0: 16-bit NTB supported (set to 1)
95 - Bit 1: 32-bit NTB supported
96 - Bits 2 – 15: reserved (reset to zero; must be ignored by host)
97
98 What: /sys/class/net/<iface>/cdc_ncm/dwNtbInMaxSize
99 Date: May 2014
100 KernelVersion: 3.16
101 Contact: Bjørn Mork <bjorn@mork.no>
102 Description:
103 IN NTB Maximum Size in bytes
104
105 What: /sys/class/net/<iface>/cdc_ncm/wNdpInDivisor
106 Date: May 2014
107 KernelVersion: 3.16
108 Contact: Bjørn Mork <bjorn@mork.no>
109 Description:
110 Divisor used for IN NTB Datagram payload alignment
111
112 What: /sys/class/net/<iface>/cdc_ncm/wNdpInPayloadRemainder
113 Date: May 2014
114 KernelVersion: 3.16
115 Contact: Bjørn Mork <bjorn@mork.no>
116 Description:
117 Remainder used to align input datagram payload within
118 the NTB: (Payload Offset) mod (wNdpInDivisor) =
119 wNdpInPayloadRemainder
120
121 What: /sys/class/net/<iface>/cdc_ncm/wNdpInAlignment
122 Date: May 2014
123 KernelVersion: 3.16
124 Contact: Bjørn Mork <bjorn@mork.no>
125 Description:
126 NDP alignment modulus for NTBs on the IN pipe. Shall
127 be a power of 2, and shall be at least 4.
128
129 What: /sys/class/net/<iface>/cdc_ncm/dwNtbOutMaxSize
130 Date: May 2014
131 KernelVersion: 3.16
132 Contact: Bjørn Mork <bjorn@mork.no>
133 Description:
134 OUT NTB Maximum Size
135
136 What: /sys/class/net/<iface>/cdc_ncm/wNdpOutDivisor
137 Date: May 2014
138 KernelVersion: 3.16
139 Contact: Bjørn Mork <bjorn@mork.no>
140 Description:
141 OUT NTB Datagram alignment modulus
142
143 What: /sys/class/net/<iface>/cdc_ncm/wNdpOutPayloadRemainder
144 Date: May 2014
145 KernelVersion: 3.16
146 Contact: Bjørn Mork <bjorn@mork.no>
147 Description:
148 Remainder used to align output datagram payload
149 offsets within the NTB: Padding, shall be transmitted
150 as zero by function, and ignored by host. (Payload
151 Offset) mod (wNdpOutDivisor) = wNdpOutPayloadRemainder
152
153 What: /sys/class/net/<iface>/cdc_ncm/wNdpOutAlignment
154 Date: May 2014
155 KernelVersion: 3.16
156 Contact: Bjørn Mork <bjorn@mork.no>
157 Description:
158 NDP alignment modulus for use in NTBs on the OUT
159 pipe. Shall be a power of 2, and shall be at least 4.
160
161 What: /sys/class/net/<iface>/cdc_ncm/wNtbOutMaxDatagrams
162 Date: May 2014
163 KernelVersion: 3.16
164 Contact: Bjørn Mork <bjorn@mork.no>
165 Description:
166 Maximum number of datagrams that the host may pack
167 into a single OUT NTB. Zero means that the device
168 imposes no limit.
169

3. 한국어 전문 번역

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

Minimum padded TX packet

1-20
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/min_tx_pkt
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
Description이 값보다 긴 NCM Transfer Block(NTB)은 driver가 tx_max까지 padding합니다. 그러면 device가 terminating short packet 없이 tx_max 크기 frame을 받을 수 있습니다. 이 limit보다 짧은 NTB는 padding 없이 그대로 전송하고 short USB packet으로 끝냅니다.

tx_max까지 padding하면 driver가 중간에 short USB packet을 넣지 않고 NTB를 back-to-back으로 전송할 수 있습니다. Device의 short packet interrupt 수를 줄이며 USB bus bandwidth와 device DMA optimization 사이의 tradeoff를 나타냅니다.

0으로 설정하면 모든 frame을 padding합니다. tx_max보다 큰 값으로 설정하면 모든 padding을 disable합니다.

min_tx_pkt padding decision
조건전송 동작
min_tx_pkt = 0모든 frame을 tx_max까지 padding
NTB length >= min_tx_pkttx_max까지 padding, terminating short packet 없음
NTB length < min_tx_pktPadding 없이 전송, short USB packet으로 종료
min_tx_pkt > tx_max모든 padding disable

NTB length와 특수 설정값에 따른 padding 및 termination 동작입니다.

NDP-to-end quirk

22-39
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/ndp_to_end
Date2015년 12월
KernelVersion4.5
ContactBjørn Mork <bjorn@mork.no>
DescriptionNDP to end quirk 상태를 표시하는 boolean 속성입니다. 이미 enable이 필요한 것으로 알려진 device를 제외하면 기본값은 N입니다.

NDP to end quirk는 driver가 packet index table인 NDP를 payload 뒤에 배치하게 합니다. NCM specification은 이를 의무화하지 않지만 일부 device는 더 제한적입니다. Default driver setting으로 동작하지 않는 것으로 의심되는 device를 임시로 test하려면 이 속성에 Y를 씁니다.

이 quirk가 필요한 것으로 확인되면 device entry를 driver에 추가해야 합니다.

ndp_to_end value
NDP 위치용도
NDefault layout일반 device의 기본값
YPayload 뒤의심 device의 temporary testing

Default와 temporary quirk test 동작입니다.

Maximum RX NTB size

41-55
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/rx_max
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionRX의 maximum NTB size입니다. Device가 지원하는 maximum 값을 넘을 수 없고 header를 포함한 maximum-size datagram 하나 이상을 허용해야 합니다.

실제 limit은 device에 따라 다릅니다. dwNtbInMaxSize를 참조하십시오.

일부 device는 이 값의 변경을 조용히 무시할 수 있으며, 그 결과 oversized NTB와 이에 대응하는 framing error가 발생합니다.

Maximum TX NTB size

57-67
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/tx_max
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionTX의 maximum NTB size입니다. Device가 지원하는 maximum 값을 넘을 수 없고 header를 포함한 maximum-size datagram 하나 이상을 허용해야 합니다.

실제 limit은 device에 따라 다릅니다. dwNtbOutMaxSize를 참조하십시오.

Configurable NTB maximum sizes
속성방향Device parameter
rx_maxRXdwNtbInMaxSize
tx_maxTXdwNtbOutMaxSize

RX와 TX limit 및 대응하는 read-only device parameter입니다.

TX datagram aggregation timer

69-87
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/tx_timer_usecs
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionDatagram aggregation timeout을 µs 단위로 지정합니다. Driver는 NTB frame을 전송하기 전에 aggregation할 datagram이 더 들어오기를 이 timeout의 최대 3배까지 기다립니다.

유효 범위는 5부터 4000000입니다. 0으로 설정하면 aggregation을 disable합니다.

뒤따르는 read-only 속성은 모두 USB Implementers Forum, Inc.가 2010년 11월 24일 발행한 Universal Serial Bus Communications Class Subclass Specifications for Network Control Model Devices(CDC NCM), Revision 1.0(Errata 1)의 6.2.1절 GetNtbParameters에 정의된 structure field를 나타냅니다. 설명은 CDC NCM table 6-3 NTB Parameter Structure에서 인용한 것입니다.

tx_timer_usecs aggregation
설정동작
0Aggregation disable
5~4000000 µs설정 timeout의 최대 3배까지 추가 datagram 대기

Aggregation enable과 wait limit을 정리합니다.

Supported NTB formats

89-96
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/bmNtbFormatsSupported
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
Description지원하는 NTB format bitfield입니다. Bit 0은 16-bit NTB 지원이며 1로 설정됩니다. Bit 1은 32-bit NTB 지원입니다. Bit 2~15는 reserved이며 0으로 reset하고 host가 무시해야 합니다.
bmNtbFormatsSupported bits
Bit의미
016-bit NTB 지원, 1로 설정
132-bit NTB 지원
2~15Reserved, 0으로 reset, host가 무시

원문 bullet의 NTB format bit 정의입니다.

IN NTB maximum size

98-103
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/dwNtbInMaxSize
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionIN NTB의 maximum size를 byte 단위로 제공합니다.

IN payload alignment divisor

105-110
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpInDivisor
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionIN NTB datagram payload alignment에 사용하는 divisor입니다.

IN payload alignment remainder

112-119
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpInPayloadRemainder
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionNTB 내부 input datagram payload를 align하는 데 사용하는 remainder입니다.
(Payload Offset) mod (wNdpInDivisor) = wNdpInPayloadRemainder

IN NDP alignment modulus

121-127
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpInAlignment
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionIN pipe의 NTB에 사용하는 NDP alignment modulus입니다. 2의 거듭제곱이어야 하고 4 이상이어야 합니다.
IN NTB parameter fields
Field의미
dwNtbInMaxSizeIN NTB maximum byte size
wNdpInDivisorDatagram payload alignment divisor
wNdpInPayloadRemainderPayload offset remainder
wNdpInAlignmentNDP modulus, power of 2이며 4 이상

GetNtbParameters의 IN 방향 maximum size와 alignment field입니다.

OUT NTB maximum size

129-134
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/dwNtbOutMaxSize
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionOUT NTB maximum size입니다.

OUT datagram alignment modulus

136-141
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpOutDivisor
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionOUT NTB datagram alignment modulus입니다.

OUT payload alignment remainder

143-151
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpOutPayloadRemainder
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionNTB 내부 output datagram payload offset을 align하는 데 사용하는 remainder입니다. Function은 padding을 0으로 전송해야 하며 host는 이를 무시합니다.
(Payload Offset) mod (wNdpOutDivisor) = wNdpOutPayloadRemainder

OUT NDP alignment modulus

153-159
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNdpOutAlignment
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionOUT pipe의 NTB에 사용하는 NDP alignment modulus입니다. 2의 거듭제곱이어야 하고 4 이상이어야 합니다.

Maximum datagrams per OUT NTB

161-168
항목한국어 전문 번역
What/sys/class/net/<iface>/cdc_ncm/wNtbOutMaxDatagrams
Date2014년 5월
KernelVersion3.16
ContactBjørn Mork <bjorn@mork.no>
DescriptionHost가 하나의 OUT NTB에 pack할 수 있는 datagram의 maximum 개수입니다. 0은 device가 limit을 두지 않음을 뜻합니다.
OUT NTB parameter fields
Field의미
dwNtbOutMaxSizeOUT NTB maximum size
wNdpOutDivisorOUT datagram alignment modulus
wNdpOutPayloadRemainderPayload offset remainder, padding은 0
wNdpOutAlignmentNDP modulus, power of 2이며 4 이상
wNtbOutMaxDatagrams단일 OUT NTB의 maximum datagram 수, 0은 no limit

GetNtbParameters의 OUT 방향 maximum size, alignment와 datagram limit입니다.