| 2211 | } |
| 2212 | |
| 2213 | struct lagg_port * |
| 2214 | lagg_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 | |
| 2243 | search: |
| 2244 | CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { |
| 2245 | if (LAGG_PORTACTIVE(lp_next)) { |
| 2246 | return (lp_next); |
| 2247 | } |
| 2248 | } |
| 2249 | found: |
| 2250 | return (rval); |
| 2251 | } |
| 2252 | |
| 2253 | int |
| 2254 | lagg_enqueue(struct ifnet *ifp, struct mbuf *m) |
no test coverage detected