Index: sys/dev/ixl/if_ixl.c =================================================================== --- sys/dev/ixl/if_ixl.c +++ sys/dev/ixl/if_ixl.c @@ -117,6 +117,7 @@ static int ixl_disable_rings(struct ixl_vsi *); static void ixl_enable_intr(struct ixl_ifx *); static void ixl_disable_intr(struct ixl_ifx *); +static void ixl_disable_rings_intr(struct ixl_ifx *); static void ixl_enable_adminq(struct i40e_hw *); static void ixl_disable_adminq(struct i40e_hw *); @@ -1870,7 +1871,10 @@ mtx_assert(&pf->pf_mtx, MA_OWNED); INIT_DEBUGOUT("ixl_stop: begin\n"); - ixl_disable_intr(ifx); + if (pf->num_vfs == 0) + ixl_disable_intr(ifx); + else + ixl_disable_rings_intr(ifx); ixl_disable_rings(&ifx->vsi); /* Tell the stack that the interface is no longer active */ @@ -3928,16 +3932,24 @@ } static void -ixl_disable_intr(struct ixl_ifx *ifx) +ixl_disable_rings_intr(struct ixl_ifx *ifx) { struct i40e_hw *hw = ifx->hw; struct ixl_queue *que = ifx->queues; + int i; - if (ixl_enable_msix) { + for (i = 0; i < ifx->vsi.num_queues; i++, que++) + ixl_disable_queue(hw, que->me); +} + +static void +ixl_disable_intr(struct ixl_ifx *ifx) +{ + struct i40e_hw *hw = ifx->hw; + + if (ixl_enable_msix) ixl_disable_adminq(hw); - for (int i = 0; i < ifx->vsi.num_queues; i++, que++) - ixl_disable_queue(hw, que->me); - } else + else ixl_disable_legacy(hw); } @@ -6530,6 +6542,9 @@ goto fail; } + ixl_configure_msix(pf); + ixl_enable_adminq(hw); + pf->num_vfs = num_vfs; IXL_PF_UNLOCK(pf); return (0); @@ -6546,10 +6561,14 @@ { struct ixl_pf *pf; struct i40e_hw *hw; + struct ixl_ifx *ifx; + struct ifnet *ifp; int i; pf = device_get_softc(dev); hw = &pf->hw; + ifx = &pf->ifx; + ifp = ifx->ifp; IXL_PF_LOCK(pf); for (i = 0; i < pf->num_vfs; i++) { @@ -6562,6 +6581,9 @@ pf->veb_seid = 0; } + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + ixl_disable_intr(ifx); + free(pf->vfs, M_IXL); pf->vfs = NULL; pf->num_vfs = 0;