Navigation Bar

FreeBSD busdma and SMPng driver conversion project


Top Applications Support Documentation Vendors Search Index Top Top

Contents

Project Goal

busdma

The busdma interfaces permit hardware device drivers to operate on a variety of platforms avoiding the encoding of platform-specific access methods into drivers. This lowers the maintenance costs for drivers across platforms, and improves the chances that a driver will "just work" on a new platform. Modifying a driver to make use of busdma is relatively straight forward, but does require familiarity with both the device driver and busdma primitives. For busdma to be used in FreeBSD, two sets of changes are generally required: adaptation of the busdma implementation to run on all platforms, and adaptation of drivers to use the framework. As such, status information on this project is broken down into platform support, and driver support (sorted by category). Completing this work requires a thorough audit of the system device drivers, then prioritized conversion of drivers.

INTR_MPSAFE

Hardware drivers register their interrupt handler with the bus_setup_intr() function. Setting the flag INTR_MPSAFE tells the system interrupt code to call the interrupt routine without holding the Giant mutex. This can give a significant performance gain on SMP systems.

Drivers can set this flag even if they are not fully locked down as long as their interrupt routine is careful about not touching other data structures in the driver. An easy way to do this is to check and clear the hardware interrupt status registers and then schedule the interrupt processing for a taskqueue or kernel thread.

SMPng locked

Drivers should employ mutexes and sx locks to protect their data structures and hardware registers from competing threads. Mutex operations are somewhat expensive, so a good strategy is combine as many atomic operations into a single mutex acquisition as possible.

p!=a safety

Intel PAE support requires that pointers and physical address representations be of differing sizes. This means that drivers must be written to use vm_paddr_t or bus_addr_t rather than assuming that physical addresses can be represented using a void *. In addition, format strings and casts must be carefully handled.

The task list below is not intended to be complete, but does represent a set of relevant and/or important components of the overall work. The "Responsible" field identifies a developer who has expressed willingness to be responsible for completing the identified task; this doesn't preclude others working on it, but suggests that coordination with the responsible party might be appropriate so as to avoid unnecessary duplication of work, and to maximize forward progress. If beginning work on a new area of substantial size, or one that appears unclaimed, it may be worth dropping an e-mail to Maxime Henrion to see if any progress has been made.

The definition of the date field varies depending on the status of a task. For completed tasks, it refers to the date completed or reported completed. For in-progress tasks, it refers to the date of the last update of the entry. For stalled tasks, it refers to the date that the task was declared stalled. For new tasks, it refers to the date the task was added to the list.

Tasks are sorted first by status, then by date.

Platform Support Status

Task Responsible Last updated Status Details
alpha Andrew Gallatin December 10, 2002 Done There may be problems for systems with large amounts of memory.
amd64 Peter Wemm July 1, 2003 Done Fully supported.
ia64 Marcel Moolenaar December 10, 2002 Done There may be problems for systems with large amounts of memory.
i386 Sam Leffler December 9, 2002 Done Fully supported.
powerpc Hiten Pandya January 15, 2003 Done Fully supported.
sparc64 Thomas Moestl January 6, 2003 Done Fully supported.

Network Interface Driver Status

Driver Responsible Last updated busdma INTR_MPSAFE SMPng locked a!=p Notes
if_ar     Not done Not done Not done Not done kvtop()
if_bge Bill Paul July 26, 2003 Needs testing Not done Not done Done  
if_cs     Not done Not done Not done Not done  
if_dc Maxime Henrion April 17, 2003 Done Not done Not done Needs testing  
if_de Maxime Henrion   Not done Not done Not done Not done vtophys()
if_ed     Not done Not done Not done Not done kvtop()
if_em Prafulla Deuskar December 19, 2002 Done Not done Not done Done  
if_en Harti Brandt March 4, 2003 Done Not done Not done Needs testing  
if_fxp Maxime Henrion December 9, 2002 Done Not done Not done Done  
if_fwe     Not done Not done Not done Not done  
if_gem Thomas Moestl January 6, 2003 Done Not done Not done Not done  
if_gx     Not done Not done Not done Not done vtophys()
if_hme Thomas Moestl January 6, 2003 Done Not done Not done Not done  
if_idt     Not done Not done Not done Not done vtophys()
if_lge     Not done Not done Not done Not done vtophys()
if_lmc     Not done Not done Not done Not done vtophys()
if_lnc David O'Brien   Not done Not done Not done Not done vtophys(). Please contact Poul-Henning Kamp for info/hardware.
if_mn     Not done Not done Not done Not done vtophys(). Please contact Poul-Henning Kamp for info/hardware.
if_my     Not done Not done Not done Not done vtophys()
if_nge     Not done Not done Not done Not done vtophys()
if_pcn David O'Brien   Not done Not done Not done Not done vtophys()
if_pdq     Not done Not done Not done Not done mostly busdma, except for vtophys()
if_rl Bill Paul December 9, 2002 Done Not done Not done Not done  
if_sf     Not done Not done Not done Not done vtophys()
if_sis Bill Paul December 9, 2002 Done Not done Not done Not done  
if_sk     Not done Not done Not done Not done vtophys()
if_sr     Not done Not done Not done Not done vtophys()
if_ste     Not done Not done Not done Not done vtophys()
if_ti     Not done Not done Not done Not done  
if_tl     Not done Not done Not done Not done  
if_tx Maxime Henrion April 19, 2003 Done Not done Not done Needs testing vtophys()
if_txp Will Andrews July 18, 2003 In progress Not done Not done Not done  
if_vr Christian S.J. Peron <maneo@bsdpro.com> January 20, 2003 In progress Not done Not done Not done  
if_wb     Not done Not done Not done Not done  
if_xl Maxime Henrion December 17, 2002 Done Not done Not done Done  

Storage Device Driver Status

Driver Responsible Last updated busdma INTR_MPSAFE SMPng locked a!=p Notes
aac Scott Long February 8, 2003 Done Done Done Done PCI-64 capable, not endian clean
adv   December 9, 2002 Done Not done Not done Not done  
aha   December 9, 2002 Done Not done Not done Not done  
ahb   December 9, 2002 Done Not done Not done Not done  
aic7xxx   December 9, 2002 Done Not done Not done Not done  
amd   December 14, 2002 Done Not done Not done Not done  
amr   December 9, 2002 Done Not done Not done Not done  
asr David O'Brien January 4, 2003 Not done Not done Not done Not done vtophys()
ata   December 9, 2002 Done Not done Not done Done  
buslogic     Not done Not done Not done Not done vtophys()
ciss   December 9, 2002 Done Not done Not done Not done  
ct     Not done Not done Not done Not done  
dpt     Not done Not done Not done Not done vtophys()
ida   December 9, 2002 Done Not done Not done Not done  
iir     Not done Not done Not done Not done vtophys()
isp   February 8, 2003 Done Done Not done Not done  
mlx Scott Long February 8, 2003 Done In progress In progress Not done  
mly Scott Long February 8, 2003 Done In progress In progress Not done  
mpt   December 9, 2002 Done Done Not done Not done  
ncr     Not done Not done Not done Not done vtophys(). Please contact Poul-Henning Kamp for a possible source of hardware.
pst     Not done Not done Not done Not done vtophys()
stg   December 9, 2002 Done Not done Not done Not done At least, it looks like it may well be.
sym   December 19, 2002 Done Not done Not done Not done  
trm Olivier Houchard December 9, 2002 Done Not done Not done Not done  
twe   December 9, 2002 Done Not done Not done Not done  

Miscellaneous Device Driver Status

Driver Responsible Last updated busdma INTR_MPSAFE SMPng locked a!=p Notes
agp Olivier Houchard January 23, 2003 In progress Not done Not done Not done vtophys()
bktr Olivier Houchard January 15, 2003 In progress Not done Not done Not done vtophys()
cs     Not done Not done Not done Not done  
digi     Not done Not done Not done Not done vtophys()
drm Eric Anholt February 17, 2003 In progress In progress In progress Not done vtophys()
exca Warner Losh December 9, 2002 Done Not done Not done Not done  
fb     Not done Not done Not done Not done vtophys()
firewire Hidetoshi Shimokawa April 17, 2003 Done Not done Not done Done vtophys()
hea     Not done Not done Not done Not done vtophys()
hfa     Not done Not done Not done Not done vtophys()
hifn Sam Leffler December 9, 2002 Done Not done Not done Not done  
meteor     Not done Not done Not done Not done vtophys()
musycc     Not done Not done Not done Not done vtophys(). Please contact Poul-Henning Kamp for info/hardware.
pcm Olivier Houchard February 20, 2003 Done Done Not done Not done  
ubsec Sam Leffler December 9, 2002 Done Not done Not done Not done vtophys() is used in debugging printf
usb John-Mark Gurney July 24, 2003 Done Not done Not done Not done a!=p should be clean, but requires further testing
wds   December 9, 2002 Done Not done Not done Not done  

Documentation Status

Task Responsible Last updated Status Notes
manpages for the busdma API Hiten Pandya January 15, 2003 Done  

home   |   contact   |   legal   |   © 1995-2003 The FreeBSD Project. All rights reserved.
Last modified: 2003/07/30 17:38:00