From patchwork Mon Jul 27 15:54:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iremonger, Bernard" X-Patchwork-Id: 6623 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 02733C5CC; Mon, 27 Jul 2015 17:54:55 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BDAAEC598 for ; Mon, 27 Jul 2015 17:54:47 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 27 Jul 2015 08:54:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,555,1432623600"; d="scan'208";a="755864402" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 27 Jul 2015 08:54:44 -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 t6RFshoo018711; Mon, 27 Jul 2015 16:54:43 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t6RFshqW000795; Mon, 27 Jul 2015 16:54:43 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t6RFshXG000791; Mon, 27 Jul 2015 16:54:43 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Mon, 27 Jul 2015 16:54:36 +0100 Message-Id: <1438012477-729-4-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438012477-729-1-git-send-email-bernard.iremonger@intel.com> References: <1438012477-729-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v7 3/4] bonding: free queue memory in close 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" add function bond_ethdev_free_queues() and call from the bond_ethdev_close() function. Signed-off-by: Bernard Iremonger --- drivers/net/bonding/rte_eth_bond_pmd.c | 21 ++++++++++++++++++++- drivers/net/bonding/rte_eth_bond_private.h | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index e1a9e7b..5cc6372 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) { @@ -1553,8 +1571,9 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) } void -bond_ethdev_close(struct rte_eth_dev *dev __rte_unused) +bond_ethdev_close(struct rte_eth_dev *dev) { + bond_ethdev_free_queues(dev); } /* forward declaration */ diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 9f57f4d..038bca6 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -288,6 +288,6 @@ void bond_ethdev_stop(struct rte_eth_dev *eth_dev); void -bond_ethdev_close(struct rte_eth_dev *dev __rte_unused); +bond_ethdev_close(struct rte_eth_dev *dev); #endif