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

Function iflib_clone_destroy

freebsd/net/iflib_clone.c:221–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static void
222iflib_clone_destroy(if_t ifp)
223{
224 if_ctx_t ctx;
225 device_t dev;
226 struct sx *ctx_lock;
227 int rc;
228
229 /*
230 * Detach device / free / free unit
231 */
232 ctx = if_getsoftc(ifp);
233 dev = iflib_get_dev(ctx);
234 ctx_lock = iflib_ctx_lock_get(ctx);
235 sx_xlock(ctx_lock);
236 iflib_set_detach(ctx);
237 iflib_stop(ctx);
238 sx_xunlock(ctx_lock);
239
240 mtx_lock(&Giant);
241 rc = device_delete_child(iflib_pseudodev, dev);
242 mtx_unlock(&Giant);
243 if (rc == 0)
244 iflib_pseudo_deregister(ctx);
245}
246
247if_pseudo_t
248iflib_clone_register(if_shared_ctx_t sctx)

Callers

nothing calls this directly

Calls 9

if_getsoftcFunction · 0.85
iflib_get_devFunction · 0.85
iflib_ctx_lock_getFunction · 0.85
iflib_set_detachFunction · 0.85
iflib_stopFunction · 0.85
device_delete_childFunction · 0.85
iflib_pseudo_deregisterFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected