]> git.droids-corp.org - dpdk.git/commitdiff
e1000: free queue memory when closing
authorBernard Iremonger <bernard.iremonger@intel.com>
Fri, 3 Jul 2015 14:38:27 +0000 (15:38 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 19 Jul 2015 19:22:03 +0000 (21:22 +0200)
Queues were freed in clear function called in stop function.
Split clearing and freeing in separate functions to
move queue freeing from stop to close function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
drivers/net/e1000/e1000_ethdev.h
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/em_rxtx.c
drivers/net/e1000/igb_ethdev.c
drivers/net/e1000/igb_rxtx.c

index ee8b87278d09024309035a6d3fd338505c6aae39..4e69e44207393d58dcea33c00557a777812a6b51 100644 (file)
@@ -259,6 +259,7 @@ struct e1000_adapter {
 void eth_igb_tx_queue_release(void *txq);
 void eth_igb_rx_queue_release(void *rxq);
 void igb_dev_clear_queues(struct rte_eth_dev *dev);
+void igb_dev_free_queues(struct rte_eth_dev *dev);
 
 int eth_igb_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
                uint16_t nb_rx_desc, unsigned int socket_id,
@@ -313,6 +314,7 @@ void eth_em_tx_queue_release(void *txq);
 void eth_em_rx_queue_release(void *rxq);
 
 void em_dev_clear_queues(struct rte_eth_dev *dev);
+void em_dev_free_queues(struct rte_eth_dev *dev);
 
 int eth_em_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
                uint16_t nb_rx_desc, unsigned int socket_id,
index dfabb158ca6fac303d7826482adc050697234d0e..d8c04e7ca3c5d33710aaf1ddd9b89e08d7f16cd0 100644 (file)
@@ -659,6 +659,7 @@ eth_em_close(struct rte_eth_dev *dev)
 
        eth_em_stop(dev);
        adapter->stopped = 1;
+       em_dev_free_queues(dev);
        e1000_phy_hw_reset(hw);
        em_release_manageability(hw);
        em_hw_control_release(hw);
index 6a5410c9860049f1dcebcbd6c81cf10401e6047b..3b8776d1c115215e9ad1e21ccc0e8217a1155b5d 100644 (file)
@@ -1513,6 +1513,12 @@ em_dev_clear_queues(struct rte_eth_dev *dev)
                        em_reset_rx_queue(rxq);
                }
        }
+}
+
+void
+em_dev_free_queues(struct rte_eth_dev *dev)
+{
+       uint16_t i;
 
        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                eth_em_rx_queue_release(dev->data->rx_queues[i]);
index 1b9f69afb9043ea7c9428b097f8647ab07c8f409..ddc71865ab3e415a916206763940bb76f60358b3 100644 (file)
@@ -1134,7 +1134,7 @@ eth_igb_close(struct rte_eth_dev *dev)
                E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, phpm_reg);
        }
 
-       igb_dev_clear_queues(dev);
+       igb_dev_free_queues(dev);
 
        memset(&link, 0, sizeof(link));
        rte_igb_dev_atomic_write_link_status(dev, &link);
@@ -2417,6 +2417,7 @@ igbvf_dev_close(struct rte_eth_dev *dev)
 
        igbvf_dev_stop(dev);
        adapter->stopped = 1;
+       igb_dev_free_queues(dev);
 }
 
 static int igbvf_set_vfta(struct e1000_hw *hw, uint16_t vid, bool on)
index 3fee73534677c3bb0335f2c714f44088252af1bb..3a31b211d9ade0b3c9abff4175ea735ca0dfdbb5 100644 (file)
@@ -1602,6 +1602,12 @@ igb_dev_clear_queues(struct rte_eth_dev *dev)
                        igb_reset_rx_queue(rxq);
                }
        }
+}
+
+void
+igb_dev_free_queues(struct rte_eth_dev *dev)
+{
+       uint16_t i;
 
        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                eth_igb_rx_queue_release(dev->data->rx_queues[i]);