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

Function iflib_link_state_change

freebsd/net/iflib.c:6337–6356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6335}
6336
6337void
6338iflib_link_state_change(if_ctx_t ctx, int link_state, uint64_t baudrate)
6339{
6340 if_t ifp = ctx->ifc_ifp;
6341 iflib_txq_t txq = ctx->ifc_txqs;
6342
6343 if_setbaudrate(ifp, baudrate);
6344 if (baudrate >= IF_Gbps(10)) {
6345 STATE_LOCK(ctx);
6346 ctx->ifc_flags |= IFC_PREFETCH;
6347 STATE_UNLOCK(ctx);
6348 }
6349 /* If link down, disable watchdog */
6350 if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) {
6351 for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++)
6352 txq->ift_qstatus = IFLIB_QUEUE_IDLE;
6353 }
6354 ctx->ifc_link_state = link_state;
6355 if_link_state_change(ifp, link_state);
6356}
6357
6358static int
6359iflib_tx_credits_update(if_ctx_t ctx, iflib_txq_t txq)

Callers

nothing calls this directly

Calls 2

if_setbaudrateFunction · 0.85
if_link_state_changeFunction · 0.85

Tested by

no test coverage detected