diff options
author | thompsa <thompsa@FreeBSD.org> | 2007-05-19 09:37:04 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2007-05-19 09:37:04 +0000 |
commit | 1bfd0c37015826814756d5f862290d95ee418843 (patch) | |
tree | af9e1092bde1298aeb24604f320a9715ce07e5f9 /sys | |
parent | 915908f0ee9b3e42861072837d171caa583d0396 (diff) | |
download | FreeBSD-src-1bfd0c37015826814756d5f862290d95ee418843.zip FreeBSD-src-1bfd0c37015826814756d5f862290d95ee418843.tar.gz |
Compare the partner system priority when choosing the aggregator.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/ieee8023ad_lacp.c | 10 | ||||
-rw-r--r-- | sys/net/ieee8023ad_lacp.h | 2 |
2 files changed, 11 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; diff --git a/sys/net/ieee8023ad_lacp.h b/sys/net/ieee8023ad_lacp.h index 04bd878..7673b09 100644 --- a/sys/net/ieee8023ad_lacp.h +++ b/sys/net/ieee8023ad_lacp.h @@ -265,6 +265,8 @@ int tlv_check(const void *, size_t, const struct tlvhdr *, #define LACP_STATE_EQ(s1, s2, mask) \ ((((s1) ^ (s2)) & (mask)) == 0) +#define LACP_SYS_PRI(peer) (peer).lip_systemid.lsi_prio + #define LACP_PORT(_lp) ((struct lacp_port *)(_lp)->lp_psc) #define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc) |