From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id DEE435598 for ; Wed, 23 Nov 2016 20:40:03 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id g23so2967935wme.1 for ; Wed, 23 Nov 2016 11:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=asK7IXrTQ8B+TvZtvMjLl/KV/iarat4hAddR67nIvgg=; b=HZ7pqEgnw3Mcn6B4FLkD2aggspWcucsxbLCF84r0njn/zfzNmSpiSV/L5N32Wk+uqB 0As1WBNsM3KPX9lpIqIz1GqsU9aLanusnNyQc7tCLpDgItBnjhlNPI1/Bw6kE7Ghmi8+ 318v8faPRXggZEPfBlsiZRFBXksrGrNpXfuPfHps8XCMM4Zv8v80p46aMW3zLMXGYX5P eWFEKfl9R4TuIkNLv2mNECaAH3+yEiqawFxQ90/KnpEMlVHwr1g4I6dOrk03J7wc88s9 OiCEm+YbdP5z3tuzPCr0xcMsLJ9uUdM6uJqZ/GeS1vIRHZwE1AyWTQNReJo74GZfIoSz Xn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=asK7IXrTQ8B+TvZtvMjLl/KV/iarat4hAddR67nIvgg=; b=K03atnH00gmaKmzubnaRgRWDvUaJ7p4spZ5oJNQMEVXraTsUkk2GBRY9AqEnqyjrUQ UPgeoPLCe3YSw4qTDxo2WS8wXg8bMGehXRPNcLcRxuDcMIlPhpdkYIHtV1jcJ43GcV1G OxFVROv/VNdPcf0WPCYwSGvr2MXpQ8asKXcF5VpybXkJI3kmeMS3qvPrslPRuDTQim+8 VCrDl0JAuxi2uWa17uVC9OwbWM8Z0WXAvjZjzADvbsvodMELXS0HwDObHkq4iW9Jza78 K2/wqAQ+36zQrrj185iKY/nN3s4perCh70jRuXDpbbFJJwkP+CIu0ia3DSOo3ptMSIVn Y5aw== X-Gm-Message-State: AKaTC01LignMGCYRBAEZSLFWrgL7S5gwmfqT0a6A5vp0l0uO1y43ElXGWaSaw6ufWkmpzg== X-Received: by 10.28.23.16 with SMTP id 16mr9284617wmx.134.1479930003567; Wed, 23 Nov 2016 11:40:03 -0800 (PST) Received: from weierstrass.local.net ([91.200.110.70]) by smtp.gmail.com with ESMTPSA id g184sm4339684wme.23.2016.11.23.11.40.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 11:40:02 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: ferruh.yigit@intel.com, i.maximets@samsung.com, bruce.richardson@intel.com, declan.doherty@intel.com Date: Wed, 23 Nov 2016 20:38:30 +0100 Message-Id: <1479929912-32079-2-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479929912-32079-1-git-send-email-jblunck@infradead.org> References: <1479929912-32079-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 2/4] ethdev: Free rx/tx_queues after releasing all queues 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: Wed, 23 Nov 2016 19:40:04 -0000 If all queues are released lets also free up the dev->data->rx/tx_queues to be able to properly reinitialize. Signed-off-by: Jan Blunck --- lib/librte_ether/rte_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 8c4b6cd..a3986ad 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -531,6 +531,9 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) for (i = nb_queues; i < old_nb_queues; i++) (*dev->dev_ops->rx_queue_release)(rxq[i]); + + rte_free(dev->data->rx_queues); + dev->data->rx_queues = NULL; } dev->data->nb_rx_queues = nb_queues; return 0; @@ -682,6 +685,9 @@ rte_eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) for (i = nb_queues; i < old_nb_queues; i++) (*dev->dev_ops->tx_queue_release)(txq[i]); + + rte_free(dev->data->tx_queues); + dev->data->tx_queues = NULL; } dev->data->nb_tx_queues = nb_queues; return 0; -- 2.7.4