summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2014-09-22 08:27:27 +0000
committerhselasky <hselasky@FreeBSD.org>2014-09-22 08:27:27 +0000
commitbdacf9ba4dd91cc0515199d29fd6debec10cee6a (patch)
tree0022e54c289be9c8abb1f440ebe83025dce57741 /sys/net/if_vlan.c
parent724af6b5c3e043d8c23475fb6fdb6767be220dcb (diff)
downloadFreeBSD-src-bdacf9ba4dd91cc0515199d29fd6debec10cee6a.zip
FreeBSD-src-bdacf9ba4dd91cc0515199d29fd6debec10cee6a.tar.gz
Improve transmit sending offload, TSO, algorithm in general.
The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. Reviewed by: adrian, rmacklem Sponsored by: Mellanox Technologies MFC after: 1 week
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index c7a2d01..926afa0 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1536,6 +1536,7 @@ vlan_capabilities(struct ifvlan *ifv)
{
struct ifnet *p = PARENT(ifv);
struct ifnet *ifp = ifv->ifv_ifp;
+ struct ifnet_hw_tsomax hw_tsomax;
TRUNK_LOCK_ASSERT(TRUNK(ifv));
@@ -1562,8 +1563,9 @@ vlan_capabilities(struct ifvlan *ifv)
* propagate the hardware-assisted flag. TSO on VLANs
* does not necessarily require hardware VLAN tagging.
*/
- if (p->if_hw_tsomax > 0)
- ifp->if_hw_tsomax = p->if_hw_tsomax;
+ memset(&hw_tsomax, 0, sizeof(hw_tsomax));
+ if_hw_tsomax_common(p, &hw_tsomax);
+ if_hw_tsomax_update(ifp, &hw_tsomax);
if (p->if_capabilities & IFCAP_VLAN_HWTSO)
ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO;
if (p->if_capenable & IFCAP_VLAN_HWTSO) {
OpenPOWER on IntegriCloud