From d575230c27eb63d1f49b45f1b5ff52b4e06e7db6 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 13 May 2022 15:56:26 -0700 Subject: [PATCH] Fix race condition while taking down port Signed-off-by: Alex Forencich --- modules/mqnic/mqnic_netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/mqnic/mqnic_netdev.c b/modules/mqnic/mqnic_netdev.c index bec1ed366..f529b3078 100644 --- a/modules/mqnic/mqnic_netdev.c +++ b/modules/mqnic/mqnic_netdev.c @@ -133,21 +133,23 @@ static int mqnic_stop_port(struct net_device *ndev) // deactivate TX queues for (k = 0; k < min(priv->tx_queue_count, priv->tx_cpl_queue_count); k++) { + napi_disable(&priv->tx_cpl_ring[k]->napi); + mqnic_deactivate_tx_ring(priv->tx_ring[k]); mqnic_deactivate_cq_ring(priv->tx_cpl_ring[k]); - napi_disable(&priv->tx_cpl_ring[k]->napi); netif_napi_del(&priv->tx_cpl_ring[k]->napi); } // deactivate RX queues for (k = 0; k < min(priv->rx_queue_count, priv->rx_cpl_queue_count); k++) { + napi_disable(&priv->rx_cpl_ring[k]->napi); + mqnic_deactivate_rx_ring(priv->rx_ring[k]); mqnic_deactivate_cq_ring(priv->rx_cpl_ring[k]); - napi_disable(&priv->rx_cpl_ring[k]->napi); netif_napi_del(&priv->rx_cpl_ring[k]->napi); }