summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Iremonger <bernard.iremonger@intel.com>2015-07-03 15:38:27 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-07-19 21:22:03 +0200
commit54a385fa474e627a88beb16321c984a3b030c4dc (patch)
tree584d907e6e09aca9996a565d796398223a90b37d
parentb9eee2cb8c291d9063297c8a36d042eb59190ae9 (diff)
downloaddpdk-54a385fa474e627a88beb16321c984a3b030c4dc.zip
dpdk-54a385fa474e627a88beb16321c984a3b030c4dc.tar.gz
dpdk-54a385fa474e627a88beb16321c984a3b030c4dc.tar.xz
e1000: free queue memory when closing
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>
-rw-r--r--drivers/net/e1000/e1000_ethdev.h2
-rw-r--r--drivers/net/e1000/em_ethdev.c1
-rw-r--r--drivers/net/e1000/em_rxtx.c6
-rw-r--r--drivers/net/e1000/igb_ethdev.c3
-rw-r--r--drivers/net/e1000/igb_rxtx.c6
5 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index ee8b872..4e69e44 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -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,
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index dfabb15..d8c04e7 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -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);
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 6a5410c..3b8776d 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -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]);
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 1b9f69a..ddc7186 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -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)
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 3fee735..3a31b21 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -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]);