MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lagg_link_active

Function lagg_link_active

freebsd/net/if_lagg.c:2213–2251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2211}
2212
2213struct lagg_port *
2214lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp)
2215{
2216 struct lagg_port *lp_next, *rval = NULL;
2217
2218 /*
2219 * Search a port which reports an active link state.
2220 */
2221
2222#ifdef INVARIANTS
2223 /*
2224 * This is called with either in the network epoch
2225 * or with LAGG_XLOCK(sc) held.
2226 */
2227 if (!in_epoch(net_epoch_preempt))
2228 LAGG_XLOCK_ASSERT(sc);
2229#endif
2230
2231 if (lp == NULL)
2232 goto search;
2233 if (LAGG_PORTACTIVE(lp)) {
2234 rval = lp;
2235 goto found;
2236 }
2237 if ((lp_next = CK_SLIST_NEXT(lp, lp_entries)) != NULL &&
2238 LAGG_PORTACTIVE(lp_next)) {
2239 rval = lp_next;
2240 goto found;
2241 }
2242
2243search:
2244 CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) {
2245 if (LAGG_PORTACTIVE(lp_next)) {
2246 return (lp_next);
2247 }
2248 }
2249found:
2250 return (rval);
2251}
2252
2253int
2254lagg_enqueue(struct ifnet *ifp, struct mbuf *m)

Callers 8

lagg_port2reqFunction · 0.85
lagg_watchdog_infinibandFunction · 0.85
lookup_snd_tag_portFunction · 0.85
lagg_rr_startFunction · 0.85
lagg_bcast_startFunction · 0.85
lagg_fail_startFunction · 0.85
lagg_fail_inputFunction · 0.85
lagg_lb_startFunction · 0.85

Calls 1

in_epochFunction · 0.85

Tested by

no test coverage detected