From aa0186bc3653138a42da52dc151acfbf2c5f5404 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 6 Sep 2017 14:36:35 +0000 Subject: [PATCH] Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that report extended media types. lacp_aggregator_bandwidth() uses the media to determine the speed of the interface and returns 0 for IFM_OTHER without the bits in the extended range. Reported by: kbowling@ Reviewed by: eugen_grosbein.net, mjoras@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12188 --- sys/net/ieee8023ad_lacp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 740294d7df2..1d26d3ae9fe 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -463,7 +463,11 @@ lacp_linkstate(struct lagg_port *lgp) uint16_t old_key; bzero((char *)&ifmr, sizeof(ifmr)); - error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + error = (*ifp->if_ioctl)(ifp, SIOCGIFXMEDIA, (caddr_t)&ifmr); + if (error != 0) { + bzero((char *)&ifmr, sizeof(ifmr)); + error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + } if (error != 0) return;