Intel e1000 Ethernet Controller Driver Intel e1000 controller - - PowerPoint PPT Presentation

intel e1000 ethernet controller driver
SMART_READER_LITE
LIVE PREVIEW

Intel e1000 Ethernet Controller Driver Intel e1000 controller - - PowerPoint PPT Presentation

Intel e1000 Ethernet Controller Driver Ivan D elalande Introduction PCI Intel e1000 Ethernet Controller Driver Intel e1000 controller Conclusion Ivan D elalande colona@lse.epita.fr http://lse.epita.fr February 12, 2013 . . . . . .


slide-1
SLIDE 1

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Intel e1000 Ethernet Controller Driver

Ivan Delalande

colona@lse.epita.fr http://lse.epita.fr

February 12, 2013

slide-2
SLIDE 2

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Plan

. .

1

Introduction . .

2

PCI . .

3

Intel e1000 controller . .

4

Conclusion

slide-3
SLIDE 3

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Plan

. .

1

Introduction

slide-4
SLIDE 4

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Motivation

Write a network stack for STOS.

Handle data link, network and transport layers. Provide network syscalls: socket, listen,

  • connect. . .
slide-5
SLIDE 5

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Plan

. .

2

PCI

slide-6
SLIDE 6

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

PCI

PCI: Peripheral Component Interconnect, Bus to connect devices to the system. Hierarchical device organization:

Bus, Device, Function, Register.

slide-7
SLIDE 7

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Device Discovery

Bus scan to find the location of the device, Devices identified by their Vendor ID and Device ID

eg: 0x8086 ; 0x100E

slide-8
SLIDE 8

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Device Structure

Various useful information. Command register (bus master, address spaces, interrupt disable. . . ), BAR: base address registers,

I/O address space, Memory address space.

slide-9
SLIDE 9

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Communication with the device

Memory-mapped I/O

Allow addressing devices’ memory or registers as a chunk of the system memory.

DMA: Direct Memory Access

Memory operations without the direct intervention

  • f the CPU,

Devices that master the PCI bus can initiate memory transfer by themselves.

PCI Interrupts

Four interrupt lines shared by all PCI devices.

slide-10
SLIDE 10

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Plan

. .

3

Intel e1000 controller

slide-11
SLIDE 11

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Presentation

Common gigabit ethernet controller by Intel with a (pretty) good documentation, Provide (too) many feature to reduce kernel’s work:

Link auto-negocitation, Filters IP addresses, Compute IP packets’ checksum, Tries to limit the number of interrupts, Provide effective shutdown method (a.k.a. Packet of Death). . .

Full customization of LEDs’ blinking!

slide-12
SLIDE 12

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

PCI Configuration

Set the bus master bit to allow DMA from the controller, Retrieve the base address of the configuration register.

slide-13
SLIDE 13

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Controller Initialization

Set configuration registers to appropriate values: MAC address, transmission modes. . . Find the proper way to read the EEPROM to get various information (MAC address, . . . ), Allocate memory for network frames transmission and reception.

slide-14
SLIDE 14

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Frame transmission and reception

Two descriptor ring structures that point to frame buffers, Software moves Descriptor Tail and hardware moves Descriptor Head. Signaling from the controller via PCI interrupts.

slide-15
SLIDE 15

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Plan

. .

4

Conclusion

slide-16
SLIDE 16

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Next steps

Process and verify the frames: check of the header, collisions detection. . . Proceed with the remaining layers of the network stack: network and transport.

slide-17
SLIDE 17

Intel e1000 Ethernet Controller Driver Ivan Delalande Introduction PCI Intel e1000 controller Conclusion

. . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Questions?