What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets.

Slides:



Advertisements
Similar presentations
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Advertisements

Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
The ATA/IDE Interface Can we write a character-mode device driver for the hard disk?
Basic Memory Management 1. Readings r Silbershatz et al: chapters
Bart Miller. Outline Definition and goals Paravirtualization System Architecture The Virtual Machine Interface Memory Management CPU Device I/O Network,
Another device-driver? Getting ready to program the network interface.
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. PCI Devices NIC Cards NIC card architecture Access to NIC register – PCI access.
IA32 Paging Scheme Introduction to the Pentium’s support for “virtual” memory.
What’s needed to receive? A look at the minimum steps required for programming our 82573L nic to receive packets.
VIA and Its Extension To TCP/IP Network Yingping Lu Based on Paper “Queue Pair IP, …” by Philip Buonadonna.
Message Signaled Interrupts
Exploring a modern NIC An introduction to programming the Intel 82573L gigabit ethernet network interface controller.
RTL-8139 experimentation Setting up an environment for studying the Network Controller.
“Virtual” Memory How does the OS kernel provide “private” and “shared” memory areas to multiple concurrent processes?
Examining network packets Information about the RTL8139 needed for understanding our ‘watch235.c’ pseudo driver.
A “real” network driver? We want to construct a Linux network device-driver that is able to send and receive packets.
Our ‘xmit1000.c’ driver Implementing a ‘packet-transmit’ capability with the Intel 82573L network interface controller.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in futrure experiments.
What’s needed to transmit? A look at the minimum steps required for programming our 82573L nic to send packets.
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
A device-driver for Video Memory Introduction to basic principles of the PC’s graphics display.
Common network diagnostic and configuration utilities A ‘toolkit’ for network users and managers when ‘troubleshooting’ is needed on your network.
Linux Memory Management How does the Linux kernel keep track of the Virtual Memory Areas that each process uses?
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
Hardware-address filtering How can we send packets to just one node on our ‘anchor’ cluster?
Accessing the NIC A look at the mechanisms that software can use to interact with our 82573L network interface.
What’s needed to receive? A look at the minimum steps required for programming our anchor nic’s to receive packets.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Author : Jiang Wang, Angelos Stavrou, and Anup Ghosh Conference: RAID 2010 Advisor: Yuh-Jye Lee Reporter: Yi-Hsiang Yang
Input and Output Computer Organization and Assembly Language: Module 9.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
GBT Interface Card for a Linux Computer Carson Teale 1.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
Memory  Main memory consists of a number of storage locations, each of which is identified by a unique address  The ability of the CPU to identify each.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Introduction to Virtual Memory and Memory Management
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
4P13 Week 12 Talking Points Device Drivers 1.Auto-configuration and initialization routines 2.Routines for servicing I/O requests (the top half)
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Input/Output (I/O) Important OS function – control I/O
Kernel Design & Implementation
Why VT-d Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing.
Linux Details: Device Drivers
Introduction of microprocessor
CS 286 Computer Organization and Architecture
Linux Details: Device Drivers
Chapter 13: I/O Systems.
Who’s listening? Some experiments with an ‘echo’ service on our anchor-cluster’s local network of 82573L nic’s.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets

Access to PRO/1000 registers Device registers are hardware mapped to a range of addresses in physical memory You obtain the location (and the length) of this memory-range from a BAR register in the nic device’s PCI Configuration Space Then you request the Linux kernel to setup an I/O ‘remapping’ of this memory-range to ‘virtual’ addresses within kernel-space

i/o-memory remapping dynamic ram nic registers vram IO-APIC Local-APIC user space APIC registers kernel code/data nic registers vram ‘virtual’ address-spacephysical address-space 1-GB 3-GB

Enhanced ‘82573.c’ module Originally we created this module to view the PCI Configuration Space for our nic Today we’ve added two character-mode device-driver ‘methods’ allowing us to see values in all of the nic’s internal registers You can use our ‘fileview’ utility to ‘read’ and ‘seek’ in the ‘/dev/82573’ device-file (or you could write your own application)

An observation We notice that the 82573L device retains the values in many of its internal registers This fact reduces the programming steps that will be required to operate our nic on the anchor cluster machines, since Intel’s own Linux device driver (‘e1000.ko’) has already initialized many nic registers But we WILL need to bring ‘eth1’ down!

Use ‘/sbin/ifconfig’ You can use the ‘/sbin/ifconfig’ command to find out whether the ‘eth1’ interface has been turned off: $ /sbin/ifconfig eth1 If it is still operating, you can turn it off with the (privileged) command: $ sudo /sbin/ifconfig eth1 down

Our ‘nicping.c’ demo We created this module to help us identify all of the programming steps that would be needed for our nic to ‘transmit’ a packet The action of displaying this module’s pseudo-file (e.g., with the ‘cat’ command) will trigger transmission of a ‘broadcast’ message to all the other stations on our anchor cluster’s LAN (if they are ‘listening’)

Tx-Desc Ring-Buffer Circular buffer (128-bytes minimum) TDBA base-address TDLEN (in bytes) TDH (head) TDT (tail) = owned by hardware (nic) = owned by software (cpu) 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80

How ‘transmit’ normally works descriptor0 descriptor1 descriptor2 descriptor Buffer0 Buffer1 Buffer2 Buffer3 List of Buffer-Descriptors We setup each data-packets that we want to be transmitted in a ‘Buffer’ area in ram We also create a list of buffer-descriptors and inform the NIC of its location and size Then, when ready, we tell the NIC to ‘Go!’ (i.e., start transmitting), but let us know when these transmissions are ‘Done’ Random Access Memory

How ‘transmit’ works here descriptor0 descriptor1 descriptor2 descriptor3 descriptor4 descriptor5 descriptor6 descriptor7 Packet Buffer List of Buffer-Descriptors We setup just one packet-buffer, and we let all of our descriptors pointing to it We retain ‘ownership’ of all our descriptors, so nothing gets transmitted, until we have prepared all our data in the packet-buffer Then, when ready, we tell the NIC to ‘Go!’ (i.e., start transmitting), by giving the nic ‘ownership’ of only the next descriptor Random Access Memory TDH TDT

Essential ‘transmit’ registers enum{ E1000_CTRL0x0000,// Device Control E1000_STATUS0x0008,// Device Status E1000_IMC0x00D8,// Interrupt Mask Clear E1000_TCRL0x0400,// Transmit Control E1000_TDBAL0x3800,// Tx Descriptor Base Address Low E1000_TDBAH0x3804,// Tx Descriptor Base Address High E1000_TDLEN0x3808,// Tx Descriptor Length E1000_TDH0x3810,// Tx Descriptor Head E1000_TDT0X3818,// Tx Descriptor Tail E1000_RA0x5400,// Receive address-filter Array };

Programming challenge Can you see how use the code shown in this example-module to implement a TX capability in our earlier ‘netframe.c’ driver?