Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PCIX Command Rgtr initialization



I am developing an IOKit device driver for a PCI-X ethernet controller
running under OSX 10.3 on a G5 platform. While investigating its DMA
performance, I noticed that the device's PCI-X Command Rgtr (Capability
ID = 0x07) was set to 0x0022, indicating:

* Relaxed Ordering is enabled
* Maximum Memory Read Byte Count (MMRBC) is set to 512 bytes
* Maximum Outstanding Split Transactions is set to 3

Seeing that the MMRBC was set to the smallest value of 512 bytes, and
suspecting that the short Memory Read Bursts were impacting performance,
I manually set it to the highest allowed value of 4K bytes using the
Reggie tool (part of CHUD). I realize that this was potentially very
dangerous, since my device might now be using resources that the OS had
actually allocated to some other device (please God - not the disk
controller!), but I wanted to test the performance impact.

It was dramatic. Packet transmission (memory read) throughput increased
by about 50% when using 16 KB jumbo frames. Apparently, my device is now
more efficent due to longer Read bursts. Furthermore, I see no evidence
of data corruption over that ethernet interface, or elsewhere in my system.

However, I don't feel safe allowing my driver to modify the PCI-X Command
Rgtr. As I understand it (and I could be wrong), this rgtr is supposed to
be setup by the O/S when it allocates its PCI bridge buffers and other
system resources during initialization, based upon which PCI devices are
found. If I remember correctly, the PCI-X Status Rgtr of each device
contains hardwired values indicating the maximum amount of such system
resources that the device can use.

My device's PCI-X Status Rgtr was set to 0x11630720, indicating:

* Designed Maximum Memory Read Byte Count is 4K bytes
* Designed Maximum Outstanding Split Transactions is set to 3
* Designed Maximum Cumulative Read Size is set to 16K bytes

Apparently, the O/S allocated all 3 of the split transactions that my
device "requested", but ignored the device's indication that it can read
4K bytes at a time.

Can anyone shed any light on why my device may have been configured for
a max read burst of just 512 bytes, and whether it is safe for my driver
to override that value?

My device is all alone on the 133 MHz PXI-X bus (slot 4). The 100 MHz bus
has a dual port ethernet card in slot 2; slot 3 is empty.

I looked through the Darwin source code for any references to the PCI-X
Command and Status Rgtrs. Interestingly, the definitions for these
rgtrs were just added into IOPCIDevice.h for 10.3, but I couldn't find
any code that was actually referencing them.

Thanks in advance,

Jim Hunter
Small Tree Communications
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.