From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f194.google.com (mail-wj0-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 1BDEE5585; Thu, 24 Nov 2016 12:35:42 +0100 (CET) Received: by mail-wj0-f194.google.com with SMTP id jb2so3060055wjb.3; Thu, 24 Nov 2016 03:35:42 -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=QgZsl+EmstZx0dcZFzDlgTTpnjFSU3jmsHovu9RhRRCa6DfmkwE3lVZ6cX1RbPChNq Rr6/55pj1pL1bSlgwW2x7ntampZX0IMQ54Xi7kNMvC86cQDgxaeMKVtDI2L56dH3X847 sJcAbdzyEmfUMbBWyFwu1kLzBPtTewKSFRtMjq6Ql+mtXpkocl2QmZYgvMlGZIkQFBNc Ky5/ed2VH+08sB5YLQvoXTM6BQB67E5mGx7QR2048NOlLmd7jQRWgPNueL2kjs86RqR3 J0X+1bjSP5/8OuUZ9H+zyrOFqi1SG+0cVVakY/EkhdSEmyc7rnuQYYAXWHNZHbT9P866 dL6g== 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=RYhevlWD/ghG5ZIQcq2YMTInr6KPTIHr3IBsRV5xLYOPwkJ7BajSG05l6rEyXafiP2 2V4GQ90yv8VnDpQZ3GfLhvICCtDosF2CNpYSHRbJOG8z+QRNrQNR927SxmhAsXYHGgqo WA2TY2hs5JBfkE5gpk3rzvUR68AXwnF+UTQy0Z0y1hD+BvzQ4F1x6UvK6McbqmXeFQqT dSIcji/Vgs5gX21zloKpJPRuePZ5abSYE4Woy28ZH7L8y8b1IoFiKB1XhiSk9m0/ClWw wEnAyVg3VjnIwqO5u5u/2tAeaUBCz1aHSWAxsdq1kaGlAn2gadgbLmP5t92coXiVI/cO 8Z3w== X-Gm-Message-State: AKaTC03a5olX0x5T5vMSaG6M3rZ2or8T5v7aWlsbdR1BJn5/JmgRqENND0XFu506QMSSDg== X-Received: by 10.194.109.65 with SMTP id hq1mr1816415wjb.37.1479987341739; Thu, 24 Nov 2016 03:35:41 -0800 (PST) Received: from weierstrass.local.net ([91.200.110.70]) by smtp.gmail.com with ESMTPSA id l74sm7786020wmg.2.2016.11.24.03.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 03:35:41 -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, ehkinzie@gmail.com, bernard.iremonger@intel.com, stable@dpdk.org Date: Thu, 24 Nov 2016 12:26:46 +0100 Message-Id: <1479986809-14934-3-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479986809-14934-1-git-send-email-jblunck@infradead.org> References: <1479986809-14934-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v2 2/5] 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: Thu, 24 Nov 2016 11:35:42 -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