mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
ice: Quiesce queues after partial initialization
ice_if_init marks DRIVER_INITIALIZED only after all queue and filter operations succeed, so ice_if_stop intentionally does nothing after an initialization failure. Each failure path must therefore unwind any hardware queues it may have configured before iflib releases their DMA mappings. Tx setup enables firmware scheduler queues one at a time, and Rx enable similarly processes queues incrementally. Route failures from both operations through cleanup paths for both the PF and mirror VSIs. The cleanup helpers tolerate queues which were not configured, so they also cover failures on the first queue. This leaves failed initialization stopped as required by the iflib_init_failed contract. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59331
This commit is contained in:
1 parent
9a1756f831
commit
fc809d6a61
2 files changed
+9
-7
No files matched your search
@@ -1929,7 +1929,7 @@ ice_control_rx_queue(struct ice_vsi *vsi, u16 qidx, bool enable)
|
||||
int
|
||||
ice_control_all_rx_queues(struct ice_vsi *vsi, bool enable)
|
||||
{
|
||||
int i, err;
|
||||
int i, err = 0;
|
||||
|
||||
/* TODO: amortize waits by changing all queues up front and then
|
||||
* checking their status afterwards. This will become more necessary
|
||||
@@ -1941,7 +1941,7 @@ ice_control_all_rx_queues(struct ice_vsi *vsi, bool enable)
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (err);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2121,7 +2121,7 @@ ice_if_init(if_ctx_t ctx)
|
||||
device_printf(dev,
|
||||
"Unable to configure the main VSI for Tx: %s\n",
|
||||
ice_err_str(err));
|
||||
goto err_init_failed;
|
||||
goto err_cleanup_tx;
|
||||
}
|
||||
|
||||
err = ice_cfg_vsi_for_rx(&sc->pf_vsi);
|
||||
@@ -2135,9 +2135,9 @@ ice_if_init(if_ctx_t ctx)
|
||||
err = ice_control_all_rx_queues(&sc->pf_vsi, true);
|
||||
if (err) {
|
||||
device_printf(dev,
|
||||
"Unable to enable Rx rings for transmit: %s\n",
|
||||
"Unable to enable Rx rings for receive: %s\n",
|
||||
ice_err_str(err));
|
||||
goto err_cleanup_tx;
|
||||
goto err_stop_rx;
|
||||
}
|
||||
|
||||
err = ice_cfg_pf_default_mac_filters(sc);
|
||||
@@ -4519,7 +4519,7 @@ ice_subif_if_init(if_ctx_t ctx)
|
||||
device_printf(dev,
|
||||
"Unable to configure subif VSI for Tx: %s\n",
|
||||
ice_err_str(err));
|
||||
goto err_init_failed;
|
||||
goto err_cleanup_tx;
|
||||
}
|
||||
|
||||
err = ice_cfg_vsi_for_rx(vsi);
|
||||
@@ -4535,7 +4535,7 @@ ice_subif_if_init(if_ctx_t ctx)
|
||||
device_printf(dev,
|
||||
"Unable to enable subif Rx rings for receive: %s\n",
|
||||
ice_err_str(err));
|
||||
goto err_cleanup_tx;
|
||||
goto err_stop_rx;
|
||||
}
|
||||
|
||||
ice_configure_all_rxq_interrupts(vsi);
|
||||
@@ -4544,6 +4544,8 @@ ice_subif_if_init(if_ctx_t ctx)
|
||||
ice_set_state(&mif->state, ICE_STATE_DRIVER_INITIALIZED);
|
||||
return;
|
||||
|
||||
err_stop_rx:
|
||||
ice_control_all_rx_queues(vsi, false);
|
||||
err_cleanup_tx:
|
||||
ice_vsi_disable_tx(vsi);
|
||||
err_init_failed:
|
||||
|
||||
Reference in new issue
Block a user