From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4E7405A29 for ; Tue, 7 Jul 2015 12:21:50 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 07 Jul 2015 03:21:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,422,1432623600"; d="scan'208";a="757473947" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 07 Jul 2015 03:21:48 -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 t67ALmPW025195; Tue, 7 Jul 2015 11:21:48 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t67ALlPa008838; Tue, 7 Jul 2015 11:21:47 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t67ALlpY008834; Tue, 7 Jul 2015 11:21:47 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Tue, 7 Jul 2015 11:21:27 +0100 Message-Id: <1436264487-8769-4-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1436264487-8769-1-git-send-email-bernard.iremonger@intel.com> References: <1436264487-8769-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v4 3/3] bonding: free queue memory in stop function 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: Tue, 07 Jul 2015 10:21:50 -0000 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 files changed, 20 insertions(+), 0 deletions(-) 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.7.4.1