Update the interface baudrate taking into account the max speed for the

different aggregation protocols.
This commit is contained in:
thompsa 2008-12-17 20:58:10 +00:00
parent b56852858e
commit d592108ca6
2 changed files with 21 additions and 0 deletions

View File

@ -901,6 +901,7 @@ lacp_aggregator_bandwidth(struct lacp_aggregator *la)
static void
lacp_select_active_aggregator(struct lacp_softc *lsc)
{
struct lagg_softc *sc = lsc->lsc_softc;
struct lacp_aggregator *la;
struct lacp_aggregator *best_la = NULL;
uint64_t best_speed = 0;
@ -956,6 +957,7 @@ lacp_select_active_aggregator(struct lacp_softc *lsc)
#endif /* defined(LACP_DEBUG) */
if (lsc->lsc_active_aggregator != best_la) {
sc->sc_ifp->if_baudrate = best_speed;
lsc->lsc_active_aggregator = best_la;
lacp_update_portmap(lsc);
if (best_la) {

View File

@ -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