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

Function lagg_rr_start

freebsd/net/if_lagg.c:2285–2311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2283}
2284
2285static int
2286lagg_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
2313static struct mbuf *
2314lagg_rr_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m)

Callers

nothing calls this directly

Calls 5

lagg_link_activeFunction · 0.85
if_inc_counterFunction · 0.85
lagg_enqueueFunction · 0.85
atomic_fetchadd_32Function · 0.50
m_freemFunction · 0.50

Tested by

no test coverage detected