summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-02-20 22:47:20 +0000
committeryongari <yongari@FreeBSD.org>2010-02-20 22:47:20 +0000
commit453676a091f9cfbbcbb1bae93154f6b75893d5c0 (patch)
treec4b9d0e694a7a33948e8a9870ca49973869188d8 /sys/net/if_vlan.c
parent7772630fb3afe62bfc6b65e13accda35f5633446 (diff)
downloadFreeBSD-src-453676a091f9cfbbcbb1bae93154f6b75893d5c0.zip
FreeBSD-src-453676a091f9cfbbcbb1bae93154f6b75893d5c0.tar.gz
Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO
from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to TSO over VLAN without VLAN hardware tagging. Driver changes and userland support will follow. Reviewed by: thompsa
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 4b16a9c..959fc5e 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1322,11 +1322,26 @@ vlan_capabilities(struct ifvlan *ifv)
if (p->if_capenable & IFCAP_VLAN_HWCSUM &&
p->if_capenable & IFCAP_VLAN_HWTAGGING) {
ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM;
- ifp->if_hwassist = p->if_hwassist;
+ ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP |
+ CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT);
} else {
ifp->if_capenable = 0;
ifp->if_hwassist = 0;
}
+ /*
+ * If the parent interface can do TSO on VLANs then
+ * propagate the hardware-assisted flag. TSO on VLANs
+ * does not necessarily require hardware VLAN tagging.
+ */
+ if (p->if_capabilities & IFCAP_VLAN_HWTSO)
+ ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO;
+ if (p->if_capenable & IFCAP_VLAN_HWTSO) {
+ ifp->if_capenable |= p->if_capenable & IFCAP_TSO;
+ ifp->if_hwassist |= p->if_hwassist & CSUM_TSO;
+ } else {
+ ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO);
+ ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO);
+ }
}
static void
OpenPOWER on IntegriCloud