Subject: Re: Should Alpha PCI code manage latency timers?
To: None <port-alpha@netbsd.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: port-alpha
Date: 01/27/2005 16:12:25
I've been running some experiments, and have a result that doesn't
make sense, according to my feeble understanding of PCI latency timers.

range is 0 - 0xff  yes?

Latency Timer - max amount of time the controller gets the bus
Minimum Grant - minimum amount of time controller needs the bus
Maximum Latency - how long the controller can go without access to the bus

Right?

Setting Latency Timer to a smaller number (0 seems to be an exception)
means the controller gets interrupted more often, and thus perhaps
achieves lower throughput, but less likely to be hogging the
bus when another controller needs it.

Setting Latency Timer to a larger number means the controller
gets interrupted less often, and thus perhaps higher throughput,
but is more likely to be hogging the bus when another controller
needs it.

Right?

However, if I set my pciide controller Latency Timer to
0x40, 0x80 or 0xff (which gets truncated to 0xf8),
then my Ethernet card is happy.

If I set pciide controller Latency Timer to 0x08,
my Ethernet card is unhappy, (abnormal interrupt: transmit underflow)
just like the original case with Latency Timer of 0.

This result seems backwards.  What am I missing?

000:05:0: Q Logic ISP1020 (SCSI mass storage, revision 0x05)
000:06:0: Digital Equipment DECchip 21040 ("Tulip") Ethernet (ethernet network, revision 0x23)
000:07:0: Digital Equipment DECchip 21040 ("Tulip") Ethernet (ethernet network, revision 0x24)
000:08:0: Intel 82378ZB System I/O (SIO) (miscellaneous prehistoric, revision 0x43)
000:09:0: Digital Equipment DECchip 21152 PCI-PCI Bridge (PCI bridge, revision 0x02)
000:11:0: CMD Technology PCI0646 (IDE mass storage, interface 0x80, revision 0x01)
pci0 device 5
    Latency Timer: 0x40
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci0 device 6
    Latency Timer: 0x00
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci0 device 7
    Latency Timer: 0x00
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci0 device 8
    Latency Timer: 0x00
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci0 device 9
    Latency Timer: 0xff
pci0 device 11
    Latency Timer: 0x08
    Maximum Latency: 0x04
    Minimum Grant: 0x02
002:05:0: Q Logic ISP1020 (SCSI mass storage, revision 0x05)
002:06:0: HiNT HB1 PCI-PCI Bridge (PCI bridge, revision 0x11)
pci1 device 5
    Latency Timer: 0x40
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci1 device 6
    Latency Timer: 0xf8
003:08:0: NEC uPD72871 IEEE 1394 OHCI Host Controller (Firewire serial bus, interface 0x10, revision 0x01)
003:09:0: NEC USB Host Controller (USB serial bus, interface 0x10, revision 0x41)
003:09:1: NEC USB Host Controller (USB serial bus, interface 0x10, revision 0x41)
003:09:2: NEC USB Host Controller (USB serial bus, interface 0x20, revision 0x02)
pci2 device 8
    Latency Timer: 0x00
    Maximum Latency: 0x00
    Minimum Grant: 0x00
pci2 device 9
    Latency Timer: 0x08
    Maximum Latency: 0x2a
    Minimum Grant: 0x01