summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-03-23 22:22:26 +0000
committeryongari <yongari@FreeBSD.org>2010-03-23 22:22:26 +0000
commitfcb41657aa04180c3de1aa5c4a3de82c6ac5fd6f (patch)
treeac6e75288ed489e9dce8d77338f6d2653c4a1148 /sys/dev
parent76e2e793acd5b957ec63fa0d272e9e2c5dfe11ea (diff)
downloadFreeBSD-src-fcb41657aa04180c3de1aa5c4a3de82c6ac5fd6f.zip
FreeBSD-src-fcb41657aa04180c3de1aa5c4a3de82c6ac5fd6f.tar.gz
MFC r204378:
Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ale/if_ale.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c
index 305eda4..76f1b74 100644
--- a/sys/dev/ale/if_ale.c
+++ b/sys/dev/ale/if_ale.c
@@ -78,9 +78,6 @@ __FBSDID("$FreeBSD$");
/* For more information about Tx checksum offload issues see ale_encap(). */
#define ALE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP)
-#ifndef IFCAP_VLAN_HWTSO
-#define IFCAP_VLAN_HWTSO 0
-#endif
MODULE_DEPEND(ale, pci, 1, 1, 1);
MODULE_DEPEND(ale, ether, 1, 1, 1);
@@ -617,8 +614,8 @@ ale_attach(device_t dev)
ether_ifattach(ifp, sc->ale_eaddr);
/* VLAN capability setup. */
- ifp->if_capabilities |= IFCAP_VLAN_MTU;
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
+ ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING |
+ IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO;
ifp->if_capenable = ifp->if_capabilities;
/*
* Even though controllers supported by ale(3) have Rx checksum
@@ -2003,29 +2000,19 @@ ale_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if ((mask & IFCAP_WOL_MAGIC) != 0 &&
(ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
ifp->if_capenable ^= IFCAP_WOL_MAGIC;
-
- if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
- (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
- ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
- ale_rxvlan(sc);
- }
if ((mask & IFCAP_VLAN_HWCSUM) != 0 &&
(ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0)
ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
(ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
- /*
- * VLAN hardware tagging is required to do checksum
- * offload or TSO on VLAN interface. Checksum offload
- * on VLAN interface also requires hardware checksum
- * offload of parent interface.
- */
- if ((ifp->if_capenable & IFCAP_TXCSUM) == 0)
- ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM;
- if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
- ifp->if_capenable &=
- ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM);
+ 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;
+ ale_rxvlan(sc);
+ }
ALE_UNLOCK(sc);
VLAN_CAPABILITIES(ifp);
break;
OpenPOWER on IntegriCloud