From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: ret_pktmbuf_pool_init problem with opaque_arg Date: Fri, 9 Jan 2015 14:42:16 -0800 Message-ID: <20150109144216.4e472e85@urahara> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev To: Alejandro Lucero Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Fri, 9 Jan 2015 14:12:10 +0000 Alejandro Lucero wrote: > Inside this function mbuf_data_room_size is set to a default value if > opaque_arg is null and it should be set to the value pointed by opaque_arg > if not null. Current implementation is using not the value but with the > pointer itself. I think this: > > roomsz = (uint16_t)(uintptr_t)opaque_arg; > > should be something like this: > > roomsz = *(uint16_t *)opaque_arg; That would require an extra value in persistent (not stack) for the size. The way that is implemented, the caller can just pass the value by casting to unsigned long.