From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <alejandro.lucero@netronome.com> Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by dpdk.org (Postfix) with ESMTP id 5E254594E for <dev@dpdk.org>; Fri, 9 Jan 2015 15:38:43 +0100 (CET) Received: by mail-vc0-f182.google.com with SMTP id hq12so3249524vcb.13 for <dev@dpdk.org>; Fri, 09 Jan 2015 06:38:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=4cXhrkiCqfpzI3kIQOt+2Xt3Sqw9rQwN8qXxbW+UFvo=; b=ab2FYGJqqCGjt9+nBL55BSYp5sTfOAYvWbj2GGLXlscU4hiyBzIDTUqZlBIFO5ntqv bKF19HiRFNhRxLuA37a39NCj0FFJN4L+lIF4zex3ok00NhWY1KBX+91921mHFdjrKwZR +//gk15ZFN/pvAS7xk1EyC/zKWhM0tg2PjYrFq8Egc2GQ307ehLHVlZ1PfanDAf+ruJc 6w/WDyu1NQw0JZdeYuZWmwMNbOqrs+JxziV1eg+ytF0CAPI1f3UonG6gUx6hqOogGiS0 oQ+oWwk8L3d70CAjtbtIpSbOc88/O/x6tCDsPgvLHpLQmN8TpLF6qT0m5Y2x4GECZgqh 3qSg== X-Gm-Message-State: ALoCoQnNQmAodEBkI4KeiL9Dsr2e6uEaFZJhxoT39jH2CnnE+caGtxnO6CH45IavQItqQE9SlG+e MIME-Version: 1.0 X-Received: by 10.52.139.68 with SMTP id qw4mr8258316vdb.70.1420814322837; Fri, 09 Jan 2015 06:38:42 -0800 (PST) Received: by 10.52.96.225 with HTTP; Fri, 9 Jan 2015 06:38:42 -0800 (PST) In-Reply-To: <54AFE58E.50009@6wind.com> References: <CAD+H9911EO_0J_GRt34j-ugOSqeJo-QobNYc_cMe+52kvXLEfw@mail.gmail.com> <54AFE58E.50009@6wind.com> Date: Fri, 9 Jan 2015 14:38:42 +0000 Message-ID: <CAD+H993HzDWiANCu5kBSc+ru_4p0KFD9WRJDS50ks4AvLV_dNw@mail.gmail.com> From: Alejandro Lucero <alejandro.lucero@netronome.com> To: Olivier MATZ <olivier.matz@6wind.com> Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev <dev@dpdk.org> Subject: Re: [dpdk-dev] ret_pktmbuf_pool_init problem with opaque_arg X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> X-List-Received-Date: Fri, 09 Jan 2015 14:38:43 -0000 Hi Olivier, On Fri, Jan 9, 2015 at 2:28 PM, Olivier MATZ <olivier.matz@6wind.com> wrote: > 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. > > Likely there is a good reason for doing things this way but I can not see the point. And it will confuse the user. Thanks and Regards > Regards, > Olivier >