Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Nov 2013 10:38:37 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r257960 - stable/8/sys/net
Message-ID:  <201311111038.rABAcbnM001359@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Nov 11 10:38:37 2013
New Revision: 257960
URL: http://svnweb.freebsd.org/changeset/base/257960

Log:
  MFC r256689 (modified):
    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

Modified:
  stable/8/sys/net/ieee8023ad_lacp.c
  stable/8/sys/net/if_media.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/net/   (props changed)

Modified: stable/8/sys/net/ieee8023ad_lacp.c
==============================================================================
--- stable/8/sys/net/ieee8023ad_lacp.c	Mon Nov 11 10:09:52 2013	(r257959)
+++ stable/8/sys/net/ieee8023ad_lacp.c	Mon Nov 11 10:38:37 2013	(r257960)
@@ -1028,8 +1028,40 @@ 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;
+		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/8/sys/net/if_media.h
==============================================================================
--- stable/8/sys/net/if_media.h	Mon Nov 11 10:09:52 2013	(r257959)
+++ stable/8/sys/net/if_media.h	Mon Nov 11 10:38:37 2013	(r257960)
@@ -150,7 +150,10 @@ uint64_t	ifmedia_baudrate(int);
 #define	IFM_10G_LRM	24		/* 10GBase-LRM 850nm Multi-mode */
 #define	IFM_UNKNOWN	25		/* media types not defined yet */
 #define	IFM_10G_T	26		/* 10GBase-T - RJ45 */
-
+/*
+ * 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) */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311111038.rABAcbnM001359>