diff options
author | yongari <yongari@FreeBSD.org> | 2010-02-20 23:21:06 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-02-20 23:21:06 +0000 |
commit | bd54d0edd70c92645e019f14c299149217d2a60f (patch) | |
tree | 61c01814ded9dff03c62c1ddea125dc4f329ce11 | |
parent | 0bad3ad1891d1a6bf1269196733eae4e5167b43a (diff) | |
download | FreeBSD-src-bd54d0edd70c92645e019f14c299149217d2a60f.zip FreeBSD-src-bd54d0edd70c92645e019f14c299149217d2a60f.tar.gz |
Add TSO support on VLAN. Controller requires VLAN hardware tagging
to make TSO work on VLAN. So if VLAN hardware tagging is disabled
explicitly clear TSO on VLAN. While I'm here remove duplicated
VLAN_CAPABILITIES call.
-rw-r--r-- | sys/dev/bge/if_bge.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 1eddbe0..3768852 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2816,7 +2816,7 @@ bge_attach(device_t dev) IFCAP_VLAN_MTU; if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; @@ -4526,9 +4526,6 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_hwassist |= BGE_CSUM_FEATURES; else ifp->if_hwassist &= ~BGE_CSUM_FEATURES; -#ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); -#endif } if ((mask & IFCAP_TSO4) != 0 && @@ -4546,16 +4543,21 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) bge_init(sc); } - if (mask & IFCAP_VLAN_HWTAGGING) { + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; BGE_LOCK(sc); bge_setvlan(sc); BGE_UNLOCK(sc); + } #ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); + VLAN_CAPABILITIES(ifp); #endif - } - break; default: error = ether_ioctl(ifp, command, data); |