From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernard Iremonger Subject: [PATCH v5 3/3] bonding: free queue memory in stop function Date: Wed, 15 Jul 2015 16:32:11 +0100 Message-ID: <1436974331-8471-4-git-send-email-bernard.iremonger@intel.com> References: <1436974331-8471-1-git-send-email-bernard.iremonger@intel.com> To: dev@dpdk.org Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E2CEA5A5D for ; Wed, 15 Jul 2015 17:32:19 +0200 (CEST) In-Reply-To: <1436974331-8471-1-git-send-email-bernard.iremonger@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" add function bond_ethdev_free_queues() and call from the bond_ethdev_stop() function. Signed-off-by: Bernard Iremonger --- drivers/net/bonding/rte_eth_bond_pmd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index a2eecb9..8734df0 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1512,6 +1512,24 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) return 0; } +static void +bond_ethdev_free_queues(struct rte_eth_dev *dev) +{ + uint8_t i; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rte_free(dev->data->rx_queues[i]); + dev->data->rx_queues[i] = NULL; + } + dev->data->nb_rx_queues = 0; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + rte_free(dev->data->tx_queues[i]); + dev->data->tx_queues[i] = NULL; + } + dev->data->nb_tx_queues = 0; +} + void bond_ethdev_stop(struct rte_eth_dev *eth_dev) { @@ -1550,6 +1568,8 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) eth_dev->data->dev_link.link_status = 0; eth_dev->data->dev_started = 0; + + bond_ethdev_free_queues(eth_dev); } static void -- 1.9.1