summaryrefslogtreecommitdiffstats
path: root/sys/net/ieee8023ad_lacp.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-05-19 09:37:04 +0000
committerthompsa <thompsa@FreeBSD.org>2007-05-19 09:37:04 +0000
commit1bfd0c37015826814756d5f862290d95ee418843 (patch)
treeaf9e1092bde1298aeb24604f320a9715ce07e5f9 /sys/net/ieee8023ad_lacp.c
parent915908f0ee9b3e42861072837d171caa583d0396 (diff)
downloadFreeBSD-src-1bfd0c37015826814756d5f862290d95ee418843.zip
FreeBSD-src-1bfd0c37015826814756d5f862290d95ee418843.tar.gz
Compare the partner system priority when choosing the aggregator.
Diffstat (limited to 'sys/net/ieee8023ad_lacp.c')
-rw-r--r--sys/net/ieee8023ad_lacp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index feacf53..328af57 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -935,7 +935,15 @@ lacp_select_active_aggregator(struct lacp_softc *lsc)
LACP_DPRINTF((NULL, "%s, speed=%jd, nports=%d\n",
lacp_format_lagid_aggregator(la, buf, sizeof(buf)),
speed, la->la_nports));
- if (speed > best_speed ||
+
+ /* This aggregator is chosen if
+ * the partner has a better system priority
+ * or, the total aggregated speed is higher
+ * or, it is already the chosen aggregator
+ */
+ if ((best_la != NULL && LACP_SYS_PRI(la->la_partner) <
+ LACP_SYS_PRI(best_la->la_partner)) ||
+ speed > best_speed ||
(speed == best_speed &&
la == lsc->lsc_active_aggregator)) {
best_la = la;
OpenPOWER on IntegriCloud