lacp on lagg interface: same speed, different media

Josef Pojsl jp at tns.cz
Tue Feb 12 21:51:48 UTC 2013


Hello list,

on a FreeBSD 8.3-RELEASE-p3, I have come across a problem with lacp
protocol on a lagg interface. I have aggregated two interfaces with the
same speed but slightly different type of media (namely 10Gbase-SR and
10Gbase-LR). There is a Cisco switch on the other side.

LACP won't work as my FreeBSD box computes the actor key differently for
the two interfaces. This is weird as LACP inists on the same speed but
not on the same exact type of media. Cisco has no problem having one
aggregated interface Short and the other Long Range.

Below, I have attached a tiny patch that changes the actor key
computation so that only speed is important, not the exact media type.
This patch works for me, LACP is ok with the Cisco box on the other
side. Please could someone competent look at the patch and test or
evaluate if it can be included in the code base. Thank you.

Regards,
Josef
-------------- next part --------------
*** sys/net/ieee8023ad_lacp.c.orig	2013-02-12 21:03:16.000000000 +0100
--- sys/net/ieee8023ad_lacp.c	2013-02-12 21:13:39.000000000 +0100
***************
*** 1028,1035 ****
  		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 5..14:	(some bits of) if_index of lagg device */
  		key |= 0x7fe0 & ((sc->sc_ifp->if_index) << 5);
  		/* bit 15:	0 */
--- 1028,1063 ----
  		KASSERT(IFM_TYPE(media) == IFM_ETHER, ("invalid media type"));
  		KASSERT((media & IFM_FDX) != 0, ("aggregating HDX interface"));
  
! 		/* 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 */


More information about the freebsd-net mailing list