Misplaced Pages

New API

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

New API (also referred to as NAPI ) is an interface to use interrupt mitigation techniques for networking devices in the Linux kernel . Such an approach is intended to reduce the overhead of packet receiving. The idea is to defer incoming message handling until there is a sufficient amount of them so that it is worth handling them all at once.

#812187

39-433: A straightforward method of implementing a network driver is to interrupt the kernel by issuing an interrupt request (IRQ) for each and every incoming packet. However, servicing IRQs is costly in terms of processor resources and time. Therefore, the straightforward implementation can be very inefficient in high-speed networks, constantly interrupting the kernel with the thousands of packets per second. Overall performance of

78-496: A comprehensive method of enumerating hardware at boot time and allocating resources, which was called the "Plug and Play" standard. Plug and play devices can have resources allocated at boot-time only, or may be hotplug systems such as USB and IEEE 1394 (FireWire). Some early microcomputer peripheral devices required the end user physically to cut some wires and solder together others in order to make configuration changes; such changes were intended to be largely permanent for

117-459: A dual-port serial card requiring a separate interrupt for each serial port. Because of this complex operating environment, the autodetection process sometimes produced incorrect results, especially in systems with large numbers of expansion devices. This led to device conflicts within Windows 95, resulting in devices which were supposed to be fully self-configuring failing to work. The unreliability of

156-452: A mix of driver entries inserted by the Windows 95 automatic configuration process, and could also include driver entries inserted or modified manually by the computer users themselves. The Windows 95 Device Manager also could offer users a choice of several semi-automatic configurations to try to free up resources for devices that still needed manual configuration. Also, although some later ISA devices were capable of automatic configuration, it

195-715: A particular device to operate. Some computers provided unique combinations of these resources to each slot of a motherboard or backplane . Other designs provided all resources to all slots, and each peripheral device had its own address decoding for the registers or memory blocks it needed to communicate with the host system. Since fixed assignments made expansion of a system difficult, devices used several manual methods for assigning addresses and other resources, such as hard-wired jumpers, pins that could be connected with wire or removable straps, or switches that could be set for particular addresses. As microprocessors made mass-market computers affordable, software configuration of I/O devices

234-448: A price premium on MCA devices. End-users and clone manufacturers revolted against IBM and developed their own open standards bus, known as EISA. Consequently, MCA usage languished except in IBM's mainframes. In time, many Industry Standard Architecture (ISA) cards incorporated, through proprietary and varied techniques, hardware to self-configure or to provide for software configuration; often,

273-600: A running program and allows a special program, an interrupt handler , to run instead. Hardware interrupts are used to handle events such as receiving data from a modem or network card , key presses, or mouse movements. Interrupt lines are often identified by an index with the format of IRQ followed by a number. For example, on the Intel 8259 family of programmable interrupt controllers (PICs) there are eight interrupt inputs commonly referred to as IRQ0 through IRQ7 . In x86 based computer systems that use two of these PICs ,

312-702: A second Intel 8259 PIC. The first PIC, the master, is the only one that directly signals the CPU. The second PIC, the slave, instead signals to the master on its IRQ 2 line, and the master passes the signal on to the CPU. There are therefore only 15 interrupt request lines available for hardware. On APIC with IOAPIC systems, typically there are 24 IRQs available, and the extra 8 IRQs are used to route PCI interrupts, avoiding conflict between dynamically configured PCI interrupts and statically configured ISA interrupts. On early APIC systems with only 16 IRQs or with only Intel 8259 interrupt controllers, PCI interrupt lines were routed to

351-436: A system with ACPI enabled. In some conditions, two ISA devices could share the same IRQ as long as they were not used simultaneously. To solve this problem, the later PCI bus allows for IRQ sharing. PCI Express does not have physical interrupt lines, and uses Message Signaled Interrupts (MSI) to the operating systems if available. Plug and play In computing , a plug and play ( PnP ) device or computer bus

390-523: Is based on the PCI BIOS Specification in 1990s, the PCI BIOS Specification is superseded by the ACPI in 2000s. In 1995, Microsoft released Windows 95 , which tried to automate device detection and configuration as much as possible, but could still fall back to manual settings if necessary. During the initial install process of Windows 95, it would attempt to automatically detect all devices installed in

429-582: Is one with a specification that facilitates the recognition of a hardware component in a system without the need for physical device configuration or user intervention in resolving resource conflicts. The term "plug and play" has since been expanded to a wide variety of applications to which the same lack of user setup applies. Expansion devices are controlled and exchange data with the host system through defined memory or I/O space port addresses, direct memory access channels, interrupt request lines and other mechanisms, which must be uniquely associated with

SECTION 10

#1733085529813

468-475: The procinfo utility. In early IBM-compatible personal computers , an IRQ conflict is a once common hardware error, received when two devices were trying to use the same interrupt request (or IRQ) to signal an interrupt to the Programmable Interrupt Controller (PIC). The PIC expects interrupt requests from only one device per line, thus more than one device sending IRQ signals along

507-556: The Autoconfig protocol and the Zorro expansion bus for its Amiga line of expandable computers. The first public appearance was in the CES computer show at Las Vegas in 1985, with the so-called "Lorraine" prototype. Like NuBus, Zorro devices had absolutely no jumpers or DIP switches. Configuration information was stored on a read-only device on each peripheral, and at boot time the host system allocated

546-455: The printer port ( LPT1 ). The serial ports are frequently disabled to free an IRQ line for another device. IRQ 2/9 is the traditional interrupt line for an MPU-401 MIDI port, but this conflicts with the ACPI system control interrupt (SCI is hardwired to IRQ9 on Intel chipsets); this means ISA MPU-401 cards with a hardwired IRQ 2/9, and MPU-401 device drivers with a hardcoded IRQ 2/9, cannot be used in interrupt-driven mode on

585-642: The 16 IRQs using a PIR (PCI interrupt routing) table integrated into the BIOS. Operating systems such as Windows 95 OSR2 may use PIR table to process PCI IRQ steering; later, the PIR table has been superseded by the ACPI _PRT (PCI routing table) protocol. On APIC with MSI systems, typically there are 224 interrupts available. The easiest way of viewing this information on Windows is to use Device Manager or System Information (msinfo32.exe). On Linux , IRQ mappings can be viewed by executing cat /proc/interrupts or using

624-533: The IRQ numbers cascade to another set or sets of numbered IRQs, handled by one or more subsequent controllers). Newer x86 systems integrate an Advanced Programmable Interrupt Controller (APIC) that conforms to the Intel APIC Architecture. Each Local APIC typically support up to 255 IRQ lines, with each I/O APIC typically support up to 24 IRQ lines. During the early years of personal computing, IRQ management

663-624: The card came with a configuration program on disk that could automatically set the software-configurable (but not itself self-configuring) hardware. Some cards had both jumpers and software-configuration, with some settings controlled by each; this compromise reduced the number of jumpers that had to be set, while avoiding great expense for certain settings, e.g. nonvolatile registers for a base address setting. The problems of required jumpers continued on, but slowly diminished as more and more devices, both ISA and other types, included extra self-configuration hardware. However, these efforts still did not solve

702-444: The combined set of lines are referred to as IRQ0 through IRQ15 . Technically these lines are named IR0 through IR7 , and the lines on the ISA bus to which they were historically attached are named IRQ0 through IRQ15 (although historically as the number of hardware devices increased, the total possible number of interrupts was increased by means of cascading requests, by making one of

741-519: The device installation process led to Plug and Play being sometimes referred to as Plug and Pray . Until approximately 2000, PC computers could still be purchased with a mix of ISA and PCI slots, so it was still possible that manual ISA device configuration might be necessary. But with successive releases of new operating systems like Windows 2000 and Windows XP, Microsoft had sufficient clout to say that drivers would no longer be provided for older devices that did not support auto-detection. In some cases,

780-414: The life of the hardware. As computers became more accessible to the general public, the need developed for more frequent changes to be made by computer users unskilled with using soldering irons. Rather than cutting and soldering connections, configuration was accomplished by jumpers or DIP switches . Later on this configuration process was automated: Plug and Play. The MSX system, released in 1983,

819-474: The need for concern for these settings, but has also virtually eliminated manual configuration. Early PCs using the Intel 8086/8088 processors only had a single PIC, and are therefore limited to eight interrupts. This was expanded to two PICs with the introduction of the 286 based PCs. Typically, on systems using the Intel 8259 PIC, 16 IRQs are used. IRQs 0 to 7 are managed by one Intel 8259 PIC, and IRQs 8 to 15 by

SECTION 20

#1733085529813

858-536: The network interface. A driver using the NAPI interface will work as follow: NAPI was an over-three-year effort by Alexey Kuznetsov, Jamal Hadi Salim and Robert Olsson. Initial effort to include NAPI was met with resistance by some members of the community, however David Miller worked hard to ensure NAPI's inclusion. A lot of real world testing was done in the Uppsala university network before inclusion. In fact, www.slu.se

897-462: The other hand, polling too infrequently introduces latency by reducing system reactivity to incoming packets, and it may result in the loss of packets if the incoming packet buffer fills up before being processed. As a compromise, the Linux kernel uses the interrupt-driven mode by default and only switches to polling mode when the flow of incoming packets exceeds a certain threshold, known as the "weight" of

936-452: The point that caused the previous freeze. At the time, there could be a mix of devices in a system, some capable of automatic configuration, and some still using fully manual settings via jumpers and DIP switches. The old world of DOS still lurked underneath Windows 95, and systems could be configured to load devices in three different ways: Microsoft could not assert full control over all device settings, so configuration files could include

975-455: The problem of making sure the end-user has the appropriate software driver for the hardware. ISA PnP or (legacy) Plug & Play ISA was a plug-and-play system that used a combination of modifications to hardware, the system BIOS, and operating system software to automatically manage resource allocations. It was superseded by the PCI bus during the mid-1990s. The PCI plug and play (autoconfiguration)

1014-708: The requested resources to the installed card. The Zorro architecture did not spread to general computing use outside of the Amiga product line, but was eventually upgraded as Zorro II and Zorro III for the later iteration of Amiga computers. In 1987, IBM released an update to the IBM PC known as the Personal System/2 line of computers using the Micro Channel Architecture . The PS/2 was capable of totally automatic self-configuration. Every piece of expansion hardware

1053-428: The same line will generally cause an IRQ conflict that can freeze a computer . For example, if a modem expansion card is added into a system and assigned to IRQ4, which is traditionally assigned to the serial port  1, it will likely cause an IRQ conflict. Initially, IRQ 7 was a common choice for the use of a sound card , but later IRQ 5 was used when it was found that IRQ 7 would interfere with

1092-606: The software side, the drivers and extensions were supplied in the card's own ROM, thus requiring no disks or any kind of user intervention to configure the software. The ROM extensions abstracted any hardware differences and offered standard APIs as specified by ASCII Corporation . In 1984, the NuBus architecture was developed by the Massachusetts Institute of Technology (MIT) as a platform agnostic peripheral interface that fully automated device configuration. The specification

1131-470: The system as well as network throughput can suffer as a result. Polling is an alternative to interrupt-based processing. The kernel can periodically check for the arrival of incoming network packets without being interrupted, which eliminates the overhead of interrupt processing. Establishing an optimal polling frequency is important, however. Too frequent polling wastes CPU resources by repeatedly checking for incoming packets that have not yet arrived. On

1170-403: The system. Since full auto-detection of everything was a new process without full industry support, the detection process constantly wrote to a progress tracking log file during the detection process. In the event that device probing would fail and the system would freeze, the end-user could reboot the computer, restart the detection process, and the installer would use the tracking log to skip past

1209-508: The time to obtain replacements were via postal mail or IBM's dial-up BBS service. Without the disks, any new hardware would be completely useless and the computer would occasionally not boot at all until the unconfigured device was removed. Micro Channel did not gain widespread support, because IBM wanted to exclude clone manufacturers from this next-generation computing platform. Anyone developing for MCA had to sign non-disclosure agreements and pay royalties to IBM for each device sold, putting

New API - Misplaced Pages Continue

1248-449: The user was forced to purchase new expansion devices or a whole new system to support the next operating system release. Several completely automated computer interfaces are currently used, each of which requires no device configuration or other action on the part of the computer user, apart from software installation, for the self-configuring devices. These interfaces include: For most of these interfaces, very little technical information

1287-508: Was advantageous to allow installation by non-specialist users. Early systems for software configuration of devices included the MSX standard, NuBus , Amiga Autoconfig , and IBM Microchannel. Initially all expansion cards for the IBM PC required physical selection of I/O configuration on the board with jumper straps or DIP switches , but increasingly ISA bus devices were arranged for software configuration. By 1995, Microsoft Windows included

1326-604: Was common for PC ISA expansion cards to limit themselves to a very small number of choices for interrupt request lines. For example, a network interface might limit itself to only interrupts 3, 7, and 10, while a sound card might limit itself to interrupts 5, 7, and 12. This results in few configuration choices if some of those interrupts are already used by some other device. The hardware of PC computers additionally limited device expansion options because interrupts could not be shared, and some multifunction expansion cards would use multiple interrupts for different card functions, such as

1365-405: Was designed to be plug and play from the ground up, and achieved this by a system of slots and subslots, where each had its own virtual address space , thus eliminating device addressing conflicts in its very source. No jumpers or any manual configuration was required, and the independent address space for each slot allowed very cheap and commonplace chips to be used, alongside cheap glue logic . On

1404-401: Was issued with a floppy disk containing a special file used to auto-configure the hardware to work with the computer. The user would install the device, turn on the computer, load the configuration information from the disk, and the hardware automatically assigned interrupts, DMA, and other needed settings. However, the disks posed a problem if they were damaged or lost, as the only options at

1443-476: Was often of user concern. With the introduction of plug and play devices this has been alleviated through automatic configuration. When working with personal computer hardware, installing and removing devices, the system relies on interrupt requests. There are default settings that are configured in the system BIOS and recognized by the operating system. These default settings can be altered by advanced users. Modern plug and play technology has not only reduced

1482-503: Was sufficiently intelligent that it could work with both big endian and little endian computer platforms that had previously been mutually incompatible. However, this agnostic approach increased interfacing complexity and required support chips on every device which in the 1980s was expensive to do, and apart from its use in Apple Macintoshes and NeXT machines, the technology was not widely adopted. In 1984, Commodore developed

1521-407: Was the first production NAPI-based OS and is still powered to this day by NAPI-based Bifrost/Linux routers. The pktgen traffic generator was also born around this time. Pktgen was extensively used to test NAPI scenarios not induced by real world traffic. Interrupt request In a computer , an interrupt request (or IRQ ) is a hardware signal sent to the processor that temporarily stops

#812187