From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) by dpdk.org (Postfix) with ESMTP id BD54B6883 for ; Wed, 11 Sep 2013 11:06:59 +0200 (CEST) Received: by mail-la0-f47.google.com with SMTP id eo20so7113753lab.20 for ; Wed, 11 Sep 2013 02:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=xI1hH0O+DMGoTNCDgdpiYW8IKD/AYwyzCaVZXuL4HGU=; b=HXQXEiUTOJ/fJ8OGVcHWTia6RNrk5KpEyrq4v5bb6nsY1DU4Q7FmZY7ZDPEiGicqGt qm+rfXFbnQIvO2xdlD4kYdpCLwAKNr1YjYJdNIO0BrnT6WXdAxyvOfuLal5UQc2C1Mcc mLI26luUXKdxNWXBI0T/GkNzng6wHJIftM4Owm2yz0xI8DoTm7wKgI1d8OHxEja/NBvA b1WQV89k9cSPHrF5NTdy/yxTqBYuICPDjMZcw7vKYBVrEF3BnTxWmDUd9jh2pEvjDVw5 fXT6WUCKmgmLeIeb+RaBhoI4ywv/oD701sKKE9XJa1t2Unyowi9BF9xT6RStfMe5ov5U ubBg== X-Received: by 10.112.42.103 with SMTP id n7mr1926823lbl.6.1378890455915; Wed, 11 Sep 2013 02:07:35 -0700 (PDT) Received: from [192.168.15.100] ([91.246.87.40]) by mx.google.com with ESMTPSA id ur6sm684785lbc.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 02:07:35 -0700 (PDT) Message-ID: <523032D7.4020004@gmail.com> Date: Wed, 11 Sep 2013 13:07:35 +0400 From: Dmitry Vyal User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: AndyChen References: <52301DA2.2060806@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] How to free a ring? 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, 11 Sep 2013 09:07:00 -0000 On 09/11/2013 11:46 AM, AndyChen wrote: > Dpdk hasn't API to free ring/memzone/mempool, what's the scene you > must free the ring? > Well, I'm writing a packet defragmenting code. I have a data structure consisting of a rte_hash, a rte_ring and an array allocated with rte_zmalloc. All these besides the ring can be freed. So looks like I can't destruct my object after allocating. Strictly speaking, I don't have to. The need shouldn't arise in normal situation. I just considered writing allocating/deallocating function pairs and processing all allocation errors to be a good practice. Isn't it a bit strange to have rte_hash_free() and not have rte_ring_free()? What's the reason for this? Best wishes, Dmitry