← Documents Documentation/networking/device_drivers/ethernet/dlink/dl2k.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

D-Link DL2000-based Gigabit Ethernet Adapter Installation

DL2000 기반 DGE-550T/SX의 구형 모듈 빌드·설치, media·VLAN·점보 프레임·인터럽트 병합 옵션과 설정 문제 해결을 설명합니다.

Source pathDocumentation/networking/device_drivers/ethernet/dlink/dl2k.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

dl2k.rst:1-314

이 문서는 Linux 2.4.7과 Red Hat 6·7 시기의 설치 절차를 담고 있습니다. 장치와 옵션 의미는 참고할 수 있지만 `.o` 모듈, `insmod`, `ifconfig`, `ifcfg`와 LKM 디렉터리 경로는 현대 배포판에서 달라졌으므로 현재 커널 문서와 네트워크 관리 도구를 우선해야 합니다.

지원 범위
구분내용
어댑터DGE-550T
어댑터DGE-550SX
칩 계열DL2000 기반
커널2.4.7 이후
시험 배포판Red Hat 6.2·7.0·7.1·7.2

문서가 명시한 어댑터와 시험 환경입니다.

빠른 설치
`make all``insmod dl2k.ko``ifconfig eth0 ...`모듈 복사alias 설정`depmod``ifcfg-eth0`

빌드부터 다음 부팅의 자동 적재까지 이어지는 역사적 절차입니다.

빌드 입력
종류필요 항목
드라이버`dl2k.c`, `dl2k.h`, `Makefile`
도구gcc
커널소스와 헤더
권장 형태적재 가능한 모듈

소스 빌드에 필요한 파일과 시스템 구성 요소입니다.

수동 활성화
`insmod dl2k.o``eth0` 이름 생성`ifconfig eth0 up``ifup eth0`구성 스크립트 적용

모듈 적재만으로는 네트워크 프로토콜 구성이 끝나지 않습니다.

안전한 제거 순서
`ifdown eth0``ifconfig eth0 down``rmmod dl2k.o`

인터페이스와 프로토콜 구성을 내린 뒤 모듈을 제거합니다.

media 값
모드
autosense / 0자동 감지
10mbps_hd / 110M 반이중
10mbps_fd / 210M 전이중
100mbps_hd / 3100M 반이중
100mbps_fd / 4100M 전이중
1000mbps_hd / 51G 반이중, 광만
1000mbps_fd / 61G 전이중, 광만

문자열과 숫자 값이 같은 링크 모드를 가리킵니다.

프레임 기능
옵션기본값의미
`mtu=`1500최대 패킷 크기
`vlan=0`VLAN 비활성0이 아닌 값은 VLAN ID
`jumbo=0`점보 비활성1이면 점보 수신
점보 조건상대도 지원양 끝 호환 필요

MTU, VLAN, 점보 프레임의 기본 동작입니다.

수신 인터럽트 병합
`rx_coalesce=m`프레임 m개또는`rx_timeout=n × 640ns`수신 IRQ 1회

프레임 수와 제한 시간 중 먼저 충족되는 조건이 인터럽트를 발생시킵니다.

병합 예시
항목
프레임 임계값10개
시간 단위640ns
timeout800
총 제한 시간512us
송신 병합 기본값16

원문의 `rx_coalesce=10 rx_timeout=800` 계산입니다.

흐름 제어
옵션0그 밖의 값
`tx_flow`송신 흐름 제어 끔자동 감지
`rx_flow`수신 흐름 제어 켬자동 감지

원문에 기록된 Tx/Rx 옵션 동작을 그대로 구분합니다.

구성 예 주의
원문검토
`POOTPROTO=none`일반적으로 `BOOTPROTO`인지 확인
고정 IPBROADCAST·NETWORK·NETMASK 일관성
`DEVICE=eth0`현대 예측 가능 인터페이스 이름 확인

원문 예제의 오타와 적용 전 확인 항목입니다.

줄 끝 복구
`dl2k.c`의 `^M``tr -d "\r"` 또는 `col -b``dl2k.tmp``mv`로 교체

Windows CR 문자를 제거한 뒤 원본 파일을 교체합니다.

헤더 선택
경로판단
/usr/src/linux/include커널 소스의 기본 헤더
/usr/include배포판 사본, 버전 확인 필요
Red Hat 7.0 /usr/include잘못된 헤더로 명시됨
INCLUDEDIR실제 헤더 위치에 맞게 설정

커널과 맞지 않는 헤더를 사용하면 잘못된 모듈이 만들어집니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =========================================================
4 D-Link DL2000-based Gigabit Ethernet Adapter Installation
5 =========================================================
6
7 May 23, 2002
8
9 .. Contents
10
11 - Compatibility List
12 - Quick Install
13 - Compiling the Driver
14 - Installing the Driver
15 - Option parameter
16 - Configuration Script Sample
17 - Troubleshooting
18
19
20 Compatibility List
21 ==================
22
23 Adapter Support:
24
25 - D-Link DGE-550T Gigabit Ethernet Adapter.
26 - D-Link DGE-550SX Gigabit Ethernet Adapter.
27 - D-Link DL2000-based Gigabit Ethernet Adapter.
28
29
30 The driver support Linux kernel 2.4.7 later. We had tested it
31 on the environments below.
32
33 . Red Hat v6.2 (update kernel to 2.4.7)
34 . Red Hat v7.0 (update kernel to 2.4.7)
35 . Red Hat v7.1 (kernel 2.4.7)
36 . Red Hat v7.2 (kernel 2.4.7-10)
37
38
39 Quick Install
40 =============
41 Install linux driver as following command::
42
43 1. make all
44 2. insmod dl2k.ko
45 3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
46 ^^^^^^^^^^^^^^^\ ^^^^^^^^\
47 IP NETMASK
48
49 Now eth0 should active, you can test it by "ping" or get more information by
50 "ifconfig". If tested ok, continue the next step.
51
52 4. ``cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net``
53 5. Add the following line to /etc/modprobe.d/dl2k.conf::
54
55 alias eth0 dl2k
56
57 6. Run ``depmod`` to updated module indexes.
58 7. Run ``netconfig`` or ``netconf`` to create configuration script ifcfg-eth0
59 located at /etc/sysconfig/network-scripts or create it manually.
60
61 [see - Configuration Script Sample]
62 8. Driver will automatically load and configure at next boot time.
63
64 Compiling the Driver
65 ====================
66 In Linux, NIC drivers are most commonly configured as loadable modules.
67 The approach of building a monolithic kernel has become obsolete. The driver
68 can be compiled as part of a monolithic kernel, but is strongly discouraged.
69 The remainder of this section assumes the driver is built as a loadable module.
70 In the Linux environment, it is a good idea to rebuild the driver from the
71 source instead of relying on a precompiled version. This approach provides
72 better reliability since a precompiled driver might depend on libraries or
73 kernel features that are not present in a given Linux installation.
74
75 The 3 files necessary to build Linux device driver are dl2k.c, dl2k.h and
76 Makefile. To compile, the Linux installation must include the gcc compiler,
77 the kernel source, and the kernel headers. The Linux driver supports Linux
78 Kernels 2.4.7. Copy the files to a directory and enter the following command
79 to compile and link the driver:
80
81 CD-ROM drive
82 ------------
83
84 ::
85
86 [root@XXX /] mkdir cdrom
87 [root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
88 [root@XXX /] cd root
89 [root@XXX /root] mkdir dl2k
90 [root@XXX /root] cd dl2k
91 [root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
92 [root@XXX dl2k] tar xfvz dl2k.tgz
93 [root@XXX dl2k] make all
94
95 Floppy disc drive
96 -----------------
97
98 ::
99
100 [root@XXX /] cd root
101 [root@XXX /root] mkdir dl2k
102 [root@XXX /root] cd dl2k
103 [root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
104 [root@XXX dl2k] tar xfvz dl2k.tgz
105 [root@XXX dl2k] make all
106
107 Installing the Driver
108 =====================
109
110 Manual Installation
111 -------------------
112
113 Once the driver has been compiled, it must be loaded, enabled, and bound
114 to a protocol stack in order to establish network connectivity. To load a
115 module enter the command::
116
117 insmod dl2k.o
118
119 or::
120
121 insmod dl2k.o <optional parameter> ; add parameter
122
123 ---------------------------------------------------------
124
125 example::
126
127 insmod dl2k.o media=100mbps_hd
128
129 or::
130
131 insmod dl2k.o media=3
132
133 or::
134
135 insmod dl2k.o media=3,2 ; for 2 cards
136
137 ---------------------------------------------------------
138
139 Please reference the list of the command line parameters supported by
140 the Linux device driver below.
141
142 The insmod command only loads the driver and gives it a name of the form
143 eth0, eth1, etc. To bring the NIC into an operational state,
144 it is necessary to issue the following command::
145
146 ifconfig eth0 up
147
148 Finally, to bind the driver to the active protocol (e.g., TCP/IP with
149 Linux), enter the following command::
150
151 ifup eth0
152
153 Note that this is meaningful only if the system can find a configuration
154 script that contains the necessary network information. A sample will be
155 given in the next paragraph.
156
157 The commands to unload a driver are as follows::
158
159 ifdown eth0
160 ifconfig eth0 down
161 rmmod dl2k.o
162
163 The following are the commands to list the currently loaded modules and
164 to see the current network configuration::
165
166 lsmod
167 ifconfig
168
169
170 Automated Installation
171 ----------------------
172 This section describes how to install the driver such that it is
173 automatically loaded and configured at boot time. The following description
174 is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to
175 other distributions as well.
176
177 Red Hat v6.x/v7.x
178 -----------------
179 1. Copy dl2k.o to the network modules directory, typically
180 /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
181 2. Locate the boot module configuration file, most commonly in the
182 /etc/modprobe.d/ directory. Add the following lines::
183
184 alias ethx dl2k
185 options dl2k <optional parameters>
186
187 where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
188 one other ethernet adapter is installed, etc. Refer to the table in the
189 previous section for the list of optional parameters.
190 3. Locate the network configuration scripts, normally the
191 /etc/sysconfig/network-scripts directory, and create a configuration
192 script named ifcfg-ethx that contains network information.
193 4. Note that for most Linux distributions, Red Hat included, a configuration
194 utility with a graphical user interface is provided to perform steps 2
195 and 3 above.
196
197
198 Parameter Description
199 =====================
200 You can install this driver without any additional parameter. However, if you
201 are going to have extensive functions then it is necessary to set extra
202 parameter. Below is a list of the command line parameters supported by the
203 Linux device
204 driver.
205
206
207 =============================== ==============================================
208 mtu=packet_size Specifies the maximum packet size. default
209 is 1500.
210
211 media=media_type Specifies the media type the NIC operates at.
212 autosense Autosensing active media.
213
214 =========== =========================
215 10mbps_hd 10Mbps half duplex.
216 10mbps_fd 10Mbps full duplex.
217 100mbps_hd 100Mbps half duplex.
218 100mbps_fd 100Mbps full duplex.
219 1000mbps_fd 1000Mbps full duplex.
220 1000mbps_hd 1000Mbps half duplex.
221 0 Autosensing active media.
222 1 10Mbps half duplex.
223 2 10Mbps full duplex.
224 3 100Mbps half duplex.
225 4 100Mbps full duplex.
226 5 1000Mbps half duplex.
227 6 1000Mbps full duplex.
228 =========== =========================
229
230 By default, the NIC operates at autosense.
231 1000mbps_fd and 1000mbps_hd types are only
232 available for fiber adapter.
233
234 vlan=n Specifies the VLAN ID. If vlan=0, the
235 Virtual Local Area Network (VLAN) function is
236 disable.
237
238 jumbo=[0|1] Specifies the jumbo frame support. If jumbo=1,
239 the NIC accept jumbo frames. By default, this
240 function is disabled.
241 Jumbo frame usually improve the performance
242 int gigabit.
243 This feature need jumbo frame compatible
244 remote.
245
246 rx_coalesce=m Number of rx frame handled each interrupt.
247 rx_timeout=n Rx DMA wait time for an interrupt.
248 If set rx_coalesce > 0, hardware only assert
249 an interrupt for m frames. Hardware won't
250 assert rx interrupt until m frames received or
251 reach timeout of n * 640 nano seconds.
252 Set proper rx_coalesce and rx_timeout can
253 reduce congestion collapse and overload which
254 has been a bottleneck for high speed network.
255
256 For example, rx_coalesce=10 rx_timeout=800.
257 that is, hardware assert only 1 interrupt
258 for 10 frames received or timeout of 512 us.
259
260 tx_coalesce=n Number of tx frame handled each interrupt.
261 Set n > 1 can reduce the interrupts
262 congestion usually lower performance of
263 high speed network card. Default is 16.
264
265 tx_flow=[1|0] Specifies the Tx flow control. If tx_flow=0,
266 the Tx flow control disable else driver
267 autodetect.
268 rx_flow=[1|0] Specifies the Rx flow control. If rx_flow=0,
269 the Rx flow control enable else driver
270 autodetect.
271 =============================== ==============================================
272
273
274 Configuration Script Sample
275 ===========================
276 Here is a sample of a simple configuration script::
277
278 DEVICE=eth0
279 USERCTL=no
280 ONBOOT=yes
281 POOTPROTO=none
282 BROADCAST=207.200.5.255
283 NETWORK=207.200.5.0
284 NETMASK=255.255.255.0
285 IPADDR=207.200.5.2
286
287
288 Troubleshooting
289 ===============
290 Q1. Source files contain ^ M behind every line.
291
292 Make sure all files are Unix file format (no LF). Try the following
293 shell command to convert files::
294
295 cat dl2k.c | col -b > dl2k.tmp
296 mv dl2k.tmp dl2k.c
297
298 OR::
299
300 cat dl2k.c | tr -d "\r" > dl2k.tmp
301 mv dl2k.tmp dl2k.c
302
303 Q2: Could not find header files (``*.h``)?
304
305 To compile the driver, you need kernel header files. After
306 installing the kernel source, the header files are usually located in
307 /usr/src/linux/include, which is the default include directory configured
308 in Makefile. For some distributions, there is a copy of header files in
309 /usr/src/include/linux and /usr/src/include/asm, that you can change the
310 INCLUDEDIR in Makefile to /usr/include without installing kernel source.
311
312 Note that RH 7.0 didn't provide correct header files in /usr/include,
313 including those files will make a wrong version driver.
314
315

3. 한국어 전문 번역

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

문서 개요와 호환성

1-38

D-Link DL2000 기반 기가비트 이더넷 어댑터 설치

2002년 5월 23일

목차

  • 호환성 목록
  • 빠른 설치
  • 드라이버 컴파일
  • 드라이버 설치
  • 옵션 매개변수
  • 구성 스크립트 예
  • 문제 해결

호환성 목록

지원 어댑터

  • D-Link DGE-550T Gigabit Ethernet Adapter
  • D-Link DGE-550SX Gigabit Ethernet Adapter
  • D-Link DL2000 기반 Gigabit Ethernet Adapter

드라이버는 Linux 커널 2.4.7 이후 버전을 지원합니다. 당시 다음 환경에서 시험했습니다.

  • Red Hat 6.2, 커널을 2.4.7로 갱신
  • Red Hat 7.0, 커널을 2.4.7로 갱신
  • Red Hat 7.1, 커널 2.4.7
  • Red Hat 7.2, 커널 2.4.7-10
.. SPDX-License-Identifier: GPL-2.0

=========================================================
D-Link DL2000-based Gigabit Ethernet Adapter Installation
=========================================================

May 23, 2002

.. Contents

 - Compatibility List
 - Quick Install
 - Compiling the Driver
 - Installing the Driver
 - Option parameter
 - Configuration Script Sample
 - Troubleshooting


Compatibility List
==================

Adapter Support:

- D-Link DGE-550T Gigabit Ethernet Adapter.
- D-Link DGE-550SX Gigabit Ethernet Adapter.
- D-Link DL2000-based Gigabit Ethernet Adapter.


The driver support Linux kernel 2.4.7 later. We had tested it
on the environments below.

 . Red Hat v6.2 (update kernel to 2.4.7)
 . Red Hat v7.0 (update kernel to 2.4.7)
 . Red Hat v7.1 (kernel 2.4.7)
 . Red Hat v7.2 (kernel 2.4.7-10)

빠른 설치와 드라이버 빌드

39-106

빠른 설치

다음 명령 순서로 Linux 드라이버를 설치합니다.

1. make all
2. insmod dl2k.ko
3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
                     ^^^^^^^^^^^^^^         ^^^^^^^^^
                          IP                 NETMASK

이제 `eth0`가 활성 상태여야 합니다. `ping`으로 시험하거나 `ifconfig`로 자세한 정보를 확인합니다. 시험이 성공하면 다음 단계로 진행합니다.

4. 모듈을 현재 커널의 네트워크 드라이버 디렉터리에 복사합니다.

cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net

5. `/etc/modprobe.d/dl2k.conf`에 다음 줄을 추가합니다.

alias eth0 dl2k

6. `depmod`를 실행해 모듈 인덱스를 갱신합니다.

7. `netconfig` 또는 `netconf`를 실행해 `/etc/sysconfig/network-scripts`에 `ifcfg-eth0` 구성 스크립트를 만들거나 직접 작성합니다. 구성 스크립트 예 절을 참조하십시오.

8. 다음 부팅부터 드라이버가 자동으로 적재되고 구성됩니다.

드라이버 컴파일

Linux에서는 NIC 드라이버를 적재 가능한 모듈로 구성하는 것이 일반적입니다. 단일 커널로 빌드하는 방식은 오래되었으며 이 드라이버를 커널 일부로 컴파일할 수도 있지만 강하게 권장하지 않습니다. 이 절의 나머지 내용은 적재 가능한 모듈로 빌드한다고 가정합니다.

Linux 환경에서는 사전 컴파일 버전에 의존하기보다 소스에서 드라이버를 다시 빌드하는 것이 좋습니다. 사전 컴파일 드라이버는 설치된 Linux에 없는 라이브러리나 커널 기능에 의존할 수 있으므로 소스 빌드가 더 안정적입니다.

Linux 장치 드라이버를 빌드하는 데 필요한 파일은 `dl2k.c`, `dl2k.h`, `Makefile`입니다. gcc 컴파일러, 커널 소스와 커널 헤더가 설치되어 있어야 합니다. 이 문서의 드라이버는 Linux 커널 2.4.7을 지원합니다. 파일을 한 디렉터리에 복사하고 다음 명령으로 컴파일하고 링크합니다.

CD-ROM 드라이브에서 빌드

[root@XXX /] mkdir cdrom
[root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
[root@XXX /] cd root
[root@XXX /root] mkdir dl2k
[root@XXX /root] cd dl2k
[root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz
[root@XXX dl2k] make all

플로피 디스크 드라이브에서 빌드

[root@XXX /] cd root
[root@XXX /root] mkdir dl2k
[root@XXX /root] cd dl2k
[root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz
[root@XXX dl2k] make all
Quick Install
=============
Install linux driver as following command::

    1. make all
    2. insmod dl2k.ko
    3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
                        ^^^^^^^^^^^^^^^\            ^^^^^^^^\
                                        IP                     NETMASK

Now eth0 should active, you can test it by "ping" or get more information by
"ifconfig". If tested ok, continue the next step.

4. ``cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net``
5. Add the following line to /etc/modprobe.d/dl2k.conf::

        alias eth0 dl2k

6. Run ``depmod`` to updated module indexes.
7. Run ``netconfig`` or ``netconf`` to create configuration script ifcfg-eth0
   located at /etc/sysconfig/network-scripts or create it manually.

   [see - Configuration Script Sample]
8. Driver will automatically load and configure at next boot time.

Compiling the Driver
====================
In Linux, NIC drivers are most commonly configured as loadable modules.
The approach of building a monolithic kernel has become obsolete. The driver
can be compiled as part of a monolithic kernel, but is strongly discouraged.
The remainder of this section assumes the driver is built as a loadable module.
In the Linux environment, it is a good idea to rebuild the driver from the
source instead of relying on a precompiled version. This approach provides
better reliability since a precompiled driver might depend on libraries or
kernel features that are not present in a given Linux installation.

The 3 files necessary to build Linux device driver are dl2k.c, dl2k.h and
Makefile. To compile, the Linux installation must include the gcc compiler,
the kernel source, and the kernel headers. The Linux driver supports Linux
Kernels 2.4.7. Copy the files to a directory and enter the following command
to compile and link the driver:

CD-ROM drive
------------

::

    [root@XXX /] mkdir cdrom
    [root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
    [root@XXX /] cd root
    [root@XXX /root] mkdir dl2k
    [root@XXX /root] cd dl2k
    [root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
    [root@XXX dl2k] tar xfvz dl2k.tgz
    [root@XXX dl2k] make all

Floppy disc drive
-----------------

::

    [root@XXX /] cd root
    [root@XXX /root] mkdir dl2k
    [root@XXX /root] cd dl2k
    [root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
    [root@XXX dl2k] tar xfvz dl2k.tgz
    [root@XXX dl2k] make all

수동 설치와 부팅 시 자동 설치

107-197

드라이버 설치

수동 설치

드라이버를 컴파일한 뒤 네트워크 연결을 구성하려면 드라이버를 적재하고 활성화한 다음 프로토콜 스택에 연결해야 합니다. 모듈을 적재하려면 다음 명령을 입력합니다.

insmod dl2k.o

선택적 매개변수를 함께 전달할 수도 있습니다.

insmod dl2k.o <optional parameter>

insmod dl2k.o media=100mbps_hd
insmod dl2k.o media=3
insmod dl2k.o media=3,2    # 카드 2개

Linux 장치 드라이버가 지원하는 명령줄 매개변수 목록은 뒤의 매개변수 설명 절을 참조하십시오.

`insmod`는 드라이버를 적재하고 `eth0`, `eth1` 같은 이름만 부여합니다. NIC를 동작 상태로 만들려면 다음 명령이 필요합니다.

ifconfig eth0 up

마지막으로 드라이버를 활성 프로토콜, 예를 들어 Linux의 TCP/IP에 연결하려면 다음 명령을 사용합니다.

ifup eth0

이 명령은 시스템이 필요한 네트워크 정보가 들어 있는 구성 스크립트를 찾을 수 있을 때만 의미가 있습니다. 다음 절에 예가 있습니다.

드라이버를 내리는 명령

ifdown eth0
ifconfig eth0 down
rmmod dl2k.o

현재 적재된 모듈과 네트워크 구성을 확인하는 명령

lsmod
ifconfig

자동 설치

이 절은 부팅할 때 드라이버가 자동으로 적재되고 구성되도록 설치하는 방법을 설명합니다. Red Hat 6.0/7.0을 기준으로 하지만 다른 배포판에도 쉽게 옮길 수 있습니다.

Red Hat 6.x/7.x

  • 1. `dl2k.o`를 일반적으로 `/lib/modules/2.x.x-xx/net` 또는 `/lib/modules/2.x.x/kernel/drivers/net`인 네트워크 모듈 디렉터리에 복사합니다.
  • 2. 보통 `/etc/modprobe.d/`에 있는 부팅 모듈 구성 파일을 찾아 alias와 options 줄을 추가합니다.
alias ethx dl2k
options dl2k <optional parameters>

`ethx`는 이 NIC가 유일한 이더넷 어댑터이면 `eth0`, 다른 이더넷 어댑터가 하나 설치되어 있으면 `eth1`이 되는 식입니다. 선택적 매개변수는 앞 절의 표를 참조하십시오.

  • 3. 일반적으로 `/etc/sysconfig/network-scripts`인 네트워크 구성 스크립트 디렉터리를 찾아 네트워크 정보가 들어 있는 `ifcfg-ethx`를 만듭니다.
  • 4. Red Hat을 포함한 대부분의 Linux 배포판은 2단계와 3단계를 수행하는 GUI 구성 도구를 제공합니다.
Installing the Driver
=====================

Manual Installation
-------------------

  Once the driver has been compiled, it must be loaded, enabled, and bound
  to a protocol stack in order to establish network connectivity. To load a
  module enter the command::

    insmod dl2k.o

  or::

    insmod dl2k.o <optional parameter>        ; add parameter

---------------------------------------------------------

  example::

    insmod dl2k.o media=100mbps_hd

   or::

    insmod dl2k.o media=3

   or::

    insmod dl2k.o media=3,2        ; for 2 cards

---------------------------------------------------------

  Please reference the list of the command line parameters supported by
  the Linux device driver below.

  The insmod command only loads the driver and gives it a name of the form
  eth0, eth1, etc. To bring the NIC into an operational state,
  it is necessary to issue the following command::

    ifconfig eth0 up

  Finally, to bind the driver to the active protocol (e.g., TCP/IP with
  Linux), enter the following command::

    ifup eth0

  Note that this is meaningful only if the system can find a configuration
  script that contains the necessary network information. A sample will be
  given in the next paragraph.

  The commands to unload a driver are as follows::

    ifdown eth0
    ifconfig eth0 down
    rmmod dl2k.o

  The following are the commands to list the currently loaded modules and
  to see the current network configuration::

    lsmod
    ifconfig


Automated Installation
----------------------
  This section describes how to install the driver such that it is
  automatically loaded and configured at boot time. The following description
  is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to
  other distributions as well.

Red Hat v6.x/v7.x
-----------------
  1. Copy dl2k.o to the network modules directory, typically
     /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
  2. Locate the boot module configuration file, most commonly in the
     /etc/modprobe.d/ directory. Add the following lines::

        alias ethx dl2k
        options dl2k <optional parameters>

     where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
     one other ethernet adapter is installed, etc. Refer to the table in the
     previous section for the list of optional parameters.
  3. Locate the network configuration scripts, normally the
     /etc/sysconfig/network-scripts directory, and create a configuration
     script named ifcfg-ethx that contains network information.
  4. Note that for most Linux distributions, Red Hat included, a configuration
     utility with a graphical user interface is provided to perform steps 2
     and 3 above.

드라이버 옵션 매개변수

198-273

매개변수 설명

추가 매개변수 없이도 드라이버를 설치할 수 있습니다. 확장 기능을 사용하려면 추가 매개변수를 설정해야 합니다. Linux 장치 드라이버가 지원하는 명령줄 매개변수는 다음과 같습니다.

`mtu=packet_size`

최대 패킷 크기를 지정합니다. 기본값은 1500입니다.

`media=media_type`

NIC가 동작할 매체 유형을 지정합니다. `autosense`는 활성 매체를 자동 감지합니다.

문자열 또는 값링크 모드
10mbps_hd / 110Mbps 반이중
10mbps_fd / 210Mbps 전이중
100mbps_hd / 3100Mbps 반이중
100mbps_fd / 4100Mbps 전이중
1000mbps_hd / 51000Mbps 반이중
1000mbps_fd / 61000Mbps 전이중
autosense / 0활성 매체 자동 감지

기본적으로 NIC는 자동 감지로 동작합니다. `1000mbps_fd`와 `1000mbps_hd`는 광 어댑터에서만 사용할 수 있습니다.

`vlan=n`

VLAN ID를 지정합니다. `vlan=0`이면 Virtual Local Area Network 기능을 끕니다.

`jumbo=0` 또는 `jumbo=1`

점보 프레임 지원을 지정합니다. `jumbo=1`이면 NIC가 점보 프레임을 받습니다. 기본값은 비활성화입니다. 점보 프레임은 일반적으로 기가비트 환경의 성능을 개선하지만 통신 상대도 점보 프레임과 호환되어야 합니다.

`rx_coalesce=m`

인터럽트 한 번에 처리할 수신 프레임 수입니다.

`rx_timeout=n`

수신 인터럽트를 기다리는 DMA 시간입니다. `rx_coalesce > 0`이면 하드웨어는 프레임 `m`개를 받을 때만 인터럽트를 발생시키며, `m`개를 받거나 `n × 640ns` 제한 시간에 도달할 때까지 수신 인터럽트를 발생시키지 않습니다. 적절한 `rx_coalesce`와 `rx_timeout`은 고속 네트워크 병목인 혼잡 붕괴와 과부하를 줄일 수 있습니다.

예를 들어 `rx_coalesce=10 rx_timeout=800`은 프레임 10개를 받거나 512us 제한 시간에 도달할 때 인터럽트 하나만 발생시킵니다.

`tx_coalesce=n`

인터럽트 한 번에 처리할 송신 프레임 수입니다. `n > 1`로 설정하면 고속 네트워크 카드의 성능을 낮추는 인터럽트 혼잡을 줄일 수 있습니다. 기본값은 16입니다.

`tx_flow=1` 또는 `tx_flow=0`

송신 흐름 제어를 지정합니다. `tx_flow=0`이면 송신 흐름 제어를 끄고, 그렇지 않으면 드라이버가 자동 감지합니다.

`rx_flow=1` 또는 `rx_flow=0`

수신 흐름 제어를 지정합니다. 원문에는 `rx_flow=0`이면 수신 흐름 제어를 활성화하고, 그렇지 않으면 드라이버가 자동 감지한다고 기록되어 있습니다.

Parameter Description
=====================
You can install this driver without any additional parameter. However, if you
are going to have extensive functions then it is necessary to set extra
parameter. Below is a list of the command line parameters supported by the
Linux device
driver.


===============================   ==============================================
mtu=packet_size                          Specifies the maximum packet size. default
                                  is 1500.

media=media_type                  Specifies the media type the NIC operates at.
                                  autosense        Autosensing active media.

                                  ===========        =========================
                                  10mbps_hd        10Mbps half duplex.
                                  10mbps_fd        10Mbps full duplex.
                                  100mbps_hd        100Mbps half duplex.
                                  100mbps_fd        100Mbps full duplex.
                                  1000mbps_fd        1000Mbps full duplex.
                                  1000mbps_hd        1000Mbps half duplex.
                                  0                Autosensing active media.
                                  1                10Mbps half duplex.
                                  2                10Mbps full duplex.
                                  3                100Mbps half duplex.
                                  4                100Mbps full duplex.
                                  5                  1000Mbps half duplex.
                                  6                  1000Mbps full duplex.
                                  ===========        =========================

                                  By default, the NIC operates at autosense.
                                  1000mbps_fd and 1000mbps_hd types are only
                                  available for fiber adapter.

vlan=n                                  Specifies the VLAN ID. If vlan=0, the
                                  Virtual Local Area Network (VLAN) function is
                                  disable.

jumbo=[0|1]                          Specifies the jumbo frame support. If jumbo=1,
                                  the NIC accept jumbo frames. By default, this
                                  function is disabled.
                                  Jumbo frame usually improve the performance
                                  int gigabit.
                                  This feature need jumbo frame compatible
                                  remote.

rx_coalesce=m                          Number of rx frame handled each interrupt.
rx_timeout=n                          Rx DMA wait time for an interrupt.
                                  If set rx_coalesce > 0, hardware only assert
                                  an interrupt for m frames. Hardware won't
                                  assert rx interrupt until m frames received or
                                  reach timeout of n * 640 nano seconds.
                                  Set proper rx_coalesce and rx_timeout can
                                  reduce congestion collapse and overload which
                                  has been a bottleneck for high speed network.

                                  For example, rx_coalesce=10 rx_timeout=800.
                                  that is, hardware assert only 1 interrupt
                                  for 10 frames received or timeout of 512 us.

tx_coalesce=n                          Number of tx frame handled each interrupt.
                                  Set n > 1 can reduce the interrupts
                                  congestion usually lower performance of
                                  high speed network card. Default is 16.

tx_flow=[1|0]                          Specifies the Tx flow control. If tx_flow=0,
                                  the Tx flow control disable else driver
                                  autodetect.
rx_flow=[1|0]                          Specifies the Rx flow control. If rx_flow=0,
                                  the Rx flow control enable else driver
                                  autodetect.
===============================   ==============================================

네트워크 구성 스크립트 예

274-287

구성 스크립트 예

다음은 간단한 구성 스크립트 예입니다.

DEVICE=eth0
USERCTL=no
ONBOOT=yes
POOTPROTO=none
BROADCAST=207.200.5.255
NETWORK=207.200.5.0
NETMASK=255.255.255.0
IPADDR=207.200.5.2

원문에는 일반적인 `BOOTPROTO`가 아니라 `POOTPROTO`로 적혀 있습니다. 원문 보존을 위해 그대로 표시했으며 실제 구성에서는 사용 중인 배포판의 변수 이름을 확인해야 합니다.

Configuration Script Sample
===========================
Here is a sample of a simple configuration script::

    DEVICE=eth0
    USERCTL=no
    ONBOOT=yes
    POOTPROTO=none
    BROADCAST=207.200.5.255
    NETWORK=207.200.5.0
    NETMASK=255.255.255.0
    IPADDR=207.200.5.2

줄 끝 문자와 커널 헤더 문제 해결

288-314

문제 해결

Q1. 소스 파일의 모든 줄 뒤에 `^M`이 있습니다.

모든 파일이 Unix 줄 끝 형식인지 확인합니다. 원문은 괄호 안에 `no LF`라고 적었지만, 제시한 명령은 CR 문자 `\r`를 제거합니다. 다음 셸 명령 중 하나로 파일을 변환합니다.

cat dl2k.c | col -b > dl2k.tmp
mv dl2k.tmp dl2k.c

또는

cat dl2k.c | tr -d "\r" > dl2k.tmp
mv dl2k.tmp dl2k.c

Q2. 헤더 파일(`*.h`)을 찾을 수 없습니다.

드라이버를 컴파일하려면 커널 헤더 파일이 필요합니다. 커널 소스를 설치하면 일반적으로 헤더는 `Makefile`의 기본 include 디렉터리인 `/usr/src/linux/include`에 있습니다.

일부 배포판은 `/usr/src/include/linux`와 `/usr/src/include/asm`에도 헤더 사본을 둡니다. 이 경우 커널 소스를 설치하지 않고 `Makefile`의 `INCLUDEDIR`을 `/usr/include`로 바꿀 수 있습니다.

Red Hat 7.0은 `/usr/include`에 올바른 헤더를 제공하지 않았습니다. 그 파일을 포함하면 잘못된 버전의 드라이버가 만들어집니다.

Troubleshooting
===============
Q1. Source files contain ^ M behind every line.

    Make sure all files are Unix file format (no LF). Try the following
    shell command to convert files::

        cat dl2k.c | col -b > dl2k.tmp
        mv dl2k.tmp dl2k.c

    OR::

        cat dl2k.c | tr -d "\r" > dl2k.tmp
        mv dl2k.tmp dl2k.c

Q2: Could not find header files (``*.h``)?

    To compile the driver, you need kernel header files. After
    installing the kernel source, the header files are usually located in
    /usr/src/linux/include, which is the default include directory configured
    in Makefile. For some distributions, there is a copy of header files in
    /usr/src/include/linux and /usr/src/include/asm, that you can change the
    INCLUDEDIR in Makefile to /usr/include without installing kernel source.

    Note that RH 7.0 didn't provide correct header files in /usr/include,
    including those files will make a wrong version driver.