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

Function lagg_clone_destroy

freebsd/net/if_lagg.c:621–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621static void
622lagg_clone_destroy(struct ifnet *ifp)
623{
624 struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc;
625 struct lagg_port *lp;
626
627 LAGG_XLOCK(sc);
628 sc->sc_destroying = 1;
629 lagg_stop(sc);
630 ifp->if_flags &= ~IFF_UP;
631
632 EVENTHANDLER_DEREGISTER(vlan_config, sc->vlan_attach);
633 EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach);
634
635 /* Shutdown and remove lagg ports */
636 while ((lp = CK_SLIST_FIRST(&sc->sc_ports)) != NULL)
637 lagg_port_destroy(lp, 1);
638
639 /* Unhook the aggregation protocol */
640 lagg_proto_detach(sc);
641 LAGG_XUNLOCK(sc);
642
643 switch (ifp->if_type) {
644 case IFT_ETHER:
645 ifmedia_removeall(&sc->sc_media);
646 ether_ifdetach(ifp);
647 break;
648 case IFT_INFINIBAND:
649 infiniband_ifdetach(ifp);
650 break;
651 default:
652 break;
653 }
654 if_free(ifp);
655
656 LAGG_LIST_LOCK();
657 SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries);
658 LAGG_LIST_UNLOCK();
659
660 mtx_destroy(&sc->sc_mtx);
661 LAGG_SX_DESTROY(sc);
662 free(sc, M_LAGG);
663}
664
665static void
666lagg_capabilities(struct lagg_softc *sc)

Callers

nothing calls this directly

Calls 8

lagg_stopFunction · 0.85
lagg_port_destroyFunction · 0.85
lagg_proto_detachFunction · 0.85
ifmedia_removeallFunction · 0.85
ether_ifdetachFunction · 0.85
infiniband_ifdetachFunction · 0.85
if_freeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected