Compare the partner system priority when choosing the aggregator.
This commit is contained in:
parent
ad08d9331d
commit
fe45e65f10
@ -935,7 +935,15 @@ lacp_select_active_aggregator(struct lacp_softc *lsc)
|
|||||||
LACP_DPRINTF((NULL, "%s, speed=%jd, nports=%d\n",
|
LACP_DPRINTF((NULL, "%s, speed=%jd, nports=%d\n",
|
||||||
lacp_format_lagid_aggregator(la, buf, sizeof(buf)),
|
lacp_format_lagid_aggregator(la, buf, sizeof(buf)),
|
||||||
speed, la->la_nports));
|
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 &&
|
(speed == best_speed &&
|
||||||
la == lsc->lsc_active_aggregator)) {
|
la == lsc->lsc_active_aggregator)) {
|
||||||
best_la = la;
|
best_la = la;
|
||||||
|
@ -265,6 +265,8 @@ int tlv_check(const void *, size_t, const struct tlvhdr *,
|
|||||||
#define LACP_STATE_EQ(s1, s2, mask) \
|
#define LACP_STATE_EQ(s1, s2, mask) \
|
||||||
((((s1) ^ (s2)) & (mask)) == 0)
|
((((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_PORT(_lp) ((struct lacp_port *)(_lp)->lp_psc)
|
||||||
#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc)
|
#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user