summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2013-10-17 15:14:58 +0000
committerae <ae@FreeBSD.org>2013-10-17 15:14:58 +0000
commit2a36c1745bb5c396e5e5d8f8afa1a5234a17b16a (patch)
treea0daa1655a0c1e4fa10b089c707674a65fa7fac3 /sys/net
parenta947356465b1c56e5c88f87117b7f99cd39cbd2c (diff)
downloadFreeBSD-src-2a36c1745bb5c396e5e5d8f8afa1a5234a17b16a.zip
FreeBSD-src-2a36c1745bb5c396e5e5d8f8afa1a5234a17b16a.tar.gz
Use the same actor key for media types of the same speed.
PR: 176097 MFC after: 2 weeks
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/ieee8023ad_lacp.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 014140b..8dbadd4 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -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 */
OpenPOWER on IntegriCloud