Tech Support > Microsoft Windows > Drivers > sub-optimal performance through CardBus controllers on Windows
sub-optimal performance through CardBus controllers on Windows
Posted by Larry Cawley on July 1st, 2003


Problem Statement
- The Windows XP and 2000 driver in the OS for CardBus controllers are not
programmed for optimal throughput or performance.

Observations
- We have a Network adapter that runs roughly the same speeds as a Fast
Ethernet NIC.
- We can sustain data rates in the Tx and Rx directions (simultaneously) of
roughly 80Mbps through the NIC and Ndis driver across PCI.
- When running through a Cardbus controller programmed by Windows (with the
Windows provided Cardbus controller drivers) we see Rx rates of
approximately 78 Mbps. Tx rates top out at roughly 38 Mbps.
- We have noticed that the Cardbus bridge is NOT programmed for optimal
performance, even though the PCI configuration space shows settings that the
CardBus controller driver seems to be ignoring. For example, burst read and
write were set in the PCI config space for the card (MBURSTDN and MBURSTUP)
but the CardBus controller is NOT programmed to burst by the Windows OS
CardBus controller driver.
- When we manually change the cardbus controller to enable bursting, the Tx
performance improves dramatically.


Questions.
1. Can the Network card do anything to influence the Windows Cardbus
controller driver to enable Burst read and write ?
2. Are there other settings the Network card can use to ensure the Cardbus
controller is set for optimal performance?
3. The Fast Ethernet NICs must have run into this same problem already. We
see that that off the shelf Fast Ethernet NICs also are not running anywhere
near optimal performance / throughput. We see simliar rates for Tx and Rx
on with Fast Ethernet Cardbus NICs. We can program the CardBus controller
maually to dramtically improve the performance but we still do not see what
we would expect (90+ Mbps in both directions).

Below are some detailed notes about our investigation and characterization
of the problem.


We are doing performance characterization on our Cardbus NIC, which has a
PHY throughput roughly equivalent to a Fast Ethernet NIC (approximately 100
Mbps simultaneously for Tx and Rx). But, we are seeing some performance
issues, while transferring data across the Cardbus interface. We have not
been able to get the Cardbus interface, on any laptop to transmit data at
rates higher than 37 Mbps and receive data across the Cardbus interface at
rates higher than 78 Mbps. Also, there are some laptops where the upstream
througput is as low as 3 Mbps and the downstream throughput only 7 Mbps. The
throughput seems to vary with the part no. of the Cardbus Controller, being
used in the laptop. Following is a list of observations that we made while
running the tests, with each laptop:
1. Sony Vaio Laptop running Win2k with RICOH 5c475 II Cardbus controller:
This laptop showed a throughput of 37 Mbps upstream and 78 Mbps downstream,
when we transfered data at roughly 100 Mbps at the PHY layer.
2. Dell Latitude laptop running WinXP with the TI PCI-1420 Cardbus
controller: This laptop showed a throughput of 37 Mbps both upstream and
downstream, when we transfered data at roughly 100 Mbps at the PHY layer.
3. IBM Thinkpad running WinXP with the TI PCI-1510 Cardbus controller: This
laptop showed a throughput of just 3 Mbps upstream and 7 Mbps downstream,
when we transfered data at roughly 100 Mbps at the PHY layer. When we
monitored the Cardbus transactions on a logic analyzer, we saw that although
the controller was allowing DMA bursts, it was issueing a lot of retries, to
the device.
4. If we replace the NIC with an out of the box Fast Ethernet NIC, we see
strikingly similar numbers in all cases.
All the above setups are running the standard Cardbus controller drivers
which came with the Operating System and we are running standardout of the
box NDIS Miniport drivers, to drive our NIC. So, the question is, how can we
get the Cardbus controller drivers on each platform and OS, to configure the
controller correctly, to allow maximum throughput across the Cardbus
interface ?

Programming the TI Cardbus controller manually
Since, the datasheets for the RICOH controllers, are not available online,
we looked at the Cardbus configuration registers, of only the TI
controllers.
Following was the default configuration on both the TI controllers on the
WinXP laptops:
1. The MBURSTDN and MBURSTUP bits (bits 15 and 14) were set in the System
Control Register (PCI Config space offset 80h), for bursts, both for Read
and Write transactions.
2. The POSTEN bit (bit 10) in the Bridge Control Register was set, enabling
write posting, which is recommended for good performance while bursting.
3. The Latency Timer settings are different on the controllers:
TI Controller Latency Timer Cardbus Latency (Secondary Bus Latency)
PCI-1420 20 20
PCI-1510 40 B0
4. The KEEPCLK bit (bit 1) in the System Control Register was cleared, which
implies that usage of the CLKRUN protocol was enabled, although we implement
the CCLKRUN# pin as a NO-CONNECT on our device, since it was decided not to
support this protocol. I tried running the tests, after toggling this bit,
so that the Cardbus clock is always kept active and is not throttled using
the CLKRUN# protocol, but that did not improve the performance, in any way.
5. The PCIRETRY and CBRETRY bits (bits 7 and 6), in the Retry Status
Register, are set, indicating that PCI and Cardbus retry timeout is enabled.
Following was the configuration of our device:
MIN_GNT = 18
MAX_LAT = FF
Latency Timer = F8

While running WinXP, we got a similar low throughput of 19 Mbps.
Subsequently, looking at the Cardbus Controller registers and we found that
again the MRBURSTUP bit was not set by the XP CB controller driver. So,
after setting this bit, manually, I was able to acheive an upstream
throughput of 51 Mbps.

This strongly suggests that the Microsoft WinXP Cardbus controller drivers
are not optimized setting the Controller hardware for optimum performance
basedon the parameters of the CardBus cards plugged into the bridge. We are
wondering if other NIC vendors would have run into the same issues on
Windows and got some fixes from Microsoft.
Following, we were able to achieve a new performance high on our Cardbus NIC
using the Dell Latitude laptop with the TI PCI-1420 Cardbus controller. We
were able to acheive 46 Mbps upstream and 79 Mbps downstream, while trying
to transmit packets at roughly 100 Mbps. So, we are almost at par with the
Cardbus Fast Ethernet performance, seen on the various laptops. The
differences this time are:
1. This NIC is programmed with a new EEPROM image which programs the PCI
MIN_GNT, MAX_LAT and the latency timer to values optimized for the maximum
throughput.

2. Before we started this test, we made sure that the PCI latency timer
values on all the intermediate PCI-PCI bridges and PCI-Cardbus controller,
was set to the max possible value of 0xF8 (since I found that the latency
timer values on some of the intermediate bridges was set to zero, by
default, which might have inhibited the Cardbus performance).




---
Larry Cawley
Airgo Networks, Inc.
636 458 1462
<mailto:LarryCawley@AirgoNetworks.com>



Similar Posts