From owner-svn-src-all@FreeBSD.ORG Mon Nov 11 09:47:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6B1AAD44; Mon, 11 Nov 2013 09:47:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA9527C1; Mon, 11 Nov 2013 09:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAB9lqMi083957; Mon, 11 Nov 2013 09:47:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAB9lpXb083955; Mon, 11 Nov 2013 09:47:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201311110947.rAB9lpXb083955@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 11 Nov 2013 09:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257956 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 11 Nov 2013 09:47:52 -0000 Author: ae Date: Mon Nov 11 09:47:51 2013 New Revision: 257956 URL: http://svnweb.freebsd.org/changeset/base/257956 Log: MFC r256689: Use the same actor key for media types of the same speed. PR: 176097 MFC r256832: Add a note that lacp_compose_key() should be updated, when new media types will be added. Submitted by: melifaro Approved by: re (hrs) Modified: stable/10/sys/net/ieee8023ad_lacp.c stable/10/sys/net/if_media.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Mon Nov 11 09:47:33 2013 (r257955) +++ stable/10/sys/net/ieee8023ad_lacp.c Mon Nov 11 09:47:51 2013 (r257956) @@ -1089,8 +1089,45 @@ lacp_compose_key(struct lacp_port *lp) KASSERT(IFM_TYPE(media) == IFM_ETHER, ("invalid media type")); KASSERT((media & IFM_FDX) != 0, ("aggregating HDX interface")); - /* bit 0..4: IFM_SUBTYPE */ - key = subtype; + /* bit 0..4: IFM_SUBTYPE modulo speed */ + switch (subtype) { + case IFM_10_T: + case IFM_10_2: + case IFM_10_5: + case IFM_10_STP: + case IFM_10_FL: + key = IFM_10_T; + break; + case IFM_100_TX: + case IFM_100_FX: + case IFM_100_T4: + case IFM_100_VG: + case IFM_100_T2: + key = IFM_100_TX; + break; + case IFM_1000_SX: + case IFM_1000_LX: + case IFM_1000_CX: + case IFM_1000_T: + key = IFM_1000_SX; + break; + case IFM_10G_LR: + case IFM_10G_SR: + case IFM_10G_CX4: + case IFM_10G_TWINAX: + case IFM_10G_TWINAX_LONG: + case IFM_10G_LRM: + case IFM_10G_T: + key = IFM_10G_LR; + break; + case IFM_40G_CR4: + case IFM_40G_SR4: + case IFM_40G_LR4: + key = IFM_40G_CR4; + break; + default: + key = subtype; + } /* bit 5..14: (some bits of) if_index of lagg device */ key |= 0x7fe0 & ((sc->sc_ifp->if_index) << 5); /* bit 15: 0 */ Modified: stable/10/sys/net/if_media.h ============================================================================== --- stable/10/sys/net/if_media.h Mon Nov 11 09:47:33 2013 (r257955) +++ stable/10/sys/net/if_media.h Mon Nov 11 09:47:51 2013 (r257956) @@ -153,7 +153,10 @@ uint64_t ifmedia_baudrate(int); #define IFM_40G_CR4 27 /* 40GBase-CR4 */ #define IFM_40G_SR4 28 /* 40GBase-SR4 */ #define IFM_40G_LR4 29 /* 40GBase-LR4 */ - +/* + * Please update ieee8023ad_lacp.c:lacp_compose_key() + * after adding new Ethernet media types. + */ /* note 31 is the max! */ #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */