e1000g races in PHY accesses
The e1000g driver has a few races in the way it accesses it PHY registers. In particular, multiple kstat readers, and other things, will hit the registers nearly simultaneously. Unfortunately, these registers are really backed by a slow serial MII bus, and overlapping reads and writes to the registers can cause corruption on the bus and incorrect responses.
This manifests as strange values coming back from the PHY.
We've seen this to be most pronounced when operating at 100 Mbps, which makes perfect sense given that the MII bus for 100 Mbps is much slower.
A lock to protect the PHY from simultaneous accesses by different threads on the host is needed. (Note that this has only a little to do with the hardware semaphore used to guard against internal chip accesses to the MII bus colliding with driver accesses. In particularly the hardware semaphore can't guard against multiple threads on the host.)
igb likely suffers from the same problem, but I've not had time to research that yet. This bug is exclusive to the e1000g driver, and the fix is contained in the e1000g driver without affecting the common e1000api code.