]> git.droids-corp.org - dpdk.git/commitdiff
net/ice: fix freeing queues on DCF device reset
authorDapeng Yu <dapengx.yu@intel.com>
Mon, 11 Oct 2021 07:25:46 +0000 (15:25 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 13 Oct 2021 10:58:04 +0000 (12:58 +0200)
In function ice_dcf_stop_queues(), RX queues and TX queues are actually
not freed, so their pointers shall not be set to NULL when queues are
stopped.

This patch adds function call to free queues on DCF device close,
which also set the RX and TX queues' pointers to NULL on freeing
queues, and avoids referring to the released resource when device is
started again.

Fixes: 1a86f4dbdf42 ("net/ice: support DCF device reset")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_dcf_ethdev.c

index f9be43741f1d4f1f05257eb62bcb039b80075431..14f4fe80fef29659cbc5b5f948f185a8d4a3dce9 100644 (file)
@@ -603,7 +603,6 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)
                txq->tx_rel_mbufs(txq);
                reset_tx_queue(txq);
                dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
-               dev->data->tx_queues[i] = NULL;
        }
        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                rxq = dev->data->rx_queues[i];
@@ -612,7 +611,6 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev)
                rxq->rx_rel_mbufs(rxq);
                reset_rx_queue(rxq);
                dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
-               dev->data->rx_queues[i] = NULL;
        }
 }
 
@@ -905,6 +903,8 @@ ice_dcf_dev_close(struct rte_eth_dev *dev)
 
        (void)ice_dcf_dev_stop(dev);
 
+       ice_free_queues(dev);
+
        ice_dcf_free_repr_info(adapter);
        ice_dcf_uninit_parent_adapter(dev);
        ice_dcf_uninit_hw(dev, &adapter->real_hw);