From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id 794B658E9 for ; Tue, 5 Nov 2013 11:33:02 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga101.ch.intel.com with ESMTP; 05 Nov 2013 02:33:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,639,1378882800"; d="scan'208";a="422465478" Received: from cccressen-mobl4.ger.corp.intel.com (HELO debian) ([10.237.220.107]) by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2013 02:33:29 -0800 Date: Tue, 5 Nov 2013 10:33:25 +0000 From: Cyril Cressent To: Jose Gavine Cueto Message-ID: <20131105103325.GA25808@debian> Mail-Followup-To: Jose Gavine Cueto , "dev@dpdk.org" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Shannon, Dromore House, East Park, Shannon, Ireland User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] preallocation of void ** obj_p of rte_ring_dequeue 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, 05 Nov 2013 10:33:03 -0000 On Tue, Nov 05, 2013 at 06:15:01PM +0800, Jose Gavine Cueto wrote: > > When using *static int rte_ring_dequeue( structe rte_ring * r, void ** > obj_p )*, is the user presumed to allocate obj_p , or does this method > allocates this obj_p ? This method doesn't allocate anything ; you have to allocate the object you want to fill yourself. You can find more details about how to work with rings there: - DPDK Programmer's Guide (Chapter 5 - Ring Library) - DPDK API Documentation for rte_ring.h Both of which are accessible at http://dpdk.org/doc Quite a few sample applications (examples/ directory in the DPDK distribution) also make use of rings, notably the quota_watermark one, so it's also a good place to look at. On a side note, it looks like the API reference page for rte_ring.h is broken? It's missing a lot of functions. I'll look into it if I get a chance. http://dpdk.org/doc/api/rte__ring_8h.html#func-members Cyril