Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/if_ice_iflib.c
Show First 20 Lines • Show All 723 Lines • ▼ Show 20 Lines | ice_if_attach_post(if_ctx_t ctx) | ||||
} | } | ||||
/* The ifnet structure hasn't yet been initialized when the attach_pre | /* The ifnet structure hasn't yet been initialized when the attach_pre | ||||
* handler is called, so wait until attach_post to setup the | * handler is called, so wait until attach_post to setup the | ||||
* isc_max_frame_size. | * isc_max_frame_size. | ||||
*/ | */ | ||||
sc->ifp = ifp; | sc->ifp = ifp; | ||||
sc->scctx->isc_max_frame_size = ifp->if_mtu + | sc->scctx->isc_max_frame_size = if_getmtu(ifp) + | ||||
ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; | ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; | ||||
/* | /* | ||||
* If we are in recovery mode, only perform a limited subset of | * If we are in recovery mode, only perform a limited subset of | ||||
* initialization to support NVM recovery. | * initialization to support NVM recovery. | ||||
*/ | */ | ||||
if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) { | if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) { | ||||
ice_attach_post_recovery_mode(sc); | ice_attach_post_recovery_mode(sc); | ||||
▲ Show 20 Lines • Show All 1,530 Lines • ▼ Show 20 Lines | |||||
ice_prepare_for_reset(struct ice_softc *sc) | ice_prepare_for_reset(struct ice_softc *sc) | ||||
{ | { | ||||
struct ice_hw *hw = &sc->hw; | struct ice_hw *hw = &sc->hw; | ||||
/* If we're already prepared, there's nothing to do */ | /* If we're already prepared, there's nothing to do */ | ||||
if (ice_testandset_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET)) | if (ice_testandset_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET)) | ||||
return; | return; | ||||
log(LOG_INFO, "%s: preparing to reset device logic\n", sc->ifp->if_xname); | log(LOG_INFO, "%s: preparing to reset device logic\n", if_name(sc->ifp)); | ||||
/* In recovery mode, hardware is not initialized */ | /* In recovery mode, hardware is not initialized */ | ||||
if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) | if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) | ||||
return; | return; | ||||
/* stop the RDMA client */ | /* stop the RDMA client */ | ||||
ice_rdma_pf_stop(sc); | ice_rdma_pf_stop(sc); | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | ice_rebuild_recovery_mode(struct ice_softc *sc) | ||||
ice_configure_misc_interrupts(sc); | ice_configure_misc_interrupts(sc); | ||||
/* Enable ITR 0 right away, so that we can handle admin interrupts */ | /* Enable ITR 0 right away, so that we can handle admin interrupts */ | ||||
ice_enable_intr(&sc->hw, sc->irqvs[0].me); | ice_enable_intr(&sc->hw, sc->irqvs[0].me); | ||||
/* Now that the rebuild is finished, we're no longer prepared to reset */ | /* Now that the rebuild is finished, we're no longer prepared to reset */ | ||||
ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); | ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); | ||||
log(LOG_INFO, "%s: device rebuild successful\n", sc->ifp->if_xname); | log(LOG_INFO, "%s: device rebuild successful\n", if_name(sc->ifp)); | ||||
/* In order to completely restore device functionality, the iflib core | /* In order to completely restore device functionality, the iflib core | ||||
* needs to be reset. We need to request an iflib reset. Additionally, | * needs to be reset. We need to request an iflib reset. Additionally, | ||||
* because the state of IFC_DO_RESET is cached within task_fn_admin in | * because the state of IFC_DO_RESET is cached within task_fn_admin in | ||||
* the iflib core, we also want re-run the admin task so that iflib | * the iflib core, we also want re-run the admin task so that iflib | ||||
* resets immediately instead of waiting for the next interrupt. | * resets immediately instead of waiting for the next interrupt. | ||||
*/ | */ | ||||
ice_request_stack_reinit(sc); | ice_request_stack_reinit(sc); | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | ice_rebuild(struct ice_softc *sc) | ||||
ice_configure_misc_interrupts(sc); | ice_configure_misc_interrupts(sc); | ||||
/* Enable ITR 0 right away, so that we can handle admin interrupts */ | /* Enable ITR 0 right away, so that we can handle admin interrupts */ | ||||
ice_enable_intr(&sc->hw, sc->irqvs[0].me); | ice_enable_intr(&sc->hw, sc->irqvs[0].me); | ||||
/* Now that the rebuild is finished, we're no longer prepared to reset */ | /* Now that the rebuild is finished, we're no longer prepared to reset */ | ||||
ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); | ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); | ||||
log(LOG_INFO, "%s: device rebuild successful\n", sc->ifp->if_xname); | log(LOG_INFO, "%s: device rebuild successful\n", if_name(sc->ifp)); | ||||
/* In order to completely restore device functionality, the iflib core | /* In order to completely restore device functionality, the iflib core | ||||
* needs to be reset. We need to request an iflib reset. Additionally, | * needs to be reset. We need to request an iflib reset. Additionally, | ||||
* because the state of IFC_DO_RESET is cached within task_fn_admin in | * because the state of IFC_DO_RESET is cached within task_fn_admin in | ||||
* the iflib core, we also want re-run the admin task so that iflib | * the iflib core, we also want re-run the admin task so that iflib | ||||
* resets immediately instead of waiting for the next interrupt. | * resets immediately instead of waiting for the next interrupt. | ||||
*/ | */ | ||||
ice_request_stack_reinit(sc); | ice_request_stack_reinit(sc); | ||||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |