From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: ret_pktmbuf_pool_init problem with opaque_arg Date: Fri, 09 Jan 2015 15:28:30 +0100 Message-ID: <54AFE58E.50009@6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Alejandro Lucero , dev 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" Hi Alejandro, On 01/09/2015 03:12 PM, 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; > In this particular case, the integer value is stored in the pointer value: the pointer is not used as a pointer but as an integer. I agree it can be surprising, but I think the code is correct. Regards, Olivier