From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 20:58:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F74106564A; Wed, 17 Dec 2008 20:58:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36D08FC17; Wed, 17 Dec 2008 20:58:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBHKwAbL015133; Wed, 17 Dec 2008 20:58:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBHKwAri015131; Wed, 17 Dec 2008 20:58:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812172058.mBHKwAri015131@svn.freebsd.org> From: Andrew Thompson Date: Wed, 17 Dec 2008 20:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186254 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 20:58:11 -0000 Author: thompsa Date: Wed Dec 17 20:58:10 2008 New Revision: 186254 URL: http://svn.freebsd.org/changeset/base/186254 Log: Update the interface baudrate taking into account the max speed for the different aggregation protocols. Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Dec 17 20:24:34 2008 (r186253) +++ head/sys/net/ieee8023ad_lacp.c Wed Dec 17 20:58:10 2008 (r186254) @@ -901,6 +901,7 @@ lacp_aggregator_bandwidth(struct lacp_ag 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 lac #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) { Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Dec 17 20:24:34 2008 (r186253) +++ head/sys/net/if_lagg.c Wed Dec 17 20:58:10 2008 (r186254) @@ -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