diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2014-05-06 02:44:01 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2014-05-06 02:44:01 +0000 |
commit | 1f951a5c9bcb6797397deb96e9da7568e440ceec (patch) | |
tree | 1eab7792c216a81529bc1d569a3e1e4290cc922e /sys | |
parent | 3942b0b24cecb754b3f7c7259fd595d86a35a9b6 (diff) | |
download | FreeBSD-src-1f951a5c9bcb6797397deb96e9da7568e440ceec.zip FreeBSD-src-1f951a5c9bcb6797397deb96e9da7568e440ceec.tar.gz |
MFC: r264469, r264498
Lagg did not set the value of if_hw_tsomax, so when lagg
was stacked on top of network interfaces that set if_hw_tsomax,
tcp_output() would see the default value instead of the value
set by the network interface(s). This patch modifies lagg so that
it sets if_hw_tsomax to the minimum of the value(s) for the
underlying network interfaces.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_lagg.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index beae0b6..bf4d9d7 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include <netinet/in.h> +#include <netinet/ip.h> #endif #ifdef INET #include <netinet/in_systm.h> #include <netinet/if_ether.h> -#include <netinet/ip.h> #endif #ifdef INET6 @@ -448,6 +448,11 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; +#if defined(INET) || defined(INET6) + u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ +#else + u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ +#endif LAGG_WLOCK_ASSERT(sc); @@ -456,6 +461,10 @@ lagg_capabilities(struct lagg_softc *sc) cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; + /* Set to the minimum value of the lagg ports. */ + if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && + lp->lp_ifp->if_hw_tsomax > 0) + hw_tsomax = lp->lp_ifp->if_hw_tsomax; } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -463,10 +472,12 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || - sc->sc_ifp->if_hwassist != hwa) { + sc->sc_ifp->if_hwassist != hwa || + sc->sc_ifp->if_hw_tsomax != hw_tsomax) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; + sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) |