SnabbCo/snabbswitch — pull request #52 by sleinen (2013-04-07 13:01:08+00:00)
Title: (intel10g): Restore adapter configuration state after selftest.

Before putting the interface into loopback mode for a selftest, save the parts of the configuration that we modify, and restore them after the test.

How this is done: We simply record the full AUTOC (link autoconfiguration) and HLREG0 (MAC core control 0) register contents and restore them to their original values in the end.

This notably reverts to the previous loopback mode setting (typically "no loopback"), and makes it easy to put a port into normal operation after a selftest. Note that the Linux ixgbe driver doesn't clear loopback mode when it brings up an interface.