| 2283 | } |
| 2284 | |
| 2285 | static int |
| 2286 | lagg_rr_start(struct lagg_softc *sc, struct mbuf *m) |
| 2287 | { |
| 2288 | struct lagg_port *lp; |
| 2289 | uint32_t p; |
| 2290 | |
| 2291 | p = atomic_fetchadd_32(&sc->sc_seq, 1); |
| 2292 | p /= sc->sc_stride; |
| 2293 | p %= sc->sc_count; |
| 2294 | lp = CK_SLIST_FIRST(&sc->sc_ports); |
| 2295 | |
| 2296 | while (p--) |
| 2297 | lp = CK_SLIST_NEXT(lp, lp_entries); |
| 2298 | |
| 2299 | /* |
| 2300 | * Check the port's link state. This will return the next active |
| 2301 | * port if the link is down or the port is NULL. |
| 2302 | */ |
| 2303 | if ((lp = lagg_link_active(sc, lp)) == NULL) { |
| 2304 | if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); |
| 2305 | m_freem(m); |
| 2306 | return (ENETDOWN); |
| 2307 | } |
| 2308 | |
| 2309 | /* Send mbuf */ |
| 2310 | return (lagg_enqueue(lp->lp_ifp, m)); |
| 2311 | } |
| 2312 | |
| 2313 | static struct mbuf * |
| 2314 | lagg_rr_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) |
nothing calls this directly
no test coverage detected