summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-03-16 19:25:30 +0000
committerthompsa <thompsa@FreeBSD.org>2008-03-16 19:25:30 +0000
commitbc8c8477a02fa7911713785305f7fe01ee91f393 (patch)
tree9b2fbdb4763db2a38161e28105570ea78bb1d411 /sys/net/if_lagg.c
parent6f407f2920aabd83849ef82bbae7a7aded2d68e3 (diff)
downloadFreeBSD-src-bc8c8477a02fa7911713785305f7fe01ee91f393.zip
FreeBSD-src-bc8c8477a02fa7911713785305f7fe01ee91f393.tar.gz
Switch the LACP state machine over to its own mutex to protect the internals,
this means that it no longer grabs the lagg rwlock. Use two port table arrays which list the active ports for Tx and switch between them with an atomic op. Now the lagg rwlock is only exclusively locked for management (ioctls) and queuing of lacp control frames isnt needed.
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c863387..5e5a115 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -746,8 +746,12 @@ lagg_port2req(struct lagg_port *lp, struct lagg_reqport *rp)
case LAGG_PROTO_LACP:
/* LACP has a different definition of active */
- if (lacp_port_isactive(lp))
+ if (lacp_isactive(lp))
rp->rp_flags |= LAGG_PORT_ACTIVE;
+ if (lacp_iscollecting(lp))
+ rp->rp_flags |= LAGG_PORT_COLLECTING;
+ if (lacp_isdistributing(lp))
+ rp->rp_flags |= LAGG_PORT_DISTRIBUTING;
break;
}
@@ -1709,8 +1713,7 @@ lagg_lacp_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m)
* If the port is not collecting or not in the active aggregator then
* free and return.
*/
- if ((lp->lp_flags & LAGG_PORT_COLLECTING) == 0 ||
- lacp_port_isactive(lp) == 0) {
+ if (lacp_iscollecting(lp) == 0 || lacp_isactive(lp) == 0) {
m_freem(m);
return (NULL);
}
OpenPOWER on IntegriCloud