Commit a323d9bf authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: fix be_close() to ensure all events are ack'ed

In be_close(), be_eq_clean() must be called after all RX/TX/MCC queues
have been cleaned to ensure that any events caused while cleaning up
completions are notified/acked. Not clearing all events can cause
upredictable behaviour when RX rings are re-created in the subsequent
be_open().
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c39ba1c2
...@@ -298,7 +298,12 @@ void be_async_mcc_enable(struct be_adapter *adapter) ...@@ -298,7 +298,12 @@ void be_async_mcc_enable(struct be_adapter *adapter)
void be_async_mcc_disable(struct be_adapter *adapter) void be_async_mcc_disable(struct be_adapter *adapter)
{ {
spin_lock_bh(&adapter->mcc_cq_lock);
adapter->mcc_obj.rearm_cq = false; adapter->mcc_obj.rearm_cq = false;
be_cq_notify(adapter, adapter->mcc_obj.cq.id, false, 0);
spin_unlock_bh(&adapter->mcc_cq_lock);
} }
int be_process_mcc(struct be_adapter *adapter) int be_process_mcc(struct be_adapter *adapter)
......
...@@ -2398,13 +2398,22 @@ static int be_close(struct net_device *netdev) ...@@ -2398,13 +2398,22 @@ static int be_close(struct net_device *netdev)
be_roce_dev_close(adapter); be_roce_dev_close(adapter);
be_async_mcc_disable(adapter);
if (!lancer_chip(adapter)) if (!lancer_chip(adapter))
be_intr_set(adapter, false); be_intr_set(adapter, false);
for_all_evt_queues(adapter, eqo, i) { for_all_evt_queues(adapter, eqo, i)
napi_disable(&eqo->napi); napi_disable(&eqo->napi);
be_async_mcc_disable(adapter);
/* Wait for all pending tx completions to arrive so that
* all tx skbs are freed.
*/
be_tx_compl_clean(adapter);
be_rx_qs_destroy(adapter);
for_all_evt_queues(adapter, eqo, i) {
if (msix_enabled(adapter)) if (msix_enabled(adapter))
synchronize_irq(be_msix_vec_get(adapter, eqo)); synchronize_irq(be_msix_vec_get(adapter, eqo));
else else
...@@ -2414,12 +2423,6 @@ static int be_close(struct net_device *netdev) ...@@ -2414,12 +2423,6 @@ static int be_close(struct net_device *netdev)
be_irq_unregister(adapter); be_irq_unregister(adapter);
/* Wait for all pending tx completions to arrive so that
* all tx skbs are freed.
*/
be_tx_compl_clean(adapter);
be_rx_qs_destroy(adapter);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment