Linux network card driver analysis (NE2000 as an example)

xiaoxiao2021-03-06  27

1

Linux network card driver program: tracking and efficacy analysis

Subject area: network software

Chen Yizhen Lin Yingda

Department of Information Science, National Jiaotong University

No. 1001, Xinzhu City University Road

Tel: (03) 5712121 EXT. 56667

E-mail: ww@cis.nctu.edu.tw, ydlin@cis.nctu.edu.tw

Main contact: Chen Yizhen Tel: 0927308032

Summary

A network component of a computer can be divided into two parts: hardware and software, and there are online cards, network lines, etc. in the hardware.

Road triver, protocol driver, and application software, where the network card drive

The moving process is responsible for connecting hardware and software, this understanding said the device driver operation process, finds the focus of writing device drivers

Essentials,

The Linux network card driver is an example, and it is some test and analysis to it. After analysis, it is found that it is not considered

Under the conditions of the PROPAGATION TIME, the sequence of the package processing is: (1) network card transmission

(transmit), accept (2) DMA (direct access memory) packet, (3) network card driver (CPU execution)

Time), the time proportion of the three is approximately 250: 30: 1, which is the result of the package size 1028byte, package

The better the proportion of the three will be more disadvantage, and it can be seen that send (or receiving) and the DMA package is time bottleneck; in addition to this, it is also understood

The situation of "new packages" when interrupting is more than a "packet delivery".

Keywords:

Linux, Agreement Driver, Network Card Driver, ISR, IRQ, I / O PORT, DMA.

1 Introduction

2

One of the main functions of the operating system is to control the input and output of the computer peripheral device. And the software used to control is mainly divided

For four parts, please refer to Figure 1. We can see that Driver is in a phase in today's computer workplays.

When it is important to "eat soft", it is necessary to "eat hard". Usually interrupt processing can be considered as a driver

Minute.

Compared to the Internet card driver, "soft" it has to eat is the upper level of agreement driver.

Protocol Driver, also TCP / IP Protocol Stack; "hard" it has to eat is the next online card,

Speaking in more detail, it is to communicate with the Mac Controller on the Internet card, and transversible on the Mac Controller

To exchange the message to achieve one of the main tasks of the online card driver: send the package to the network card or capture from the network card

The package that has arrived; and the other main work is to pass the package from the online card to the upper level of the agreement driver.

Alternatively, the packet received from the protocol driver is passed to the network card, please refer to Figure II.

User trip

DEVICE-Independent Software

Driver

Interrupt processing

Hardware

I / O Call, Spooling

Naming, protection, allocation

Setup Device Registers, Check Status

Wakeup Driver When I / O Completed

Perform I / O Operations

I / O request I / O reply

Figure 1: The layering in the I / O system and the main functions of each layer

I / O

Core network card driver program network card

Outbound package

Entering package

Outbound package

Entering package

Figure 2: Main work of online card drivers

3

2. Write a driver

How to be correct

Write a driver in the Linux operating system. The following we will divide the hardware (Probe)

Hardware), interrupt handling, read and write information using I / O (Using I / O Ports)

Most of them comment.

2.1 Probes Hardware

Some of the initialization work that must be done before a driver can communicate with the device, including: I / O of the detection device

Ports and IRQ Number. With I / O Ports can communicate with certain transisters (register) on the device, IRQNumber can register the interrupt processing in the core. Detecting the hardware method and Types of bus rows (bus)

Related to the device of the PCI interface is to automatically exist of the I / O Ports and Irq Number used when boot (boot).

On some speculation, the driver is only necessary to read these temporary depositors, and do not need a real deinterletter.

But the device driver of the ISA interface must actually do the work of detection.

In terms of the PCI interface,

Linux core version 2.4 further integrates I / O Ports and IRQ Number in system capital

In the source (PCI_DEV STRUCTURE), there is no need to directly obtain I / O Ports directly from a temporary device on the device.

And IRQ Number, and just get the system resource:

INT PCI_ENABLE_DEVICE (Struct PCI_Dev * DEV);

Unsigned long pci_resource_start (Struct PCI_Dev * dev, int bar);

Struct Resource * Request_Region (unsigned long position, unsigned long list, char *

Name);

Void Release_Region (unsigned long start, unsigned long list);

To get I / O Ports and IRQ Number, be sure to call PCI_Nable_Device () to start

This PCI device, if you want to IRQ Number, you can get from Dev-> IRQ, if you want

I / O Ports Call PCI_Resource_Start () to get the base address (Base Address), then call

Request_region () declared to the system to use the I / O Ports of a certain paragraph, and finally

Remember to call Release_REGION () to release this I / O Ports.

As for the device of the ISA interface, there are many troubles, and the mechanism used in the detection I / O Ports is going.

"Scan" All possible I / O Ports, only the I / O Ports connected to the device will have the correct response,

4

The following is a probably process:

1. INT Check_region (unsigned long start, unsigned long list);

This file is used to check if this paragraph I / O Ports can be used.

2. Reactively detect hardware, check if this device exists, you must try to "write" action because you are not careful

The write will make the system a lot of problems.

3. Call Request_Region () to request the I / O Ports you want to use to the core.

4. When you do not use a paragraph I / O Ports, call release_region () to release system resources.

The mechanism used in the detection of IRQ Number is to make the device generate an interrupt (INTERRUPT),

Go to see some related information to know how much IRQ used by the device, here you should pay attention to: drive

The program is to know how much IRQ used by the device, rather than assigning IRQ to the device, the following is

The functions that can be used:

Unsigned long probe_irq_on (void);

INT Probe_irq_off (unsigned long);

ProBe_irq_on () will return a bitmask, this mask can be used to determine what is in

It has not been used yet, and the driver must store this mask, because you must make this mask as a ginseng.

The number is passed to ProBe_irq_off (). After the proBe_irq_on () is executed, the driver should prompt the device.

Generate an interrupt, then call probe_irq_off (bitmask), this is previously prope_irq_off ()

The IRQ Number used in this device will be returned.

2.2 Interrupt Treatment (Interrupt Handling)

When the data is transmitted during the core and the device, there will be some delay, so the drive program must be

Term it first, put it in the completeness of waiting for the information in the buffer to the correct transmission time

Come, and a better buffer mechanism we are "Interrupt-Driver I / O", this method is lost

Input Buffer is filled in the data when the interrupt is interrupted, and the program that needs these materials is required.

(process) is taken; Output Buffer is filled in the information after being filled in a program, at the interrupt

5

The information is given to the device, and the part of the so-called interrupt processing is to hand over the interrupt processing.

Responsibility. Usually, a driver only registers an interrupt processing for its device to the core,

The following functions can be used to register and log out of the interrupt process:

INT Request_irq (Unsigned Int Irq, Void (INT, VOID *, STRUCT PT_REGS *),

Unsigned long flags, const char * dev_name, void * dev_id);

Void free_irq (unsigned int IRQ, VOID * DEV_ID);

Request_irq can be used to register interrupt processing, while Free_IRQ is used to log out it.

2.2.1 Interrupt Processing Outline

When there is interruption, the system is actually "soft and hard and hard", please refer to Table 1.

1. Hardware storage program counters, etc.

2. Hardware load new program counters

3. Companies Storage Temcrop

4. Companies set new stack

5. C program processes the actual interrupt transaction, wake up the itinerary, may call

Schedule (), finally jumps back to the synthesis program

6. Composition Starts Start the current execution

The entire process of Interrupt Service Routine (ISR) is 3 ~ 6, and the driver is actually

5 items.

2.2.2 "Fast" and "Slow" Processing Circular

Old version

The LINUX core spent a lot of work to distinguish "fast" and "slow" interruption,

It is "fast", "slow" interruption, its difference is the length of the processing time required, if an interrupt is only very

If you have a short time, you can process it for fast interrupts. Conversely, if an interrupt needs a long time

To complete, it is slow interrupt. For the interrupt processing, the processor is processed when the interrupt is handled.

Whether other interrupt rewards will be accepted, this interrupt is often

Table 1: Interrupt processing outline

6

The formula is SLOW (because the processor must take care of other interrupts), it is FAST (due to processor)

It is completely occupied by this interrupt process. There is one of the same places, whether it is FAST or

Slow's interrupt placement, when it is in an interrupt service, this interrupt in the interrupt controller

(Interrupt Controller) is a Disable. In Request_IRQ () Flags parameters

If it is set to sa_interrupt, it is a representative to register a fast interrupt processing common, and in now

In the core, fast and slow interrupts have been considered almost the same, the table is two

Comparison:

During the interruption

It interrupts failure

During the interruption, the current

Service interrupt failure

Will the service will call

call

RET_FROM_SYS_CALL

Is it possible to frequently dispose?

Slow disposal of the common format is

2.2.3 Writing Interrupt Processing Circular

The work that must be considered when making an interruption is often considered, as listed in Table 4.

The last item written in Table 4

The following subsequent criticism we will introduce in the next section.

Interrupt processing Circular Since the execution is performed during an interrupt, it has been much restrictions.

The reason for judging the interruption, E.G. Network interrupt processing commonality to judge the interrupt is the package

The arrival, away or wrong.

Wake up in the trip to wait for an interrupted event.

If a longer execution time is required, use the Bottom Half to complete.

Table 2: Comparison of regular and slow interrupts

Table 4: The work to do in the interrupt situation

Seduce

For example: it can't be transferred to each other with the user's space, it can't do anything will let yourself sleep

Sleeping status. In the actual interrupt processing, the resources we can use are all incoming three parameters, which are int IRQ, VOID * DEV_ID, STRUCT PT_REGS * REGS.

IRQ can be used in the record file, DEV_ID is the indicator of this device, when we use a shared interrupt (E.G.

Two interrupt processes are commonly shared with an IRQ number), and the interrupt processing can be used to utilize DEV_ID.

Identify whether an interrupt belongs to yourself, and the last parameter regs rarely is used,

REGS will store the processor to enter the interrupt process, the contents of the previous time, so REGS can

It is used as a monitoring and disruption.

2.2.4 Subsequent processing Circular (Bottom Half)

One of the main problems faced by the interrupt is how to make the disposed of common successful implementation

For time consuming work, I will not miss the next interruption.

Linux solves this

The way is to divide the interrupt office is divided into two parts, one is "Top Half), another

A part is "Bottom Half). First, we mentioned before, use

The disposal of the registration of Request_irq, which is responsible for the subsequent criticism to the operating system,

Industry system, etc., can be implemented (so-called security means that the requirements for execution time are not strict

Black) will perform subsequent commonality.

There are two mechanisms in the core of the Linux to work on follow-up: BH (

Also known as Bottom Half and Tasklets.BH are older methods, actually in the core 2.4

It is also used in Tasklets, and Tasklets are developed from the 2.3 series, which is currently

Subsequent commonly used methods of commonly used, but because tasklets cannot be made on the older core

For use, if you consider Portability's problems, use BH's way more appropriate. Let's take a look

To work with Tasklets, which functions can be used:

Declare_Tasklet (Name, Function, DATA) Download (NAME, FUNCTION, DATA);

Tasklet_schedule (struct tasklet_struct * t);

How do I use these functions? For example, if you write a letter func () to be used as

Subsequent, the first step is to declare a tasklet: declare_tasklet to the system (Task,

8

Func, 0), TASK is the name representing this tasklet, then calls Tasklet_schedule (& Task) next

To discover this Task to your job system, you will go to the job system.

In the method of BH, if you want to use a subsequent Customized Code to the system, you can use the following one.

Void Mark_BH (INT NR);

Where NR is representing a Bottom-Half Routine, Mark_BH () in the core of the old version is in one

Set a bit in a bitmask, allowing the interrupt processing of this element to be able to successfully

Several subsequent creature is used to be executed, and the table is listed in the table.

The part of the program can be used:

However, in the new version of the core (2.4), Mark_BH () is actually going to call Tasklet_Hi_SCHEDULE ()

(Similar to Tasklet_schedule ()) to take the Bottom-Half Routine to the core to the core.

2.2.5 Competitive State (RACE CONDition)

Due to the reasons for Interrupt-Driver I / O, therefore introduced a problem: if there is a group of travel

How to solve several trips at the same time to access synchronization issues of the shared data, and this type of question

It is called a race condition. Because any of the execution points in the driver can occur

Interrupt, therefore as long as it is to interrupt the interactive drive (most of which) must pay attention to competition.

The Linux core supports several techniques to avoid the determination of data, and we will introduce the most common

Method: Use SpinLocks to reach two mutual exclusion between the strokes, so that you can avoid competition

The occurrence of the struggle, the white point is whether it is subject to the interrupt process.

When you take the shared information, you must first get (LOCK) a lock, then the access to the shared data, and finally don't use this to lock it again, so that other strokes can also be the same method To access shared information.

Spinlocks

The type in Linux is SpinLock_T, and the following is a function that can be operated on spinlocks:

IMMEDIATE_BH TQUE_BH TIMER_BH

Table 3: Follow-up of the core announcement

9

Void spin_lock (spinlock_t * Lock);

Void spin_lock_irqsave (spinlock_t * lock, unsigned long flags);

Void spin_lock_irq (spinlock_t * Lock);

Void spin_lock_bh (spinlock_t * Lock);

Void spin_unlock (spinlock_t * Lock);

Void spin_unlock_irqrestore (Spinlock_t * Lock, Unsigned Long Flags);

Void spin_unlock_irq (spinlock_t * Lock);

Void spin_unlock_bh (spinlock_t * Lock);

Spin_lock () gets a lock (Lock) you want in a busy-waiting manner.

When the spin_lock () is returned, the call can be obtained when it is called.

Spin_lock_irqsave () also got a lock in the same way, in addition to this, it will make the interrupt

Invalid, and record the current interrupt in the Flags parameter, and spin_lock_irq () except

Will not record the current interruption, the same movement spin_lock_irqsave (), as for

Spin_lock_bh (), it is the same as the busy-wait in the first three, but it also

Not allowed to be implemented. The above four functions can get a lock, reverse, the next four corresponding

The card will be locked, spin_unlock () just simply put the previously obtained,

Spin_unlock_irqrestore () will also make some interrupts vary depending on the value of Flags,

SPIN_UNLOCK_IRQ () In addition to the lock, all interruptions will be effective, while spin_unlock_bh () will

Locked also, and let the subsequent could be executed. There are two points to pay special attention when using these functions, the first is

Indeed

The function of the unlock lock in the LOCK lock is early, and the second is to have two or two pairs.

Use.

2.3 Reading and writing information using I / O

After the hard body phase, the driver can obtain the I / O Ports used by the hardware. Most of the

Hardware will divide the width of I / O Ports into 8-bit, 16-bit, and 32-bit yuan, so drivers

10

The form of the I / O Ports must be called different kinds of I / O Ports to call different functions, in

Linux

The following functions can be used to access the I / O Ports in the core.

Unsigned inb (unsigned port);

Void Outb (unsigned char BYE, UNSIGNED Port);

INB () reads the ports of the width of 8 bits, while the OUTB () is written to the ports of the width of 8 bits.

Unsigned inw (unsigned port);

Void Outw (unsigned char BYE, UNSIGNED Port);

INW () reads the ports of the width of 16 bits, while the OUTW () writes the ports of the width of 16 bits.

Unsigned inl (unsigned port);

Void Outl (unsigned char BYE, UNSIGNED Port);

INL () reads the ports of the width of 32-bit yuan, and the OUTL () is written to the ports of the width of 32 bits.

In addition to the way the above is read,

Linux also supports the operation of strings:

Void INSB (UNSIGNED Port, Void * Addr, Unsigned long count); Void Outsb (unsigned port, void * addr, unsigned long count);

INSB () reads the information of the count bit group from the 8-bit Ports, then stores these information to memory

The part site is the place of addr, and Outsb () uses the memory location to addr's information, and writes a count bit.

Group to 8-bit Ports.

Void INSW (UNSIGNED Port, Void * Addr, unsigned long count);

Void

Outsw (unsigned port, void * addr, unsigned long count);

The operation of these two correspondences is similar to the above, in addition to saying that they are 16-bit dollars for the width.

Ports designed.

Void INSL (UNSIGNED Port, Void * Addr, unsigned long count);

Void Outsl (unsigned port, void * addr, unsigned long count);

These two correspondences are similar to the above two, except that they are for the width of 32 yuan.

Ports designed.

11

3.

Linux network card driver instance

In the full network card driver, we choose the highest compatibility with the highest compatibility.

Road card

The Linux version of the driver is tracked, so that it is more practical.

3.1 Important Data Structure (Data Structure)

in

In the Linux system, there are two data structures commonly used by the network card driver: SK_BUFF and

Net_Device. Figure 4 shows that the two data structures are located in the system,

Whoever will go to access them.

Briefly illustrate Figure 4: SKB in the figure refers to the index variables of the SK_BUFF form, and DEV refers to

Net_Device form indicator variable. Network card driver crashed from the network card to the package (at this time

When a frame is called Frame, it will be configured to configure a SK_BUFF memory, plug FRAME into the DATA in SKB.

In the field, the package is in the system is in the form of SK_BUFF. And the Xu Net_Device

The multi-column value is filled in the network card driver, and the LOCAL is most of the DEV.

The field value is generated in the network card driver and then fills in the NET_DEVICE field, after the network

The card is in the system is in the form of NET_DEVICE, and then the two data is introduced in detail.

The main field.

core

SKB

DEV

Network card driver

SKB Frame

DEV LOCAL

Network card

Figure 4: SKB_BUFF and NET_DEVICE location in the system

12

3.1.1 SK_Buff

This information structure is defined in the middle, and the table is listed in its main field, and the column.

The meaning representative of the position.

3.1.2 Net_Device

This data structure is defined in, and the top six listed its main field, with

The meaning representative of the field.

3.2 Initialization

The initialization work can be divided into "registered interrupt processing common" and "detection hard body", registration interrupt

Treatment is often done with the Request_irq () written in the previously said, and the hardware of the probe is

The online card of the PCI interface, so you can get I / O Ports and IRQ only with the methods we teach before.

Number, without actually detecting a network card.

Bar name

NAME device name

Base_addr I / O Base Address

IRQ interrupt number

DEV_ADDR network card hardware order

MTU maximum transmission unit

HARD_START_XMIT device function Function

Famd name meaning field name

Head pointing to SK_BUFF starting LEN data itself

Data points to the "real information" start PKT_TYPE Type

Tail point to the end of "real information" SADDR source address

End points to the endddr destination address of SK_BUFF

Dev packet arrives or leaves the device RADDR router site

Table 5: Important fields of SK_BUFF

Table 6: NET_DEVICE's important field 13

3.3 Sending the package

Figure 5 shows the packet transmission process of this network card drive program, and the portion with shadows is a drive program.

Here is a simple explanation of text: The core is to transmit the package and call dev-> hard_start_xmit (),

In this drive program, the function made is EI_START_XMIT (), which will call in ei_start_xmit ()

Ne2k_pci_block_output () moves the package to the network card, then call

NS8390_trigger_send () to trigger (TRIGGER) network card will be sent out, wait until the package is finished,

The network card will notify the core in an interrupt, so the core will go to the corresponding interrupt processing common, drive

The shift is EI_Interrupt (), and EI_INTERRUPT () will first determine which interrupt is it belonging.

It was found that after the package was sent, it will call EI_TX_INTR () to process, EI_TX_INTR ()

Will call NS8390_trigger_send () to trigger another package transfer on the network card (if any

Word), then call Netif_Wake_Queue () to let the core know that the package has been passed, you can make the next item.

jobs.

core

(Disposal of common)

EI_Interrupt

(TX)

EI_START_XMIT

(RX)

Ei_RecEive

EI_TX_INTR

Network card

1. dev-> hard_start_xmit

2. NE2K_PCI_BLOCK_OUTPUT

3. NS8390_TRIGGER_SEND

4. Interrupt generation

5.

6.

7. NS8390_TRIGGER_SEND

8. Netif_Wake_Queue

Figure 5: Package delivery process

14

3.4 reception of packet

Figure 6 shows the packet receiving process of this network card driver.

Here is a simple explanation of text: When the network card receives a package, it will notify the core in an interruption.

It is the core to call the corresponding interrupt processing, which is Ei_Interrupt () in this driver.

EI_INTERRUPT () will first determine which interrupt is itself, and it is found that there is a package to come.

After break, it will call ei_receive () to handle, call in Ei_Receive ()

NE2K_PCI_BLOCK_INPUT () Move the package from the network card to the system memory, then plug the package into

In the structure of SK_Buff, this package is left to the upper layer in a Netif_Rx () in a group, and Netif_Rx ()

What does what we do is what we have previously discussed.

4. Efficacy analysis

Here we will do two interesting performance analysis, one name "a lifetime", another name "interrupt processing

"" The first test allows us to understand, a time to leave the country and the time of the entry package in the system, so

You can know which places will be spent in packet processing; the second test can let us know, network

Different interrupts of card drivers are completely different, and the categories of interruptions are different (delivery, receiving

To a new package) also has different ways of processing, we can use this test results as judging network card and driver card drivers

One of the good or bad factors of matching, because the network card and the network card driver have the average of the average of interrupt processing.

core

(Disposal of common)

EI_Interrupt

(TX)

EI_START_XMIT

(Rx)

Ei_RecEive

EI_TX_INTR

Network card

Interrupt Occurs

twenty three.

4. NE2K_PCI_BLOCK_INPUT 5. Netif_RX

Figure 6: Package acceptance process

15

The smaller between.

4.1 packet

We divide the lifetime of the package into three phases: network card stage, DMA stage, and network card drive

Dynamic phase (excluding DMA parts) will measure how long the exit and entry packets are waiting for these three stages

Room. Measurement method is to first set out the starting point of each stage and then use RDTSCLL (definition) to catch

Take time, Table 7 is the hardware used in our test, software:

CPU: Celeron 567.007 MHz

Network card: PCI Realtek 10MBPS Ethernet card

Homework system core: Linux kernel 2.2.19

Network card driver program: NE2K-PCI

The next episode is the result obtained by this test, and the time unit is the number of CPU Clock Cycle.

Since our CPU speed is 567.007 MHz, a clock = 1.8 nanosecond.

In the network card stage, the time and the package of the entry packet and the exit package are proportional, this is because

Packet Category Size (BYTE) Network Card Stage DMA Stage Network Card Driver Stage

ICMP (28 1)

ICMP (28 100)

ICMP (28 1000)

Immigration

62000 12000

102000 52000

512000 462000

Immigration and exit

7000

11000

66000

Immigration

1300 3000

1300 3000

1300 3000

UDP (28 1)

UDP (28 100)

UDP (28 1000)

62000 12000

102000 52000

512000 462000

7000

11000

66000

1300 3000

1300 3000

1300 3000

ARP (28) 62000 12000 7000 1300 3000

Table 7: Test one soft, hardware equipment

16

For the network card on the transfer package to the network, and the time spent from the network is received and the package is packet

The size is proportional; and the entry package will stay in the online card stage than the exit package is:

Immigration package: Receive time combined language interrupt processing time C language interrupt processing time.

Outbound packet: transfer time part C language interrupt processing time.

Since the entry packet has spent the time of combined language interrupt processing, coupled with its C language interruption processing

A long time is divided into the package, so the time of the entry package is from the network card.

In the stage, the time to get the package is obviously related to the size of the package, whether it is necessary to enter the country.

Packet of the environment. The package is in the shortest time in the network card driver program, especially in the country

Packet, this is because when the entry package DMA is on the network card driver, the network card driver

Buck Netif_RX handles the package to subsequent commonality.

4.2 Interrupt Time

In this test, we found two online cards and their corresponding network card drivers, test two

The time spent on the interrupt process, of course, this is also divided into a package transfer and new sealing

The package came to these two types of interrupts, and the table is the soft and hard body used here.

CPU: Celeron 567.007 MHz

Network card: PCI Realtek RTL-8029 (AS)

10MBPS Ethernet Card

Network card driver program: NE2K-PCI

Network card: PCI Intel GD82559 100Mbps

Ethaling

Network card driver program: EEPRO100

Homework system core:

Linux kernel 2.2.19

Table 9: Testing the soft, hardware equipment

In one

Table 10 is the result of this test, and the unit of time is the number of CPU Clock.

Interrupt type

Sealing size (Byte)

New package

EEPRO100 NE2K-PCI

Packet delivery is completed

EEPRO100 NE2K-PCI

28 1 8500 29000 6000 8500

28 100 8500 34000 6000 8500

28 1000 8500 90000 6000 8500

This results showed that the combination of EEPRO100 and Intel network card is spent on the interrupt processing.

Compared with the combination of NE2K-PCI and Realtek online cards, it can be said that EEPRO100 is

Intel Network Card Combination is good than the combination of NE2K-PCI and Realtek online cards;

It can be found that the time required "new package to come" is much more than "packaged", because

When processing a new package, you must first post the package from the network card DMA, then add

In SK_BUFF, and transfer it to the upper layer, and the "package transfer is complete" is only doing some

Work, for example, the number of packets will be added to the package. 5. Conclusion

The network card driver plays an important role in the system, because it must communicate with the lower network card and the upper core,

It has become a lot of samples to do, it is very complicated, if you want to learn to write a network card driver's best way to find an example

Override. The method introduced in the second section is very common, not just the network card driver, other device drivers

The practice is also small. In the fourth quarter, we did two very interesting tests, from these tests, you can more understand the package

The relationship between the hands and network card drivers, you can know when the package is processed, DMA and send (or pick up "

Receiving the package is a bottleneck at a time, and this may design some way to speed up the speed of the package.

6. References

[1] Alessandro Rubini, "

Linux Device Drivers, First Edition, O'Reilly & Associates,

1998.

Table 10: Test the results of the two

18

[2] Alessandro Rubini & Jonathan Corbet, "

Linux Device Drivers ", 2nd Edition, O'Reilly

& Associates, June 2001.

[3] Andrew S.Tanenbaum, "Modern Operating Systems", Prentice Hall, 1996

[4] W. Richard Stevens, "TCP / IP ILLUSTRATED, VOLUME1 & 2", Addison Wesley, 1994

[5] Lin Yingda, "Computer Network Experiment", Wiko Publishing House, 1999.

转载请注明原文地址:https://www.9cbs.com/read-40192.html

New Post(0)