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

Function _task_fn_admin

freebsd/net/iflib.c:3969–4016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3967}
3968
3969static void
3970_task_fn_admin(void *context)
3971{
3972 if_ctx_t ctx = context;
3973 if_softc_ctx_t sctx = &ctx->ifc_softc_ctx;
3974 iflib_txq_t txq;
3975 int i;
3976 bool oactive, running, do_reset, do_watchdog, in_detach;
3977
3978 STATE_LOCK(ctx);
3979 running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING);
3980 oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE);
3981 do_reset = (ctx->ifc_flags & IFC_DO_RESET);
3982 do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG);
3983 in_detach = (ctx->ifc_flags & IFC_IN_DETACH);
3984 ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG);
3985 STATE_UNLOCK(ctx);
3986
3987 if ((!running && !oactive) && !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN))
3988 return;
3989 if (in_detach)
3990 return;
3991
3992 CTX_LOCK(ctx);
3993 for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) {
3994 CALLOUT_LOCK(txq);
3995 callout_stop(&txq->ift_timer);
3996 CALLOUT_UNLOCK(txq);
3997 }
3998 if (do_watchdog) {
3999 ctx->ifc_watchdog_events++;
4000 IFDI_WATCHDOG_RESET(ctx);
4001 }
4002 IFDI_UPDATE_ADMIN_STATUS(ctx);
4003 for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) {
4004 callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
4005 txq->ift_timer.c_cpu);
4006 }
4007 IFDI_LINK_INTR_ENABLE(ctx);
4008 if (do_reset)
4009 iflib_if_init_locked(ctx);
4010 CTX_UNLOCK(ctx);
4011
4012 if (LINK_ACTIVE(ctx) == 0)
4013 return;
4014 for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++)
4015 iflib_txq_check_drain(txq, IFLIB_RESTART_BUDGET);
4016}
4017
4018static void
4019_task_fn_iov(void *context)

Callers

nothing calls this directly

Calls 3

if_getdrvflagsFunction · 0.85
iflib_if_init_lockedFunction · 0.85
iflib_txq_check_drainFunction · 0.85

Tested by

no test coverage detected