- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
was committed in r295133 (MFCed to stable/10 in r295287), CSUM_TSO gets
always disabled by em(4) on the first invocation of em_init_locked() as
at that point no link is established, yet. In turn, this causes CSUM_TSO
also to be off when em(4) is used as a parent device for vlan(4), i. e.
besides IFCAP_TSO4, IFCAP_VLAN_HWTSO effectively doesn't work either.
In head an attempt to fix this was made with r308345, but that revision
had several problems on its own. One of which was that r308345 caused
IFCAP_TSO4 to also be cleared from both the interface capability and
capability enable bits. Thus, once a link switched from gigabit to a
lower speed, TSO no longer could be enabled, even not via ifconfig(8).
So this change moves the aforementioned WAR to em_update_link_status()
like r308345 did, but only alters the hardware assist bits accordingly,
leaving IFCAP_TSO4 flags alone.
Still, this isn't the only problem r308345 had. Another one is that there
just is no way to atomically flush TSO-using descriptors already queued
at the point in time a link speed switch to below GbE occurs. Thus, such
in-flight descriptors still may hang the MAC. Moreover, at least currently
there also is no way of triggering a reconfiguration of vlan(4) when the
state of IFCAP_VLAN_HWTSO support changes at runtime, causing vlan(4) to
continue employing TSO. Last but not least, testing shows that - despite
all the WARs for TSO-related silicon bugs in em(4) - at least 82579 still
may hang at gigabit speed with IFCAP_TSO4 enabled. Therefore, this change
further removes IFCAP_TSO4 and IFCAP_VLAN_HWTSO from interface capability
enable bits as set by em(4). While at it, the use of CSUM_TCP is replaced
with CSUM_IP_TSO as em(4) only implements support for IFCAP_TSO4 but not
IFCAP_TSO6 (although in principle available with a subset of the supported
MACs).
At the bottom line, this change allows IFCAP_TSO4 and IFCAP_VLAN_HWTSO to
be used again with em(4), but these hardware offloading capabilities now
need to be explicitly enabled via ifconfig(8). Beware that it's only
considered safe to do so (and also only may work) in environments where
the link speed is not to be expected to change from GbE. Moreover, em(4)
appears to still be missing some more TSO workarounds for at least some
models, specifically the 82579 (I could not find an errata sheet and
"specification update" respectively for these latter, though, and the
generic ICH8 one doesn't list any TSO related bugs).
- Let igb_tso_setup() handle EtherType protocols that are unsupported or
for which support hasn't been compiled in gracefully instead of calling
panic(9).
- Make em_allocate_{legacy,msix}() and lem_allocate_irq() match their
prototypes WRT static.
This is a direct commit to stable/10 as corresponding code is no longer
present in head.
Approved by: re (gjb, kib)
git-svn-id: svn://svn.freebsd.org/base/stable/10@323293
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f