Skip to content

Commit 1c4d5f5

Browse files
nhormandavem330
authored andcommitted
vmxnet3: ensure that adapter is in proper state during force_close
There are several paths in vmxnet3, where settings changes cause the adapter to be brought down and back up (vmxnet3_set_ringparam among them). Should part of the reset operation fail, these paths call vmxnet3_force_close, which enables all napi instances prior to calling dev_close (with the expectation that vmxnet3_close will then properly disable them again). However, vmxnet3_force_close neglects to clear VMXNET3_STATE_BIT_QUIESCED prior to calling dev_close. As a result vmxnet3_quiesce_dev (called from vmxnet3_close), returns early, and leaves all the napi instances in a enabled state while the device itself is closed. If a device in this state is activated again, napi_enable will be called on already enabled napi_instances, leading to a BUG halt. The fix is to simply enausre that the QUIESCED bit is cleared in vmxnet3_force_close to allow quesence to be completed properly on close. Signed-off-by: Neil Horman <[email protected]> CC: Shrikrishna Khare <[email protected]> CC: "VMware, Inc." <[email protected]> CC: "David S. Miller" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 42e6cae commit 1c4d5f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,6 +2962,11 @@ vmxnet3_force_close(struct vmxnet3_adapter *adapter)
29622962
/* we need to enable NAPI, otherwise dev_close will deadlock */
29632963
for (i = 0; i < adapter->num_rx_queues; i++)
29642964
napi_enable(&adapter->rx_queue[i].napi);
2965+
/*
2966+
* Need to clear the quiesce bit to ensure that vmxnet3_close
2967+
* can quiesce the device properly
2968+
*/
2969+
clear_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
29652970
dev_close(adapter->netdev);
29662971
}
29672972

0 commit comments

Comments
 (0)