summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-12-17 20:58:10 +0000
committerthompsa <thompsa@FreeBSD.org>2008-12-17 20:58:10 +0000
commitd592108ca6acf64f5a653ef0cbf3be53e7540ce5 (patch)
treea1f3bc4828cba42058ff79b6b0b6141018276aae /sys/net/if_lagg.c
parentb56852858e5fc4c068e7ab39dfb3866bf8dc71f2 (diff)
downloadFreeBSD-src-d592108ca6acf64f5a653ef0cbf3be53e7540ce5.zip
FreeBSD-src-d592108ca6acf64f5a653ef0cbf3be53e7540ce5.tar.gz
Update the interface baudrate taking into account the max speed for the
different aggregation protocols.
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 06543bb..f3c4143 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1211,6 +1211,7 @@ lagg_linkstate(struct lagg_softc *sc)
{
struct lagg_port *lp;
int new_link = LINK_STATE_DOWN;
+ uint64_t speed = 0;
/* Our link is considered up if at least one of our ports is active */
SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
@@ -1220,6 +1221,24 @@ lagg_linkstate(struct lagg_softc *sc)
}
}
if_link_state_change(sc->sc_ifp, new_link);
+
+ /* Update if_baudrate to reflect the max possible speed */
+ switch (sc->sc_proto) {
+ case LAGG_PROTO_FAILOVER:
+ sc->sc_ifp->if_baudrate =
+ sc->sc_primary->lp_ifp->if_baudrate;
+ break;
+ case LAGG_PROTO_ROUNDROBIN:
+ case LAGG_PROTO_LOADBALANCE:
+ case LAGG_PROTO_ETHERCHANNEL:
+ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
+ speed += lp->lp_ifp->if_baudrate;
+ sc->sc_ifp->if_baudrate = speed;
+ break;
+ case LAGG_PROTO_LACP:
+ /* LACP updates if_baudrate itself */
+ break;
+ }
}
static void
OpenPOWER on IntegriCloud