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

Function lagg_init

freebsd/net/if_lagg.c:1252–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1250}
1251
1252static void
1253lagg_init(void *xsc)
1254{
1255 struct lagg_softc *sc = (struct lagg_softc *)xsc;
1256 struct ifnet *ifp = sc->sc_ifp;
1257 struct lagg_port *lp;
1258
1259 LAGG_XLOCK(sc);
1260 if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
1261 LAGG_XUNLOCK(sc);
1262 return;
1263 }
1264
1265 ifp->if_drv_flags |= IFF_DRV_RUNNING;
1266
1267 /*
1268 * Update the port lladdrs if needed.
1269 * This might be if_setlladdr() notification
1270 * that lladdr has been changed.
1271 */
1272 CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
1273 if (memcmp(IF_LLADDR(ifp), IF_LLADDR(lp->lp_ifp),
1274 ifp->if_addrlen) != 0)
1275 if_setlladdr(lp->lp_ifp, IF_LLADDR(ifp), ifp->if_addrlen);
1276 }
1277
1278 lagg_proto_init(sc);
1279
1280 if (ifp->if_type == IFT_INFINIBAND) {
1281 mtx_lock(&sc->sc_mtx);
1282 lagg_watchdog_infiniband(sc);
1283 mtx_unlock(&sc->sc_mtx);
1284 }
1285
1286 LAGG_XUNLOCK(sc);
1287}
1288
1289static void
1290lagg_stop(struct lagg_softc *sc)

Callers

nothing calls this directly

Calls 5

if_setlladdrFunction · 0.85
lagg_proto_initFunction · 0.85
lagg_watchdog_infinibandFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected