RE: bonding with 3c59x driver
From: David Laight <hidden>
Date: 2012-02-14 10:45:12
Well I am still curious why the 3c59x driver has such slow polling when other drivers I have been testing are able to report almost instantly when I remove a network cable. Could it be that other network chips generate an interrupt on cable removal and the 3com chips do not?
Not sure about those specific cards, but detecting the link state might require software bit-banging of an MII (or similar) interface. Since this needs delays between all the edges it can end up spinning the cpu for a noticable time, especially if the resolution (and minimim delay) of the delay() function used is significantly longer than the delays actually required - which might only be a few 100ns. Using a cpu spin for the delays is also slightly problematical because the writes might get 'posted' and delayed further - so the writes have to be forced out to the device itself (eg by a readback) prior to the delay() being requested. If the driver is polling the link status it might be valid to do one bit-bang transition on each timer interrupt. This would separate the edges without spinning the cpu - provided there is a fast method for being called on every timer tick. Another scheme I have used is to write each value to the bit-bang register multiple times - using the maximum speed of the IO writes to generate the required delays. David