Date: Mon, 21 May 2001 16:32:31 -0700 From: Steve Madsen <madsen@akamba.com> To: "'freebsd-smp@freebsd.org'" <freebsd-smp@freebsd.org> Subject: Supporting old-style SMP in drivers Message-ID: <B5F5C0FDF648D311A9D700508B322DFD3C46A8@mailhost.akamba.com>
next in thread | raw e-mail | index | archive | help
I apologize in advance for the questions, as I know that most discussion here relates to the new implementation. I've done several searches and can't seem to find information on the SMP implementation in 3.x and 4.x. I'm trying to hunt down a bug in a network driver that only occurs when running on an SMP kernel (4.2, to be exact). Is there a site or document somewhere that explains the SMP implementation in 3.x and 4.x? Is only one CPU ever permitted in the kernel, even when an interrupt fires? If yes, when will that interrupt be serviced? Are there any locking primitives that can or should be used for synchronization? The problem I'm seeing is that occasionally, the kernel will cease delivering interrupts to my handler. I can poke the NIC and generate an interrupt, but the handler is never invoked. I can examine the PCI registers from a user-space application and see that the interrupt was generated (and is not masked by the card). It just never gets handled and cleared. I did see some vaguely similar problems in the bug database. Here is the output of "mptable -dmesg -verbose": ============================================================================ === MPTable, version 2.0.15 looking for EBDA pointer @ 0x040e, found, searching EBDA @ 0x0009f800 searching CMOS 'top of mem' @ 0x0009f400 (637K) searching default 'top of mem' @ 0x0009fc00 (639K) searching BIOS @ 0x000f0000 MP FPS found in BIOS @ physical addr: 0x000f72d0 ---------------------------------------------------------------------------- --- MP Floating Pointer Structure: location: BIOS physical address: 0x000f72d0 signature: '_MP_' length: 16 bytes version: 1.1 checksum: 0x41 mode: Virtual Wire ---------------------------------------------------------------------------- --- MP Config Table Header: physical address: 0x0009f960 signature: 'PCMP' base table length: 252 version: 1.1 checksum: 0x7c OEM ID: 'INTEL ' Product ID: 'N440BX ' OEM table pointer: 0x00000000 OEM table size: 0 entry count: 23 local APIC address: 0xfee00000 extended table length: 0 extended table checksum: 0 ---------------------------------------------------------------------------- --- MP Config Base Table Entries: -- Processors: APIC ID Version State Family Model Step Flags 1 0x11 BSP, usable 6 7 2 0x387fbff 0 0x11 AP, usable 6 7 2 0x387fbff -- Bus: Bus ID Type 0 PCI 1 ISA -- I/O APICs: APIC ID Version State Address 2 0x11 usable 0xfec00000 -- I/O Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN# ExtINT active-hi edge 1 0 2 0 INT active-hi edge 1 1 2 1 INT active-hi edge 1 0 2 2 INT active-hi edge 1 3 2 3 INT active-hi edge 1 4 2 4 INT active-hi level 1 5 2 5 INT active-hi edge 1 6 2 6 INT active-hi edge 1 7 2 7 INT active-hi edge 1 8 2 8 INT active-hi level 1 9 2 9 INT active-hi level 1 10 2 10 INT active-hi level 1 11 2 11 INT active-hi edge 1 12 2 12 INT active-hi edge 1 13 2 13 INT active-hi edge 1 14 2 14 INT active-hi edge 1 15 2 15 -- Local Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN# ExtINT active-hi edge 1 0 255 0 NMI active-hi edge 0 0:A 255 1 ---------------------------------------------------------------------------- --- # SMP kernel config file options: # Required: options SMP # Symmetric MultiProcessor Kernel options APIC_IO # Symmetric (APIC) I/O # Optional (built-in defaults will work in most cases): #options NCPU=2 # number of CPUs #options NBUS=2 # number of busses #options NAPIC=1 # number of IO APICs #options NINTR=24 # number of INTs ---------------------------------------------------------------------------- --- dmesg output: Copyright (c) 1992-2000 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.2-RELEASE #34: Mon May 21 16:15:43 PDT 2001 madsen@s18.test.akamba.com:/usr/src/sys/compile/AKAMBA-SMP Timecounter "i8254" frequency 1193182 Hz CPU: Pentium III/Pentium III Xeon/Celeron (498.75-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x672 Stepping = 2 Features=0x387fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA, CMOV,PAT,PSE36,PN,MMX,FXSR,SSE> real memory = 536805376 (524224K bytes) avail memory = 515620864 (503536K bytes) Programming 24 pins in IOAPIC #0 IOAPIC #0 intpin 2 -> irq 0 FreeBSD/SMP: Multiprocessor motherboard cpu0 (BSP): apic id: 1, version: 0x00040011, at 0xfee00000 cpu1 (AP): apic id: 0, version: 0x00040011, at 0xfee00000 io0 (APIC): apic id: 2, version: 0x00170011, at 0xfec00000 Preloaded elf kernel "kernel" at 0xc0378000. Pentium Pro MTRR support enabled md0: Malloc disk npx0: <math processor> on motherboard npx0: INT 16 interface pcib0: <Intel 82443BX host to PCI bridge (AGP disabled)> on motherboard pci0: <PCI bus> on pcib0 cb0: <Akamba Velobahn 10/100 Ethernet> mem 0xfa000000-0xfa0fffff irq 11 at device 11.0 on pci0 cb0: Ethernet address 00:30:76:01:10:8c cb0: driver is using old-style compatability shims ncr0: <ncr 53c875 fast20 wide scsi> port 0x1400-0x14ff mem 0xfa200000-0xfa200fff,0xfa203000-0xfa2030ff irq 11 at device 13.0 on pci0 ncr1: <ncr 53c875 fast20 wide scsi> port 0x1800-0x18ff mem 0xfa201000-0xfa201fff,0xfa203400-0xfa2034ff irq 10 at device 13.1 on pci0 fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0x1060-0x107f mem 0xfa100000-0xfa1fffff,0xfa204000-0xfa204fff irq 5 at device 15.0 on pci0 fxp0: Ethernet address 00:a0:c9:ac:fe:94 isab0: <Intel 82371AB PCI to ISA bridge> at device 18.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <Intel PIIX4 ATA33 controller> port 0x1050-0x105f at device 18.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x1080-0x109f irq 10 at device 18.2 on pci0 usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered Timecounter "PIIX" frequency 3579545 Hz chip1: <Intel 82371AB Power management controller> port 0x1040-0x104f at device 18.3 on pci0 pci0: <Cirrus Logic GD5480 SVGA controller> at 20.0 fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x100> sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 16550A, console sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0 ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/8 bytes threshold plip0: <PLIP network interface> on ppbus0 lpt0: <Printer> on ppbus0 lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 APIC_IO: Testing 8254 interrupt delivery APIC_IO: routing 8254 via IOAPIC #0 intpin 2 cb0 XXX: driver didn't set ifq_maxlen SMP: AP CPU #1 Launched! ad0: 9641MB <IBM-DTTA-371010> [19590/16/63] at ata0-master UDMA33 Mounting root from ufs:/dev/ad0s1a cb0: not multicast capable, IPv6 not enabled ============================================================================ === -- Steve Madsen <madsen@akamba.com> Akamba Corporation, http://www.akamba.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B5F5C0FDF648D311A9D700508B322DFD3C46A8>