From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F03906A80 for ; Fri, 3 Jul 2015 16:38:40 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 03 Jul 2015 07:38:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,400,1432623600"; d="scan'208";a="757943350" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 03 Jul 2015 07:38:31 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t63EcVD0023194; Fri, 3 Jul 2015 15:38:31 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t63EcVRq004545; Fri, 3 Jul 2015 15:38:31 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t63EcVV8004541; Fri, 3 Jul 2015 15:38:31 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Fri, 3 Jul 2015 15:38:27 +0100 Message-Id: <1435934307-4495-3-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1435934307-4495-1-git-send-email-bernard.iremonger@intel.com> References: <1435934307-4495-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v7 2/2] e1000: free queue memory in close functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 14:38:41 -0000 add new functions igb_dev_free_queues() and em_dev_free_queues() Signed-off-by: Bernard Iremonger --- drivers/net/e1000/e1000_ethdev.h | 2 ++ drivers/net/e1000/em_ethdev.c | 1 + drivers/net/e1000/em_rxtx.c | 6 ++++++ drivers/net/e1000/igb_ethdev.c | 3 ++- drivers/net/e1000/igb_rxtx.c | 6 ++++++ 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 976df60..9913ad0 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -1512,6 +1512,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 80e4a6c..6e92f2e 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1089,7 +1089,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); @@ -2363,6 +2363,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 1bf8c93..0aecf8c 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -1498,6 +1498,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]); -- 1.7.4.1