sfc: Split STATE_READY in to STATE_NET_DOWN and STATE_NET_UP.
[ Upstream commit 813cf9d1e753e1e0a247d3d685212a06141b483e ] This patch splits the READY state in to NET_UP and NET_DOWN. This is to prepare for future work to delay resource allocation until interface up so that we can use resources more efficiently in SRIOV environments, and also to lay the ground work for an extra PROBED state where we don't create a network interface, for VDPA operation. Signed-off-by: Jonathan Cooper <jonathan.s.cooper@amd.com> Acked-by: Martin Habets <habetsm.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: a80bb8e7233b ("sfc: Fix use-after-free due to selftest_work") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
b6dd232f63
commit
06a72bbf0d
@@ -897,7 +897,7 @@ static void efx_reset_work(struct work_struct *data)
|
||||
* have changed by now. Now that we have the RTNL lock,
|
||||
* it cannot change again.
|
||||
*/
|
||||
if (efx->state == STATE_READY)
|
||||
if (efx_net_active(efx->state))
|
||||
(void)efx_reset(efx, method);
|
||||
|
||||
rtnl_unlock();
|
||||
@@ -907,7 +907,7 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type)
|
||||
{
|
||||
enum reset_type method;
|
||||
|
||||
if (efx->state == STATE_RECOVERY) {
|
||||
if (efx_recovering(efx->state)) {
|
||||
netif_dbg(efx, drv, efx->net_dev,
|
||||
"recovering: skip scheduling %s reset\n",
|
||||
RESET_TYPE(type));
|
||||
@@ -942,7 +942,7 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type)
|
||||
/* If we're not READY then just leave the flags set as the cue
|
||||
* to abort probing or reschedule the reset later.
|
||||
*/
|
||||
if (READ_ONCE(efx->state) != STATE_READY)
|
||||
if (!efx_net_active(READ_ONCE(efx->state)))
|
||||
return;
|
||||
|
||||
/* efx_process_channel() will no longer read events once a
|
||||
@@ -1214,7 +1214,7 @@ static pci_ers_result_t efx_io_error_detected(struct pci_dev *pdev,
|
||||
rtnl_lock();
|
||||
|
||||
if (efx->state != STATE_DISABLED) {
|
||||
efx->state = STATE_RECOVERY;
|
||||
efx->state = efx_recover(efx->state);
|
||||
efx->reset_pending = 0;
|
||||
|
||||
efx_device_detach_sync(efx);
|
||||
@@ -1268,7 +1268,7 @@ static void efx_io_resume(struct pci_dev *pdev)
|
||||
netif_err(efx, hw, efx->net_dev,
|
||||
"efx_reset failed after PCI error (%d)\n", rc);
|
||||
} else {
|
||||
efx->state = STATE_READY;
|
||||
efx->state = efx_recovered(efx->state);
|
||||
netif_dbg(efx, hw, efx->net_dev,
|
||||
"Done resetting and resuming IO after PCI error.\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user